Added/Fixed primitives, improved the Double Face Modal cards management: now it's possibile to click on card to flip the side in odrer to read card infos such as name, manacost, text and types, improved the "moveto" keyword in order to allow the usage of the "temp" zone for removing unecessary cards from game (e.g. duplicated card generated from some dual face cards), added the option "nolegend" to the "copy" keyword in order to crerate copy of legendary cards that are not legendary (e.g. Echoing Equation), added the keywords "doublefacedeath" and "gaineddoublefacedeath" to send a card to temp zone after death (e.g. duplicated card generated from some dual face cards), added the keywords "lifefaker" to identify the cards wich modify the life increasement when a @lifeof triggers occours (e.g. Angel of Vitality).
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1975,7 +1975,7 @@ type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
name=Ajani's Pridemate
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):counter(1/1,1)
|
||||
auto=@lifeof(player) from(*[-lifefaker]):counter(1/1,1)
|
||||
text=Whenever you gain life, put a +1/+1 counter on Ajani's Pridemate.
|
||||
mana={1}{W}
|
||||
type=Creature
|
||||
@@ -5143,7 +5143,7 @@ toughness=4
|
||||
[card]
|
||||
name=Archangel of Thune
|
||||
abilities=flying,lifelink
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):all(creature|mybattlefield) counter(1/1,1)
|
||||
auto=@lifeof(player) from(*[-lifefaker]):all(creature|mybattlefield) counter(1/1,1)
|
||||
text=Flying. -- Lifelink. -- Whenever you gain life, put a +1/+1 counter on each creature you control.
|
||||
mana={3}{W}{W}
|
||||
type=Creature
|
||||
@@ -12217,7 +12217,7 @@ type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
name=Bloodbond Vampire
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):counter(1/1,1)
|
||||
auto=@lifeof(player) from(*[-lifefaker]):counter(1/1,1)
|
||||
text=Whenever you gain life, put a +1/+1 counter on Bloodbond Vampire.
|
||||
mana={2}{B}{B}
|
||||
type=Creature
|
||||
@@ -20321,7 +20321,7 @@ toughness=1
|
||||
[card]
|
||||
name=Cliffhaven Vampire
|
||||
abilities=flying
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):life:-1 opponent
|
||||
auto=@lifeof(player) from(*[-lifefaker]):life:-1 opponent
|
||||
text=Flying -- Whenever you gain life, each opponent loses 1 life.
|
||||
mana={2}{W}{B}
|
||||
type=Creature
|
||||
@@ -32124,7 +32124,7 @@ toughness=4
|
||||
[card]
|
||||
name=Drogskol Reaver
|
||||
abilities=flying,double strike,lifelink
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):draw:1 controller
|
||||
auto=@lifeof(player) from(*[-lifefaker]):draw:1 controller
|
||||
text=Flying, double strike, lifelink -- Whenever you gain life, draw a card.
|
||||
mana={5}{W}{U}
|
||||
type=Creature
|
||||
@@ -61148,7 +61148,7 @@ toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
name=Kalastria Nightwatch
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):flying ueot
|
||||
auto=@lifeof(player) from(*[-lifefaker]):flying ueot
|
||||
text=Whenever you gain life, Kalastria Nightwatch gains flying until end of turn.
|
||||
mana={4}{B}
|
||||
type=Creature
|
||||
@@ -61545,7 +61545,7 @@ type=Sorcery
|
||||
[/card]
|
||||
[card]
|
||||
name=Karlov of the Ghost Council
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):counter(1/1,2)
|
||||
auto=@lifeof(player) from(*[-lifefaker]):counter(1/1,2)
|
||||
auto={W}{B}{C(1/1,-6)}:moveto(exile) target(creature)
|
||||
text=Whenever you gain life, put two +1/+1 counters on Karlov of the Ghost Council. -- {W}{B}, Remove six +1/+1 counters from Karlov of the Ghost Council: Exile target creature.
|
||||
mana={W}{B}
|
||||
@@ -70052,7 +70052,7 @@ toughness=1
|
||||
[card]
|
||||
name=Malakir Familiar
|
||||
abilities=flying,deathtouch
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):1/1 ueot
|
||||
auto=@lifeof(player) from(*[-lifefaker]):1/1 ueot
|
||||
text=Flying, deathtouch -- Whenever you gain life, Malakir Familiar gets +1/+1 until end of turn.
|
||||
mana={2}{B}
|
||||
type=Creature
|
||||
@@ -80034,7 +80034,7 @@ toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
name=Nirkana Assassin
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):deathtouch ueot
|
||||
auto=@lifeof(player) from(*[-lifefaker]):deathtouch ueot
|
||||
text=Whenever you gain life, Nirkana Assassin gains deathtouch until end of turn. (Any amount of damage it deals to a creature is enough to destroy it.)
|
||||
mana={2}{B}
|
||||
type=Creature
|
||||
@@ -101131,7 +101131,7 @@ type=Instant
|
||||
[/card]
|
||||
[card]
|
||||
name=Searing Meditation
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):pay({2}) target(creature,player) damage:2
|
||||
auto=@lifeof(player) from(*[-lifefaker]):pay({2}) target(creature,player) damage:2
|
||||
text=Whenever you gain life, you may pay {2}. If you do, Searing Meditation deals 2 damage to target creature or player.
|
||||
mana={1}{R}{W}
|
||||
type=Enchantment
|
||||
@@ -102337,7 +102337,7 @@ type=Sorcery
|
||||
[/card]
|
||||
[card]
|
||||
name=Serene Steward
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):pay({W}) counter(1/1) target(creature)
|
||||
auto=@lifeof(player) from(*[-lifefaker]):pay({W}) counter(1/1) target(creature)
|
||||
text=Whenever you gain life, you may pay {W}. If you do, put a +1/+1 counter on target creature.
|
||||
mana={1}{W}
|
||||
type=Creature
|
||||
@@ -131076,7 +131076,7 @@ toughness=5
|
||||
[card]
|
||||
name=Wall of Limbs
|
||||
abilities=defender
|
||||
auto=@lifeof(player) from(*[-Alhammarret's Archive;-Angel of Vitality;-Boon Reflection;-Honor Troll]):counter(1/1,1)
|
||||
auto=@lifeof(player) from(*[-lifefaker]):counter(1/1,1)
|
||||
auto={5}{B}{B}{S}:name(Lose Life) target(player) life:-storedpower
|
||||
text=Defender (This creature can't attack.) -- Whenever you gain life, put a +1/+1 counter on Wall of Limbs. -- {5}{B}{B}, Sacrifice Wall of Limbs: Target player loses X life, where X is Wall of Limbs's power.
|
||||
mana={2}{B}
|
||||
|
||||
@@ -1681,7 +1681,7 @@ auto={C(0/0,1,Loyalty)}:name(+1: Don't discard any card) donothing
|
||||
auto={C(0/0,1,Loyalty)}:name(+1: Discard and draw) target(*|myhand) transforms((,newability[reject],newability[if cantargetcard(*[creature]|*) then draw:2 else draw:1])) oneshot
|
||||
auto={C(0/0,-2,Loyalty)}:name(-2: Return creature from graveyard) target(creature|mygraveyard) moveto(mybattlefield) and!( transforms((,newability[unearth],newability[haste])) forever )!
|
||||
auto={C(0/0,-7,Loyalty)}:name(-7: Get emblem powerstrike) emblem transforms((,newability[@movedTo(creature|mybattlefield):name(Damage any target) all(trigger[to]) transforms((,newability[name(Damage any target) damage:power target(player^creature^planeswalker)])) oneshot])) forever dontremove
|
||||
text=+1: You may discard a card. If you do, draw a card. If a creature card was discarded this way, draw two cards instead. -- −2: Return target creature card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of your next upkeep. -- −7: You get an emblem with "Whenever a creature enters the battlefield under your control, it deals damage equal to its power to any target."
|
||||
text=+1: You may discard a card. If you do, draw a card. If a creature card was discarded this way, draw two cards instead. -- −2: Return target creature card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of your next upkeep. -- −7: You get an emblem with "Whenever a creature enters the battlefield under your control, it deals damage equal to its power to any target." // {1}{W}{W} Mila, Crafty Companion
|
||||
mana={4}{R}{R}
|
||||
type=Legendary Planeswalker
|
||||
subtype=Lukka
|
||||
@@ -2152,13 +2152,15 @@ subtype=Rowan
|
||||
[card]
|
||||
name=Rowan, Scholar of Sparks
|
||||
other={4}{U} name(Will, Scholar of Frost)
|
||||
otherrestriction=can play planeswalker
|
||||
otherrestriction=can play planeswalker,compare(isflipped)~equalto~1
|
||||
restriction=compare(isflipped)~equalto~0
|
||||
anyzone={0}:doubleside(Will, Scholar of Frost)
|
||||
autostack=if paid(alternative) then name(Will, Scholar of Frost) name(Will, Scholar of Frost) flip(Will, Scholar of Frost) forcetype(Legendary Planeswalker)
|
||||
auto=if paid(alternative) then counter(0/0,4,Loyalty) else counter(0/0,2,loyalty)
|
||||
auto=this(variable{isflipped}<1) lord(instant,sorcery|mycastingzone) altercost(colorless,-1)
|
||||
auto=this(variable{isflipped}<1) {C(0/0,1,Loyalty)}:name(+1: Deals damage) name(+1: Deals damage) if compare(pdrewcount)~lessthan~3 then damage:1 opponent else damage:3 opponent
|
||||
auto=this(variable{isflipped}<1) {C(0/0,-4,Loyalty)}:name(-4: Emblem copy spells) name(-4: Emblem copy spells) emblem transforms((,newability[@movedto(*[instant;sorcery]|mystack):all(trigger[to]<1>) transforms((,newability[pay[[{2}]] name(copy spell) activate name(copy spell) castcard(copied noevent)])) forever])) forever dontremove
|
||||
text=Instant and sorcery spells you cast cost {1} less to cast. -- +1: Rowan, Scholar of Sparks deals 1 damage to each opponent. If you've drawn three or more cards this turn, she deals 3 damage to each opponent instead. -- −4: You get an emblem with "Whenever you cast an instant or sorcery spell, you may pay 2 . If you do, copy that spell. You may choose new targets for the copy."
|
||||
text=Instant and sorcery spells you cast cost {1} less to cast. -- +1: Rowan, Scholar of Sparks deals 1 damage to each opponent. If you've drawn three or more cards this turn, she deals 3 damage to each opponent instead. -- −4: You get an emblem with "Whenever you cast an instant or sorcery spell, you may pay 2 . If you do, copy that spell. You may choose new targets for the copy." // {4}{U} Will, Scholar of Frost
|
||||
mana={2}{R}
|
||||
type=Legendary Planeswalker
|
||||
subtype=Rowan
|
||||
@@ -2679,7 +2681,7 @@ auto=create(TibaltEmblem:TibaltEmblem:0/0:shroud:indestructible)])) and!( transf
|
||||
auto={C(0/0,2,Loyalty)}:name(+2: Exile the top card) all(*[zpos=1]|library) moveto(ownerexile) and!( counter(0/0,1,TibaltExiled) )!
|
||||
auto={C(0/0,-3,Loyalty)}:name(-3: Exile target artifact or creature) target(*[artifact;creature]|battlefield) moveto(ownerexile) and!( counter(0/0,1,TibaltExiled) )!
|
||||
auto={C(0/0,-8,Loyalty)}:name(-8: Exile all cards from all graveyards) all(*|graveyard) moveto(ownerexile) and!( counter(0/0,1,TibaltExiled) )!
|
||||
text=As Tibalt enters the battlefield, you get an emblem with "You may play cards exiled with Tibalt, Cosmic Impostor, and you may spend mana as though it were mana of any color to cast those spells." -- +2: Exile the top card of each player’s library. -- -3: Exile target artifact or creature. -- -8: Exile all cards from all graveyards. Add {R}{R}{R}.
|
||||
text=As Tibalt enters the battlefield, you get an emblem with "You may play cards exiled with Tibalt, Cosmic Impostor, and you may spend mana as though it were mana of any color to cast those spells." -- +2: Exile the top card of each player’s library. -- -3: Exile target artifact or creature. -- -8: Exile all cards from all graveyards. Add {R}{R}{R}. // {1}{B} Valki, God of Lies
|
||||
mana={5}{B}{R}
|
||||
type=Legendary Planeswalker
|
||||
subtype=Tibalt
|
||||
@@ -2924,7 +2926,7 @@ auto=this(variable{isflipped}>0) {C(0/0,1,Loyalty)}:name(+1: Dont't target any c
|
||||
auto=this(variable{isflipped}>0) {C(0/0,1,Loyalty)}:name(+1: Target creature becomes 0/2) name(+1: Target creature becomes 0/2) target(creature) transforms((,setpower=0,settoughness=2)) uynt
|
||||
auto=this(variable{isflipped}>0) {C(0/0,-3,Loyalty)}:name(-3: Draw 2 cards) name(-3: Draw 2 cards) draw:2 controller
|
||||
auto=this(variable{isflipped}>0) {C(0/0,-7,Loyalty)}:name(-7: Exile 5 permanents) name(-7: Exile 5 permanents) target(<upto:5>*|battlefield) moveto(exile) and!( transforms((,newability[token(Elemental^Creature Elemental^4/4^blue^red)])) oneshot )!
|
||||
text=Instant and sorcery spells you cast cost {1} less to cast. -- +1: Up to one target creature has base power and toughness 0/2 until your next turn. -- −3: Draw two cards. -- −7: Exile up to five target permanents. For each permanent exiled this way, its controller creates a 4/4 blue and red Elemental creature token.
|
||||
text=Instant and sorcery spells you cast cost {1} less to cast. -- +1: Up to one target creature has base power and toughness 0/2 until your next turn. -- −3: Draw two cards. -- −7: Exile up to five target permanents. For each permanent exiled this way, its controller creates a 4/4 blue and red Elemental creature token. // {2}{R} Rowan, Scholar of Sparks
|
||||
mana={4}{U}
|
||||
type=Legendary Planeswalker
|
||||
subtype=Will
|
||||
|
||||
@@ -1412,9 +1412,10 @@ class AACopier: public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
bool isactivated;
|
||||
string options;
|
||||
vector<MTGAbility *> currentAbilities;
|
||||
MTGAbility * andAbility;
|
||||
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL);
|
||||
AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target = NULL, ManaCost * _cost = NULL, string optionsList = "");
|
||||
int resolve();
|
||||
const string getMenuText();
|
||||
AACopier * clone() const;
|
||||
@@ -4217,6 +4218,18 @@ public:
|
||||
AAMeld * clone() const;
|
||||
};
|
||||
|
||||
/* doubleside */
|
||||
class AATurnSide : public ActivatedAbility
|
||||
{
|
||||
public:
|
||||
string _SideName;
|
||||
AATurnSide(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, string SideName = "");
|
||||
int resolve();
|
||||
|
||||
const string getMenuText();
|
||||
AATurnSide * clone() const;
|
||||
};
|
||||
|
||||
/* flip*/
|
||||
class AAFlip: public InstantAbility
|
||||
{
|
||||
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
int removeCantBeBlockerOfCard(MTGCardInstance * card, int erase = 0);
|
||||
int cantBeBlockerOfCard(MTGCardInstance * card);
|
||||
|
||||
void copy(MTGCardInstance * card);
|
||||
void copy(MTGCardInstance * card, bool nolegend = false);
|
||||
|
||||
void setUntapping();
|
||||
void resetUntapping(); // Fix to avoid the untap on frozen card by clicking on them after the untap phase.
|
||||
|
||||
@@ -305,7 +305,10 @@ class Constants
|
||||
REPLACESCRY = 178,
|
||||
HASNOKICKER = 179,
|
||||
UNDAMAGEABLE = 180,
|
||||
NB_BASIC_ABILITIES = 181,
|
||||
LIFEFAKER = 181,
|
||||
DOUBLEFACEDEATH = 182,
|
||||
GAINEDDOUBLEFACEDEATH = 183,
|
||||
NB_BASIC_ABILITIES = 184,
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
RARITY_M = 'M', //Mythics
|
||||
|
||||
@@ -95,6 +95,14 @@ class MTGGameZone {
|
||||
COMMANDZONE = 92,
|
||||
OWNER_COMMANDZONE = 93,
|
||||
TARGETED_PLAYER_COMMANDZONE = 94,
|
||||
|
||||
MY_TEMP = 95,
|
||||
OPPONENT_TEMP = 96,
|
||||
TARGET_OWNER_TEMP = 97,
|
||||
TARGET_CONTROLLER_TEMP = 98,
|
||||
TEMP = 99,
|
||||
OWNER_TEMP = 100,
|
||||
TARGETED_PLAYER_TEMP = 101,
|
||||
};
|
||||
|
||||
Player * owner;
|
||||
|
||||
@@ -591,6 +591,12 @@ int PutInGraveyard::resolve()
|
||||
card->controller()->game->putInZone(card, zone, card->owner->game->exile);
|
||||
return 1;
|
||||
}
|
||||
if (card->basicAbilities[(int)Constants::DOUBLEFACEDEATH] || card->basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH])
|
||||
{
|
||||
card->basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH] = 0;
|
||||
card->controller()->game->putInZone(card, zone, card->owner->game->temp);
|
||||
return 1;
|
||||
}
|
||||
if (card->basicAbilities[(int)Constants::HANDDEATH] || card->basicAbilities[(int)Constants::GAINEDHANDDEATH])
|
||||
{
|
||||
card->basicAbilities[(int)Constants::GAINEDHANDDEATH] = 0;
|
||||
|
||||
@@ -1921,11 +1921,12 @@ AALibraryBottom::~AALibraryBottom()
|
||||
}
|
||||
|
||||
//AACopier
|
||||
AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost) :
|
||||
AACopier::AACopier(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, ManaCost * _cost, string optionsList) :
|
||||
ActivatedAbility(observer, _id, _source, _cost, 0)
|
||||
{
|
||||
target = _target;
|
||||
andAbility = NULL;
|
||||
options = optionsList;
|
||||
isactivated = false;
|
||||
}
|
||||
|
||||
@@ -1942,9 +1943,10 @@ int AACopier::resolve()
|
||||
source->hasCopiedToken = tokencopied;
|
||||
/*since we look for the real card it will not copy granted haste ability however for token we copy all*/
|
||||
/*but how to do backup for token so we just copy the backup???*/
|
||||
bool nolegend = options.find("nolegend") != string::npos; // Check if the copy has to be legendary or not. (e.g. Echoing Equation)
|
||||
if(tokencopied && !_target->isACopier && !_target->getMTGId())
|
||||
{
|
||||
source->copy(_target->tokCard);
|
||||
source->copy(_target->tokCard, nolegend);
|
||||
//if the token doesn't have cda/dynamic pt then allow this...
|
||||
if(!_target->isCDA)
|
||||
{
|
||||
@@ -1967,7 +1969,7 @@ int AACopier::resolve()
|
||||
else
|
||||
{
|
||||
source->nameOrig = source->name; // Saves the orignal card name before become a copy
|
||||
source->copy(_target);
|
||||
source->copy(_target, nolegend);
|
||||
}
|
||||
source->isACopier = true;
|
||||
source->copiedID = _target->copiedID;
|
||||
@@ -4332,6 +4334,70 @@ AAMeld * AAMeld::clone() const
|
||||
return NEW AAMeld(*this);
|
||||
}
|
||||
|
||||
//Turn side of double faced cards
|
||||
AATurnSide::AATurnSide(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, string SideName) :
|
||||
ActivatedAbility(observer, id, card, 0), _SideName(SideName)
|
||||
{
|
||||
target = _target;
|
||||
}
|
||||
|
||||
int AATurnSide::resolve()
|
||||
{
|
||||
MTGCardInstance * _target = (MTGCardInstance *)target;
|
||||
if (_target && _target->currentZone != _target->controller()->game->battlefield) // It's not allowed to turn side on battlefield.
|
||||
{
|
||||
if(_target->mutation && _target->parentCards.size() > 0) return 0; // Mutated down cards cannot be turned, they will follow the fate of top-card
|
||||
MTGCard * fcard;
|
||||
MTGCardInstance* sideCard;
|
||||
if(!_target->isFlipped){
|
||||
fcard = MTGCollection()->getCardByName(_SideName);
|
||||
if(!fcard) return 0;
|
||||
sideCard = NEW MTGCardInstance(fcard, _target->controller()->game);
|
||||
_target->nameOrig = _target->name;
|
||||
_target->name = sideCard->name;
|
||||
if(!sideCard) return 0;
|
||||
if(sideCard->getManaCost()){
|
||||
if(_target->getManaCost()->getAlternative()){
|
||||
sideCard->getManaCost()->setAlternative(NEW ManaCost());
|
||||
sideCard->getManaCost()->getAlternative()->copy(_target->getManaCost()->getAlternative()); // Keep orignal alternative cost to cast card with other.
|
||||
}
|
||||
_target->getManaCost()->copy(sideCard->getManaCost()); // Show the other side cost mana symbols.
|
||||
}
|
||||
} else {
|
||||
fcard = MTGCollection()->getCardByName(_target->nameOrig);
|
||||
if(!fcard) return 0;
|
||||
_target->name = _target->nameOrig;
|
||||
_target->nameOrig = "";
|
||||
sideCard = NEW MTGCardInstance(fcard, _target->controller()->game);
|
||||
if(!sideCard) return 0;
|
||||
if(sideCard->getManaCost()){
|
||||
_target->getManaCost()->resetCosts();
|
||||
_target->getManaCost()->copy(sideCard->getManaCost()); // Restore the original side cost mana symbols.
|
||||
}
|
||||
}
|
||||
for (int i = ((int)_target->types.size())-1; i >= 0; --i) // Load all the types from the current side
|
||||
_target->removeType(_target->types[i]);
|
||||
for (int i = 0; i < ((int)sideCard->types.size()); i++)
|
||||
_target->addType(sideCard->types[i]);
|
||||
_target->text = sideCard->text;
|
||||
_target->formattedText = sideCard->formattedText;
|
||||
_target->isFlipped = !_target->isFlipped;
|
||||
SAFE_DELETE(sideCard);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const string AATurnSide::getMenuText()
|
||||
{
|
||||
return "Flip Side";
|
||||
}
|
||||
|
||||
AATurnSide * AATurnSide::clone() const
|
||||
{
|
||||
return NEW AATurnSide(*this);
|
||||
}
|
||||
|
||||
// flip a card
|
||||
AAFlip::AAFlip(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,string flipStats, bool isflipcard, bool forcedcopy, string forcetype, bool backfromcopy) :
|
||||
InstantAbility(observer, id, card, _target),flipStats(flipStats),isflipcard(isflipcard),forcedcopy(forcedcopy),forcetype(forcetype),backfromcopy(backfromcopy)
|
||||
@@ -4345,7 +4411,7 @@ int AAFlip::resolve()
|
||||
int activatedanyability = 0;
|
||||
MTGCardInstance * Flipper = (MTGCardInstance*)source;
|
||||
this->oneShot = true;
|
||||
if(Flipper->isFlipped)
|
||||
if(Flipper->isFlipped && forcetype == "")
|
||||
{
|
||||
game->removeObserver(this);
|
||||
return 0;
|
||||
|
||||
@@ -3148,7 +3148,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
found = s.find("copy");
|
||||
if (found != string::npos)
|
||||
{
|
||||
MTGAbility * a = NEW AACopier(observer, id, card, target);
|
||||
string options = "";
|
||||
vector<string> splitOptions = parseBetween(s, "options(", ")");
|
||||
if (splitOptions.size())
|
||||
{
|
||||
options = splitOptions[1];
|
||||
}
|
||||
MTGAbility * a = NEW AACopier(observer, id, card, target, NULL, options);
|
||||
a->oneShot = 1;
|
||||
a->canBeInterrupted = false;
|
||||
((AACopier*)a)->isactivated = activated;
|
||||
@@ -4297,6 +4303,21 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return a;
|
||||
}
|
||||
|
||||
//doubleside
|
||||
vector<string> splitSide = parseBetween(s, "doubleside(", ")", true);
|
||||
if (splitSide.size())
|
||||
{
|
||||
string splitSideName = "";
|
||||
if (splitSide[1].size())
|
||||
{
|
||||
splitSideName = splitSide[1];
|
||||
replace(splitSideName.begin(), splitSideName.end(), '^', ','); // To allow the usage of ^ instead of , char (e.g. using doubleside keyword inside transforms)
|
||||
}
|
||||
MTGAbility * a = NEW AATurnSide(observer, id, card, target, splitSideName);
|
||||
a->oneShot = true;
|
||||
return a;
|
||||
}
|
||||
|
||||
//flip
|
||||
vector<string> splitFlipStat = parseBetween(s, "flip(", ")", true);
|
||||
if(splitFlipStat.size())
|
||||
@@ -5088,6 +5109,8 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
|
||||
badAbilities[(int)Constants::GAINEDHANDDEATH] = true;
|
||||
badAbilities[(int)Constants::INPLAYDEATH] = true;
|
||||
badAbilities[(int)Constants::INPLAYTAPDEATH] = true;
|
||||
badAbilities[(int)Constants::DOUBLEFACEDEATH] = true;
|
||||
badAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH] = true;
|
||||
badAbilities[(int)Constants::WEAK] = true;
|
||||
badAbilities[(int)Constants::NOLIFEGAIN] = true;
|
||||
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
|
||||
@@ -5906,6 +5929,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
|
||||
card->basicAbilities[(int)Constants::GAINEDEXILEDEATH] = 0;
|
||||
card->controller()->game->putInZone(card, card->getCurrentZone(), card->owner->game->exile);
|
||||
}
|
||||
else if (card->basicAbilities[(int)Constants::DOUBLEFACEDEATH] || card->basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH])
|
||||
{
|
||||
card->basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH] = 0;
|
||||
card->controller()->game->putInZone(card, card->getCurrentZone(), card->owner->game->temp);
|
||||
}
|
||||
else if (card->basicAbilities[(int)Constants::HANDDEATH] || card->basicAbilities[(int)Constants::GAINEDHANDDEATH])
|
||||
{
|
||||
card->basicAbilities[(int)Constants::GAINEDHANDDEATH] = 0;
|
||||
|
||||
@@ -97,7 +97,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
|
||||
return snapShot;
|
||||
}
|
||||
|
||||
void MTGCardInstance::copy(MTGCardInstance * card)
|
||||
void MTGCardInstance::copy(MTGCardInstance * card, bool nolegend)
|
||||
{
|
||||
MTGCard * source = NULL;
|
||||
if(card->isACopier && card->copiedID)
|
||||
@@ -130,7 +130,8 @@ void MTGCardInstance::copy(MTGCardInstance * card)
|
||||
types.clear();//reset types.. fix copying man lands... the copier becomes an unanimated land...
|
||||
for (size_t i = 0; i < data->types.size(); i++)
|
||||
{
|
||||
types.push_back(data->types[i]);
|
||||
if(!(nolegend && data->types[i] == Subtypes::TYPE_LEGENDARY)) // Check if the copy has to be legendary or not. (e.g. Echoing Equation)
|
||||
types.push_back(data->types[i]);
|
||||
}
|
||||
|
||||
colors = data->colors;
|
||||
@@ -514,6 +515,12 @@ int MTGCardInstance::toGrave( bool forced )
|
||||
basicAbilities[(int)Constants::GAINEDEXILEDEATH] = 0;
|
||||
return 1;
|
||||
}
|
||||
if (basicAbilities[(int)Constants::DOUBLEFACEDEATH] || basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH])
|
||||
{
|
||||
p->game->putInZone(this, p->game->inPlay, owner->game->temp);
|
||||
basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH] = 0;
|
||||
return 1;
|
||||
}
|
||||
if (basicAbilities[(int)Constants::HANDDEATH] || basicAbilities[(int)Constants::GAINEDHANDDEATH])
|
||||
{
|
||||
p->game->putInZone(this, p->game->inPlay, owner->game->hand);
|
||||
|
||||
@@ -211,7 +211,10 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"twoboast", //It has boast twice ability (e.g. Birgi, God of Storytelling)
|
||||
"replacescry", //It has scry replacement ability
|
||||
"hasnokicker", //Kicker cost is not a real kicker cost (eg. cards with Fuse cost)
|
||||
"undamageable" //It cannot be damaged by any source
|
||||
"undamageable", //It cannot be damaged by any source
|
||||
"lifefaker", //It's a card wich modify the life increasement when a @lifeof triggers occours (e.g. Angel of Vitality)
|
||||
"doublefacedeath", //It goes to temp zone after death (e.g. Double face card)
|
||||
"gaineddoublefacedeath" //It goes to temp after death (use just to give add ability to instants and sorceries which originally have not, e.g. with transforms keyword)
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
@@ -404,6 +404,12 @@ MTGCardInstance * MTGPlayerCards::putInGraveyard(MTGCardInstance * card)
|
||||
ret->basicAbilities[(int)Constants::GAINEDHANDDEATH] = 0;
|
||||
return ret;
|
||||
}
|
||||
else if (card->getCurrentZone() != card->controller()->game->hand && (card->basicAbilities[(int)Constants::DOUBLEFACEDEATH] || card->basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH]))
|
||||
{
|
||||
MTGCardInstance* ret = putInZone(card, card->getCurrentZone(), card->owner->game->temp);
|
||||
ret->basicAbilities[(int)Constants::GAINEDDOUBLEFACEDEATH] = 0;
|
||||
return ret;
|
||||
}
|
||||
else if (card->getCurrentZone() != card->controller()->game->hand && (card->basicAbilities[(int)Constants::INPLAYDEATH] || card->basicAbilities[(int)Constants::INPLAYTAPDEATH]))
|
||||
{
|
||||
MTGCardInstance* ret = putInZone(card, card->getCurrentZone(), card->owner->game->battlefield);
|
||||
@@ -823,6 +829,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card, int createCopy
|
||||
copy->basicAbilities[Constants::ISCOMMANDER] = card->basicAbilities[Constants::ISCOMMANDER];
|
||||
copy->basicAbilities[Constants::GAINEDEXILEDEATH] = card->basicAbilities[Constants::GAINEDEXILEDEATH];
|
||||
copy->basicAbilities[Constants::GAINEDHANDDEATH] = card->basicAbilities[Constants::GAINEDHANDDEATH];
|
||||
copy->basicAbilities[Constants::GAINEDDOUBLEFACEDEATH] = card->basicAbilities[Constants::GAINEDDOUBLEFACEDEATH];
|
||||
copy->damageInflictedAsCommander = card->damageInflictedAsCommander;
|
||||
copy->numofcastfromcommandzone = card->numofcastfromcommandzone;
|
||||
for (int i = 0; i < ManaCost::MANA_PAID_WITH_BESTOW +1; i++)
|
||||
@@ -1358,6 +1365,13 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
|
||||
case COMMANDZONE:
|
||||
return p->game->commandzone;
|
||||
|
||||
case MY_TEMP:
|
||||
return p->game->temp;
|
||||
case OPPONENT_TEMP:
|
||||
return p->opponent()->game->temp;
|
||||
case TEMP:
|
||||
return p->game->temp;
|
||||
|
||||
}
|
||||
if (!p2) return NULL;
|
||||
switch (zoneId)
|
||||
@@ -1389,6 +1403,9 @@ MTGGameZone * MTGGameZone::intToZone(int zoneId, Player * p, Player * p2)
|
||||
case TARGET_CONTROLLER_COMMANDZONE:
|
||||
return p2->game->commandzone;
|
||||
|
||||
case TARGET_CONTROLLER_TEMP:
|
||||
return p2->game->temp;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -1520,6 +1537,17 @@ MTGGameZone * MTGGameZone::intToZone(GameObserver *g, int zoneId, MTGCardInstanc
|
||||
return source->playerTarget->game->commandzone;
|
||||
else return source->controller()->game->commandzone;
|
||||
|
||||
case TARGET_OWNER_TEMP:
|
||||
return target->owner->game->temp;
|
||||
case TEMP:
|
||||
return target->owner->game->temp;
|
||||
case OWNER_TEMP:
|
||||
return target->owner->game->temp;
|
||||
case TARGETED_PLAYER_TEMP:
|
||||
if (source->playerTarget)
|
||||
return source->playerTarget->game->temp;
|
||||
else return source->controller()->game->temp;
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
@@ -1553,6 +1581,8 @@ int MTGGameZone::zoneStringToId(string zoneName)
|
||||
|
||||
"mycommandzone", "opponentcommandzone", "targetownercommandzone", "targetcontrollercommandzone", "ownercommandzone", "commandzone","targetedpersonscommandzone",
|
||||
|
||||
"mytemp", "opponenttemp", "targetownertemp", "targetcontrollertemp", "ownertemp", "temp","targetedpersonstemp",
|
||||
|
||||
};
|
||||
|
||||
int values[] = { MY_GRAVEYARD, OPPONENT_GRAVEYARD, TARGET_OWNER_GRAVEYARD, TARGET_CONTROLLER_GRAVEYARD, OWNER_GRAVEYARD,
|
||||
@@ -1578,7 +1608,9 @@ int MTGGameZone::zoneStringToId(string zoneName)
|
||||
|
||||
MY_SIDEBOARD, OPPONENT_SIDEBOARD, TARGET_OWNER_SIDEBOARD, TARGET_CONTROLLER_SIDEBOARD, OWNER_SIDEBOARD, SIDEBOARD,TARGETED_PLAYER_SIDEBOARD,
|
||||
|
||||
MY_COMMANDZONE, OPPONENT_COMMANDZONE, TARGET_OWNER_COMMANDZONE, TARGET_CONTROLLER_COMMANDZONE, OWNER_COMMANDZONE, COMMANDZONE,TARGETED_PLAYER_COMMANDZONE };
|
||||
MY_COMMANDZONE, OPPONENT_COMMANDZONE, TARGET_OWNER_COMMANDZONE, TARGET_CONTROLLER_COMMANDZONE, OWNER_COMMANDZONE, COMMANDZONE,TARGETED_PLAYER_COMMANDZONE,
|
||||
|
||||
MY_TEMP, OPPONENT_TEMP, TARGET_OWNER_TEMP, TARGET_CONTROLLER_TEMP, OWNER_TEMP, TEMP,TARGETED_PLAYER_TEMP };
|
||||
|
||||
int max = sizeof(values) / sizeof *(values);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user