fixed a reported bug where the foelost restrictions for triggers were not activating correctly, also updated the code by making it more flexiable...you can now do foelost(number) instead.
This commit is contained in:
@@ -556,7 +556,7 @@ int ActionStack::addDamage(MTGCardInstance * _source, Damageable * _target, int
|
||||
addAction(damage);
|
||||
_source->thatmuch = _damage;
|
||||
_target->thatmuch = _damage;
|
||||
_target->lifeLostThisTurn += _damage;
|
||||
//_target->lifeLostThisTurn += _damage;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -335,17 +335,11 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string magicText, int
|
||||
{
|
||||
sourceTap = true;
|
||||
}
|
||||
found = s.find("foelostthree");
|
||||
found = s.find("foelost(");
|
||||
if (found != string::npos)
|
||||
{
|
||||
lifelost = true;
|
||||
lifeamount = 3;
|
||||
}
|
||||
found = s.find("foelosttwo");
|
||||
if (found != string::npos)
|
||||
{
|
||||
lifelost = true;
|
||||
lifeamount = 2;
|
||||
lifeamount = atoi(s.substr(found + 8,')').c_str());
|
||||
}
|
||||
found = s.find("opponentpoisoned");
|
||||
if ( found != string::npos)
|
||||
@@ -4388,9 +4382,11 @@ TriggerAtPhase::TriggerAtPhase(int id, MTGCardInstance * source, Targetable * ta
|
||||
int TriggerAtPhase::trigger()
|
||||
{
|
||||
if(source->isPhased) return 0;
|
||||
if(lifelost && source->controller()->opponent()->lifeLostThisTurn < lifeamount)
|
||||
if(lifelost)
|
||||
{
|
||||
return 0;
|
||||
int lifeloss = source->controller()->opponent()->lifeLostThisTurn;
|
||||
if(lifeloss < lifeamount)
|
||||
return 0;
|
||||
}
|
||||
if (sourceUntapped && source->isTapped() == 1)
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user