cleaned up resetting cost for altercost code, its *almost* where i want it to be, removed the need to have "resetcost" coding on card code. removed "resetcost" keyword.

i was not 100% successful in getting the correct cost on altercost which reduced the amounts. however altercost which increased the amounts are now clean code. so the reducers are still using a dirty method of putting the card from the hand back into the hand to get the correct amounts.

the issue i ran into is how to get the correct amount in this situation.
target cost {5} 
have 3 reducers that - {2}
thats {1} of overkill reduce...
heres the issue. now remove all the reducers from play. the cost returns to {6} instead of 5. 
you would think, will have it track the over kill. which leads to another. have the 3rd card which would contain the overkill removed first, i factor the overkill and increase the amount by what was reduced, but that would not be correct. since the reduce was {2} the increase of removing the overkill card should increase the targets cost by {2} not the amount it actually reduced. as you can see, it is extremely complex. so for now im leaving it dirty, but removing the resetcost code.
This commit is contained in:
omegablast2002@yahoo.com
2011-03-22 01:12:33 +00:00
parent e9eaef430e
commit f2c905225b
3 changed files with 34 additions and 40 deletions
-7
View File
@@ -2490,13 +2490,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
if (s.find("altercost(") != string::npos)
return getManaReduxAbility(s.substr(s.find("altercost(") + 10), id, spell, card, target);
//resetcost dirty code
found = s.find("resetcost");
if (found != string::npos)
{
MTGAbility * a = NEW AResetCost(id, card, target);
return a;
}
//transform....(hivestone,living enchantment)
found = s.find("transforms(");
if (found != string::npos)