refactor Legendary Rule

This commit is contained in:
Anthony Calosa
2017-02-01 09:49:36 +08:00
parent c0afb3b95e
commit 7b0fdcd721
6 changed files with 72 additions and 70 deletions

View File

@@ -250,6 +250,7 @@ public:
int getCurrentToughness();
int LKIpower;
int LKItoughness;
int countDuplicateCardNames();
void cdaPT(int p = 0, int t = 0);
bool isCDA;
void switchPT(bool apply = false);

View File

@@ -423,19 +423,19 @@ public:
};
/*
* Rule 420.5e (Legend Rule)
* If two or more legendary permanents with the same name are in play, all are put into their
* owners' graveyards. This is called the "legend rule." If only one of those permanents is
* legendary, this rule doesn't apply.
* 704.5k If a player controls two or more legendary permanents with the same name,
* that player chooses one of them, and the rest are put into their owners graveyards.
* This is called the legend rule.
*/
class MTGLegendRule: public ListMaintainerAbility
class MTGLegendRule: public PermanentAbility
{
public:
TargetChooser * tcL;
MTGAbility * Legendrule;
MTGAbility * LegendruleAbility;
MTGAbility * LegendruleGeneric;
MTGLegendRule(GameObserver* observer, int _id);
int canBeInList(MTGCardInstance * card);
int added(MTGCardInstance * card);
int removed(MTGCardInstance * card);
int testDestroy();
int receiveEvent(WEvent * event);
virtual ostream& toString(ostream& out) const;
virtual MTGLegendRule * clone() const;
};

View File

@@ -79,6 +79,11 @@ struct WEventDamageStackResolved : public WEvent {
WEventDamageStackResolved();
};
struct WEventGameStateBasedChecked : public WEvent {
WEventGameStateBasedChecked();
};
struct WEventPhasePreChange : public WEvent {
Phase * from;
Phase * to;