Fixed Treasure token, added boast trigger event, added new keyword "hascnt" to retrieve the amount of specific counter type on a card (e.g. hascntloyalty).

This commit is contained in:
Vittorio Alfieri
2021-01-24 20:37:14 +01:00
parent f6199719fd
commit 4bdc1fdfe1
7 changed files with 127 additions and 6 deletions

View File

@@ -619,6 +619,33 @@ public:
}
};
class TrCardBoasted: public Trigger
{
public:
bool limitOnceATurn;
int triggeredTurn;
TrCardBoasted(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false,bool limitOnceATurn = false) :
Trigger(observer, id, source,once, tc),limitOnceATurn(limitOnceATurn)
{
}
int triggerOnEventImpl(WEvent * event)
{
WEventCardBoasted * e = dynamic_cast<WEventCardBoasted *> (event);
if (!e) return 0;
if (limitOnceATurn && triggeredTurn == game->turn)
return 0;
if (!tc->canTarget(e->card)) return 0;
triggeredTurn = game->turn;
return 1;
}
TrCardBoasted * clone() const
{
return NEW TrCardBoasted(*this);
}
};
class TrCardSurveiled: public Trigger
{
public:
@@ -3939,6 +3966,19 @@ public:
AAAlterEnergy * clone() const;
~AAAlterEnergy();
};
//Boast Event
class AABoastEvent: public ActivatedAbilityTP
{
public:
MTGCardInstance * card;
AABoastEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const string getMenuText();
AABoastEvent * clone() const;
~AABoastEvent();
};
//Surveil Event
class AASurveilEvent: public ActivatedAbilityTP
{

View File

@@ -360,6 +360,12 @@ struct WEventplayerMonarch : public WEvent {
virtual Targetable * getTarget(Player * player);
};
//boast event
struct WEventCardBoasted : public WEventCardUpdate {
WEventCardBoasted(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//surveil event
struct WEventCardSurveiled : public WEventCardUpdate {
WEventCardSurveiled(MTGCardInstance * card);