- fixed a bug with creature bond
- fixed a bug with control magic
This commit is contained in:
wagic.the.homebrew
2008-12-06 14:50:10 +00:00
parent b89c4522de
commit 7f5312be20
4 changed files with 54 additions and 5 deletions
+1
View File
@@ -25,6 +25,7 @@ control_magic2.txt
counsel_of_the_soratami.txt counsel_of_the_soratami.txt
counterspell.txt counterspell.txt
counterspell2.txt counterspell2.txt
creature_bond.txt
drain_life.txt drain_life.txt
flare.txt flare.txt
force_of_nature.txt force_of_nature.txt
@@ -0,0 +1,43 @@
#Testing Creature Bond on a fire elemental in opponent's play, then testing what happens when the elemental gets killed.
#opponent should lose life
[INIT]
FIRSTMAIN
[PLAYER1]
hand:1197
inplay:1239
manapool:{1}{U}
[PLAYER2]
inplay:1290
[DO]
1197
1290
eot
#untap
next
#upkeep
next
#draw
next
#main 1
next
#cbt begins
next
#attackers
1290
next
#defensers
1239
next
#damage
next
#combat end
[ASSERT]
COMBATEND
[PLAYER1]
graveyard:1197,1239
manapool:{0}
life:20
[PLAYER2]
graveyard:1290
life:16
[END]
+9 -4
View File
@@ -1108,12 +1108,12 @@ class AControlStealAura: public MTGAbility{
int destroy(){ int destroy(){
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target->controller()->game->inPlay->hasCard(_target)){ //if the target is still in game -> spell was destroyed Player * p = _target->controller();
if (p && p->game->inPlay->hasCard(_target)){ //if the target is still in game -> spell was destroyed
_target->changeController(originalController); _target->changeController(originalController);
} }
return 1; return 1;
} }
//TODO put it back into owners's graveyard if needed...
}; };
@@ -1481,15 +1481,20 @@ class AConservator: public MTGAbility{
//Creature bond //Creature bond
class ACreatureBond:public TriggeredAbility{ class ACreatureBond:public TriggeredAbility{
public: public:
int mTriggered;
int resolved; int resolved;
ACreatureBond(int _id, MTGCardInstance * _source, MTGCardInstance * _target):TriggeredAbility(_id,_source,_target){ ACreatureBond(int _id, MTGCardInstance * _source, MTGCardInstance * _target):TriggeredAbility(_id,_source,_target){
resolved = 1; mTriggered = 0;
resolved = 0;
} }
int trigger(){ int trigger(){
MTGCardInstance * _target = (MTGCardInstance *) target; MTGCardInstance * _target = (MTGCardInstance *) target;
for (int i = 0; i < 2; i++){ for (int i = 0; i < 2; i++){
if (game->players[i]->game->graveyard->hasCard(_target)) return 1; if (!mTriggered && game->players[i]->game->graveyard->hasCard(_target)){
mTriggered = 1;
return 1;
}
} }
return 0; return 0;
} }
+1 -1
View File
@@ -999,7 +999,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
} }
case 1194: //Control Magic case 1194: //Control Magic
{ {
game->addObserver(NEW ATakeControlAura(_id, card, card->target)); game->addObserver(NEW AControlStealAura(_id, card, card->target));
break; break;
} }