fix morbid

also added zerodead restriction - returns true if you dont have any
creature that died this turn
This commit is contained in:
Anthony Calosa
2017-08-03 18:27:45 +08:00
parent bc06f93aae
commit 0c053c713a
2 changed files with 29 additions and 3 deletions

View File

@@ -106336,7 +106336,8 @@ toughness=6
[/card]
[card]
name=Simoon
auto=damage:1 all(creature|opponentBattlefield)
target=opponent
auto=damage:1 all(creature|targetedpersonsbattlefield)
text=Simoon deals 1 damage to each creature target opponent controls.
mana={R}{G}
type=Instant

View File

@@ -386,7 +386,10 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
for(unsigned int gy = 0;gy < grave->cardsSeenThisTurn.size();gy++)
{
MTGCardInstance * checkCard = grave->cardsSeenThisTurn[gy];
if(checkCard->isCreature())
if(checkCard->isCreature() &&
((checkCard->previousZone == checkCurrent->game->battlefield)||
(checkCard->previousZone == checkCurrent->opponent()->game->battlefield))//died from battlefield
)
{
isMorbid = true;
break;
@@ -398,7 +401,29 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
if(!isMorbid)
return 0;
}
check = restriction[i].find("zerodead");
if(check != string::npos)//returns true if zero
{
bool hasDeadCreature = false;
for(int cp = 0;cp < 2;cp++)
{
Player * checkCurrent = observer->players[cp];
MTGGameZone * grave = checkCurrent->game->graveyard;
for(unsigned int gy = 0;gy < grave->cardsSeenThisTurn.size();gy++)
{
MTGCardInstance * checkCard = grave->cardsSeenThisTurn[gy];
if(checkCard->isCreature() &&
((checkCard->previousZone == checkCurrent->game->battlefield))//died from your battlefield
)
{
hasDeadCreature = true;
break;
}
}
if(hasDeadCreature)
return 0;
}
}
//Ensnaring Bridge
check = restriction[i].find("powermorethanopponenthand");
if (check != string::npos)//for opponent creatures