added stack check, modified life check
if activating ability, playing a land or casting sorcery spell at sorcery level(timing restriction), if the stack is not empty, don't allow it. Modified the life state check, if any of the players would lose the game, allow the gamestateeffects to check... added reduceto:value for ali from cairo...
This commit is contained in:
@@ -2665,6 +2665,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return NEW AProduceExtraAbility(observer, id, card,s.substr(13));
|
||||
}
|
||||
|
||||
//reducelife to specific value
|
||||
if (s.find("reduceto:") != string::npos)
|
||||
{
|
||||
return NEW AReduceToAbility(observer, id, card,s.substr(9));
|
||||
}
|
||||
|
||||
//flanking
|
||||
if (s.find("flanker") != string::npos)
|
||||
{
|
||||
@@ -4594,6 +4600,8 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
||||
return 0;
|
||||
if (cPhase != MTG_PHASE_FIRSTMAIN && cPhase != MTG_PHASE_SECONDMAIN)
|
||||
return 0;
|
||||
if (player->opponent()->getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0||game->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0||player->getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
if (restrictions >= MY_BEFORE_BEGIN && restrictions <= MY_AFTER_EOT)
|
||||
@@ -5016,30 +5024,6 @@ int TriggeredAbility::receiveEvent(WEvent * e)
|
||||
resolve();
|
||||
return 1;
|
||||
}
|
||||
if(dynamic_cast<WEventLife*>(e))
|
||||
{
|
||||
//check life state on life triger
|
||||
WEventLife * lifecheck = dynamic_cast<WEventLife*>(e);
|
||||
if (lifecheck->player->DeadLifeState())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
fireAbility();
|
||||
return 1;
|
||||
}
|
||||
if(dynamic_cast<WEventDamage*>(e))
|
||||
{
|
||||
//check life state on damage trigger
|
||||
WEventDamage * lifecheck = dynamic_cast<WEventDamage*>(e);
|
||||
if (lifecheck->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
||||
{
|
||||
Player * triggerPlayer = (Player *) lifecheck->damage->target;
|
||||
if(triggerPlayer->DeadLifeState())
|
||||
return 0;
|
||||
}
|
||||
fireAbility();
|
||||
return 1;
|
||||
}
|
||||
WEventZoneChange * stackCheck = dynamic_cast<WEventZoneChange*>(e);
|
||||
if(stackCheck && (stackCheck->to == game->currentPlayer->game->stack||stackCheck->to == game->currentPlayer->opponent()->game->stack))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user