TrcardDrawn changes

@drawn(who) -> static version
@drawof(player) -> current controller of the card
@drawfoeof(player) -> current opponent of the card
This commit is contained in:
Anthony Calosa
2015-10-21 10:16:01 +08:00
parent 743c2a6a5e
commit 21eea225af
4 changed files with 47 additions and 32 deletions

View File

@@ -1196,9 +1196,9 @@ public:
class TrcardDrawn: public Trigger
{
public:
TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false) :
Trigger(observer, id, source,once, tc)
bool thiscontroller, thisopponent;
TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false, bool thiscontroller = false, bool thisopponent = false) :
Trigger(observer, id, source,once, tc),thiscontroller(thiscontroller),thisopponent(thisopponent)
{
}
@@ -1207,7 +1207,12 @@ public:
WEventcardDraw * e = dynamic_cast<WEventcardDraw *> (event);
if (!e) return 0;
if (!tc->canTarget(e->player)) return 0;
if(thiscontroller)
if(e->player != source->controller())
return 0;
if(thisopponent)
if(e->player == source->controller())
return 0;
return 1;
}