From 5dc98359c182fecbcfe4010380e8fea0fd46cf83 Mon Sep 17 00:00:00 2001 From: "wagic.laurent" Date: Tue, 23 Jun 2009 00:43:31 +0000 Subject: [PATCH] Laurent - Added Threaten (10E) - Steal creature until end of turn. Return creature at end of turn to opponent and also "untap" it.. not sure if it is quite right, but does not make any difference since it is at the end of turn just before the untap phase of opponent. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Few comments: I spent quite some time to make it work... made some test all working but experienced some random crash in windows version (debugging did not help much) don't know if i broke something or if it is due to other SVN addition. Some other cards are similar and could be hardcoded/aliased (Overtake - MRQ, Ray of Command - ICE,MIR, Slave of Bolas - ARB, Spinal Embrace INV, Unwilling Recruit EVE) we could discuss about them... I think it is the last card that was missing for the red premade 10E deck. Now 10E has 255 cards and is the set with the most cards... GrĂ¼. L. --- projects/mtg/bin/Res/sets/10E/_cards.dat | 11 ++++++++ projects/mtg/bin/Res/sets/10E/todo.dat | 2 ++ projects/mtg/include/AllAbilities.h | 34 ++++++++++++++++++++++++ projects/mtg/src/MTGAbility.cpp | 7 ++++- 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/projects/mtg/bin/Res/sets/10E/_cards.dat b/projects/mtg/bin/Res/sets/10E/_cards.dat index 06679263d..bf10693c1 100644 --- a/projects/mtg/bin/Res/sets/10E/_cards.dat +++ b/projects/mtg/bin/Res/sets/10E/_cards.dat @@ -2712,6 +2712,17 @@ type=Artifact mana={5} [/card] [card] +text=Untap target creature and gain control of it until end of turn. That creature gains haste until end of turn. (It can attack and {T} this turn.) +id=129767 +target=creature +auto=haste +name=Threaten +rarity=U +color=Red +type=Sorcery +mana={2}{R} +[/card] +[card] text=Haste (This creature can attack and {T} as soon as it comes under your control.) abilities=haste id=130381 diff --git a/projects/mtg/bin/Res/sets/10E/todo.dat b/projects/mtg/bin/Res/sets/10E/todo.dat index 6bf05c518..e2922ee98 100644 --- a/projects/mtg/bin/Res/sets/10E/todo.dat +++ b/projects/mtg/bin/Res/sets/10E/todo.dat @@ -1172,6 +1172,8 @@ toughness=3 [card] text=Untap target creature and gain control of it until end of turn. That creature gains haste until end of turn. (It can attack and {T} this turn.) id=129767 +alias=1194 +auto=haste name=Threaten rarity=U color=Red diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 799e637c0..2930e5ded 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3846,5 +3846,39 @@ class AVerdantForce: public TriggeredAbility{ } }; +//Instant Steal control of a target +class AInstantControlSteal: public InstantAbility{ + public: + Player * TrueController; + Player * TheftController; + AInstantControlSteal(int _id , MTGCardInstance * _source, MTGCardInstance * _target):InstantAbility(_id, _source, _target){ + TrueController = _target->controller(); + // TrueController->game->putInZone(_target, TrueController->game->inPlay, source->controller()->game->inPlay); + TheftController = source->controller(); + MTGCardInstance * copy = _target->changeController(game->currentlyActing()); + target = copy; + source->target = copy; + + + } + int destroy(){ + MTGCardInstance * _target = (MTGCardInstance *) target; + if (TheftController && TheftController->game->inPlay->hasCard(_target)){ //if the target is still in game -> spell was destroyed + _target->changeController(TrueController); + + } + return 1; + } + + + virtual ostream& toString(ostream& out) const + { + out << "AInstantControlSteal ::: TrueController : " << TrueController + << " ("; + return InstantAbility::toString(out) << ")"; + } +}; + + #endif diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 83d7d3d96..ae666e82b 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1885,7 +1885,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ MTGCardInstance * current = game->players[i]->game->inPlay->cards[j]; if (current->hasType("Artifact")){ game->players[i]->game->putInGraveyard(current); - current->controller()->life-= current->getManaCost()->getConvertedCost(); + current->controller()->life+= current->getManaCost()->getConvertedCost(); } } } @@ -1915,6 +1915,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ //-- addon 10E--- + case 129767: //Threaten + { + game->addObserver( NEW AInstantControlSteal(_id,card,card->target)); + break; + } case 130542: //Flowstone Slide { TargetChooser * lordTargets = NULL;