- a few bug fixes with cards that bring other cards back to play (zombify, resurrection...)
- bug fix with abilities parsing "reachshadow"
- a few card fixes
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-04-19 07:47:52 +00:00
parent 33e79e234e
commit 0af938589b
13 changed files with 135 additions and 19 deletions
+1 -3
View File
@@ -369,9 +369,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
game->addObserver(a);
}
}else{
MTGGameZone * fromZone = target->getCurrentZone();//this is technically incorrect. The initial zone should be as described in the targetchooser
MTGGameZone * destZone = MTGGameZone::stringToZone(szone, card, target);
target->controller()->game->putInZone(target,fromZone,destZone);
AZoneMover::moveTarget(target,szone,card);
}
}
result++;
+16 -4
View File
@@ -62,10 +62,22 @@ int MTGAllCards::processConfLine(string s, MTGCard *card){
}else if (key.compare("abilities")==0){
//Specific Abilities
std::transform( value.begin(), value.end(), value.begin(),::tolower );
for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){
unsigned int found = value.find(Constants::MTGBasicAbilities[j]);
if (found != string::npos){
card->basicAbilities[j] = 1;
while (value.size()){
string attribute;
size_t found2 = value.find(",");
if (found2 != string::npos){
attribute = value.substr(0,found2);
value = value.substr(found2+1);
}else{
attribute = value;
value = "";
}
for (int j = Constants::NB_BASIC_ABILITIES-1; j >=0 ; j--){
size_t found = attribute.find(Constants::MTGBasicAbilities[j]);
if (found != string::npos){
card->basicAbilities[j] = 1;
break;
}
}
}
}else if(key.compare("id")==0){
+7 -2
View File
@@ -225,8 +225,13 @@ MTGCardInstance * MTGMomirRule::genCreature( int id){
}
int MTGMomirRule::genRandomCreatureId(int convertedCost){
if (convertedCost > 20) return 0;
int total_cards = pool[convertedCost].size();
if (convertedCost > 20) convertedCost = 20;
int total_cards = 0;
int i = convertedCost;
while (!total_cards && i >=0){
total_cards = pool[i].size();
i--;
}
if (!total_cards) return 0;
int start = (rand() % total_cards);
return pool[convertedCost][start];
+1
View File
@@ -70,6 +70,7 @@ void SimpleMenuItem::Relocate(int x, int y)
int SimpleMenuItem::GetWidth()
{
mFont->SetScale(1.0);
return mFont->GetStringWidth(mText.c_str());
}