diff --git a/projects/mtg/bin/Res/sets/ALA/_cards.dat b/projects/mtg/bin/Res/sets/ALA/_cards.dat index 33e2c9adb..8b50259e6 100644 --- a/projects/mtg/bin/Res/sets/ALA/_cards.dat +++ b/projects/mtg/bin/Res/sets/ALA/_cards.dat @@ -201,9 +201,9 @@ toughness=3 [/card] [card] text={T}: Add {R}, {G}, or {W} to your mana pool. -auto={T]:Add {R} -auto={T]:Add {G} -auto={T]:Add {W} +auto={T}:Add {R} +auto={T}:Add {G} +auto={T}:Add {W} id=174903 name=Druid of the Anima rarity=C @@ -294,6 +294,7 @@ subtype=Forest [/card] [card] text=Trample +abilities=trample id=177596 name=Goblin Deathraiders rarity=C diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 8318e3fa6..d93e636b5 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -17,6 +17,7 @@ afflict.txt anarchy.txt animate_dead.txt animate_dead2.txt +animate_dead3.txt ankh_of_mishra.txt ardakar_wastes.txt ascendant_evincar.txt diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 72bd925bd..54bd296fc 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1743,6 +1743,7 @@ class AAnimateDead:public MTGAbility{ int destroy(){ MTGCardInstance * card = (MTGCardInstance *) target; card->power++; + card->controller()->game->putInZone(card, card->controller()->game->inPlay,card->owner->game->graveyard); return 1; } }; diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index 54e888db3..64f4b064e 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -72,11 +72,8 @@ class GameObserver{ void addObserver(MTGAbility * observer); void removeObserver(ActionElement * observer); void startGame(int shuffle = 1, int draw = 1); - void nextStep(); void untapPhase(); void draw(); - int canPutInPlay(MTGCardInstance * card); - void putInPlay(MTGCardInstance * card); int isInPlay(MTGCardInstance * card); int isACreature(MTGCardInstance * card); int tryToTapOrUntap(MTGCardInstance * card); diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 20c031faf..3cedb76b3 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -222,11 +222,6 @@ void GameObserver::Render(){ } -void GameObserver::nextStep(){ - -} - - void GameObserver::ButtonPressed (int controllerId, PlayGuiObject * _object){ @@ -345,67 +340,8 @@ TargetChooser * GameObserver::getCurrentTargetChooser(){ return targetChooser; } -//Check if it is possible to put a card into play -//TODO : improve according to spells in game... -int GameObserver::canPutInPlay(MTGCardInstance * card){ - Player * player = currentlyActing(); - LOG("CANPUTINPLAY- check if card belongs to current player\n"); - if (!player->game->hand->hasCard(card)) return 0; - LOG("CANPUTINPLAY- check if card is land or can be played\n"); - if (card->hasType("land")){ - LOG("CANPUTINPLAY- card is land - check if can be played\n"); - if (player == currentPlayer && currentPlayer->canPutLandsIntoPlay && (currentGamePhase == Constants::MTG_PHASE_FIRSTMAIN || currentGamePhase == Constants::MTG_PHASE_SECONDMAIN)){ - LOG("CANPUTINPLAY- Land, ok\n"); - return 1; - } - }else if ((card->hasType("instant")) || card->has(Constants::FLASH) || (player == currentPlayer && (currentGamePhase == Constants::MTG_PHASE_FIRSTMAIN || currentGamePhase == Constants::MTG_PHASE_SECONDMAIN))){ - LOG("CANPUTINPLAY- correct time to play\n"); - if (checkManaCost(card)){ - LOG("CANPUTINPLAY- ManaCost ok\n"); - if (targetListIsSet(card)){ -#ifdef LOG - LOG("CANPUTINPLAY- Targets chosen -> OK\n"); -#endif - return 1; - }else{ -#ifdef LOG - LOG("CANPUTINPLAY- Targets not chosen yet\n"); -#endif - return 0; - } - } - } - return 0; -} -void GameObserver::putInPlay(MTGCardInstance * card){ - Player * player = currentlyActing(); - ManaCost * previousManaPool = NEW ManaCost(player->getManaPool()); - player->getManaPool()->pay(card->getManaCost()); - ManaCost * spellCost = previousManaPool->Diff(player->getManaPool()); - delete previousManaPool; - if (card->hasType("land")){ - Spell * spell = NEW Spell(card); - player->game->putInZone(card, player->game->hand, player->game->stack); - spell->resolve(); - delete spellCost; - delete spell; - }else{ - if (targetChooser){ - mLayers->stackLayer()->addSpell(card,targetChooser->targets,targetChooser->cursor, spellCost); - delete targetChooser; - targetChooser = NULL; - }else{ - mLayers->stackLayer()->addSpell(card,NULL,0, spellCost); - } - player->game->putInZone(card, player->game->hand, player->game->stack); - - } - - -} - /* Returns true if the card is in one of the player's play zone */ int GameObserver::isInPlay(MTGCardInstance * card){ for (int i = 0; i < 2; i++){ @@ -415,7 +351,6 @@ int GameObserver::isInPlay(MTGCardInstance * card){ } void GameObserver::draw(){ - //TODO checks to allow multiple draw, or no draw, etc... currentPlayer->game->drawFromLibrary(); }