Transform Trigger, Turnlimit for TrCardAddedtoZone
Cleaned primitives, and fix SOI cards (remove workarounds) todo(recheck BFZ and OGW)
This commit is contained in:
@@ -903,19 +903,29 @@ private:
|
||||
}
|
||||
else if (s == "gravecardtypes")//Tarmogoyf
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
intValue = 0;
|
||||
int pc = 0, tc = 0, sc = 0, lc = 0, ic = 0, ec = 0, cc = 0, ac = 0;
|
||||
for (int j = 0; j < 2; j++)
|
||||
{
|
||||
MTGGameZone * checkZone = card->getObserver()->players[i]->game->graveyard;
|
||||
intValue =
|
||||
cardHasTypeinZone("planeswalker",checkZone) +
|
||||
cardHasTypeinZone("tribal",checkZone) +
|
||||
cardHasTypeinZone("sorcery",checkZone) +
|
||||
cardHasTypeinZone("land",checkZone) +
|
||||
cardHasTypeinZone("instant",checkZone) +
|
||||
cardHasTypeinZone("enchantment",checkZone) +
|
||||
cardHasTypeinZone("creature",checkZone) +
|
||||
cardHasTypeinZone("artifact",checkZone);
|
||||
MTGGameZone * checkZone = card->getObserver()->players[j]->game->graveyard;
|
||||
if(cardHasTypeinZone("planeswalker",checkZone))
|
||||
pc = 1;
|
||||
if(cardHasTypeinZone("tribal",checkZone))
|
||||
tc = 1;
|
||||
if(cardHasTypeinZone("sorcery",checkZone))
|
||||
sc = 1;
|
||||
if(cardHasTypeinZone("land",checkZone))
|
||||
lc = 1;
|
||||
if(cardHasTypeinZone("instant",checkZone))
|
||||
ic = 1;
|
||||
if(cardHasTypeinZone("enchantment",checkZone))
|
||||
ec = 1;
|
||||
if(cardHasTypeinZone("creature",checkZone))
|
||||
cc = 1;
|
||||
if(cardHasTypeinZone("artifact",checkZone))
|
||||
ac = 1;
|
||||
}
|
||||
intValue = pc+tc+sc+lc+ic+ec+cc+ac;
|
||||
}
|
||||
else if (s == "powertotalinplay")//Count Total Power of Creatures you control... Formidable
|
||||
{
|
||||
@@ -1133,10 +1143,13 @@ public:
|
||||
TargetChooser * toTcCard, *fromTcCard;
|
||||
bool sourceUntapped;
|
||||
bool isSuspended;
|
||||
bool limitOnceATurn;
|
||||
int triggeredTurn;
|
||||
TrCardAddedToZone(GameObserver* observer, int id, MTGCardInstance * source, TargetZoneChooser * toTcZone, TargetChooser * toTcCard,
|
||||
TargetZoneChooser * fromTcZone = NULL, TargetChooser * fromTcCard = NULL,bool once = false,bool sourceUntapped = false,bool isSuspended = false) :
|
||||
Trigger(observer, id, source, once), toTcZone(toTcZone), fromTcZone(fromTcZone), toTcCard(toTcCard), fromTcCard(fromTcCard),sourceUntapped(sourceUntapped),isSuspended(isSuspended)
|
||||
TargetZoneChooser * fromTcZone = NULL, TargetChooser * fromTcCard = NULL,bool once = false,bool sourceUntapped = false,bool isSuspended = false, bool limitOnceATurn = false) :
|
||||
Trigger(observer, id, source, once), toTcZone(toTcZone), fromTcZone(fromTcZone), toTcCard(toTcCard), fromTcCard(fromTcCard),sourceUntapped(sourceUntapped),isSuspended(isSuspended),limitOnceATurn(limitOnceATurn)
|
||||
{
|
||||
triggeredTurn = -1;
|
||||
};
|
||||
|
||||
|
||||
@@ -1146,6 +1159,8 @@ public:
|
||||
if (!e) return 0;
|
||||
if(sourceUntapped && source->isTapped() == 1)
|
||||
return 0;
|
||||
if (limitOnceATurn && triggeredTurn == game->turn)
|
||||
return 0;
|
||||
if(isSuspended && !source->suspended)
|
||||
return 0;
|
||||
if (!toTcZone->targetsZone(e->to)) return 0;
|
||||
@@ -1160,7 +1175,7 @@ public:
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
triggeredTurn = game->turn;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1230,6 +1245,28 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class TrCardTransformed: public Trigger
|
||||
{
|
||||
public:
|
||||
TrCardTransformed(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false) :
|
||||
Trigger(observer, id, source, once, tc)
|
||||
{
|
||||
}
|
||||
|
||||
int triggerOnEventImpl(WEvent * event)
|
||||
{
|
||||
WEventCardTransforms * e = dynamic_cast<WEventCardTransforms *> (event);
|
||||
if (!e) return 0;
|
||||
if (!tc->canTarget(e->card)) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
TrCardTransformed * clone() const
|
||||
{
|
||||
return NEW TrCardTransformed(*this);
|
||||
}
|
||||
};
|
||||
|
||||
class TrCombatTrigger: public Trigger
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -257,7 +257,8 @@ class Constants
|
||||
FLYERSONLY = 135,//can attack only if it has flying
|
||||
TEMPFLASHBACK = 136,
|
||||
NOLEGENDRULE =137,
|
||||
NB_BASIC_ABILITIES = 138,
|
||||
CANTTRANSFORM =138,
|
||||
NB_BASIC_ABILITIES = 139,
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
RARITY_M = 'M', //Mythics
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
ManaCost(const ManaCost& manaCost);
|
||||
ManaCost& operator= (const ManaCost& manaCost);
|
||||
void copy(ManaCost * _manaCost);
|
||||
void changeCostTo(ManaCost * _manaCost);
|
||||
int isNull();
|
||||
int getConvertedCost();
|
||||
string toString();
|
||||
|
||||
Reference in New Issue
Block a user