Erwan
- Fixed an issue with maxCast targeting opponent
This commit is contained in:
@@ -415,6 +415,7 @@ OneDozenEyes.txt
|
|||||||
orcish_artillery.txt
|
orcish_artillery.txt
|
||||||
orcish_lumberjack.txt
|
orcish_lumberjack.txt
|
||||||
orims_chant_i595.txt
|
orims_chant_i595.txt
|
||||||
|
orims_chant2.txt
|
||||||
overrun.txt
|
overrun.txt
|
||||||
paradise_mantle.txt
|
paradise_mantle.txt
|
||||||
paralysis.txt
|
paralysis.txt
|
||||||
|
|||||||
41
projects/mtg/bin/Res/test/orims_chant2.txt
Normal file
41
projects/mtg/bin/Res/test/orims_chant2.txt
Normal 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]
|
||||||
@@ -107,7 +107,7 @@ class MTGGameZone {
|
|||||||
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target);
|
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target);
|
||||||
static int zoneStringToId(string zoneName);
|
static int zoneStringToId(string zoneName);
|
||||||
static MTGGameZone *intToZone(int zoneId, MTGCardInstance * source = NULL,MTGCardInstance * target = NULL);
|
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;
|
bool needShuffle;
|
||||||
virtual const char * getName(){return "zone";};
|
virtual const char * getName(){return "zone";};
|
||||||
virtual ostream& toString(ostream&) const;
|
virtual ostream& toString(ostream&) const;
|
||||||
|
|||||||
@@ -1491,7 +1491,7 @@ int ACastRestriction::addToGame()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
TargetChooser * _tc = restrictionsScope->clone();
|
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);
|
targetPlayer->game->playRestrictions->addRestriction(existingRestriction);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -746,15 +746,11 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
|
|||||||
return p->game->graveyard;
|
return p->game->graveyard;
|
||||||
case OPPONENT_GRAVEYARD:
|
case OPPONENT_GRAVEYARD:
|
||||||
return p->opponent()->game->graveyard;
|
return p->opponent()->game->graveyard;
|
||||||
case TARGET_CONTROLLER_GRAVEYARD:
|
|
||||||
return p2->game->graveyard;
|
|
||||||
|
|
||||||
case MY_BATTLEFIELD:
|
case MY_BATTLEFIELD:
|
||||||
return p->game->inPlay;
|
return p->game->inPlay;
|
||||||
case OPPONENT_BATTLEFIELD:
|
case OPPONENT_BATTLEFIELD:
|
||||||
return p->opponent()->game->inPlay;
|
return p->opponent()->game->inPlay;
|
||||||
case TARGET_CONTROLLER_BATTLEFIELD:
|
|
||||||
return p2->game->inPlay;
|
|
||||||
case BATTLEFIELD:
|
case BATTLEFIELD:
|
||||||
return p->game->inPlay;
|
return p->game->inPlay;
|
||||||
|
|
||||||
@@ -762,22 +758,17 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
|
|||||||
return p->game->hand;
|
return p->game->hand;
|
||||||
case OPPONENT_HAND:
|
case OPPONENT_HAND:
|
||||||
return p->opponent()->game->hand;
|
return p->opponent()->game->hand;
|
||||||
case TARGET_CONTROLLER_HAND:
|
|
||||||
return p2->game->hand;
|
|
||||||
|
|
||||||
case MY_EXILE:
|
case MY_EXILE:
|
||||||
return p->game->removedFromGame;
|
return p->game->removedFromGame;
|
||||||
case OPPONENT_EXILE:
|
case OPPONENT_EXILE:
|
||||||
return p->opponent()->game->removedFromGame;
|
return p->opponent()->game->removedFromGame;
|
||||||
case TARGET_CONTROLLER_EXILE:
|
|
||||||
return p2->game->removedFromGame;
|
|
||||||
|
|
||||||
case MY_LIBRARY:
|
case MY_LIBRARY:
|
||||||
return p->game->library;
|
return p->game->library;
|
||||||
case OPPONENT_LIBRARY:
|
case OPPONENT_LIBRARY:
|
||||||
return p->opponent()->game->library;
|
return p->opponent()->game->library;
|
||||||
case TARGET_CONTROLLER_LIBRARY:
|
|
||||||
return p2->game->library;
|
|
||||||
case LIBRARY:
|
case LIBRARY:
|
||||||
return p->game->library;
|
return p->game->library;
|
||||||
|
|
||||||
@@ -785,10 +776,31 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
|
|||||||
return p->game->stack;
|
return p->game->stack;
|
||||||
case OPPONENT_STACK:
|
case OPPONENT_STACK:
|
||||||
return p->opponent()->game->stack;
|
return p->opponent()->game->stack;
|
||||||
case TARGET_CONTROLLER_STACK:
|
|
||||||
return p2->game->stack;
|
|
||||||
case STACK:
|
case STACK:
|
||||||
return p->game->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:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user