Erwan
-Bug fix: Selesnya Guildmage ability ueot
This commit is contained in:
@@ -161,6 +161,7 @@ royal_assassin.txt
|
|||||||
safehold_duo.txt
|
safehold_duo.txt
|
||||||
sedge_sliver.txt
|
sedge_sliver.txt
|
||||||
seismic_assault.txt
|
seismic_assault.txt
|
||||||
|
selesnya_guildmage.txt
|
||||||
siege_gang_commander.txt
|
siege_gang_commander.txt
|
||||||
shepherd_of_rot.txt
|
shepherd_of_rot.txt
|
||||||
shivan_hellkite.txt
|
shivan_hellkite.txt
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
#Bug: Selesnya guildmage's ability doesn't wear off at the end of turn
|
||||||
|
# {3}{W}: creatures you control gain +1/+1 until end of turn
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:selesnya guildmage,grizzly bears
|
||||||
|
manapool:{3}{W}
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:mountain
|
||||||
|
hand:shock
|
||||||
|
[DO]
|
||||||
|
selesnya guildmage
|
||||||
|
next
|
||||||
|
#combat begins
|
||||||
|
next
|
||||||
|
#attackers
|
||||||
|
grizzly bears
|
||||||
|
eot
|
||||||
|
#untap
|
||||||
|
next
|
||||||
|
#upkeep
|
||||||
|
next
|
||||||
|
#draw
|
||||||
|
next
|
||||||
|
#main
|
||||||
|
mountain
|
||||||
|
shock
|
||||||
|
grizzly bears
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:selesnya guildmage
|
||||||
|
graveyard:grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:mountain
|
||||||
|
graveyard:shock
|
||||||
|
life:17
|
||||||
|
[END]
|
||||||
@@ -202,7 +202,7 @@ class AbilityFactory{
|
|||||||
int countCards(TargetChooser * tc, Player * player = NULL, int option = 0);
|
int countCards(TargetChooser * tc, Player * player = NULL, int option = 0);
|
||||||
int parsePowerToughness(string s, int *power, int *toughness);
|
int parsePowerToughness(string s, int *power, int *toughness);
|
||||||
TriggeredAbility * parseTrigger(string s, int id, Spell * spell, MTGCardInstance *card, Targetable * target);
|
TriggeredAbility * parseTrigger(string s, int id, Spell * spell, MTGCardInstance *card, Targetable * target);
|
||||||
MTGAbility * parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated = 0);
|
MTGAbility * parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated = 0, int forceUEOT = 0);
|
||||||
public:
|
public:
|
||||||
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY);
|
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY);
|
||||||
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL);
|
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL);
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell
|
|||||||
|
|
||||||
//Parses a string and returns the corresponding MTGAbility object
|
//Parses a string and returns the corresponding MTGAbility object
|
||||||
// Returns NULL if parsing failed
|
// Returns NULL if parsing failed
|
||||||
MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated){
|
MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTGCardInstance *card, int activated, int forceUEOT){
|
||||||
size_t found;
|
size_t found;
|
||||||
|
|
||||||
string whitespaces (" \t\f\v\n\r");
|
string whitespaces (" \t\f\v\n\r");
|
||||||
@@ -259,13 +259,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
TargetChooser * lordTargets = tcf.createTargetChooser(lordTargetsString, card);
|
TargetChooser * lordTargets = tcf.createTargetChooser(lordTargetsString, card);
|
||||||
|
|
||||||
|
|
||||||
MTGAbility * a = parseMagicLine(s1,id,spell, card);
|
MTGAbility * a = parseMagicLine(s1,id,spell, card,0,activated); //activated lords usually force an end of turn ability
|
||||||
if (!a){
|
if (!a){
|
||||||
SAFE_DELETE(lordTargets);
|
SAFE_DELETE(lordTargets);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
MTGAbility * result = NULL;
|
MTGAbility * result = NULL;
|
||||||
int oneShot = 0;
|
int oneShot = 0;
|
||||||
|
if (activated) oneShot = 1;
|
||||||
if (card->hasType("sorcery") || card->hasType("instant")) oneShot = 1;
|
if (card->hasType("sorcery") || card->hasType("instant")) oneShot = 1;
|
||||||
if (i == 3) oneShot = 1;
|
if (i == 3) oneShot = 1;
|
||||||
if (a->oneShot) oneShot = 1;
|
if (a->oneShot) oneShot = 1;
|
||||||
@@ -545,7 +546,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int forceUEOT = 0;
|
|
||||||
found = s.find("ueot");
|
found = s.find("ueot");
|
||||||
if (found!= string::npos) forceUEOT = 1;
|
if (found!= string::npos) forceUEOT = 1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user