Fixed LTC and SIR dat files, added new primitives from LTR set, implemented the new abilities and trigers related to ring bearer and ring temptations for LTR and LTC sets.

This commit is contained in:
Vittorio Alfieri
2023-06-26 22:27:29 +02:00
parent b00f142168
commit edc0aebf04
15 changed files with 762 additions and 9 deletions

View File

@@ -683,6 +683,35 @@ public:
}
};
class TrplayerTempted: public Trigger
{
public:
bool thiscontroller, thisopponent;
TrplayerTempted(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)
{
WEventplayerTempted * e = dynamic_cast<WEventplayerTempted *> (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;
}
TrplayerTempted * clone() const
{
return NEW TrplayerTempted(*this);
}
};
class TrplayerProliferated: public Trigger
{
public:
@@ -863,6 +892,37 @@ public:
}
};
class TrCardBearerChosen: public Trigger
{
public:
bool limitOnceATurn;
int triggeredTurn;
bool checkBearerChanged;
TrCardBearerChosen(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false, bool limitOnceATurn = false, bool checkBearerChanged = false) :
Trigger(observer, id, source, once, tc), limitOnceATurn(limitOnceATurn), checkBearerChanged(checkBearerChanged)
{
triggeredTurn = -1;
}
int triggerOnEventImpl(WEvent * event)
{
WEventCardBearerChosen * e = dynamic_cast<WEventCardBearerChosen *> (event);
if (!e) return 0;
if (limitOnceATurn && triggeredTurn == game->turn)
return 0;
if (checkBearerChanged && !e->bearerChanged)
return 0;
if (!tc->canTarget(e->card)) return 0;
triggeredTurn = game->turn;
return 1;
}
TrCardBearerChosen * clone() const
{
return NEW TrCardBearerChosen(*this);
}
};
class TrCardBoasted: public Trigger
{
public:
@@ -4685,6 +4745,18 @@ public:
AAExploresEvent * clone() const;
~AAExploresEvent();
};
//Ring bearer has been chosen
class AARingBearerChosen : public ActivatedAbility
{
public:
MTGAbility * andAbility;
AARingBearerChosen(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
int resolve();
const string getMenuText();
AARingBearerChosen * clone() const;
~AARingBearerChosen();
};
//Dungeon Completed
class AAAlterDungeonCompleted: public ActivatedAbilityTP
{
@@ -4711,6 +4783,19 @@ public:
AAAlterYidaroCount * clone() const;
~AAAlterYidaroCount();
};
//Ring Temptations
class AAAlterRingTemptations: public ActivatedAbilityTP
{
public:
int temptations;
MTGAbility * andAbility;
AAAlterRingTemptations(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, int temptations = 1, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const string getMenuText();
AAAlterRingTemptations * clone() const;
~AAAlterRingTemptations();
};
//Monarch
class AAAlterMonarch: public ActivatedAbilityTP
{

View File

@@ -362,7 +362,8 @@ class Constants
POISONEIGHTTOXIC = 234,
POISONNINETOXIC = 235,
POISONTENTOXIC = 236,
NB_BASIC_ABILITIES = 237,
RINGBEARER = 237,
NB_BASIC_ABILITIES = 238,
RARITY_S = 'S', //Special Rarity
RARITY_M = 'M', //Mythics

View File

@@ -45,6 +45,7 @@ public:
int energyCount;
int experienceCount;
int yidaroCount;
int ringTemptations;
int dungeonCompleted;
int numOfCommandCast;
int monarch;

View File

@@ -404,6 +404,14 @@ struct WEventplayerMonarch : public WEvent {
virtual Targetable * getTarget(Player * player);
};
//ring tempts event
struct WEventplayerTempted : public WEvent {
WEventplayerTempted(Player * player);
Player * player;
using WEvent::getTarget;
virtual Targetable * getTarget(Player * player);
};
//proliferate event
struct WEventplayerProliferated : public WEvent {
WEventplayerProliferated(Player * player);
@@ -477,6 +485,13 @@ struct WEventCardExplored : public WEventCardUpdate {
virtual Targetable * getTarget(int target);
};
//ring bearer event
struct WEventCardBearerChosen : public WEventCardUpdate {
bool bearerChanged;
WEventCardBearerChosen(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//dungeon completed event
struct WEventCardDungeonCompleted : public WEventCardUpdate {
int totaldng;