Erwan
- Added "@movedTo(...) trigger. See argothian enchantress in USG
This commit is contained in:
@@ -293,6 +293,15 @@ type=Land
|
|||||||
rarity=R
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text={2}, {T}, Sacrifice Darkwater Egg: Add {U}{B} to your mana pool. Draw a card.
|
||||||
|
auto={2}{T}{S}:Add{U}{B} && Draw:1
|
||||||
|
id=30749
|
||||||
|
name=Darkwater Egg
|
||||||
|
rarity=U
|
||||||
|
type=Artifact
|
||||||
|
mana={1}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text={W}, Sacrifice Dedicated Martyr: You gain 3 life.
|
text={W}, Sacrifice Dedicated Martyr: You gain 3 life.
|
||||||
id=31771
|
id=31771
|
||||||
name=Dedicated Martyr
|
name=Dedicated Martyr
|
||||||
@@ -306,6 +315,15 @@ toughness=1
|
|||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Tap all creatures without flying.
|
||||||
|
auto=tap all(creature[-flying])
|
||||||
|
id=31816
|
||||||
|
name=Deluge
|
||||||
|
rarity=U
|
||||||
|
type=Instant
|
||||||
|
mana={2}{U}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Destroy target artifact or land.
|
text=Destroy target artifact or land.
|
||||||
id=29867
|
id=29867
|
||||||
name=Demolish
|
name=Demolish
|
||||||
@@ -431,6 +449,17 @@ toughness=4
|
|||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Flame Burst deals X damage to target creature or player, where X is 2 plus the number of cards named Flame Burst in all graveyards.
|
||||||
|
target=creature,player
|
||||||
|
auto=Damage:2
|
||||||
|
auto=foreach(Flame Burst|graveyard) Damage:1
|
||||||
|
id=29767
|
||||||
|
name=Flame Burst
|
||||||
|
rarity=C
|
||||||
|
type=Instant
|
||||||
|
mana={1}{R}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text={B}, Discard a card from your hand: Fledgling Imp gains flying until end of turn.
|
text={B}, Discard a card from your hand: Fledgling Imp gains flying until end of turn.
|
||||||
id=31777
|
id=31777
|
||||||
name=Fledgling Imp
|
name=Fledgling Imp
|
||||||
@@ -698,6 +727,15 @@ toughness=*
|
|||||||
rarity=R
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text={2}, {T}, Sacrifice Mossfire Egg: Add {R}{G} to your mana pool. Draw a card.
|
||||||
|
auto={2}{T}{S}:Add{r}{R} && Draw:1
|
||||||
|
id=30010
|
||||||
|
name=Mossfire Egg
|
||||||
|
rarity=U
|
||||||
|
type=Artifact
|
||||||
|
mana={1}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text={1}{T}: Add {R}{G} to your mana pool.
|
text={1}{T}: Add {R}{G} to your mana pool.
|
||||||
id=29795
|
id=29795
|
||||||
name=Mossfire Valley
|
name=Mossfire Valley
|
||||||
@@ -742,6 +780,17 @@ subtype=Mountain
|
|||||||
rarity=L
|
rarity=L
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards.
|
||||||
|
target=creature
|
||||||
|
auto=3/3
|
||||||
|
auto=foreach(Muscle Burst|graveyard) 1/1
|
||||||
|
id=29788
|
||||||
|
name=Muscle Burst
|
||||||
|
rarity=C
|
||||||
|
type=Instant
|
||||||
|
mana={1}{G}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text={G}{T}: Target creature gets +2/+2 until end of turn.
|
text={G}{T}: Target creature gets +2/+2 until end of turn.
|
||||||
id=29771
|
id=29771
|
||||||
name=Nantuko Disciple
|
name=Nantuko Disciple
|
||||||
|
|||||||
@@ -490,14 +490,7 @@ power=4
|
|||||||
subtype=Horror
|
subtype=Horror
|
||||||
toughness=3
|
toughness=3
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text={2}, {T}, Sacrifice Darkwater Egg: Add {U}{B} to your mana pool. Draw a card.
|
|
||||||
id=30749
|
|
||||||
name=Darkwater Egg
|
|
||||||
rarity=U
|
|
||||||
type=Artifact
|
|
||||||
mana={1}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=At the beginning of your upkeep, remove a card in your graveyard from the game. Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from play, you may pay {1}. If you do, return that card to your hand."
|
text=At the beginning of your upkeep, remove a card in your graveyard from the game. Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from play, you may pay {1}. If you do, return that card to your hand."
|
||||||
id=29955
|
id=29955
|
||||||
@@ -538,14 +531,7 @@ rarity=R
|
|||||||
type=Enchantment
|
type=Enchantment
|
||||||
mana={3}{W}
|
mana={3}{W}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Tap all creatures without flying.
|
|
||||||
id=31816
|
|
||||||
name=Deluge
|
|
||||||
rarity=U
|
|
||||||
type=Instant
|
|
||||||
mana={2}{U}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Return target permanent to its owner's hand. Flashback {5}{U}{U} (You may play this card from your graveyard for its flashback cost. Then remove it from the game.)
|
text=Return target permanent to its owner's hand. Flashback {5}{U}{U} (You may play this card from your graveyard for its flashback cost. Then remove it from the game.)
|
||||||
id=29826
|
id=29826
|
||||||
@@ -629,7 +615,8 @@ rarity=R
|
|||||||
text=Dreamwinder can't attack unless defending player controls an Island. {U}, Sacrifice an Island: Target land becomes an Island until end of turn.
|
text=Dreamwinder can't attack unless defending player controls an Island. {U}, Sacrifice an Island: Target land becomes an Island until end of turn.
|
||||||
id=31802
|
id=31802
|
||||||
name=Dreamwinder
|
name=Dreamwinder
|
||||||
auto=aslongas(land[-island]|opponentinplay) cantattack
|
auto=aslongas(land[island]|opponentinplay) -cantattack
|
||||||
|
abilities=cantattack
|
||||||
rarity=C
|
rarity=C
|
||||||
type=Creature
|
type=Creature
|
||||||
mana={3}{U}
|
mana={3}{U}
|
||||||
@@ -775,14 +762,7 @@ rarity=C
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
mana={R}
|
mana={R}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Flame Burst deals X damage to target creature or player, where X is 2 plus the number of cards named Flame Burst in all graveyards.
|
|
||||||
id=29767
|
|
||||||
name=Flame Burst
|
|
||||||
rarity=C
|
|
||||||
type=Instant
|
|
||||||
mana={1}{R}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text={R}, Discard a card at random: Frenetic Ogre gets +3/+0 until end of turn.
|
text={R}, Discard a card at random: Frenetic Ogre gets +3/+0 until end of turn.
|
||||||
id=29855
|
id=29855
|
||||||
@@ -1176,14 +1156,7 @@ rarity=C
|
|||||||
type=Sorcery
|
type=Sorcery
|
||||||
mana={1}{B}
|
mana={1}{B}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text={2}, {T}, Sacrifice Mossfire Egg: Add {R}{G} to your mana pool. Draw a card.
|
|
||||||
id=30010
|
|
||||||
name=Mossfire Egg
|
|
||||||
rarity=U
|
|
||||||
type=Artifact
|
|
||||||
mana={1}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Target player removes all land cards in his or her graveyard from the game.
|
text=Target player removes all land cards in his or her graveyard from the game.
|
||||||
id=31740
|
id=31740
|
||||||
@@ -1192,14 +1165,7 @@ rarity=R
|
|||||||
type=Instant
|
type=Instant
|
||||||
mana={2}{R}
|
mana={2}{R}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Target creature gets +X/+X until end of turn, where X is 3 plus the number of cards named Muscle Burst in all graveyards.
|
|
||||||
id=29788
|
|
||||||
name=Muscle Burst
|
|
||||||
rarity=C
|
|
||||||
type=Instant
|
|
||||||
mana={1}{G}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Protection from black and from red Threshold - Mystic Crusader gets +1/+1 and has flying as long as seven or more cards are in your graveyard.
|
text=Protection from black and from red Threshold - Mystic Crusader gets +1/+1 and has flying as long as seven or more cards are in your graveyard.
|
||||||
id=29802
|
id=29802
|
||||||
|
|||||||
@@ -57,6 +57,19 @@ mana={U}
|
|||||||
type=Instant
|
type=Instant
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Shroud (This permanent can't be the target of spells or abilities.) Whenever you play an enchantment spell, draw a card.
|
||||||
|
abilities=shroud
|
||||||
|
auto=@movedTo(enchantment|mystack):draw:1
|
||||||
|
id=5686
|
||||||
|
name=Argothian Enchantress
|
||||||
|
rarity=R
|
||||||
|
type=Creature
|
||||||
|
mana={1}{G}
|
||||||
|
power=0
|
||||||
|
subtype=Human Druid
|
||||||
|
toughness=1
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Trample
|
text=Trample
|
||||||
id=5862
|
id=5862
|
||||||
name=Argothian swine
|
name=Argothian swine
|
||||||
@@ -70,6 +83,15 @@ toughness=3
|
|||||||
abilities=trample
|
abilities=trample
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
text=Nonbasic lands don't untap during their controllers' untap steps.
|
||||||
|
auto=lord(land[-basic]) doesnotuntap
|
||||||
|
id=5711
|
||||||
|
name=Back to Basics
|
||||||
|
rarity=R
|
||||||
|
type=Enchantment
|
||||||
|
mana={2}{U}
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
text=Legendary {2}, Sacrifice a permanent: Return target creature to its owner's hand.
|
text=Legendary {2}, Sacrifice a permanent: Return target creature to its owner's hand.
|
||||||
id=9856
|
id=9856
|
||||||
name=Barrin, Master Wizard
|
name=Barrin, Master Wizard
|
||||||
|
|||||||
@@ -101,17 +101,7 @@ power=2
|
|||||||
subtype=Elf Druid
|
subtype=Elf Druid
|
||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Shroud (This permanent can't be the target of spells or abilities.) Whenever you play an enchantment spell, draw a card.
|
|
||||||
id=5686
|
|
||||||
name=Argothian Enchantress
|
|
||||||
rarity=R
|
|
||||||
type=Creature
|
|
||||||
mana={1}{G}
|
|
||||||
power=0
|
|
||||||
subtype=Human Druid
|
|
||||||
toughness=1
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=Trample When Argothian Wurm comes into play, any player may sacrifice a land. If a player does, put Argothian Wurm on top of its owner's library.
|
text=Trample When Argothian Wurm comes into play, any player may sacrifice a land. If a player does, put Argothian Wurm on top of its owner's library.
|
||||||
id=5769
|
id=5769
|
||||||
@@ -131,14 +121,7 @@ rarity=R
|
|||||||
type=Enchantment
|
type=Enchantment
|
||||||
mana={2}{U}
|
mana={2}{U}
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
|
||||||
text=Nonbasic lands don't untap during their controllers' untap steps.
|
|
||||||
id=5711
|
|
||||||
name=Back to Basics
|
|
||||||
rarity=R
|
|
||||||
type=Enchantment
|
|
||||||
mana={2}{U}
|
|
||||||
[/card]
|
|
||||||
[card]
|
[card]
|
||||||
text=At the beginning of your upkeep, you may put a page counter on Barrin's Codex. {4}, {T}, Sacrifice Barrin's Codex: Draw X cards, where X is the number of page counters on Barrin's Codex.
|
text=At the beginning of your upkeep, you may put a page counter on Barrin's Codex. {4}, {T}, Sacrifice Barrin's Codex: Draw X cards, where X is the number of page counters on Barrin's Codex.
|
||||||
id=5735
|
id=5735
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ ankh_of_mishra.txt
|
|||||||
arcanis_the_omnipotent.txt
|
arcanis_the_omnipotent.txt
|
||||||
arcanis_the_omnipotent2.txt
|
arcanis_the_omnipotent2.txt
|
||||||
ardakar_wastes.txt
|
ardakar_wastes.txt
|
||||||
|
argothian_enchantress.txt
|
||||||
ascendant_evincar.txt
|
ascendant_evincar.txt
|
||||||
ascendant_evincar2.txt
|
ascendant_evincar2.txt
|
||||||
ascendant_evincar3.txt
|
ascendant_evincar3.txt
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#Testing Argothian Enchantress
|
||||||
|
#Whenever you play an enchantment spell, draw a card.
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Argothian Enchantress
|
||||||
|
hand:lifeforce
|
||||||
|
library:plains
|
||||||
|
manapool:{G}{G}
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
lifeforce
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Argothian Enchantress,lifeforce
|
||||||
|
hand:plains
|
||||||
|
manapool{0}
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -146,7 +146,7 @@ class ActionStack :public GuiLayer{
|
|||||||
Player * askIfWishesToInterrupt;
|
Player * askIfWishesToInterrupt;
|
||||||
int garbageCollect();
|
int garbageCollect();
|
||||||
int addAction(Interruptible * interruptible);
|
int addAction(Interruptible * interruptible);
|
||||||
int addSpell(MTGCardInstance* card, Targetable * targets[], int nbtargets, ManaCost * mana);
|
Spell * addSpell(MTGCardInstance* card, Targetable * targets[], int nbtargets, ManaCost * mana);
|
||||||
int AddNextGamePhase();
|
int AddNextGamePhase();
|
||||||
int addPutInGraveyard(MTGCardInstance * card);
|
int addPutInGraveyard(MTGCardInstance * card);
|
||||||
int addDraw(Player * player, int nbcards = 1);
|
int addDraw(Player * player, int nbcards = 1);
|
||||||
|
|||||||
@@ -21,6 +21,40 @@
|
|||||||
using std::map;
|
using std::map;
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
//Triggers
|
||||||
|
//
|
||||||
|
|
||||||
|
class TrCardAddedToZone:public TriggeredAbility{
|
||||||
|
public:
|
||||||
|
TargetChooser * toTc;
|
||||||
|
TargetZoneChooser * fromTc;
|
||||||
|
TrCardAddedToZone::TrCardAddedToZone(int id,MTGCardInstance * source, TargetChooser * toTc, TargetZoneChooser * fromTc = NULL):TriggeredAbility(id,source), fromTc(fromTc),toTc(toTc){
|
||||||
|
}
|
||||||
|
|
||||||
|
int resolve(){
|
||||||
|
return 0; //This is a trigger, this function should not be called
|
||||||
|
}
|
||||||
|
|
||||||
|
int triggerOnEvent(WEvent * event){
|
||||||
|
WEventZoneChange * e = dynamic_cast<WEventZoneChange*>(event);
|
||||||
|
if (!e) return 0;
|
||||||
|
if (!toTc->canTarget(e->card)) return 0;
|
||||||
|
if (fromTc && !fromTc->targetsZone(e->from)) return 0;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
~TrCardAddedToZone(){
|
||||||
|
SAFE_DELETE(toTc);
|
||||||
|
SAFE_DELETE(fromTc);
|
||||||
|
}
|
||||||
|
|
||||||
|
TrCardAddedToZone * clone() const{
|
||||||
|
TrCardAddedToZone * a = NEW TrCardAddedToZone(*this);
|
||||||
|
a->isClone = 1;
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class AAFizzler:public ActivatedAbility{
|
class AAFizzler:public ActivatedAbility{
|
||||||
|
|||||||
@@ -88,7 +88,9 @@ class TriggeredAbility:public MTGAbility{
|
|||||||
TriggeredAbility(int id, MTGCardInstance * _source, Targetable * _target);
|
TriggeredAbility(int id, MTGCardInstance * _source, Targetable * _target);
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
virtual void Render(){};
|
virtual void Render(){};
|
||||||
virtual int trigger()=0;
|
virtual int trigger(){return 0;};
|
||||||
|
virtual int triggerOnEvent(WEvent * e){return 0;};
|
||||||
|
int receiveEvent(WEvent * e);
|
||||||
virtual int resolve() = 0;
|
virtual int resolve() = 0;
|
||||||
virtual TriggeredAbility* clone() const = 0;
|
virtual TriggeredAbility* clone() const = 0;
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
@@ -183,11 +185,12 @@ class GenericTriggeredAbility:public TriggeredAbility{
|
|||||||
MTGAbility * destroyCondition;
|
MTGAbility * destroyCondition;
|
||||||
GenericTriggeredAbility(int id, MTGCardInstance * _source, TriggeredAbility * _t, MTGAbility * a,MTGAbility * dc = NULL, Targetable * _target = NULL);
|
GenericTriggeredAbility(int id, MTGCardInstance * _source, TriggeredAbility * _t, MTGAbility * a,MTGAbility * dc = NULL, Targetable * _target = NULL);
|
||||||
virtual int trigger();
|
virtual int trigger();
|
||||||
virtual int receiveEvent(WEvent * e);
|
virtual int triggerOnEvent(WEvent * e);
|
||||||
virtual int resolve();
|
virtual int resolve();
|
||||||
virtual int testDestroy();
|
virtual int testDestroy();
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
virtual GenericTriggeredAbility* clone() const;
|
virtual GenericTriggeredAbility* clone() const;
|
||||||
|
const char * getMenuText();
|
||||||
~GenericTriggeredAbility();
|
~GenericTriggeredAbility();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ int ActionStack::addAction(Interruptible * action){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ActionStack::addSpell(MTGCardInstance * _source, Targetable * _targets[], int _nbtargets, ManaCost * mana){
|
Spell * ActionStack::addSpell(MTGCardInstance * _source, Targetable * _targets[], int _nbtargets, ManaCost * mana){
|
||||||
#if defined (WIN32) || defined (LINUX)
|
#if defined (WIN32) || defined (LINUX)
|
||||||
char buf[4096], *p = buf;
|
char buf[4096], *p = buf;
|
||||||
sprintf(buf, "Add spell\n");
|
sprintf(buf, "Add spell\n");
|
||||||
@@ -333,7 +333,7 @@ int ActionStack::addSpell(MTGCardInstance * _source, Targetable * _targets[], in
|
|||||||
GameOptions::GetInstance()->values[OPTIONS_INTERRUPTMYSPELLS].getIntValue() == 0){
|
GameOptions::GetInstance()->values[OPTIONS_INTERRUPTMYSPELLS].getIntValue() == 0){
|
||||||
interruptDecision[0] = DONT_INTERRUPT;
|
interruptDecision[0] = DONT_INTERRUPT;
|
||||||
}
|
}
|
||||||
return result;
|
return spell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,17 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell
|
|||||||
size_t found = magicText.find("@");
|
size_t found = magicText.find("@");
|
||||||
if (found == string::npos) return NULL;
|
if (found == string::npos) return NULL;
|
||||||
|
|
||||||
|
//Card Changed Zone
|
||||||
|
found = magicText.find("movedto(");
|
||||||
|
if (found != string::npos){
|
||||||
|
size_t end = magicText.find (")");
|
||||||
|
string starget = magicText.substr(found+8,end - found - 8);
|
||||||
|
TargetChooserFactory tcf;
|
||||||
|
TargetChooser *toTc = tcf.createTargetChooser(starget,card);
|
||||||
|
toTc->targetter = NULL;
|
||||||
|
return NEW TrCardAddedToZone(id,card,toTc);
|
||||||
|
}
|
||||||
|
|
||||||
//Next Time...
|
//Next Time...
|
||||||
found = magicText.find("next");
|
found = magicText.find("next");
|
||||||
if (found != string::npos){
|
if (found != string::npos){
|
||||||
@@ -339,13 +350,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
found = s.find(destroys[i]);
|
found = s.find(destroys[i]);
|
||||||
if (found != string::npos){
|
if (found != string::npos){
|
||||||
int bury = destroyTypes[i];
|
int bury = destroyTypes[i];
|
||||||
/*if (trigger){
|
|
||||||
if (bury){
|
|
||||||
BuryEvent * action = NEW BuryEvent();
|
|
||||||
return NEW GenericTriggeredAbility(id, card,trigger,action);
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}*/
|
|
||||||
MTGAbility * a = NEW AADestroyer(id,card,target,bury);
|
MTGAbility * a = NEW AADestroyer(id,card,target,bury);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
@@ -403,11 +407,6 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
nbcards = atoi(s.substr(start+1).c_str());
|
nbcards = atoi(s.substr(start+1).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (trigger){
|
|
||||||
DrawEvent * action = NEW DrawEvent(card->controller(),nbcards);
|
|
||||||
return NEW GenericTriggeredAbility(id, card,trigger,action);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
MTGAbility * a = NEW AADrawer(id,card,NULL,nbcards);
|
MTGAbility * a = NEW AADrawer(id,card,NULL,nbcards);
|
||||||
a->oneShot = 1;
|
a->oneShot = 1;
|
||||||
return a;
|
return a;
|
||||||
@@ -2205,6 +2204,14 @@ TriggeredAbility::TriggeredAbility(int id, MTGCardInstance * card, Targetable *
|
|||||||
TriggeredAbility::TriggeredAbility(int id, MTGCardInstance * card):MTGAbility(id,card){
|
TriggeredAbility::TriggeredAbility(int id, MTGCardInstance * card):MTGAbility(id,card){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TriggeredAbility::receiveEvent(WEvent * e){
|
||||||
|
if (triggerOnEvent(e)){
|
||||||
|
fireAbility();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void TriggeredAbility::Update(float dt){
|
void TriggeredAbility::Update(float dt){
|
||||||
if (trigger()) fireAbility();
|
if (trigger()) fireAbility();
|
||||||
}
|
}
|
||||||
@@ -2397,9 +2404,8 @@ int GenericTriggeredAbility::trigger(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int GenericTriggeredAbility::receiveEvent(WEvent * e){
|
int GenericTriggeredAbility::triggerOnEvent(WEvent * e){
|
||||||
if (t->receiveEvent(e)) return resolve();
|
return t->triggerOnEvent(e);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericTriggeredAbility::Update(float dt){
|
void GenericTriggeredAbility::Update(float dt){
|
||||||
@@ -2427,6 +2433,10 @@ GenericTriggeredAbility::~GenericTriggeredAbility(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * GenericTriggeredAbility::getMenuText(){
|
||||||
|
return ability->getMenuText();
|
||||||
|
}
|
||||||
|
|
||||||
GenericTriggeredAbility* GenericTriggeredAbility::clone() const{
|
GenericTriggeredAbility* GenericTriggeredAbility::clone() const{
|
||||||
GenericTriggeredAbility * a = NEW GenericTriggeredAbility(*this);
|
GenericTriggeredAbility * a = NEW GenericTriggeredAbility(*this);
|
||||||
a->isClone = 1;
|
a->isClone = 1;
|
||||||
|
|||||||
@@ -502,6 +502,14 @@ int MTGGameZone::zoneStringToId(string zoneName){
|
|||||||
"targetcontrollerexile",
|
"targetcontrollerexile",
|
||||||
"ownerexile",
|
"ownerexile",
|
||||||
"exile",
|
"exile",
|
||||||
|
|
||||||
|
"mystack",
|
||||||
|
"opponentstack",
|
||||||
|
"targetownerstack",
|
||||||
|
"targetcontrollerstack",
|
||||||
|
"ownerstack",
|
||||||
|
"stack",
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int values[] = {
|
int values[] = {
|
||||||
@@ -553,6 +561,13 @@ int MTGGameZone::zoneStringToId(string zoneName){
|
|||||||
TARGET_CONTROLLER_EXILE,
|
TARGET_CONTROLLER_EXILE,
|
||||||
OWNER_EXILE ,
|
OWNER_EXILE ,
|
||||||
EXILE,
|
EXILE,
|
||||||
|
|
||||||
|
MY_STACK,
|
||||||
|
OPPONENT_STACK,
|
||||||
|
TARGET_OWNER_STACK ,
|
||||||
|
TARGET_CONTROLLER_STACK,
|
||||||
|
OWNER_STACK ,
|
||||||
|
STACK,
|
||||||
};
|
};
|
||||||
|
|
||||||
int max = sizeof(values) / sizeof*(values);
|
int max = sizeof(values) / sizeof*(values);
|
||||||
|
|||||||
@@ -60,15 +60,15 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card){
|
|||||||
delete spell;
|
delete spell;
|
||||||
player->canPutLandsIntoPlay--;
|
player->canPutLandsIntoPlay--;
|
||||||
}else{
|
}else{
|
||||||
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->stack);
|
Spell * spell = NULL;
|
||||||
if (game->targetChooser){
|
if (game->targetChooser){
|
||||||
game->mLayers->stackLayer()->addSpell(copy,game->targetChooser->targets,game->targetChooser->cursor, spellCost);
|
spell = game->mLayers->stackLayer()->addSpell(card,game->targetChooser->targets,game->targetChooser->cursor, spellCost);
|
||||||
SAFE_DELETE(game->targetChooser);
|
SAFE_DELETE(game->targetChooser);
|
||||||
}else{
|
}else{
|
||||||
game->mLayers->stackLayer()->addSpell(copy,NULL,0, spellCost);
|
spell = game->mLayers->stackLayer()->addSpell(card,NULL,0, spellCost);
|
||||||
}
|
}
|
||||||
|
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->stack);
|
||||||
|
spell->source = copy;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -741,10 +741,6 @@
|
|||||||
RelativePath=".\include\MTGRules.h"
|
RelativePath=".\include\MTGRules.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\include\MTGSpellStack.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath=".\include\OptionItem.h"
|
RelativePath=".\include\OptionItem.h"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user