Jeck - Changed filter pricing scheme- filter tax is now inversely proportional to the amount of results. Added preliminary "economic difficulty" option. Note that it requires difficulty modes to be unlocked (at least to appear in the gui). Should we make it available from the start?
This commit is contained in:
@@ -41,8 +41,9 @@ public:
|
|||||||
MANADISPLAY,
|
MANADISPLAY,
|
||||||
REVERSETRIGGERS,
|
REVERSETRIGGERS,
|
||||||
DISABLECARDS,
|
DISABLECARDS,
|
||||||
INTERRUPT_SECONDS,
|
|
||||||
MAX_GRADE,
|
MAX_GRADE,
|
||||||
|
ECON_DIFFICULTY,
|
||||||
|
INTERRUPT_SECONDS,
|
||||||
//My interrupts
|
//My interrupts
|
||||||
INTERRUPTMYSPELLS,
|
INTERRUPTMYSPELLS,
|
||||||
INTERRUPTMYABILITIES,
|
INTERRUPTMYABILITIES,
|
||||||
@@ -169,6 +170,14 @@ private:
|
|||||||
static OptionMaxGrade mDef;
|
static OptionMaxGrade mDef;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OptionEconDifficulty: public EnumDefinition {
|
||||||
|
public:
|
||||||
|
static EnumDefinition * getInstance() {return &mDef;};
|
||||||
|
private:
|
||||||
|
OptionEconDifficulty();
|
||||||
|
static OptionEconDifficulty mDef;
|
||||||
|
};
|
||||||
|
|
||||||
class OptionDifficulty: public EnumDefinition {
|
class OptionDifficulty: public EnumDefinition {
|
||||||
public:
|
public:
|
||||||
enum { NORMAL = 0, HARD = 1, HARDER = 2, EVIL = 3};
|
enum { NORMAL = 0, HARD = 1, HARDER = 2, EVIL = 3};
|
||||||
|
|||||||
@@ -114,9 +114,13 @@ class Constants
|
|||||||
RARITY_L = 'L', //Lands
|
RARITY_L = 'L', //Lands
|
||||||
RARITY_T = 'T', //Tokens
|
RARITY_T = 'T', //Tokens
|
||||||
|
|
||||||
//Price flux
|
//Economic values (Placeholders for stuff later set by economic difficulty)
|
||||||
PRICE_FLUX_RANGE = 20,
|
PRICE_FILTER_SCALAR = 4,
|
||||||
PRICE_FLUX_MINUS = 10,
|
|
||||||
|
ECON_NORMAL = 0, //Options default to 0.
|
||||||
|
ECON_HARD = 1,
|
||||||
|
ECON_LUCK = 2,
|
||||||
|
ECON_EASY = 3,
|
||||||
|
|
||||||
//Price for singles
|
//Price for singles
|
||||||
PRICE_1M = 3000,
|
PRICE_1M = 3000,
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public:
|
|||||||
WCFilterSet(string arg);
|
WCFilterSet(string arg);
|
||||||
bool isMatch(MTGCard *c) {return (setid==-1 || c->setId == setid);};
|
bool isMatch(MTGCard *c) {return (setid==-1 || c->setId == setid);};
|
||||||
string getCode();
|
string getCode();
|
||||||
float filterFee() {return 0.1f;};
|
float filterFee() {return 0.2f;};
|
||||||
protected:
|
protected:
|
||||||
int setid;
|
int setid;
|
||||||
};
|
};
|
||||||
@@ -98,7 +98,7 @@ public:
|
|||||||
WCFilterLetter(string arg);
|
WCFilterLetter(string arg);
|
||||||
bool isMatch(MTGCard * c);
|
bool isMatch(MTGCard * c);
|
||||||
string getCode();
|
string getCode();
|
||||||
float filterFee() {return 1.0f;}; //Alpha searches are expensive!
|
float filterFee() {return 4.0f;}; //Alpha searches are expensive!
|
||||||
protected:
|
protected:
|
||||||
char alpha;
|
char alpha;
|
||||||
};
|
};
|
||||||
@@ -108,7 +108,7 @@ public:
|
|||||||
WCFilterColor(string arg);
|
WCFilterColor(string arg);
|
||||||
bool isMatch(MTGCard * c);
|
bool isMatch(MTGCard * c);
|
||||||
string getCode();
|
string getCode();
|
||||||
float filterFee() {return 0.1f;};
|
float filterFee() {return 0.2f;};
|
||||||
protected:
|
protected:
|
||||||
int color;
|
int color;
|
||||||
};
|
};
|
||||||
@@ -150,7 +150,7 @@ public:
|
|||||||
WCFilterPower(string arg) : WCFilterNumeric(arg) {};
|
WCFilterPower(string arg) : WCFilterNumeric(arg) {};
|
||||||
bool isMatch(MTGCard * c);
|
bool isMatch(MTGCard * c);
|
||||||
string getCode();
|
string getCode();
|
||||||
float filterFee() {return number/12.0f;};
|
float filterFee() {return 2*number/12.0f;};
|
||||||
};
|
};
|
||||||
class WCFilterToughness: public WCFilterNumeric{
|
class WCFilterToughness: public WCFilterNumeric{
|
||||||
public:
|
public:
|
||||||
@@ -158,7 +158,7 @@ public:
|
|||||||
WCFilterToughness(string arg) : WCFilterNumeric(arg) {};
|
WCFilterToughness(string arg) : WCFilterNumeric(arg) {};
|
||||||
bool isMatch(MTGCard * c);
|
bool isMatch(MTGCard * c);
|
||||||
string getCode();
|
string getCode();
|
||||||
float filterFee() {return number/12.0f;};
|
float filterFee() {return 2*number/12.0f;};
|
||||||
};
|
};
|
||||||
|
|
||||||
class WCFilterType: public WCardFilter{
|
class WCFilterType: public WCardFilter{
|
||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
WCFilterType(string arg) {type = arg;};
|
WCFilterType(string arg) {type = arg;};
|
||||||
bool isMatch(MTGCard * c);
|
bool isMatch(MTGCard * c);
|
||||||
string getCode();
|
string getCode();
|
||||||
float filterFee() {return 0.2f;};
|
float filterFee() {return 0.4f;};
|
||||||
protected:
|
protected:
|
||||||
string type;
|
string type;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,8 +27,9 @@ const char * Options::optionNames[] = {
|
|||||||
"mana_display",
|
"mana_display",
|
||||||
"reverse_triggers",
|
"reverse_triggers",
|
||||||
"disable_cards",
|
"disable_cards",
|
||||||
"interruptSeconds",
|
|
||||||
"maxGrade",
|
"maxGrade",
|
||||||
|
"economic_difficulty",
|
||||||
|
"interruptSeconds",
|
||||||
"interruptMySpells",
|
"interruptMySpells",
|
||||||
"interruptMyAbilities",
|
"interruptMyAbilities",
|
||||||
//General interrupts
|
//General interrupts
|
||||||
@@ -46,12 +47,6 @@ const char * Options::optionNames[] = {
|
|||||||
"interruptEndTurn",
|
"interruptEndTurn",
|
||||||
"interruptCleanup",
|
"interruptCleanup",
|
||||||
"interruptAfterEnd",
|
"interruptAfterEnd",
|
||||||
//Unlocked modes
|
|
||||||
"prx_handler",
|
|
||||||
"prx_rimom",
|
|
||||||
"prx_eviltwin",
|
|
||||||
"prx_rnddeck",
|
|
||||||
"aw_collector",
|
|
||||||
};
|
};
|
||||||
int Options::getID(string name){
|
int Options::getID(string name){
|
||||||
if(!name.size())
|
if(!name.size())
|
||||||
@@ -366,6 +361,11 @@ GameOption * GameOptions::get(int optionID) {
|
|||||||
goEnum->def = OptionMaxGrade::getInstance();
|
goEnum->def = OptionMaxGrade::getInstance();
|
||||||
go = goEnum;
|
go = goEnum;
|
||||||
break;
|
break;
|
||||||
|
case Options::ECON_DIFFICULTY:
|
||||||
|
goEnum = NEW GameOptionEnum();
|
||||||
|
goEnum->def = OptionEconDifficulty::getInstance();
|
||||||
|
go = goEnum;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if(x >= Options::BEGIN_AWARDS)
|
if(x >= Options::BEGIN_AWARDS)
|
||||||
go = NEW GameOptionAward();
|
go = NEW GameOptionAward();
|
||||||
@@ -742,7 +742,13 @@ OptionDifficulty::OptionDifficulty(){
|
|||||||
mDef.values.push_back(EnumDefinition::assoc(HARDER, "Harder"));
|
mDef.values.push_back(EnumDefinition::assoc(HARDER, "Harder"));
|
||||||
mDef.values.push_back(EnumDefinition::assoc(EVIL, "Evil"));
|
mDef.values.push_back(EnumDefinition::assoc(EVIL, "Evil"));
|
||||||
};
|
};
|
||||||
|
OptionEconDifficulty OptionEconDifficulty::mDef;
|
||||||
|
OptionEconDifficulty::OptionEconDifficulty(){
|
||||||
|
mDef.values.push_back(EnumDefinition::assoc(Constants::ECON_NORMAL, "Normal"));
|
||||||
|
mDef.values.push_back(EnumDefinition::assoc(Constants::ECON_HARD, "Hard"));
|
||||||
|
mDef.values.push_back(EnumDefinition::assoc(Constants::ECON_LUCK, "Luck"));
|
||||||
|
mDef.values.push_back(EnumDefinition::assoc(Constants::ECON_EASY, "Easy"));
|
||||||
|
};
|
||||||
//GameOptionAward
|
//GameOptionAward
|
||||||
GameOptionAward::GameOptionAward(){
|
GameOptionAward::GameOptionAward(){
|
||||||
achieved = time(NULL);
|
achieved = time(NULL);
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ void GameStateOptions::Start()
|
|||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::MUSICVOLUME,"Music volume",100,10,100),OptionVolume::getInstance()));
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::MUSICVOLUME,"Music volume",100,10,100),OptionVolume::getInstance()));
|
||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::SFXVOLUME,"SFX volume",100,10,100),OptionVolume::getInstance()));
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::SFXVOLUME,"SFX volume",100,10,100),OptionVolume::getInstance()));
|
||||||
optionsList->Add(NEW OptionInteger(Options::OSD, "Display InGame extra information"));
|
optionsList->Add(NEW OptionInteger(Options::OSD, "Display InGame extra information"));
|
||||||
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number)
|
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number){
|
||||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::DIFFICULTY,"Difficulty",3,1,0),OptionDifficulty::getInstance()));
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::DIFFICULTY,"Difficulty",3,1,0),OptionDifficulty::getInstance()));
|
||||||
|
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::ECON_DIFFICULTY,"Economic Difficuly",Constants::ECON_EASY)));
|
||||||
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable cheat mode")));
|
}
|
||||||
optionsList->Add(NEW OptionInteger(Options::INTERRUPT_SECONDS, "Seconds to pause for an Interrupt", 20, 1));
|
optionsList->Add(NEW OptionInteger(Options::INTERRUPT_SECONDS, "Seconds to pause for an Interrupt", 20, 1));
|
||||||
optionsList->Add(NEW OptionInteger(Options::INTERRUPTMYSPELLS, "Interrupt my spells"));
|
optionsList->Add(NEW OptionInteger(Options::INTERRUPTMYSPELLS, "Interrupt my spells"));
|
||||||
optionsList->Add(NEW OptionInteger(Options::INTERRUPTMYABILITIES, "Interrupt my abilities"));
|
optionsList->Add(NEW OptionInteger(Options::INTERRUPTMYABILITIES, "Interrupt my abilities"));
|
||||||
@@ -56,7 +56,6 @@ void GameStateOptions::Start()
|
|||||||
|
|
||||||
optionsList = NEW WGuiList("User");
|
optionsList = NEW WGuiList("User");
|
||||||
optionsList->Add(NEW WGuiHeader("User Options"));
|
optionsList->Add(NEW WGuiHeader("User Options"));
|
||||||
|
|
||||||
WDecoConfirm * cPrf = NEW WDecoConfirm(this,NEW OptionProfile(mParent,this));
|
WDecoConfirm * cPrf = NEW WDecoConfirm(this,NEW OptionProfile(mParent,this));
|
||||||
cPrf->confirm = "Use this Profile";
|
cPrf->confirm = "Use this Profile";
|
||||||
OptionDirectory * od = NEW OptionTheme();
|
OptionDirectory * od = NEW OptionTheme();
|
||||||
@@ -65,6 +64,7 @@ void GameStateOptions::Start()
|
|||||||
|
|
||||||
optionsList->Add(NEW WGuiSplit(cPrf,cThm));
|
optionsList->Add(NEW WGuiSplit(cPrf,cThm));
|
||||||
optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"),-102,4,this));
|
optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"),-102,4,this));
|
||||||
|
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable cheat mode")));
|
||||||
optionsTabs->Add(optionsList);
|
optionsTabs->Add(optionsList);
|
||||||
|
|
||||||
optionsList = NEW WGuiList("Advanced");
|
optionsList = NEW WGuiList("Advanced");
|
||||||
|
|||||||
@@ -281,7 +281,15 @@ int GameStateShop::purchasePrice(int offset){
|
|||||||
if(!pricelist || !srcCards || (c = srcCards->getCard(offset)) == NULL)
|
if(!pricelist || !srcCards || (c = srcCards->getCard(offset)) == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
float price = (float) pricelist->getPurchasePrice(c->getMTGId());
|
float price = (float) pricelist->getPurchasePrice(c->getMTGId());
|
||||||
return (int) (price + price * srcCards->filterFee());
|
float filteradd = srcCards->Size(true);
|
||||||
|
filteradd = ((filteradd - srcCards->Size())/filteradd);
|
||||||
|
|
||||||
|
switch(options[Options::ECON_DIFFICULTY].number){
|
||||||
|
case Constants::ECON_EASY: filteradd /= 2; break;
|
||||||
|
case Constants::ECON_HARD: filteradd *= 2; break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
return (int) price + price * (filteradd*srcCards->filterFee());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameStateShop::load(){
|
void GameStateShop::load(){
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ int PriceList::getPrice(int cardId){
|
|||||||
return Constants::PRICE_1C;
|
return Constants::PRICE_1C;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int PriceList::setPrice(int cardId, int price){
|
int PriceList::setPrice(int cardId, int price){
|
||||||
@@ -75,7 +75,19 @@ int PriceList::getSellPrice(int cardid){
|
|||||||
}
|
}
|
||||||
int PriceList::getPurchasePrice(int cardid){
|
int PriceList::getPurchasePrice(int cardid){
|
||||||
float price = (float) getPrice(cardid);
|
float price = (float) getPrice(cardid);
|
||||||
int rnd = abs(cardid + randomKey) % (1+Constants::PRICE_FLUX_RANGE);
|
float badluck = (float)(abs(cardid + randomKey) % 201) / 100; //Float between 0 and 2.
|
||||||
price += price * (float)(rnd - Constants::PRICE_FLUX_MINUS)/100.0f;
|
|
||||||
return price;
|
switch(options[Options::ECON_DIFFICULTY].number){
|
||||||
|
case Constants::ECON_EASY:
|
||||||
|
badluck -= 1.5; price /= 2; break; //Price from .25x to .75x, .25x more likely.
|
||||||
|
case Constants::ECON_NORMAL: default:
|
||||||
|
badluck -= 1; break; //price from 1x to 2x, even probability.
|
||||||
|
case Constants::ECON_HARD:
|
||||||
|
price *= 1.5; break; //price from 1.5x to 3x, 3x being twice as likely.
|
||||||
|
case Constants::ECON_LUCK:
|
||||||
|
badluck += .25; return price*badluck; break; //Price from .25x to 2.25x, randomly.
|
||||||
|
}
|
||||||
|
if(badluck > 1) badluck = 1;
|
||||||
|
else if(badluck < -1) badluck = -1;
|
||||||
|
return (price + price * badluck);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -283,10 +283,10 @@ string WCFilterToughness::getCode(){
|
|||||||
//WCFilterRarity
|
//WCFilterRarity
|
||||||
float WCFilterRarity::filterFee(){
|
float WCFilterRarity::filterFee(){
|
||||||
switch(rarity){
|
switch(rarity){
|
||||||
case 'M': return 0.4f;
|
case 'M': return 2.0f;
|
||||||
case 'R': return 0.2f;
|
case 'R': return 1.0f;
|
||||||
case 'U': return 0.1f;
|
case 'U': return 0.5f;
|
||||||
case 'C': return 0.01f;
|
case 'C': return 0.2f;
|
||||||
}
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
@@ -360,7 +360,7 @@ float WCFilterAbility::filterFee(){
|
|||||||
case Constants::UNBLOCKABLE:
|
case Constants::UNBLOCKABLE:
|
||||||
case Constants::WITHER:
|
case Constants::WITHER:
|
||||||
case Constants::PERSIST:
|
case Constants::PERSIST:
|
||||||
return 0.4f;
|
return 0.8f;
|
||||||
case Constants::PROTECTIONBLACK:
|
case Constants::PROTECTIONBLACK:
|
||||||
case Constants::PROTECTIONWHITE:
|
case Constants::PROTECTIONWHITE:
|
||||||
case Constants::PROTECTIONBLUE:
|
case Constants::PROTECTIONBLUE:
|
||||||
@@ -368,24 +368,24 @@ float WCFilterAbility::filterFee(){
|
|||||||
case Constants::PROTECTIONGREEN:
|
case Constants::PROTECTIONGREEN:
|
||||||
case Constants::DOUBLESTRIKE:
|
case Constants::DOUBLESTRIKE:
|
||||||
case Constants::LIFELINK:
|
case Constants::LIFELINK:
|
||||||
return 0.35f;
|
return 0.7f;
|
||||||
case Constants::TRAMPLE:
|
case Constants::TRAMPLE:
|
||||||
case Constants::FLYING:
|
case Constants::FLYING:
|
||||||
case Constants::FEAR:
|
case Constants::FEAR:
|
||||||
case Constants::VIGILANCE:
|
case Constants::VIGILANCE:
|
||||||
case Constants::FIRSTSTRIKE:
|
case Constants::FIRSTSTRIKE:
|
||||||
return 0.3f;
|
return 0.6f;
|
||||||
case Constants::PLAINSHOME:
|
case Constants::PLAINSHOME:
|
||||||
case Constants::SWAMPHOME:
|
case Constants::SWAMPHOME:
|
||||||
case Constants::ISLANDHOME:
|
case Constants::ISLANDHOME:
|
||||||
case Constants::MOUNTAINHOME:
|
case Constants::MOUNTAINHOME:
|
||||||
case Constants::FORESTHOME:
|
case Constants::FORESTHOME:
|
||||||
return -0.1f;
|
return -0.2f;
|
||||||
case Constants::DEFENDER:
|
case Constants::DEFENDER:
|
||||||
case Constants::CLOUD:
|
case Constants::CLOUD:
|
||||||
return 0.1f;
|
|
||||||
default:
|
|
||||||
return 0.2f;
|
return 0.2f;
|
||||||
|
default:
|
||||||
|
return 0.4f;
|
||||||
}
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user