Fixed several primitives, added a new Commander Deck for AI, Fixed an issue on "blink" return ability (e.g. "Otherworldly Journey"), improved "exerted" trigger adding "turnlimited" option, added a new keyword "losesatype" to remove a specific type from a card (e.g. "Conversion"), improved "vanishing", "fading" and "bloodthirst" keywords in order to allow the usage of variables (e.g. "Tidewalker"), added new triggers "poisonedof" and "poisonedfoeof" to handle the event when a player gets a poison counter, added new keywords "countershroud" to avoid a card can get any kind of counter, added new keywords "expshroud" and "energyshroud" to avoid a player can get one of those counters, added new option "uent" for "transforms" keyword ability to allow transformation effects end at the end of your next turn, fixed an issue on "swap" keyword when a non-creature card is firstly transformed into a creature (e.g. "Wandering Fumarole").

This commit is contained in:
Vittorio Alfieri
2021-12-18 13:45:58 +01:00
parent 8551f55636
commit 7fa03e620d
15 changed files with 655 additions and 332 deletions

View File

@@ -347,16 +347,22 @@ public:
class TrCardExerted: public Trigger
{
public:
TrCardExerted(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false) :
Trigger(observer, id, source, once, tc)
bool limitOnceATurn;
int triggeredTurn;
TrCardExerted(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false, bool limitOnceATurn = false) :
Trigger(observer, id, source, once, tc), limitOnceATurn(limitOnceATurn)
{
triggeredTurn = -1;
}
int triggerOnEventImpl(WEvent * event)
{
WEventCardExerted * e = dynamic_cast<WEventCardExerted *> (event);
if (!e) return 0;
if (limitOnceATurn && triggeredTurn == game->turn)
return 0;
if (!tc->canTarget(e->card)) return 0;
triggeredTurn = game->turn;
return 1;
}
@@ -485,6 +491,35 @@ public:
}
};
class TrplayerPoisoned: public Trigger
{
public:
bool thiscontroller, thisopponent;
TrplayerPoisoned(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)
{
}
int triggerOnEventImpl(WEvent * event)
{
WEventplayerPoisoned * e = dynamic_cast<WEventplayerPoisoned *> (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;
}
TrplayerPoisoned * clone() const
{
return NEW TrplayerPoisoned(*this);
}
};
class TrplayerEnergized: public Trigger
{
public:
@@ -4904,9 +4939,10 @@ public:
bool newAbilityFound;
bool aForever;
bool UYNT;
bool UENT;
int myCurrentTurn;
string menutext; //this overrides the previous.
ATransformer(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower, bool newpowerfound,string newtoughness, bool newtoughnessfound,vector<string> newAbilitiesList, bool newAbilityFound = false, bool aForever = false , bool UYNT = false,string menutext = "");
ATransformer(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities,string newpower, bool newpowerfound,string newtoughness, bool newtoughnessfound,vector<string> newAbilitiesList, bool newAbilityFound = false, bool aForever = false, bool UYNT = false, bool UENT = false, string menutext = "");
int addToGame();
int reapplyCountersBonus(MTGCardInstance * rtarget= NULL, bool powerapplied=false, bool toughnessapplied=false);
int testDestroy();
@@ -4930,9 +4966,10 @@ public:
bool newAbilityFound;
bool aForever;
bool UYNT;
bool UENT;
string menu;
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "", bool newpowerfound = false, string newtoughness = "", bool newtoughnessfound = false, vector<string>newAbilitiesList = vector<string>(), bool newAbilityFound = false, bool aForever = false, bool UYNT = false, string menutext = "");
ATransformerInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, string types = "", string abilities = "",string newpower = "", bool newpowerfound = false, string newtoughness = "", bool newtoughnessfound = false, vector<string>newAbilitiesList = vector<string>(), bool newAbilityFound = false, bool aForever = false, bool UYNT = false, bool UENT = false, string menutext = "");
int resolve();
const string getMenuText();
ATransformerInstant * clone() const;
@@ -5087,8 +5124,9 @@ class ALoseSubtypes: public MTGAbility
{
public:
int parentType;
bool specificType; // added to remove a specific type (e.g. "Conversion").
vector <int> storedSubtypes;
ALoseSubtypes(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int parentType);
ALoseSubtypes(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, int parentType, bool specificType = false);
int addToGame();
int destroy();
ALoseSubtypes * clone() const;

View File

@@ -333,7 +333,10 @@ class Constants
NOENTERTRG = 206,
NODIETRG = 207,
TRAINING = 208,
NB_BASIC_ABILITIES = 209,
ENERGYSHROUD = 209,
EXPSHROUD = 210,
COUNTERSHROUD = 211,
NB_BASIC_ABILITIES = 212,
RARITY_S = 'S', //Special Rarity
RARITY_M = 'M', //Mythics

View File

@@ -350,6 +350,15 @@ struct WEventCardCopiedACard : public WEventCardUpdate {
virtual Targetable * getTarget(int target);
};
//alterpoison event
struct WEventplayerPoisoned : public WEvent {
WEventplayerPoisoned(Player * player, int nb_count);
Player * player;
int nb_count;
using WEvent::getTarget;
virtual Targetable * getTarget(Player * player);
};
//alterenergy event
struct WEventplayerEnergized : public WEvent {
WEventplayerEnergized(Player * player, int nb_count);