modified castcard to support put into play

for reanimated aura
This commit is contained in:
Anthony Calosa
2015-09-23 21:36:05 +08:00
parent 7db5345f9a
commit 2223cd4f30
4 changed files with 19 additions and 9 deletions
+3 -3
View File
@@ -30262,7 +30262,7 @@ type=Instant
[/card] [/card]
[card] [card]
name=Enduring Ideal name=Enduring Ideal
auto=moveto(mybattlefield) notatarget(enchantment|mylibrary) and!( transforms((,newability[if cantargetcard(aura) then retarget target(creature|mybattlefield)])) )! auto=moveto(mybattlefield) notatarget(enchantment|mylibrary) and!(castcard(putinplay))!
auto=if compare(epicactivated)~lessthan~1 then emblem transforms((,newability[epic controller],newability[@each my upkeep:castcard(copied named!:Enduring Ideal:!)])) forever dontremove auto=if compare(epicactivated)~lessthan~1 then emblem transforms((,newability[epic controller],newability[@each my upkeep:castcard(copied named!:Enduring Ideal:!)])) forever dontremove
text=Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library. -- Epic (For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps, copy this spell except for its epic ability.) text=Search your library for an enchantment card and put it onto the battlefield. Then shuffle your library. -- Epic (For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps, copy this spell except for its epic ability.)
mana={5}{W}{W} mana={5}{W}{W}
@@ -88918,7 +88918,7 @@ type=Sorcery
[card] [card]
name=Silent Sentinel name=Silent Sentinel
abilities=flying abilities=flying
auto=@combat(attacking) source(this):may moveto(mybattlefield) target(enchantment|mygraveyard) and!( transforms((,newability[if cantargetcard(aura) then retarget target(creature|mybattlefield)])) )! auto=@combat(attacking) source(this):may moveto(mybattlefield) target(enchantment|mygraveyard) and!(castcard(putinplay))!
text=Flying -- Whenever Silent Sentinel attacks, you may return target enchantment card from your graveyard to the battlefield. text=Flying -- Whenever Silent Sentinel attacks, you may return target enchantment card from your graveyard to the battlefield.
mana={5}{W}{W} mana={5}{W}{W}
type=Creature type=Creature
@@ -95343,7 +95343,7 @@ type=Instant
[/card] [/card]
[card] [card]
name=Starfield of Nyx name=Starfield of Nyx
auto=@each my upkeep:may moveto(mybattlefield) target(enchantment|mygraveyard) and!( transforms((,newability[if cantargetcard(aura) then retarget target(creature|mybattlefield)])) )! auto=@each my upkeep:may moveto(mybattlefield) target(enchantment|mygraveyard) and!(castcard(putinplay))!
auto=aslongas(enchantment|mybattlefield) lord(other enchantment[-aura;manacost=1]) transforms((,newability[becomes(Creature)],setpower=1,settoughness=1)) >4 auto=aslongas(enchantment|mybattlefield) lord(other enchantment[-aura;manacost=1]) transforms((,newability[becomes(Creature)],setpower=1,settoughness=1)) >4
auto=aslongas(enchantment|mybattlefield) lord(other enchantment[-aura;manacost=2]) transforms((,newability[becomes(Creature)],setpower=2,settoughness=2)) >4 auto=aslongas(enchantment|mybattlefield) lord(other enchantment[-aura;manacost=2]) transforms((,newability[becomes(Creature)],setpower=2,settoughness=2)) >4
auto=aslongas(enchantment|mybattlefield) lord(other enchantment[-aura;manacost=3]) transforms((,newability[becomes(Creature)],setpower=3,settoughness=3)) >4 auto=aslongas(enchantment|mybattlefield) lord(other enchantment[-aura;manacost=3]) transforms((,newability[becomes(Creature)],setpower=3,settoughness=3)) >4
+2 -1
View File
@@ -6025,7 +6025,8 @@ public:
string nameThis; string nameThis;
MTGCardInstance * theNamedCard; MTGCardInstance * theNamedCard;
bool noEvent; bool noEvent;
AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool restricted,bool copied,bool _asNormal,string nameCard,string abilityName,bool _noEvent); bool putinplay;
AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool restricted,bool copied,bool _asNormal,string nameCard,string abilityName,bool _noEvent, bool putinplay);
int testDestroy(){return 0;}; int testDestroy(){return 0;};
void Update(float dt); void Update(float dt);
+12 -4
View File
@@ -5507,8 +5507,8 @@ AEquip * AEquip::clone() const
} }
// casting a card for free, or casting a copy of a card. // casting a card for free, or casting a copy of a card.
AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent) : AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent,bool putinplay) :
MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent) MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent),putinplay(putinplay)
{ {
target = _target; target = _target;
andAbility = NULL; andAbility = NULL;
@@ -5633,12 +5633,18 @@ int AACastCard::resolveSpell()
MTGCardInstance * copy = NULL; MTGCardInstance * copy = NULL;
if (normal ||(!_target->hasType(Subtypes::TYPE_INSTANT) && !_target->hasType(Subtypes::TYPE_SORCERY))) if (normal ||(!_target->hasType(Subtypes::TYPE_INSTANT) && !_target->hasType(Subtypes::TYPE_SORCERY)))
{ {
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent); if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER)))
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent);
else
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent);
copy->changeController(source->controller(),true); copy->changeController(source->controller(),true);
} }
else else
{ {
copy =_target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->stack,noEvent); if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER)))
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent);
else
copy =_target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->stack,noEvent);
copy->changeController(source->controller(),true); copy->changeController(source->controller(),true);
} }
if (game->targetChooser) if (game->targetChooser)
@@ -5693,6 +5699,8 @@ const string AACastCard::getMenuText()
{ {
if(nameThis.size()) if(nameThis.size())
return nameThis.c_str(); return nameThis.c_str();
if(putinplay)
return "Put Into Play";
return "Cast For Free"; return "Cast For Free";
} }
+2 -1
View File
@@ -2331,6 +2331,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
bool asCopy = splitCastCard[1].find("copied") != string::npos; bool asCopy = splitCastCard[1].find("copied") != string::npos;
bool asNormal = splitCastCard[1].find("normal") != string::npos; bool asNormal = splitCastCard[1].find("normal") != string::npos;
bool sendNoEvent = splitCastCard[1].find("noevent") != string::npos; bool sendNoEvent = splitCastCard[1].find("noevent") != string::npos;
bool putinplay = splitCastCard[1].find("putinplay") != string::npos;
string nameCard = ""; string nameCard = "";
if(splitCastCard[1].find("named!:") != string::npos) if(splitCastCard[1].find("named!:") != string::npos)
{ {
@@ -2340,7 +2341,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
nameCard = splitCastName[1]; nameCard = splitCastName[1];
} }
} }
MTGAbility *a = NEW AACastCard(observer, id, card, target,withRestrictions,asCopy,asNormal,nameCard,newName,sendNoEvent); MTGAbility *a = NEW AACastCard(observer, id, card, target,withRestrictions,asCopy,asNormal,nameCard,newName,sendNoEvent,putinplay);
a->oneShot = false; a->oneShot = false;
if(splitCastCard[1].find("trigger[to]") != string::npos) if(splitCastCard[1].find("trigger[to]") != string::npos)
{ {