diff --git a/projects/mtg/bin/Res/sets/10E/_cards.dat b/projects/mtg/bin/Res/sets/10E/_cards.dat index fb6fbff4c..599d36028 100644 --- a/projects/mtg/bin/Res/sets/10E/_cards.dat +++ b/projects/mtg/bin/Res/sets/10E/_cards.dat @@ -66,6 +66,7 @@ toughness=3 text=First strike (This creature deals combat damage before creatures without first strike.) When Ancestor's Chosen comes into play, you gain 1 life for each card in your graveyard. abilities=first strike id=130550 +auto=foreach(*|mygraveyard)life:1 name=Ancestor's Chosen rarity=U color=White diff --git a/projects/mtg/bin/Res/sets/ICE/_cards.dat b/projects/mtg/bin/Res/sets/ICE/_cards.dat index fa02fe8f1..287ce2ce4 100644 --- a/projects/mtg/bin/Res/sets/ICE/_cards.dat +++ b/projects/mtg/bin/Res/sets/ICE/_cards.dat @@ -1228,6 +1228,7 @@ text=Add {B} to your mana pool for each creature card in your graveyard. id=2484 name=Songs of the Damned rarity=C +auto=foreach(creature|mygraveyard)add:{B} type=Instant mana={B} [/card] @@ -1246,6 +1247,8 @@ subtype=Aura [card] text=For each artifact or creature card in an opponent's graveyard, add {1} to your mana pool and you gain 1 life. id=2487 +auto=foreach(artifact,creature|opponentgraveyard)add:{1} +auto=foreach(artifact,creature|opponentgraveyard)life:1 name=Spoils of Evil rarity=R type=Instant diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index da8511159..44cf6c2f8 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3719,13 +3719,12 @@ class AAngelicChorus: public ListMaintainerAbility{ class ALifeModifierPutinplay: public ListMaintainerAbility{ public: int init; - char type[20]; int life; int PlayerTarget; int AddOrRemove; - ALifeModifierPutinplay(int id, MTGCardInstance * _source,const char * _type, int _life, int _PlayerTarget, int _AddOrRemove):ListMaintainerAbility(id, _source){ - sprintf(type,"%s",_type); + ALifeModifierPutinplay(int id, MTGCardInstance * _source,TargetChooser * _tc, int _life, int _PlayerTarget, int _AddOrRemove):ListMaintainerAbility(id, _source){ init = 0; + tc = _tc; PlayerTarget = _PlayerTarget; AddOrRemove = _AddOrRemove; life = _life; @@ -3737,7 +3736,7 @@ class ALifeModifierPutinplay: public ListMaintainerAbility{ } int canBeInList(MTGCardInstance * card){ - if (card->hasType(type) && game->isInPlay(card)) return 1; + if (tc->canTarget(card)) return 1; return 0; } @@ -3803,7 +3802,6 @@ class ALifeModifierPutinplay: public ListMaintainerAbility{ virtual ostream& toString(ostream& out) const { out << "ALifeModifierPutinplay ::: init : " << init - << " ; type : " << type << " ; life : " << life << " ; PlayerTarget : " << PlayerTarget << " ; AddOrRemove : " << AddOrRemove diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index 5c426a945..de6232ccb 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -97,8 +97,9 @@ class Constants CANTBLOCK = 39, DOESNOTUNTAP =40, OPPONENTSHROUD=41, + INDESTRUCTIBLE=42, - NB_BASIC_ABILITIES = 42, + NB_BASIC_ABILITIES = 43, RARITY_M = 'M', diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index ae83fca48..8197a9add 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -989,12 +989,24 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ } }else{ OutputDebugString ("uh oh\n"); - card->controller()->getManaPool()->add(output); - delete output; + if (lordType == PARSER_FOREACH){ + ManaCost * FinalOutput = NEW ManaCost(); + int multiplier = countCards(lordTargets); + for (int i = 0; i < Constants::MTG_NB_COLORS; i++){ + if (output->hasColor(i)){ + FinalOutput->add(i,multiplier); + } + } + card->controller()->getManaPool()->add(FinalOutput); + delete FinalOutput; + }else{ + card->controller()->getManaPool()->add(output); + delete output; + } } result++; continue; - } + } //Gain/loose Ability for (int j = 0; j < Constants::NB_BASIC_ABILITIES; j++){ @@ -1101,12 +1113,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver(ability); break; } - case 130550: //Ancestor's chosen - { - int life = card->controller()->game->graveyard->nb_cards; - card->controller()->life+= life; - break; - } case 1190: //Animate Artifact { int x = card->target->getManaCost()->getConvertedCost(); @@ -1867,13 +1873,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver(NEW AGiveLifeForTappedType (_id, card, "island")); break; } - case 2484: //Songs of the Damned - { - int mana = card->controller()->game->graveyard->countByType("creature"); - game->currentlyActing()->getManaPool()->add(Constants::MTG_COLOR_BLACK, mana); - break; - } - case 2474: //Minion of Leshrac { game->addObserver(NEW AMinionofLeshrac( _id, card)); @@ -1884,15 +1883,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver(NEW AShieldOfTheAge( _id, card)); break; } - case 2487: //Spoil of Evil - { - int mana_cr = game->opponent()->game->graveyard->countByType("creature"); - int mana_ar = game->opponent()->game->graveyard->countByType("artifact"); - int spoil = mana_ar + mana_cr; - game->currentlyActing()->getManaPool()->add(Constants::MTG_COLOR_ARTIFACT, spoil); - game->currentlyActing()->life+= spoil; - break; - } case 2435: //Whalebone Glider { int cost[] = {Constants::MTG_COLOR_ARTIFACT,2}; @@ -2077,7 +2067,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ int life; Player * player = spell->getNextPlayerTarget(); MTGLibrary * library = card->controller()->game->library; - MTGGraveyard * graveyard = card->controller()->game->graveyard; life = player->life; player->life+=life; MTGGameZone * zones[] = {card->controller()->game->inPlay,card->controller()->game->graveyard,card->controller()->game->hand}; diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 031bdc500..04fc3cbef 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -129,7 +129,7 @@ int MTGCardInstance::afterDamage(){ if (!doDamageTest) return 0; doDamageTest = 0; if (!isACreature()) return 0; - if (life <=0 && isInPlay()){ + if (life <=0 && isInPlay() && !basicAbilities[Constants::INDESTRUCTIBLE]){ return destroy(); } return 0; @@ -137,11 +137,13 @@ int MTGCardInstance::afterDamage(){ int MTGCardInstance::bury(){ Player * p = controller(); + if (!basicAbilities[Constants::INDESTRUCTIBLE]){ p->game->putInZone(this,p->game->inPlay,owner->game->graveyard); - return 1; + } + return 1; } int MTGCardInstance::destroy(){ - if (!triggerRegenerate()) return bury(); + if (!triggerRegenerate() || !basicAbilities[Constants::INDESTRUCTIBLE]) return bury(); return 0; } diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 6ba16cb2c..d9a88f2de 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -50,6 +50,7 @@ const char* Constants::MTGBasicAbilities[] = { "cantblock", "doesnotuntap", "opponentshroud", +"indestructible", };