fix morbid
also added zerodead restriction - returns true if you dont have any creature that died this turn
This commit is contained in:
@@ -106336,7 +106336,8 @@ toughness=6
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Simoon
|
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.
|
text=Simoon deals 1 damage to each creature target opponent controls.
|
||||||
mana={R}{G}
|
mana={R}{G}
|
||||||
type=Instant
|
type=Instant
|
||||||
|
|||||||
@@ -386,7 +386,10 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
|||||||
for(unsigned int gy = 0;gy < grave->cardsSeenThisTurn.size();gy++)
|
for(unsigned int gy = 0;gy < grave->cardsSeenThisTurn.size();gy++)
|
||||||
{
|
{
|
||||||
MTGCardInstance * checkCard = grave->cardsSeenThisTurn[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;
|
isMorbid = true;
|
||||||
break;
|
break;
|
||||||
@@ -398,7 +401,29 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
|
|||||||
if(!isMorbid)
|
if(!isMorbid)
|
||||||
return 0;
|
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
|
//Ensnaring Bridge
|
||||||
check = restriction[i].find("powermorethanopponenthand");
|
check = restriction[i].find("powermorethanopponenthand");
|
||||||
if (check != string::npos)//for opponent creatures
|
if (check != string::npos)//for opponent creatures
|
||||||
|
|||||||
Reference in New Issue
Block a user