Erwan
- cards bugfixes - added a few zone names for moveTo
This commit is contained in:
@@ -847,6 +847,7 @@ toughness=1
|
||||
[card]
|
||||
text={1}, {T}: Tap target artifact, creature, or land.
|
||||
id=129601
|
||||
auto={1}{T}:tap target(artifact,creature,land)
|
||||
name=Icy Manipulator
|
||||
rarity=U
|
||||
color=Artifact
|
||||
|
||||
@@ -96,6 +96,7 @@ subtype=Aura
|
||||
[/card]
|
||||
[card]
|
||||
text=Sacrifice an artifact: Atog gets +2/+2 until end of turn.
|
||||
auto={s(artifact|myinplay)}:2/2
|
||||
id=1280
|
||||
name=Atog
|
||||
rarity=C
|
||||
@@ -270,6 +271,7 @@ subtype=Aura
|
||||
[card]
|
||||
text=Untapped creatures you control get +0/+2.
|
||||
id=1334
|
||||
auto=lord(creature[-tapped]|myinplay) 0/2
|
||||
name=Castle
|
||||
rarity=U
|
||||
type=Enchantment
|
||||
@@ -1485,6 +1487,7 @@ toughness=3
|
||||
text=Attacking creatures you control get +1/+0.
|
||||
id=1310
|
||||
name=Orcish Oriflamme
|
||||
auto=lord(creature[attacking]|myinplay)1/0
|
||||
rarity=U
|
||||
type=Enchantment
|
||||
mana={3}{R}
|
||||
@@ -1656,6 +1659,7 @@ mana={W}
|
||||
[card]
|
||||
text=Return target creature card from your graveyard to your hand.
|
||||
target=creature|myGraveyard
|
||||
auto=moveTo(myHand)
|
||||
id=1174
|
||||
name=Raise Dead
|
||||
rarity=C
|
||||
@@ -1703,6 +1707,7 @@ subtype=Aura
|
||||
[card]
|
||||
text=Return target card from your graveyard to your hand.
|
||||
target=*|myGraveyard
|
||||
auto=moveTo(myHand)
|
||||
id=1263
|
||||
name=Regrowth
|
||||
rarity=U
|
||||
@@ -1712,6 +1717,7 @@ mana={1}{G}
|
||||
[card]
|
||||
text=Return target creature card from your graveyard to play.
|
||||
target=creature|myGraveyard
|
||||
auto=moveTo(myInPlay)
|
||||
id=1360
|
||||
name=Resurrection
|
||||
rarity=U
|
||||
@@ -2052,6 +2058,7 @@ subtype=Mountain Forest
|
||||
[card]
|
||||
text=Destroy target nonartifact, nonblack creature. It can't be regenerated.
|
||||
target=creature[-black;-artifact]
|
||||
auto=bury
|
||||
id=1182
|
||||
name=Terror
|
||||
rarity=C
|
||||
@@ -2196,6 +2203,7 @@ subtype=Aura
|
||||
[card]
|
||||
text=Return target creature to its owner's hand.
|
||||
target=creature
|
||||
auto=moveTo(ownerHand)
|
||||
id=1229
|
||||
name=Unsummon
|
||||
rarity=C
|
||||
@@ -2403,7 +2411,8 @@ subtype=Aura
|
||||
[card]
|
||||
text=Enchant creature (Target a creature as you play this. This card comes into play attached to that creature.) Enchanted creature gets +0/+2 and has reach. (It can block creatures with flying.)
|
||||
target=creature
|
||||
auto=reach, :0/2
|
||||
auto=reach
|
||||
auto=0/2
|
||||
id=1278
|
||||
name=Web
|
||||
rarity=R
|
||||
|
||||
@@ -52,6 +52,7 @@ goblin_balloon_brigade.txt
|
||||
goblin_balloon_brigade2.txt
|
||||
goblin_king.txt
|
||||
hymn_of_rebirth.txt
|
||||
icatian_priest.txt
|
||||
keldon_warlord.txt
|
||||
kird_ape.txt
|
||||
kudzu.txt
|
||||
|
||||
31
projects/mtg/bin/Res/test/icatian_priest.txt
Normal file
31
projects/mtg/bin/Res/test/icatian_priest.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
#Bug : icatian priest(10E) & spirit weaver(10E) have the same problem that their abilities become tap abilities and thus can be used once a turn and affected by summon sickness
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
inplay:132123,129624
|
||||
manapool:{W}{W}{W}{W}{W}{W}
|
||||
[PLAYER2]
|
||||
[DO]
|
||||
132123
|
||||
129624
|
||||
132123
|
||||
129624
|
||||
next
|
||||
#combat begins
|
||||
next
|
||||
#attackers
|
||||
129624
|
||||
next
|
||||
#blockers
|
||||
next
|
||||
#damages
|
||||
next
|
||||
#combatend
|
||||
[ASSERT]
|
||||
COMBATEND
|
||||
[PLAYER1]
|
||||
inplay:132123,129624
|
||||
manapool:{0}
|
||||
[PLAYER2]
|
||||
life:14
|
||||
[END]
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
Player* p = _target->controller();
|
||||
if (p){
|
||||
MTGGameZone * fromZone = _target->getCurrentZone();
|
||||
MTGGameZone * destZone = MTGGameZone::stringToZone(destinationZone, source);
|
||||
MTGGameZone * destZone = MTGGameZone::stringToZone(destinationZone, source,_target);
|
||||
|
||||
//inplay is a special zone !
|
||||
for (int i=0; i < 2; i++){
|
||||
@@ -516,7 +516,7 @@ class ATargetterPowerToughnessModifierUntilEOT: public TargetAbility{
|
||||
int nbTargets;
|
||||
int power, toughness;
|
||||
|
||||
ATargetterPowerToughnessModifierUntilEOT(int _id, MTGCardInstance * _source, int _power, int _toughness, ManaCost * _cost, TargetChooser * _tc = NULL):TargetAbility(_id,_source,_tc,_cost,0),power(_power),toughness(_toughness){
|
||||
ATargetterPowerToughnessModifierUntilEOT(int _id, MTGCardInstance * _source, int _power, int _toughness, ManaCost * _cost, TargetChooser * _tc = NULL, int doTap=1):TargetAbility(_id,_source,_tc,_cost,0,doTap),power(_power),toughness(_toughness){
|
||||
if (!tc) tc = NEW CreatureTargetChooser(_source);
|
||||
nbTargets = 0;
|
||||
}
|
||||
@@ -1472,14 +1472,6 @@ class ACreatureBond:public MTGAbility{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* int testDestroy(){
|
||||
MTGCardInstance * _target = (MTGCardInstance *)target;
|
||||
if(_target->controller()->game->graveyard->hasCard(_target) && !resolved){
|
||||
return 0;
|
||||
}else{
|
||||
return TriggeredAbility::testDestroy();
|
||||
}
|
||||
}*/
|
||||
};
|
||||
|
||||
//1105: Dingus Egg
|
||||
@@ -1556,20 +1548,31 @@ class AEbonyHorse:public TargetAbility{
|
||||
//1345 Farmstead
|
||||
class AFarmstead:public ActivatedAbility{
|
||||
public:
|
||||
int usedThisTurn;
|
||||
AFarmstead(int _id, MTGCardInstance * source, MTGCardInstance * _target):ActivatedAbility(_id, source,0,1,0){
|
||||
int _cost[] = {Constants::MTG_COLOR_WHITE, 2};
|
||||
cost = NEW ManaCost(_cost,1);
|
||||
target = _target;
|
||||
usedThisTurn = 0;
|
||||
}
|
||||
|
||||
void Update(float dt){
|
||||
if (newPhase != currentPhase && newPhase != Constants::MTG_PHASE_UPKEEP){
|
||||
usedThisTurn = 0;
|
||||
}
|
||||
ActivatedAbility::Update(dt);
|
||||
}
|
||||
|
||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL){
|
||||
if (!ActivatedAbility::isReactingToClick(card,mana)) return 0;
|
||||
if (currentPhase == Constants::MTG_PHASE_UPKEEP) return 1;
|
||||
return 0;
|
||||
if (currentPhase != Constants::MTG_PHASE_UPKEEP) return 0;
|
||||
if (usedThisTurn) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int resolve(){
|
||||
source->controller()->life++;
|
||||
usedThisTurn = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2292,47 +2295,6 @@ class AWanderlust:public TriggeredAbility{
|
||||
}
|
||||
};
|
||||
|
||||
//1280 Atog
|
||||
class AAtog:public TargetAbility{
|
||||
public:
|
||||
Player * currentController;
|
||||
int counters;
|
||||
AAtog(int _id, MTGCardInstance * _source):TargetAbility(_id, _source,NULL, NULL, 0,0){
|
||||
currentController = source->controller();
|
||||
MTGGameZone * zones[] = {currentController->game->inPlay};
|
||||
tc = NEW TypeTargetChooser("artifact", zones, 1, source);
|
||||
counters = 0;
|
||||
}
|
||||
|
||||
void Update(float dt){
|
||||
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP){
|
||||
for (int i = 0; i < counters; i++){
|
||||
source->power-=2;
|
||||
source->addToToughness(-2);
|
||||
}
|
||||
counters = 0;
|
||||
}
|
||||
TargetAbility::Update(dt);
|
||||
Player * newController = source->controller();
|
||||
if (newController != currentController){
|
||||
SAFE_DELETE(tc);
|
||||
MTGGameZone * zones[] = {newController->game->inPlay}; //In case Atog's controller changes
|
||||
tc = NEW TypeTargetChooser("artifact", zones, 1, source);
|
||||
currentController = newController;
|
||||
}
|
||||
}
|
||||
|
||||
int resolve(){
|
||||
tc->getNextCardTarget()->controller()->game->putInGraveyard(tc->getNextCardTarget());
|
||||
source->power+=2;
|
||||
source->addToToughness(2);
|
||||
counters ++;
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//1284 Dragon Whelp
|
||||
class ADragonWhelp: public APowerToughnessModifierUntilEndOfTurn{
|
||||
@@ -2444,52 +2406,6 @@ class AOrcishArtillery: public ADamager{
|
||||
|
||||
};
|
||||
|
||||
//1310 Orcish Oriflame
|
||||
class AOrcishOriflame:public ListMaintainerAbility{
|
||||
public:
|
||||
int color;
|
||||
AOrcishOriflame(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
int canBeInList(MTGCardInstance * card){
|
||||
if (source->controller() == game->currentPlayer && game->currentPlayer->game->inPlay->hasCard(card) && card->attacker) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int added(MTGCardInstance * card){
|
||||
card->power += 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int removed(MTGCardInstance * card){
|
||||
card->power -= 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//1334 Castle
|
||||
class ACastle:public ListMaintainerAbility{
|
||||
public:
|
||||
ACastle(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||
}
|
||||
|
||||
int canBeInList(MTGCardInstance * card){
|
||||
if (source->controller()->game->inPlay->hasCard(card) && card->isACreature() && !card->isAttacker() && !card->tapped) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int added(MTGCardInstance * card){
|
||||
card->addToToughness(2);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int removed(MTGCardInstance * card){
|
||||
card->addToToughness(-2);
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//1351 Island Sanctuary
|
||||
class AIslandSanctuary:public MTGAbility{
|
||||
|
||||
@@ -35,7 +35,7 @@ class MTGGameZone {
|
||||
int hasType(const char * value);
|
||||
void setOwner(Player * player);
|
||||
MTGCardInstance * lastCardDrawn;
|
||||
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source);
|
||||
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target);
|
||||
};
|
||||
|
||||
class MTGLibrary: public MTGGameZone {
|
||||
|
||||
@@ -302,7 +302,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
}
|
||||
}else{
|
||||
MTGGameZone * fromZone = target->getCurrentZone();//this is technically incorrect. The initial zone should be as described in the targetchooser
|
||||
MTGGameZone * destZone = MTGGameZone::stringToZone(szone, target);
|
||||
MTGGameZone * destZone = MTGGameZone::stringToZone(szone, card, target);
|
||||
target->controller()->game->putInZone(target,fromZone,destZone);
|
||||
}
|
||||
result++;
|
||||
@@ -489,7 +489,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
game->addObserver(NEW ALord(id,card,lordTargets,lordIncludeSelf,power,toughness));
|
||||
}else{
|
||||
if(tc){
|
||||
game->addObserver(NEW ATargetterPowerToughnessModifierUntilEOT(id, card,power,toughness, cost, tc));
|
||||
game->addObserver(NEW ATargetterPowerToughnessModifierUntilEOT(id, card,power,toughness, cost, tc,doTap));
|
||||
}else{
|
||||
if (!cost){
|
||||
if(card->hasType("enchantment")){
|
||||
@@ -498,7 +498,6 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
game->addObserver(NEW AInstantPowerToughnessModifierUntilEOT(id, card, target,power,toughness));
|
||||
}
|
||||
}else{
|
||||
OutputDebugString("NANTUKO OK\n");
|
||||
game->addObserver(NEW APowerToughnessModifierUntilEndOfTurn(id, card, target,power,toughness, cost, limit));
|
||||
}
|
||||
}
|
||||
@@ -1045,11 +1044,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
break;
|
||||
}
|
||||
|
||||
case 1174: //Raise Dead
|
||||
{
|
||||
MTGPlayerCards * zones = game->currentlyActing()->game;
|
||||
zones->putInZone(card->target,zones->graveyard,zones->hand);
|
||||
}
|
||||
case 1176: //Sacrifice
|
||||
{
|
||||
ASacrifice * ability = NEW ASacrifice(_id, card, card->target);
|
||||
@@ -1090,15 +1084,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AWanderlust(_id, card, card->target));
|
||||
break;
|
||||
}
|
||||
case 129601: //Icy Manipulator
|
||||
{
|
||||
int cost[] = {Constants::MTG_COLOR_ARTIFACT, 1};
|
||||
TypeTargetChooser * tc = new TypeTargetChooser("artifact",card);
|
||||
tc->addType("land");
|
||||
tc->addType("creature");
|
||||
game->addObserver(NEW ATapper(_id,card,NEW ManaCost(cost, 1),tc));
|
||||
break;
|
||||
}
|
||||
|
||||
case 1203: //Island Fish
|
||||
{
|
||||
@@ -1145,13 +1130,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW APowerToughnessModifierRegularCounter(_id, card, card->target, Constants::MTG_PHASE_UPKEEP, -1, -1));
|
||||
break;
|
||||
}
|
||||
case 1229: //Unsummon
|
||||
{
|
||||
MTGPlayerCards * zones = card->target->controller()->game;
|
||||
zones->putInZone(card->target,zones->inPlay,zones->hand);
|
||||
break;
|
||||
|
||||
}
|
||||
case 1235: //Aspect of Wolf
|
||||
{
|
||||
game->addObserver(NEW AAspectOfWolf(_id, card, card->target));
|
||||
@@ -1191,12 +1170,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AStandardRegenerate(_id,card,card->target,NEW ManaCost(cost,1)));
|
||||
break;
|
||||
}
|
||||
case 1263: //Regrowth
|
||||
{
|
||||
MTGPlayerCards * zones = game->currentlyActing()->game;
|
||||
zones->putInZone(card->target,zones->graveyard,zones->hand);
|
||||
break;
|
||||
}
|
||||
|
||||
case 1266: //stream of life
|
||||
{
|
||||
int x = spell->cost->getConvertedCost() - 1; //TODO Improve that !
|
||||
@@ -1227,17 +1201,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1278: //Web
|
||||
{
|
||||
game->addObserver(NEW APowerToughnessModifier(_id, card, card->target, 0,2));
|
||||
game->addObserver(NEW ABasicAbilityModifier(_id + 1, card, card->target, Constants::REACH));
|
||||
break;
|
||||
}
|
||||
case 1280: //Atog
|
||||
{
|
||||
game->addObserver(NEW AAtog(_id, card));
|
||||
break;
|
||||
}
|
||||
|
||||
case 1285: //Dwarven Warriors{
|
||||
{
|
||||
CreatureTargetChooser * tc = NEW CreatureTargetChooser(card);
|
||||
@@ -1294,11 +1258,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AOrcishArtillery(_id, card));
|
||||
break;
|
||||
}
|
||||
case 1310: //Orcish Oriflame
|
||||
{
|
||||
game->addObserver(NEW AOrcishOriflame(_id, card));
|
||||
break;
|
||||
}
|
||||
case 1326: //Wheel of fortune
|
||||
{
|
||||
for (int i = 0; i < 2; i++){
|
||||
@@ -1323,11 +1282,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_BLUE));
|
||||
break;
|
||||
}
|
||||
case 1334: //Castle
|
||||
{
|
||||
game->addObserver(NEW ACastle(_id,card));
|
||||
break;
|
||||
}
|
||||
case 1238: //Cockatrice
|
||||
{
|
||||
game->addObserver(NEW AOldSchoolDeathtouch(_id,card));
|
||||
@@ -1353,14 +1307,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
game->addObserver(NEW AProtectionFrom( _id,card, card->target, Constants::MTG_COLOR_RED));
|
||||
break;
|
||||
}
|
||||
case 1360: //Resurrection
|
||||
{
|
||||
Player * p = card->controller();
|
||||
Player * p2 = card->target->controller();
|
||||
AbilityFactory af;
|
||||
af.putInPlayFromZone(card->target, p2->game->graveyard, p);
|
||||
break;
|
||||
}
|
||||
case 1362: //Reverse polarity
|
||||
{
|
||||
ActionStack * as = game->mLayers->stackLayer();
|
||||
@@ -1387,14 +1333,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||
p->game->putInZone(card->target,p->game->inPlay,card->owner->game->removedFromGame);
|
||||
break;
|
||||
}
|
||||
case 1182: //Terror
|
||||
{
|
||||
if (card->target->hasColor(Constants::MTG_COLOR_BLACK) || card->target->hasSubtype("artifact")){
|
||||
}else{
|
||||
card->target->controller()->game->putInGraveyard(card->target);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1267: //Thicket Basilic
|
||||
{
|
||||
game->addObserver(NEW AOldSchoolDeathtouch(_id,card));
|
||||
|
||||
@@ -353,25 +353,34 @@ void MTGLibrary::shuffleTopToBottom(int nbcards){
|
||||
}
|
||||
}
|
||||
|
||||
MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * source){
|
||||
MTGGameZone * MTGGameZone::stringToZone(string zoneName, MTGCardInstance * source,MTGCardInstance * target){
|
||||
Player * p = source->controller();
|
||||
Player * p2 = target->controller();
|
||||
if(zoneName.compare("mygraveyard") == 0)return p->game->graveyard;
|
||||
if(zoneName.compare("opponentgraveyard") == 0) return p->opponent()->game->graveyard;
|
||||
if(zoneName.compare("ownergraveyard") == 0) return source->owner->game->graveyard;
|
||||
if(zoneName.compare("graveyard") == 0) return source->owner->game->graveyard;
|
||||
if(zoneName.compare("targetownergraveyard") == 0) return target->owner->game->graveyard;
|
||||
if(zoneName.compare("targetcontrollergraveyard") == 0) return p2->game->graveyard;
|
||||
if(zoneName.compare("ownergraveyard") == 0) return target->owner->game->graveyard;
|
||||
if(zoneName.compare("graveyard") == 0) return target->owner->game->graveyard;
|
||||
|
||||
if(zoneName.compare("myinplay") == 0)return p->game->inPlay;
|
||||
if(zoneName.compare("opponentinplay") == 0) return p->opponent()->game->inPlay;
|
||||
if(zoneName.compare("ownerinplay") == 0) return source->owner->game->inPlay;
|
||||
if(zoneName.compare("targetownerinplay") == 0) return target->owner->game->inPlay;
|
||||
if(zoneName.compare("targetcontrollerinplay") == 0) return p2->game->inPlay;
|
||||
if(zoneName.compare("ownerinplay") == 0) return target->owner->game->inPlay;
|
||||
|
||||
if(zoneName.compare("myhand") == 0)return p->game->hand;
|
||||
if(zoneName.compare("opponenthand") == 0) return p->opponent()->game->hand;
|
||||
if(zoneName.compare("ownerhand") == 0) return source->owner->game->hand;
|
||||
if(zoneName.compare("hand") == 0) return source->owner->game->hand;
|
||||
if(zoneName.compare("targetcontrollerhand") == 0) return p2->game->hand;
|
||||
if(zoneName.compare("targetownerhand") == 0) return target->owner->game->hand;
|
||||
if(zoneName.compare("ownerhand") == 0) return target->owner->game->hand;
|
||||
if(zoneName.compare("hand") == 0) return target->owner->game->hand;
|
||||
|
||||
if(zoneName.compare("myremovedfromgame") == 0)return p->game->removedFromGame;
|
||||
if(zoneName.compare("opponentremovedfromgame") == 0) return p->opponent()->game->removedFromGame;
|
||||
if(zoneName.compare("ownerremovedfromgame") == 0) return source->owner->game->removedFromGame;
|
||||
if(zoneName.compare("removedfromgame") == 0) return source->owner->game->removedFromGame;
|
||||
if(zoneName.compare("targetcontrollerremovedfromgame") == 0) return p2->game->removedFromGame;
|
||||
if(zoneName.compare("targetownerremovedfromgame") == 0) return target->owner->game->removedFromGame;
|
||||
if(zoneName.compare("ownerremovedfromgame") == 0) return target->owner->game->removedFromGame;
|
||||
if(zoneName.compare("removedfromgame") == 0) return target->owner->game->removedFromGame;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user