fix flying and multiple moat in play

putrid imp that gains temporary flying cant attack if the opponent has
multiple moat in play, this should fix it.
This commit is contained in:
Anthony Calosa
2016-07-23 09:45:12 +08:00
parent 007010067b
commit fe577d9dd0
5 changed files with 15 additions and 8 deletions

View File

@@ -39610,7 +39610,7 @@ toughness=1
name=Form of the Dragon
auto=@each my upkeep:damage:5 target(creature,player)
auto=@each end:lifeset:5
auto=lord(creature[-flying]|opponentBattlefield) cantattack
auto=lord(creature|opponentBattlefield) flyersonly
text=At the beginning of your upkeep, Form of the Dragon deals 5 damage to target creature or player. -- At the beginning of each end step, your life total becomes 5. -- Creatures without flying can't attack you.
mana={4}{R}{R}{R}
type=Enchantment
@@ -64668,7 +64668,7 @@ toughness=2
[/card]
[card]
name=Magus of the Moat
auto=lord(creature[-flying]) cantattack
auto=lord(creature) flyersonly
text=Creatures without flying can't attack.
mana={2}{W}{W}
type=Creature
@@ -69545,7 +69545,7 @@ toughness=1
[/card]
[card]
name=Moat
auto=lord(creature[-flying]) cantattack
auto=lord(creature) flyersonly
text=Creatures without flying can't attack.
mana={2}{W}{W}
type=Enchantment
@@ -106044,7 +106044,8 @@ toughness=2
name=Stormtide Leviathan
abilities=islandwalk
auto=lord(land) transforms((island))
auto=lord(creature[-flying;-islandwalk]) cantattack
auto=lord(creature[-islandwalk]) cantattack
auto=lord(creature) flyersonly
text=Islandwalk -- All lands are Islands in addition to their original type. -- Creatures without flying or islandwalk can't attack.
mana={5}{U}{U}{U}
type=Creature
@@ -109798,7 +109799,7 @@ type=Legendary Land
[/card]
[card]
name=Teferi's Moat
auto=chooseacolor lord(creature[chosencolor&-flying]|opponentBattlefield) cantattack chooseend
auto=chooseacolor lord(creature[chosencolor]|opponentBattlefield) flyersonly chooseend
text=As Teferi's Moat enters the battlefield, choose a color. -- Creatures of the chosen color without flying can't attack you.
mana={3}{W}{U}
type=Enchantment
@@ -111800,7 +111801,7 @@ type=Sorcery
[card]
name=Thoughtseize
target=player
auto=reveal:type:*:targetedpersonshand revealzone(targetedpersonshand) optionone name(choose discards) target(*[-land]|reveal) moveto(ownerhand) and!( transforms((,newability[reject],newability[all(*[-land]|reveal) moveto(ownerhand) and!(reject)!])) oneshot )! optiononeend optiontwo name(look) target(<1>*|reveal) moveto(ownerhand) and!( all(*|reveal) moveto(ownerhand) )! optiontwoend afterrevealed transforms((,newability[life:-2 controller])) oneshot afterrevealedend revealend
auto=reveal:type:*:targetedpersonshand revealzone(targetedpersonshand) optionone name(choose discards) target(*[-land]|reveal) moveto(ownerhand) and!( transforms((,newability[reject],newability[all(*[-land]|reveal) moveto(ownerhand)])) oneshot )! optiononeend optiontwo name(look) target(<1>*|reveal) moveto(ownerhand) and!( all(*|reveal) moveto(ownerhand) )! optiontwoend afterrevealed transforms((,newability[life:-2 controller])) oneshot afterrevealedend revealend
text=Target player reveals his or her hand. You choose a nonland card from it. That player discards that card. You lose 2 life.
mana={B}
type=Sorcery

View File

@@ -254,7 +254,8 @@ class Constants
DETHRONE = 132,
OVERLOAD = 133,
SHACKLER = 134,
NB_BASIC_ABILITIES = 135,
FLYERSONLY = 135,//can attack only if it has flying
NB_BASIC_ABILITIES = 136,
RARITY_S = 'S', //Special Rarity
RARITY_M = 'M', //Mythics

View File

@@ -3982,6 +3982,8 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
badAbilities[(int)Constants::WEAK] = true;
badAbilities[(int)Constants::NOLIFEGAIN] = true;
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
badAbilities[(int)Constants::MUSTBLOCK] = true;
badAbilities[(int)Constants::FLYERSONLY] = true;
if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast<AInstantBasicAbilityModifierUntilEOT *>(a))
{

View File

@@ -637,6 +637,8 @@ int MTGCardInstance::canAttack()
{
if (basicAbilities[(int)Constants::CANTATTACK])
return 0;
if (basicAbilities[(int)Constants::FLYERSONLY] && !basicAbilities[(int)Constants::FLYING])
return 0;
if (tapped)
return 0;
if (hasSummoningSickness())

View File

@@ -165,7 +165,8 @@ const char* Constants::MTGBasicAbilities[] = {
"mustblock",
"dethrone",
"overload",
"shackler"
"shackler",
"flyersonly"
};
map<string,int> Constants::MTGBasicAbilitiesMap;