TrLifeGained changes

@lifed/lifeloss(who) -> static version
@lifeof/lifelostof(player) -> current controller of the card
@lifefoeof/lifelostfoeof(player) -> current opponent of the card
This commit is contained in:
Anthony Calosa
2015-10-21 12:25:08 +08:00
parent 21eea225af
commit 3b0cd389e5
3 changed files with 57 additions and 23 deletions

View File

@@ -1342,9 +1342,9 @@ class TrLifeGained: public Trigger
public:
TargetChooser * fromTc;
int type;//this allows damagenoncombat and combatdamage to share this trigger
bool sourceUntapped;
TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool once = false) :
Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped)
bool sourceUntapped, thiscontroller, thisopponent;
TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool once = false, bool thiscontroller = false, bool thisopponent = false) :
Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped) , thiscontroller(thiscontroller) , thisopponent(thisopponent)
{
}
@@ -1358,6 +1358,12 @@ public:
if (fromTc && !fromTc->canTarget(e->player)) return 0;
if (type == 1 && (e->amount > 0)) return 0;
if (type == 0 && (e->amount < 0)) return 0;
if(thiscontroller)
if(e->player != source->controller())
return 0;
if(thisopponent)
if(e->player == source->controller())
return 0;
e->player->thatmuch = abs(e->amount);
this->source->thatmuch = abs(e->amount);