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,
|
||||
REVERSETRIGGERS,
|
||||
DISABLECARDS,
|
||||
INTERRUPT_SECONDS,
|
||||
MAX_GRADE,
|
||||
ECON_DIFFICULTY,
|
||||
INTERRUPT_SECONDS,
|
||||
//My interrupts
|
||||
INTERRUPTMYSPELLS,
|
||||
INTERRUPTMYABILITIES,
|
||||
@@ -169,6 +170,14 @@ private:
|
||||
static OptionMaxGrade mDef;
|
||||
};
|
||||
|
||||
class OptionEconDifficulty: public EnumDefinition {
|
||||
public:
|
||||
static EnumDefinition * getInstance() {return &mDef;};
|
||||
private:
|
||||
OptionEconDifficulty();
|
||||
static OptionEconDifficulty mDef;
|
||||
};
|
||||
|
||||
class OptionDifficulty: public EnumDefinition {
|
||||
public:
|
||||
enum { NORMAL = 0, HARD = 1, HARDER = 2, EVIL = 3};
|
||||
|
||||
@@ -114,9 +114,13 @@ class Constants
|
||||
RARITY_L = 'L', //Lands
|
||||
RARITY_T = 'T', //Tokens
|
||||
|
||||
//Price flux
|
||||
PRICE_FLUX_RANGE = 20,
|
||||
PRICE_FLUX_MINUS = 10,
|
||||
//Economic values (Placeholders for stuff later set by economic difficulty)
|
||||
PRICE_FILTER_SCALAR = 4,
|
||||
|
||||
ECON_NORMAL = 0, //Options default to 0.
|
||||
ECON_HARD = 1,
|
||||
ECON_LUCK = 2,
|
||||
ECON_EASY = 3,
|
||||
|
||||
//Price for singles
|
||||
PRICE_1M = 3000,
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
WCFilterSet(string arg);
|
||||
bool isMatch(MTGCard *c) {return (setid==-1 || c->setId == setid);};
|
||||
string getCode();
|
||||
float filterFee() {return 0.1f;};
|
||||
float filterFee() {return 0.2f;};
|
||||
protected:
|
||||
int setid;
|
||||
};
|
||||
@@ -98,7 +98,7 @@ public:
|
||||
WCFilterLetter(string arg);
|
||||
bool isMatch(MTGCard * c);
|
||||
string getCode();
|
||||
float filterFee() {return 1.0f;}; //Alpha searches are expensive!
|
||||
float filterFee() {return 4.0f;}; //Alpha searches are expensive!
|
||||
protected:
|
||||
char alpha;
|
||||
};
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
WCFilterColor(string arg);
|
||||
bool isMatch(MTGCard * c);
|
||||
string getCode();
|
||||
float filterFee() {return 0.1f;};
|
||||
float filterFee() {return 0.2f;};
|
||||
protected:
|
||||
int color;
|
||||
};
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
WCFilterPower(string arg) : WCFilterNumeric(arg) {};
|
||||
bool isMatch(MTGCard * c);
|
||||
string getCode();
|
||||
float filterFee() {return number/12.0f;};
|
||||
float filterFee() {return 2*number/12.0f;};
|
||||
};
|
||||
class WCFilterToughness: public WCFilterNumeric{
|
||||
public:
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
WCFilterToughness(string arg) : WCFilterNumeric(arg) {};
|
||||
bool isMatch(MTGCard * c);
|
||||
string getCode();
|
||||
float filterFee() {return number/12.0f;};
|
||||
float filterFee() {return 2*number/12.0f;};
|
||||
};
|
||||
|
||||
class WCFilterType: public WCardFilter{
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
WCFilterType(string arg) {type = arg;};
|
||||
bool isMatch(MTGCard * c);
|
||||
string getCode();
|
||||
float filterFee() {return 0.2f;};
|
||||
float filterFee() {return 0.4f;};
|
||||
protected:
|
||||
string type;
|
||||
};
|
||||
|
||||
@@ -27,8 +27,9 @@ const char * Options::optionNames[] = {
|
||||
"mana_display",
|
||||
"reverse_triggers",
|
||||
"disable_cards",
|
||||
"interruptSeconds",
|
||||
"maxGrade",
|
||||
"economic_difficulty",
|
||||
"interruptSeconds",
|
||||
"interruptMySpells",
|
||||
"interruptMyAbilities",
|
||||
//General interrupts
|
||||
@@ -46,12 +47,6 @@ const char * Options::optionNames[] = {
|
||||
"interruptEndTurn",
|
||||
"interruptCleanup",
|
||||
"interruptAfterEnd",
|
||||
//Unlocked modes
|
||||
"prx_handler",
|
||||
"prx_rimom",
|
||||
"prx_eviltwin",
|
||||
"prx_rnddeck",
|
||||
"aw_collector",
|
||||
};
|
||||
int Options::getID(string name){
|
||||
if(!name.size())
|
||||
@@ -366,6 +361,11 @@ GameOption * GameOptions::get(int optionID) {
|
||||
goEnum->def = OptionMaxGrade::getInstance();
|
||||
go = goEnum;
|
||||
break;
|
||||
case Options::ECON_DIFFICULTY:
|
||||
goEnum = NEW GameOptionEnum();
|
||||
goEnum->def = OptionEconDifficulty::getInstance();
|
||||
go = goEnum;
|
||||
break;
|
||||
default:
|
||||
if(x >= Options::BEGIN_AWARDS)
|
||||
go = NEW GameOptionAward();
|
||||
@@ -742,7 +742,13 @@ OptionDifficulty::OptionDifficulty(){
|
||||
mDef.values.push_back(EnumDefinition::assoc(HARDER, "Harder"));
|
||||
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(){
|
||||
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::SFXVOLUME,"SFX volume",100,10,100),OptionVolume::getInstance()));
|
||||
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 WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable cheat mode")));
|
||||
optionsList->Add(NEW WDecoEnum(NEW OptionInteger(Options::ECON_DIFFICULTY,"Economic Difficuly",Constants::ECON_EASY)));
|
||||
}
|
||||
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::INTERRUPTMYABILITIES, "Interrupt my abilities"));
|
||||
@@ -56,7 +56,6 @@ void GameStateOptions::Start()
|
||||
|
||||
optionsList = NEW WGuiList("User");
|
||||
optionsList->Add(NEW WGuiHeader("User Options"));
|
||||
|
||||
WDecoConfirm * cPrf = NEW WDecoConfirm(this,NEW OptionProfile(mParent,this));
|
||||
cPrf->confirm = "Use this Profile";
|
||||
OptionDirectory * od = NEW OptionTheme();
|
||||
@@ -65,6 +64,7 @@ void GameStateOptions::Start()
|
||||
|
||||
optionsList->Add(NEW WGuiSplit(cPrf,cThm));
|
||||
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);
|
||||
|
||||
optionsList = NEW WGuiList("Advanced");
|
||||
|
||||
@@ -281,7 +281,15 @@ int GameStateShop::purchasePrice(int offset){
|
||||
if(!pricelist || !srcCards || (c = srcCards->getCard(offset)) == NULL)
|
||||
return 0;
|
||||
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(){
|
||||
|
||||
@@ -63,7 +63,7 @@ int PriceList::getPrice(int cardId){
|
||||
return Constants::PRICE_1C;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int PriceList::setPrice(int cardId, int price){
|
||||
@@ -75,7 +75,19 @@ int PriceList::getSellPrice(int cardid){
|
||||
}
|
||||
int PriceList::getPurchasePrice(int cardid){
|
||||
float price = (float) getPrice(cardid);
|
||||
int rnd = abs(cardid + randomKey) % (1+Constants::PRICE_FLUX_RANGE);
|
||||
price += price * (float)(rnd - Constants::PRICE_FLUX_MINUS)/100.0f;
|
||||
return price;
|
||||
float badluck = (float)(abs(cardid + randomKey) % 201) / 100; //Float between 0 and 2.
|
||||
|
||||
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
|
||||
float WCFilterRarity::filterFee(){
|
||||
switch(rarity){
|
||||
case 'M': return 0.4f;
|
||||
case 'R': return 0.2f;
|
||||
case 'U': return 0.1f;
|
||||
case 'C': return 0.01f;
|
||||
case 'M': return 2.0f;
|
||||
case 'R': return 1.0f;
|
||||
case 'U': return 0.5f;
|
||||
case 'C': return 0.2f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
@@ -360,7 +360,7 @@ float WCFilterAbility::filterFee(){
|
||||
case Constants::UNBLOCKABLE:
|
||||
case Constants::WITHER:
|
||||
case Constants::PERSIST:
|
||||
return 0.4f;
|
||||
return 0.8f;
|
||||
case Constants::PROTECTIONBLACK:
|
||||
case Constants::PROTECTIONWHITE:
|
||||
case Constants::PROTECTIONBLUE:
|
||||
@@ -368,24 +368,24 @@ float WCFilterAbility::filterFee(){
|
||||
case Constants::PROTECTIONGREEN:
|
||||
case Constants::DOUBLESTRIKE:
|
||||
case Constants::LIFELINK:
|
||||
return 0.35f;
|
||||
return 0.7f;
|
||||
case Constants::TRAMPLE:
|
||||
case Constants::FLYING:
|
||||
case Constants::FEAR:
|
||||
case Constants::VIGILANCE:
|
||||
case Constants::FIRSTSTRIKE:
|
||||
return 0.3f;
|
||||
return 0.6f;
|
||||
case Constants::PLAINSHOME:
|
||||
case Constants::SWAMPHOME:
|
||||
case Constants::ISLANDHOME:
|
||||
case Constants::MOUNTAINHOME:
|
||||
case Constants::FORESTHOME:
|
||||
return -0.1f;
|
||||
return -0.2f;
|
||||
case Constants::DEFENDER:
|
||||
case Constants::CLOUD:
|
||||
return 0.1f;
|
||||
default:
|
||||
return 0.2f;
|
||||
default:
|
||||
return 0.4f;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user