Erwan
- Added "@movedTo(...) trigger. See argothian enchantress in USG
This commit is contained in:
@@ -146,7 +146,7 @@ class ActionStack :public GuiLayer{
|
||||
Player * askIfWishesToInterrupt;
|
||||
int garbageCollect();
|
||||
int addAction(Interruptible * interruptible);
|
||||
int addSpell(MTGCardInstance* card, Targetable * targets[], int nbtargets, ManaCost * mana);
|
||||
Spell * addSpell(MTGCardInstance* card, Targetable * targets[], int nbtargets, ManaCost * mana);
|
||||
int AddNextGamePhase();
|
||||
int addPutInGraveyard(MTGCardInstance * card);
|
||||
int addDraw(Player * player, int nbcards = 1);
|
||||
|
||||
@@ -21,6 +21,40 @@
|
||||
using std::map;
|
||||
|
||||
|
||||
//
|
||||
//Triggers
|
||||
//
|
||||
|
||||
class TrCardAddedToZone:public TriggeredAbility{
|
||||
public:
|
||||
TargetChooser * toTc;
|
||||
TargetZoneChooser * fromTc;
|
||||
TrCardAddedToZone::TrCardAddedToZone(int id,MTGCardInstance * source, TargetChooser * toTc, TargetZoneChooser * fromTc = NULL):TriggeredAbility(id,source), fromTc(fromTc),toTc(toTc){
|
||||
}
|
||||
|
||||
int resolve(){
|
||||
return 0; //This is a trigger, this function should not be called
|
||||
}
|
||||
|
||||
int triggerOnEvent(WEvent * event){
|
||||
WEventZoneChange * e = dynamic_cast<WEventZoneChange*>(event);
|
||||
if (!e) return 0;
|
||||
if (!toTc->canTarget(e->card)) return 0;
|
||||
if (fromTc && !fromTc->targetsZone(e->from)) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
~TrCardAddedToZone(){
|
||||
SAFE_DELETE(toTc);
|
||||
SAFE_DELETE(fromTc);
|
||||
}
|
||||
|
||||
TrCardAddedToZone * clone() const{
|
||||
TrCardAddedToZone * a = NEW TrCardAddedToZone(*this);
|
||||
a->isClone = 1;
|
||||
return a;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class AAFizzler:public ActivatedAbility{
|
||||
|
||||
@@ -88,7 +88,9 @@ class TriggeredAbility:public MTGAbility{
|
||||
TriggeredAbility(int id, MTGCardInstance * _source, Targetable * _target);
|
||||
virtual void Update(float dt);
|
||||
virtual void Render(){};
|
||||
virtual int trigger()=0;
|
||||
virtual int trigger(){return 0;};
|
||||
virtual int triggerOnEvent(WEvent * e){return 0;};
|
||||
int receiveEvent(WEvent * e);
|
||||
virtual int resolve() = 0;
|
||||
virtual TriggeredAbility* clone() const = 0;
|
||||
virtual ostream& toString(ostream& out) const;
|
||||
@@ -183,11 +185,12 @@ class GenericTriggeredAbility:public TriggeredAbility{
|
||||
MTGAbility * destroyCondition;
|
||||
GenericTriggeredAbility(int id, MTGCardInstance * _source, TriggeredAbility * _t, MTGAbility * a,MTGAbility * dc = NULL, Targetable * _target = NULL);
|
||||
virtual int trigger();
|
||||
virtual int receiveEvent(WEvent * e);
|
||||
virtual int triggerOnEvent(WEvent * e);
|
||||
virtual int resolve();
|
||||
virtual int testDestroy();
|
||||
void Update(float dt);
|
||||
virtual GenericTriggeredAbility* clone() const;
|
||||
const char * getMenuText();
|
||||
~GenericTriggeredAbility();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user