- Fixed an issue with maxCast targeting opponent
This commit is contained in:
wagic.the.homebrew@gmail.com
2011-02-16 14:35:49 +00:00
parent 88218a9822
commit db0c55b4dd
5 changed files with 68 additions and 14 deletions

View File

@@ -415,6 +415,7 @@ OneDozenEyes.txt
orcish_artillery.txt
orcish_lumberjack.txt
orims_chant_i595.txt
orims_chant2.txt
overrun.txt
paradise_mantle.txt
paralysis.txt

View File

@@ -0,0 +1,41 @@
#Bug with maxCast, see http://code.google.com/p/wagic/issues/detail?id=595
#1. Have at least two or more spells in your hand, include Orim's Chant; and have enough mana in your mana pool for these spells
#2. Cast Orim's Chant on yourself
#3. Cast other spells in your hand
[init]
secondmain
[player1]
inplay:plains
hand:Orim's chant
[player2]
inplay:swamp,mountain,forest
hand:raging goblin, grizzly bears
[do]
eot
next
#upkeep
next
#draw
next
#main
mountain
raging goblin
no
yes
plains
Orim's chant
p2
endofinterruption
swamp
forest
grizzly bears
[assert]
firstmain
[player1]
graveyard:Orim's chant
inplay:plains
[player2]
inplay:swamp,mountain,forest,raging goblin
hand:grizzly bears
manapool:{G}{B}
[end]

View File

@@ -107,7 +107,7 @@ class MTGGameZone {
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target);
static int zoneStringToId(string zoneName);
static MTGGameZone *intToZone(int zoneId, MTGCardInstance * source = NULL,MTGCardInstance * target = NULL);
static MTGGameZone *intToZone(int zoneId, Player * source, Player * target);
static MTGGameZone *intToZone(int zoneId, Player * source, Player * target = NULL);
bool needShuffle;
virtual const char * getName(){return "zone";};
virtual ostream& toString(ostream&) const;

View File

@@ -1491,7 +1491,7 @@ int ACastRestriction::addToGame()
else
{
TargetChooser * _tc = restrictionsScope->clone();
existingRestriction = NEW MaxPerTurnRestriction(_tc, value->getValue(), MTGGameZone::intToZone(zoneId, source->controller(), targetPlayer));
existingRestriction = NEW MaxPerTurnRestriction(_tc, value->getValue(), MTGGameZone::intToZone(zoneId, targetPlayer));
targetPlayer->game->playRestrictions->addRestriction(existingRestriction);
}

View File

@@ -746,15 +746,11 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
return p->game->graveyard;
case OPPONENT_GRAVEYARD:
return p->opponent()->game->graveyard;
case TARGET_CONTROLLER_GRAVEYARD:
return p2->game->graveyard;
case MY_BATTLEFIELD:
return p->game->inPlay;
case OPPONENT_BATTLEFIELD:
return p->opponent()->game->inPlay;
case TARGET_CONTROLLER_BATTLEFIELD:
return p2->game->inPlay;
case BATTLEFIELD:
return p->game->inPlay;
@@ -762,22 +758,17 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
return p->game->hand;
case OPPONENT_HAND:
return p->opponent()->game->hand;
case TARGET_CONTROLLER_HAND:
return p2->game->hand;
case MY_EXILE:
return p->game->removedFromGame;
case OPPONENT_EXILE:
return p->opponent()->game->removedFromGame;
case TARGET_CONTROLLER_EXILE:
return p2->game->removedFromGame;
case MY_LIBRARY:
return p->game->library;
case OPPONENT_LIBRARY:
return p->opponent()->game->library;
case TARGET_CONTROLLER_LIBRARY:
return p2->game->library;
case LIBRARY:
return p->game->library;
@@ -785,10 +776,31 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
return p->game->stack;
case OPPONENT_STACK:
return p->opponent()->game->stack;
case TARGET_CONTROLLER_STACK:
return p2->game->stack;
case STACK:
return p->game->stack;
}
if (!p2) return NULL;
switch (zoneId)
{
case TARGET_CONTROLLER_GRAVEYARD:
return p2->game->graveyard;
case TARGET_CONTROLLER_BATTLEFIELD:
return p2->game->inPlay;
case TARGET_CONTROLLER_HAND:
return p2->game->hand;
case TARGET_CONTROLLER_EXILE:
return p2->game->removedFromGame;
case TARGET_CONTROLLER_LIBRARY:
return p2->game->library;
case TARGET_CONTROLLER_STACK:
return p2->game->stack;
default:
return NULL;
}