diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 3e4bc2e3e..4e981445a 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -20799,8 +20799,8 @@ power=3 toughness=1 [/card] [card] +alias=2732 name=Kjeldoran Frostbeast -alias=1267 text=At end of combat, destroy all creatures blocking or blocked by Kjeldoran Frostbeast. mana={3}{G}{W} type=Creature diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index de0560de5..73209343c 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -272,6 +272,7 @@ keldon_warlord.txt keldon_warlord2.txt kird_ape.txt kjeldoran_frostbeast1.txt +kjeldoran_frostbeast2_i167.txt knight_captain_of_eos_i294.txt knight_captain_of_eos_i294_2.txt kormus_bell_i301.txt diff --git a/projects/mtg/bin/Res/test/bugs/kjeldoran_frostbeast2_i167.txt b/projects/mtg/bin/Res/test/kjeldoran_frostbeast2_i167.txt similarity index 100% rename from projects/mtg/bin/Res/test/bugs/kjeldoran_frostbeast2_i167.txt rename to projects/mtg/bin/Res/test/kjeldoran_frostbeast2_i167.txt diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 6e79aff68..d8892d595 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -2664,7 +2664,6 @@ class AFarmstead:public ActivatedAbility{ } }; - //1112 Howling Mine class AHowlingMine:public MTGAbility{ public: @@ -2688,6 +2687,55 @@ class AHowlingMine:public MTGAbility{ } }; +//Kjeldoran Frostbeast +class AKjeldoranFrostbeast:public MTGAbility{ + public: + MTGCardInstance * opponents[20]; + int nbOpponents; + AKjeldoranFrostbeast(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){ + nbOpponents = 0; + } + + void Update(float dt){ + if (newPhase != currentPhase){ + if( newPhase == Constants::MTG_PHASE_COMBATEND){ + nbOpponents = 0; + MTGCardInstance * opponent = source->getNextOpponent(); + while (opponent && !opponent->hasSubtype("wall")){ + opponents[nbOpponents] = opponent; + nbOpponents ++; + opponent = source->getNextOpponent(opponent); + } + if (source->isInPlay()) { + for (int i = 0; i < nbOpponents ; i++){ + opponents[i]->destroy(); + } + } + } + } + } + + int testDestroy(){ + if(!game->isInPlay(source) && currentPhase != Constants::MTG_PHASE_UNTAP){ + return 0; + }else{ + return MTGAbility::testDestroy(); + } + } + + virtual ostream& toString(ostream& out) const + { + out << "AKjeldoranFrostbeast ::: opponents : " << opponents + << " ; nbOpponents : " << nbOpponents + << " ("; + return MTGAbility::toString(out) << ")"; + } + AKjeldoranFrostbeast * clone() const{ + AKjeldoranFrostbeast * a = NEW AKjeldoranFrostbeast(*this); + a->isClone = 1; + return a; + } +}; //Living Artifact class ALivingArtifact:public MTGAbility{ diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 31203de8d..6824eb833 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1463,6 +1463,12 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ break; } + case 2732: //Kjeldoran Frostbeast + { + game->addObserver(NEW AKjeldoranFrostbeast(_id,card)); + break; + } + // --- addon Mirage --- case 3410: //Seed of Innocence