- Fixed a few bugs (animate dead(RV), Goblins Deathraiders(ALA), Druid of Anima(ALA))
This commit is contained in:
wagic.the.homebrew
2009-02-15 09:22:17 +00:00
parent f7a887db2a
commit 3b16eb5020
5 changed files with 6 additions and 71 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
};

View File

@@ -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);

View File

@@ -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();
}