Erwan
- fix for issue 301 (creatures go to graveyard) - This adds an important change to "movedTo", which now accepts a "full" target description in both "from" and "movedTo". The point is that a card does not move to "creature|graveyard" from "battlefield" but moves from "creature|battlefield" to "graveyard".
This commit is contained in:
@@ -17,7 +17,7 @@ abilities=exalted
|
||||
[/card]
|
||||
[card]
|
||||
text=Shroud Whenever another creature is put into a graveyard from the battlefield, you may put a +1/+1 counter on Algae Gharial.
|
||||
auto=@movedTo(other creature|graveyard) from(battlefield):may counter(1/1)
|
||||
auto=@movedTo(graveyard) from(other creature|battlefield):may counter(1/1)
|
||||
id=174986
|
||||
name=Algae Gharial
|
||||
rarity=U
|
||||
@@ -218,7 +218,7 @@ abilities=flying
|
||||
[card]
|
||||
text=Enchant artifact or creature. Enchanted permanent doesn't untap during its controller's untap step.
|
||||
id=175042
|
||||
|
||||
|
||||
target=creature,artifact
|
||||
auto=doesnotuntap
|
||||
name=Coma Veil
|
||||
@@ -308,7 +308,7 @@ toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=Whenever another creature is put into a graveyard from the battlefield, you may gain 1 life.
|
||||
auto=@movedTo(other creature|graveyard) from(battlefield):may life:1
|
||||
auto=@movedTo(graveyard) from(other creature|battlefield):may life:1
|
||||
id=175073
|
||||
name=Deathgreeter
|
||||
rarity=C
|
||||
@@ -589,7 +589,7 @@ abilities=flying,trample,haste
|
||||
[/card]
|
||||
[card]
|
||||
text=Whenever another creature is put into a graveyard from the battlefield, you may have Hissing Iguanar deal 1 damage to target player.
|
||||
auto=@movedTo(other creature|graveyard) from(battlefield):may damage:1 target(player)
|
||||
auto=@movedTo(graveyard) from(other creature|battlefield):may damage:1 target(player)
|
||||
id=174873
|
||||
name=Hissing Iguanar
|
||||
rarity=C
|
||||
@@ -1178,7 +1178,7 @@ toughness=7
|
||||
[/card]
|
||||
[card]
|
||||
text=First strike Whenever another creature is put into a graveyard from the battlefield, you may put a +1/+1 counter on Rockslide Elemental.
|
||||
auto=@movedTo(other creature|graveyard) from(battlefield):may counter(1/1)
|
||||
auto=@movedTo(graveyard) from(other creature|battlefield):may counter(1/1)
|
||||
id=174988
|
||||
name=Rockslide Elemental
|
||||
rarity=U
|
||||
@@ -1239,7 +1239,7 @@ type=Land
|
||||
[/card]
|
||||
[card]
|
||||
text=Flying Whenever another creature is put into a graveyard from the battlefield, you may put a +1/+1 counter on Scavenger Drake.
|
||||
auto=@movedTo(other creature|graveyard) from(battlefield):may counter(1/1)
|
||||
auto=@movedTo(graveyard) from(other creature|battlefield):may counter(1/1)
|
||||
id=174987
|
||||
name=Scavenger Drake
|
||||
rarity=U
|
||||
|
||||
@@ -411,7 +411,7 @@ type=Sorcery
|
||||
[card]
|
||||
text=Whenever Mycoid Shepherd or another creature you control with power 5 or greater is put into a graveyard from the battlefield, you may gain 5 life.
|
||||
auto=@movedTo(this|graveyard) from(myBattlefield):may life:5 controller
|
||||
auto=@movedTo(other creature[power>=5]|graveyard) from(myBattlefield):may life:5 controller
|
||||
auto=@movedTo(graveyard) from(other creature[power>=5]|myBattlefield):may life:5 controller
|
||||
id=179548
|
||||
name=Mycoid Shepherd
|
||||
rarity=R
|
||||
|
||||
@@ -996,7 +996,7 @@ abilities=flying
|
||||
[card]
|
||||
text=Enchant creature When a creature is put into a graveyard from the battlefield, destroy enchanted creature.
|
||||
target=creature
|
||||
auto=@movedTo(creature|graveyard) from(battlefield):destroy
|
||||
auto=@movedTo(graveyard) from(creature|battlefield):destroy
|
||||
id=179891
|
||||
name=Yoke of the Damned
|
||||
rarity=C
|
||||
|
||||
@@ -369,7 +369,7 @@ toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=Whenever another nontoken creature you control is put into a graveyard from the battlefield, put a 3/1 black and red Graveborn creature token with haste onto the battlefield.
|
||||
auto=@movedto(other creature|myGraveyard) from(myBattlefield):token(Graveborn, Creature Graveborn,3/1,haste red black)
|
||||
auto=@movedto(myGraveyard) from(other creature|myBattlefield):token(Graveborn, Creature Graveborn,3/1,haste red black)
|
||||
id=121261
|
||||
name=Sek'Kuar, Deathkeeper
|
||||
rarity=R
|
||||
|
||||
@@ -1016,7 +1016,7 @@ subtype=Aura
|
||||
[/card]
|
||||
[card]
|
||||
text=Whenever another nontoken Elf is put into your graveyard from the battlefield, you may put a 1/1 green Elf Warrior creature token onto the battlefield.
|
||||
auto=@movedTo(other elf|graveyard) from(battlefield):may token(Elf Warrior,creature elf warrior,1/1,green)
|
||||
auto=@movedTo(graveyard) from(other elf|battlefield):may token(Elf Warrior,creature elf warrior,1/1,green)
|
||||
id=146167
|
||||
name=Prowess of the Fair
|
||||
rarity=U
|
||||
|
||||
@@ -224,7 +224,7 @@ subtype=Aura
|
||||
[card]
|
||||
text=Whenever an artifact is put into a graveyard from the battlefield, you may have target opponent lose 1 life.
|
||||
id=49090
|
||||
auto=@movedTo(artifact|graveyard) from(battlefield):may life:-1 opponent
|
||||
auto=@movedTo(graveyard) from(artifact|battlefield):may life:-1 opponent
|
||||
name=Disciple of the Vault
|
||||
rarity=C
|
||||
mana={B}
|
||||
@@ -244,7 +244,7 @@ type=Artifact
|
||||
[/card]
|
||||
[card]
|
||||
text=Protection from white. At the end of your turn, you lose 4 life. Whenever a creature is put into a graveyard from the battlefield, you gain 2 life.
|
||||
auto=@movedTo(creature|graveyard) from(battlefield):life:2
|
||||
auto=@movedTo(graveyard) from(creature|battlefield):life:2
|
||||
auto=@each my end:life:-4 controller
|
||||
id=50537
|
||||
name=Dross Harvester
|
||||
@@ -270,7 +270,7 @@ abilities=fear
|
||||
[/card]
|
||||
[card]
|
||||
text=Whenever Dross Scorpion or another artifact creature is put into a graveyard from the battlefield, you may untap target artifact.
|
||||
auto=@movedTo(creature[artifact]|graveyard) from(battlefield):may untap target(artifact)
|
||||
auto=@movedTo(graveyard) from(creature[artifact]|battlefield):may untap target(artifact)
|
||||
id=46434
|
||||
name=Dross Scorpion
|
||||
rarity=C
|
||||
@@ -869,7 +869,7 @@ subtype=Mountain
|
||||
[/card]
|
||||
[card]
|
||||
text=When Myr Retriever is put into a graveyard from the battlefield, return another target artifact card from your graveyard to your hand.
|
||||
auto=@movedTo(this|graveyard) from(battlefield):moveTo(myhand) target(other artifact|mygraveyard)
|
||||
auto=@movedTo(this|graveyard) from(battlefield):moveTo(myhand) target(other artifact|mygraveyard)
|
||||
|
||||
id=46126
|
||||
name=Myr Retriever
|
||||
|
||||
@@ -992,7 +992,7 @@ abilities=flying
|
||||
[card]
|
||||
text=Whenever a creature is put into a graveyard from the battlefield, you gain 1 life.
|
||||
id=136514
|
||||
auto=@movedTo(creature|graveyard) from(battlefield):life:1 controller
|
||||
auto=@movedTo(graveyard) from(creature|battlefield):life:1 controller
|
||||
name=Moonlit Wake
|
||||
rarity=U
|
||||
mana={2}{W}
|
||||
|
||||
@@ -1606,7 +1606,7 @@ abilities=reach
|
||||
[/card]
|
||||
[card]
|
||||
text=Flying Whenever a creature with flying is put into a graveyard from the battlefield, put a +1/+1 counter on Soulcatcher.
|
||||
auto=@movedTo(creature[flying]|graveyard) from(battlefield):counter(1/1)
|
||||
auto=@movedTo(graveyard) from(creature[flying]|battlefield):counter(1/1)
|
||||
id=31865
|
||||
name=Soulcatcher
|
||||
rarity=U
|
||||
|
||||
@@ -632,7 +632,7 @@ mana={2}{R}
|
||||
type=Creature
|
||||
subtype=Goblin
|
||||
auto={T}:Damage:1 target(creature,player)
|
||||
auto=@movedTo(creature|graveyard) from(battlefield):untap
|
||||
auto=@movedTo(graveyard) from(creature|battlefield):untap
|
||||
power=1
|
||||
toughness=1
|
||||
abilities=doesnotuntap
|
||||
@@ -1130,7 +1130,7 @@ mana={2}{B}
|
||||
type=Creature
|
||||
subtype=Zombie Cleric
|
||||
auto=@movedTo(this|graveyard) from(battlefield):token(Zombie,creature token Zombie, 2/2,black)
|
||||
auto=@movedTo(other cleric|graveyard) from(battlefield):token(Zombie,creature token Zombie, 2/2,black)
|
||||
auto=@movedTo(graveyard) from(other cleric|battlefield):token(Zombie,creature token Zombie, 2/2,black)
|
||||
power=2
|
||||
toughness=2
|
||||
[/card]
|
||||
|
||||
@@ -549,7 +549,7 @@ abilities=mountainwalk
|
||||
[card]
|
||||
text=Whenever a nontoken creature you control is put into a graveyard from the battlefield, put a 1/1 green Saproling creature token onto the battlefield.
|
||||
id=89069
|
||||
auto=@movedto(creature[-token]|graveyard) from(myBattlefield):token(Saproling,creature saproling, 1/1,green)
|
||||
auto=@movedto(graveyard) from(creature[-token]|myBattlefield):token(Saproling,creature saproling, 1/1,green)
|
||||
name=Golgari Germination
|
||||
rarity=U
|
||||
type=Enchantment
|
||||
|
||||
@@ -397,7 +397,7 @@ rarity=U
|
||||
mana={3}{B}
|
||||
auto=@next my endofturn:bury
|
||||
auto=@next my endofturn:life:-8 controller
|
||||
auto=@movedto(* other|graveyard):moveto(opponentBattlefield)
|
||||
auto=@movedto(graveyard) from(* other|*):moveto(opponentBattlefield)
|
||||
type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
@@ -540,8 +540,8 @@ toughness=1
|
||||
[/card]
|
||||
[card]
|
||||
text=When a creature you control is put into a graveyard from the battlefield, sacrifice Promise of Bunrei. If you do, put four 1/1 colorless Spirit creature tokens onto the battlefield.
|
||||
auto=@movedto(creature|graveyard) from(myBattlefield):token(Spirit,Creature Spirit,1/1,)*4
|
||||
auto=@movedto(creature|graveyard) from(myBattlefield):bury
|
||||
auto=@movedto(graveyard) from(creature|myBattlefield):token(Spirit,Creature Spirit,1/1,)*4
|
||||
auto=@movedto(graveyard) from(creature|myBattlefield):bury
|
||||
id=84376
|
||||
name=Promise of Bunrei
|
||||
rarity=R
|
||||
|
||||
@@ -377,7 +377,7 @@ type=Enchantment
|
||||
[/card]
|
||||
[card]
|
||||
text=Shadow (This creature can block or be blocked by only creatures with shadow.) Whenever a creature with shadow is put into a graveyard from the battlefield, put a +1/+1 counter on Dauthi Ghoul.
|
||||
auto=@movedTo(creature[shadow]|graveyard) from(battlefield):counter(1/1)
|
||||
auto=@movedTo(graveyard) from(creature[shadow]|battlefield):counter(1/1)
|
||||
id=4649
|
||||
name=Dauthi Ghoul
|
||||
rarity=U
|
||||
@@ -1490,7 +1490,7 @@ toughness=1
|
||||
[card]
|
||||
text=Enchant creature Whenever a creature is put into a graveyard from the battlefield, put a +1/+1 counter on enchanted creature.
|
||||
target=creature
|
||||
auto=@movedTo(creature|graveyard) from(battlefield):counter(1/1)
|
||||
auto=@movedTo(graveyard) from(creature|battlefield):counter(1/1)
|
||||
id=4682
|
||||
name=Sadistic Glee
|
||||
rarity=C
|
||||
|
||||
@@ -130,8 +130,8 @@ abilities=flying,cloud
|
||||
[card]
|
||||
text=Whenever a creature is put into a graveyard from the battlefield, Dingus Staff deals 2 damage to that creature's controller.
|
||||
id=4432
|
||||
auto=@movedTo(creature|mygraveyard) from(myBattlefield):life:-2 controller
|
||||
auto=@movedTo(creature|opponentgraveyard) from(opponentBattlefield):life:-2 opponent
|
||||
auto=@movedTo(mygraveyard) from(creature|myBattlefield):life:-2 controller
|
||||
auto=@movedTo(opponentgraveyard) from(creature|opponentBattlefield):life:-2 opponent
|
||||
name=Dingus Staff
|
||||
rarity=U
|
||||
mana={4}
|
||||
|
||||
@@ -269,6 +269,7 @@ kird_ape.txt
|
||||
kjeldoran_frostbeast1.txt
|
||||
knight_captain_of_eos_i294.txt
|
||||
knight_captain_of_eos_i294_2.txt
|
||||
kormus_bell_i301.txt
|
||||
krosan_beast.txt
|
||||
krosan_beast2.txt
|
||||
kraken_eye.txt
|
||||
|
||||
@@ -101,8 +101,9 @@ public:
|
||||
class TrCardAddedToZone:public TriggeredAbility{
|
||||
public:
|
||||
TargetChooser * toTc;
|
||||
TargetZoneChooser * fromTc;
|
||||
TrCardAddedToZone(int id, MTGCardInstance * source, TargetChooser * toTc, TargetZoneChooser * fromTc = NULL):TriggeredAbility(id,source), toTc(toTc), fromTc(fromTc){}
|
||||
TargetZoneChooser * fromTcZone;
|
||||
TargetChooser * fromTcCard;
|
||||
TrCardAddedToZone(int id, MTGCardInstance * source, TargetChooser * toTc, TargetZoneChooser * fromTcZone = NULL,TargetChooser * fromTcCard = NULL):TriggeredAbility(id,source), toTc(toTc), fromTcZone(fromTcZone), fromTcCard(fromTcCard){}
|
||||
|
||||
int resolve(){
|
||||
return 0; //This is a trigger, this function should not be called
|
||||
@@ -111,8 +112,10 @@ public:
|
||||
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;
|
||||
if (fromTcZone && !fromTcZone->targetsZone(e->from)) return 0;
|
||||
if (fromTcCard && !fromTcCard->canTarget(e->card->previous)) return 0;
|
||||
|
||||
//Battlefield is a special case. We usually don't want to trigger when a card comes from battlefield to battlefield
|
||||
// http://code.google.com/p/wagic/issues/detail?id=179
|
||||
@@ -125,7 +128,8 @@ public:
|
||||
|
||||
~TrCardAddedToZone(){
|
||||
SAFE_DELETE(toTc);
|
||||
SAFE_DELETE(fromTc);
|
||||
SAFE_DELETE(fromTcZone);
|
||||
SAFE_DELETE(fromTcCard);
|
||||
}
|
||||
|
||||
TrCardAddedToZone * clone() const{
|
||||
|
||||
@@ -20,6 +20,8 @@ class MTGGameZone {
|
||||
public:
|
||||
|
||||
enum{
|
||||
ALL_ZONES = -1,
|
||||
|
||||
MY_GRAVEYARD = 11,
|
||||
OPPONENT_GRAVEYARD = 12,
|
||||
TARGET_OWNER_GRAVEYARD = 13,
|
||||
|
||||
@@ -64,20 +64,30 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell
|
||||
if (found != string::npos){
|
||||
size_t end = s.find (")");
|
||||
string starget = s.substr(found+8,end - found - 8);
|
||||
if (starget.find("|") == string::npos) starget.insert(0,"*|");
|
||||
TargetChooserFactory tcf;
|
||||
TargetChooser *toTc = tcf.createTargetChooser(starget,card);
|
||||
toTc->targetter = NULL;
|
||||
|
||||
TargetChooser *fromTc = NULL;
|
||||
TargetChooser * fromTcCard = NULL;
|
||||
found = s.find("from(");
|
||||
if (found != string::npos){
|
||||
end = s.find ("|", found);
|
||||
if (end == string::npos) {
|
||||
fromTcCard = tcf.createTargetChooser("*",card);
|
||||
found = found + 5;
|
||||
}else{
|
||||
fromTcCard = tcf.createTargetChooser(s.substr(found + 5, end - found - 5).append("|*"),card);
|
||||
found = end + 1;
|
||||
}
|
||||
fromTcCard->setAllZones();
|
||||
end = s.find (")", found);
|
||||
starget = s.substr(found+5,end - found - 5);
|
||||
if (starget.find("|") == string::npos) starget.insert(0,"*|");
|
||||
starget = s.substr(found,end - found).insert(0,"*|");
|
||||
fromTc = tcf.createTargetChooser(starget,card);
|
||||
fromTc->targetter = NULL;
|
||||
}
|
||||
return NEW TrCardAddedToZone(id,card,toTc,(TargetZoneChooser *)fromTc);
|
||||
return NEW TrCardAddedToZone(id,card,toTc,(TargetZoneChooser *)fromTc,fromTcCard);
|
||||
}
|
||||
|
||||
//Card Tapped
|
||||
|
||||
@@ -56,8 +56,9 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
}
|
||||
zones[nbzones] = MTGGameZone::MY_BATTLEFIELD;
|
||||
|
||||
//Graveyards
|
||||
if(zoneName.compare("graveyard") == 0){
|
||||
if(zoneName.compare("*") == 0){
|
||||
zones[nbzones] = MTGGameZone::ALL_ZONES;
|
||||
}else if(zoneName.compare("graveyard") == 0){
|
||||
zones[nbzones] = MTGGameZone::MY_GRAVEYARD;
|
||||
nbzones++;
|
||||
zones[nbzones] = MTGGameZone::OPPONENT_GRAVEYARD;
|
||||
@@ -590,21 +591,10 @@ int TargetZoneChooser::init(int * _zones, int _nbzones){
|
||||
|
||||
int TargetZoneChooser::setAllZones(){
|
||||
int zones[] = {
|
||||
MTGGameZone::MY_BATTLEFIELD,
|
||||
MTGGameZone::MY_EXILE,
|
||||
MTGGameZone::MY_GRAVEYARD,
|
||||
MTGGameZone::MY_HAND,
|
||||
MTGGameZone::MY_LIBRARY,
|
||||
MTGGameZone::MY_STACK,
|
||||
MTGGameZone::OPPONENT_BATTLEFIELD,
|
||||
MTGGameZone::OPPONENT_EXILE,
|
||||
MTGGameZone::OPPONENT_GRAVEYARD,
|
||||
MTGGameZone::OPPONENT_HAND,
|
||||
MTGGameZone::OPPONENT_LIBRARY,
|
||||
MTGGameZone::OPPONENT_STACK
|
||||
MTGGameZone::ALL_ZONES,
|
||||
};
|
||||
|
||||
init(zones,12);
|
||||
init(zones,1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -613,8 +603,10 @@ bool TargetZoneChooser::canTarget(Targetable * target){
|
||||
if (!TargetChooser::canTarget(target)) return false;
|
||||
if (target->typeAsTarget() == TARGET_CARD){
|
||||
MTGCardInstance * card = (MTGCardInstance *) target;
|
||||
for (int i = 0; i<nbzones; i++)
|
||||
for (int i = 0; i<nbzones; i++){
|
||||
if (zones[i] == MTGGameZone::ALL_ZONES) return true;
|
||||
if (MTGGameZone::intToZone(zones[i],source,card)->hasCard(card)) return true;
|
||||
}
|
||||
}else if (target->typeAsTarget() == TARGET_STACKACTION){
|
||||
OutputDebugString ("CHECKING INTERRUPTIBLE\n");
|
||||
Interruptible * action = (Interruptible *) target;
|
||||
|
||||
Reference in New Issue
Block a user