Erwan
- fix issue 168 (kudzu) - Fix issue 162 (copy VS shroud). This fix introduces a new keyword: NotATarget() instead of Target(). (Which was the best way for me to keep some kind of backward compatibility/ not alter the code too much / fix the bug)
This commit is contained in:
@@ -402,7 +402,7 @@ toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=As Clone comes into play, you may choose a creature in play. If you do, Clone comes into play as a copy of that creature.
|
||||
auto=may copy target(creature)
|
||||
auto=may copy NotATarget(creature)
|
||||
id=129501
|
||||
name=Clone
|
||||
rarity=R
|
||||
@@ -2141,7 +2141,7 @@ toughness=*
|
||||
[/card]
|
||||
[card]
|
||||
text=As Sculpting Steel comes into play, you may choose an artifact in play. If you do, Sculpting Steel comes into play as a copy of that artifact.
|
||||
auto=may copy target(artifact)
|
||||
auto=may copy notatarget(artifact)
|
||||
id=135241
|
||||
name=Sculpting Steel
|
||||
rarity=R
|
||||
|
||||
@@ -320,7 +320,7 @@ subtype=Shapeshifter
|
||||
power=0
|
||||
toughness=0
|
||||
text=You may have Clone enter the battlefield as a copy of any creature on the battlefield.
|
||||
auto=may copy target(creature)
|
||||
auto=may copy notatarget(creature)
|
||||
rarity=R
|
||||
[/card]
|
||||
[card]
|
||||
|
||||
@@ -1067,7 +1067,7 @@ toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
text=As Sculpting Steel enters the battlefield, you may choose an artifact on the battlefield. If you do, Sculpting Steel enters the battlefield as a copy of that artifact.
|
||||
auto=may copy target(artifact)
|
||||
auto=may copy notatarget(artifact)
|
||||
id=46720
|
||||
name=Sculpting Steel
|
||||
rarity=R
|
||||
|
||||
@@ -138,7 +138,7 @@ rarity=U
|
||||
mana={3}{U}
|
||||
type=Creature
|
||||
subtype=Shapeshifter
|
||||
auto=may copy target(creature)
|
||||
auto=may copy notatarget(creature)
|
||||
power=0
|
||||
toughness=0
|
||||
[/card]
|
||||
|
||||
@@ -24,7 +24,7 @@ abilities=first strike,protection from white
|
||||
[/card]
|
||||
[card]
|
||||
text=You may have Body Double enter the battlefield as a copy of any creature card in a graveyard.
|
||||
auto=may copy target(creature|graveyard)
|
||||
auto=may copy notatarget(creature|graveyard)
|
||||
id=124443
|
||||
name=Body Double
|
||||
rarity=R
|
||||
|
||||
@@ -363,7 +363,7 @@ toughness=4
|
||||
[/card]
|
||||
[card]
|
||||
text=You may have Clone enter the battlefield as a copy of any creature on the battlefield.
|
||||
auto=may copy target(creature)
|
||||
auto=may copy notAtarget(creature)
|
||||
id=1193
|
||||
name=Clone
|
||||
rarity=U
|
||||
|
||||
@@ -389,7 +389,7 @@ rarity=L
|
||||
text={R}, {T}, Discard a card: Destroy target blue permanent. {1}{R}, {T}, Discard a card: Jaya Ballard, Task Mage deals 3 damage to target creature or player. A creature dealt damage this way can't be regenerated this turn. {5}{R}{R}, {T}, Discard a card: Jaya Ballard deals 6 damage to each creature and each player.
|
||||
id=109752
|
||||
name=Jaya Ballard, Task Mage
|
||||
rarity=R
|
||||
rarity=R
|
||||
mana={1}{R}{R}
|
||||
type=Creature
|
||||
subtype=Human Spellshaper
|
||||
@@ -916,7 +916,7 @@ text=As Vesuva enters the battlefield, you may choose a land on the battlefield.
|
||||
id=113543
|
||||
name=Vesuva
|
||||
auto=tap
|
||||
auto=may copy target(land)
|
||||
auto=may copy notatarget(land)
|
||||
rarity=R
|
||||
type=Land
|
||||
[/card]
|
||||
|
||||
@@ -128,6 +128,7 @@ circle_of_protection_i211.txt
|
||||
civic_wayfinder.txt
|
||||
clone.txt
|
||||
clone2.txt
|
||||
clone3.txt
|
||||
cockatrice.txt
|
||||
colossus_of_sardia1.txt
|
||||
colossus_of_sardia2.txt
|
||||
@@ -242,6 +243,7 @@ kraken_eye3.txt
|
||||
kraken_eye4.txt
|
||||
kudzu.txt
|
||||
kudzu2.txt
|
||||
kudzu_i168.txt
|
||||
leveler.txt
|
||||
lhurgoyf.txt
|
||||
liability.txt
|
||||
|
||||
22
projects/mtg/bin/Res/test/clone3.txt
Normal file
22
projects/mtg/bin/Res/test/clone3.txt
Normal file
@@ -0,0 +1,22 @@
|
||||
# As Clone comes into play, you may choose a creature in play. If you do, Clone comes into play as a copy of that creature.
|
||||
#Bug: impossible to copy permanents with shroud
|
||||
#see: http://code.google.com/p/wagic/issues/detail?id=162
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
hand:clone
|
||||
manapool:{3}{U}
|
||||
inplay:Deft Duelist
|
||||
[PLAYER2]
|
||||
[DO]
|
||||
clone
|
||||
choice 0
|
||||
deft duelist
|
||||
next
|
||||
[ASSERT]
|
||||
COMBATBEGIN
|
||||
[PLAYER1]
|
||||
inplay:*,*
|
||||
manapool:{0}
|
||||
[PLAYER2]
|
||||
[END]
|
||||
@@ -2,6 +2,7 @@
|
||||
#DESC: Bug: Game crashes if a land with
|
||||
#DESC: two Kudzus in it is tapped.
|
||||
#DESC: See: http://code.google.com/p/wagic/issues/detail?id=168
|
||||
#TODO Update this code with 2 different kudzus to make the test more reliable
|
||||
[INIT]
|
||||
firstmain
|
||||
[PLAYER1]
|
||||
@@ -17,13 +18,12 @@ Kudzu
|
||||
Swamp
|
||||
Swamp
|
||||
Mountain
|
||||
Mountain
|
||||
[ASSERT]
|
||||
firstmain
|
||||
[PLAYER1]
|
||||
inplay:
|
||||
graveyard:Swamp
|
||||
manapool:
|
||||
inplay:*
|
||||
graveyard:Swamp,*
|
||||
manapool:{B}
|
||||
[PLAYER2]
|
||||
inplay:Mountain,Kudzu,Kudzu
|
||||
inplay:Mountain
|
||||
[END]
|
||||
@@ -3159,29 +3159,24 @@ class AJandorsRing:public ActivatedAbility{
|
||||
//What happens when there are no targets ???
|
||||
class AKudzu: public TargetAbility{
|
||||
public:
|
||||
int previouslyTapped;
|
||||
AKudzu(int _id, MTGCardInstance * card, MTGCardInstance * _target):TargetAbility(_id,card, NEW TypeTargetChooser("land",card)){
|
||||
tc->toggleTarget(_target);
|
||||
target = _target;
|
||||
previouslyTapped = 0;
|
||||
if (_target->isTapped()) previouslyTapped = 1;
|
||||
}
|
||||
|
||||
int receiveEvent(WEvent * event){
|
||||
if (WEventCardTap* wect = dynamic_cast<WEventCardTap*>(event)) {
|
||||
if (wect->before == false && wect->after == true){
|
||||
MTGCardInstance * _target = (MTGCardInstance *)target;
|
||||
if (!_target->isInPlay()) return 0;
|
||||
target = _target->controller()->game->putInGraveyard(_target);
|
||||
reactToClick(source);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
void Update(float dt){
|
||||
MTGCardInstance * _target = (MTGCardInstance *)target;
|
||||
if (_target && !_target->isTapped()){
|
||||
previouslyTapped = 0;
|
||||
}else if (!previouslyTapped){
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
OutputDebugString("Kudzu Strikes !\n");
|
||||
#endif
|
||||
MTGCardInstance * _target = (MTGCardInstance *)target;
|
||||
target = _target->controller()->game->putInGraveyard(_target);
|
||||
reactToClick(source); // ????
|
||||
}
|
||||
TargetAbility::Update(dt);
|
||||
}
|
||||
}
|
||||
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL){
|
||||
MTGCardInstance * _target = (MTGCardInstance *)target;
|
||||
@@ -3198,8 +3193,6 @@ class AKudzu: public TargetAbility{
|
||||
int resolve(){
|
||||
target = tc->getNextCardTarget();
|
||||
source->target = (MTGCardInstance *) target;
|
||||
previouslyTapped = 0;
|
||||
if (source->target && source->target->isTapped()) previouslyTapped = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3220,12 +3213,6 @@ class AKudzu: public TargetAbility{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual ostream& toString(ostream& out) const
|
||||
{
|
||||
out << "AKudzu ::: previouslyTapped : " << previouslyTapped
|
||||
<< " (";
|
||||
return TargetAbility::toString(out) << ")";
|
||||
}
|
||||
AKudzu * clone() const{
|
||||
AKudzu * a = NEW AKudzu(*this);
|
||||
a->isClone = 1;
|
||||
|
||||
@@ -231,6 +231,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
string starget = s.substr(found + 7,end - found - 7);
|
||||
TargetChooserFactory tcf;
|
||||
tc = tcf.createTargetChooser(starget, card);
|
||||
if (tc && s.find("notatarget(") != string::npos) tc->targetter = NULL;
|
||||
}
|
||||
|
||||
AEquip *ae = dynamic_cast<AEquip*>(a);
|
||||
@@ -273,6 +274,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
string starget = s.substr(found + 7,end - found - 7);
|
||||
TargetChooserFactory tcf;
|
||||
tc = tcf.createTargetChooser(starget, card);
|
||||
if (tc && s.find("notatarget(") != string::npos) tc->targetter = NULL;
|
||||
}
|
||||
if (tc) a1 = NEW GenericTargetAbility(id, card, tc, a1);
|
||||
else a1 = NEW GenericActivatedAbility(id, card, a1,NULL);
|
||||
|
||||
Reference in New Issue
Block a user