From 89caaaadb421b63afb02e453fbe5b24d21b2a62e Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Sat, 4 Apr 2009 15:09:31 +0000 Subject: [PATCH] Erwan -Fixed a bug with */* creatures that don't die when they come into play as 0/0 -Fixed a bug with hymn of rebirth introduced in rev 245 --- projects/mtg/bin/Res/sets/ICE/_cards.dat | 3 ++- projects/mtg/bin/Res/test/_tests.txt | 1 + projects/mtg/bin/Res/test/nightmare.txt | 16 ++++++++++++++++ projects/mtg/src/GameObserver.cpp | 3 +++ projects/mtg/src/MTGCardInstance.cpp | 3 ++- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 projects/mtg/bin/Res/test/nightmare.txt diff --git a/projects/mtg/bin/Res/sets/ICE/_cards.dat b/projects/mtg/bin/Res/sets/ICE/_cards.dat index 3837519d4..1b25de6ba 100644 --- a/projects/mtg/bin/Res/sets/ICE/_cards.dat +++ b/projects/mtg/bin/Res/sets/ICE/_cards.dat @@ -466,7 +466,8 @@ subtype=Swamp [card] text=Put target creature card in a graveyard into play under your control. id=2731 -auto=moveTo(myinplay) target(creature|graveyard) +target=creature|graveyard +auto=moveTo(myinplay) name=Hymn of Rebirth rarity=U type=Sorcery diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 6b18cb05c..5e45b5fef 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -69,6 +69,7 @@ living_lands.txt lord_of_the_pit.txt lord_of_the_pit2.txt nantuko_husk.txt +nightmare.txt Nyxathid.txt orcish_lumberjack.txt paralysis.txt diff --git a/projects/mtg/bin/Res/test/nightmare.txt b/projects/mtg/bin/Res/test/nightmare.txt new file mode 100644 index 000000000..e06f1c390 --- /dev/null +++ b/projects/mtg/bin/Res/test/nightmare.txt @@ -0,0 +1,16 @@ +#nightmare has 0 life, does it go to graveyard ? +[INIT] +FIRSTMAIN +[PLAYER1] +hand:nightmare +manapool:{5}{B} +[PLAYER2] +[DO] +nightmare +[ASSERT] +FIRSTMAIN +[PLAYER1] +graveyard:nightmare +manapool:{0} +[PLAYER2] +[END] \ No newline at end of file diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index a60dbc396..385795a97 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -225,6 +225,9 @@ void GameObserver::Update(float dt){ //applies damage to creatures after updates //Players life test void GameObserver::stateEffects(){ + if (mLayers->stackLayer()->count(0,NOT_RESOLVED) != 0) return; + if (mLayers->actionLayer()->menuObject) return; + if (targetChooser || mLayers->actionLayer()->isWaitingForAnswer()) return; for (int i =0; i < 2; i++){ MTGGameZone * zone = players[i]->game->inPlay; for (int j = zone->nb_cards-1 ; j>=0; j--){ diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 81c0c00d4..5c7513409 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -84,7 +84,7 @@ void MTGCardInstance::initMTGCI(){ model=NULL; isToken = false; lifeOrig = 0; - doDamageTest = 0; + doDamageTest = 1; belongs_to=NULL; tapped = 0; blockers = NEW Blockers(); @@ -125,6 +125,7 @@ int MTGCardInstance::isInPlay(){ int MTGCardInstance::afterDamage(){ if (!doDamageTest) return 0; doDamageTest = 0; + if (!isACreature()) return 0; if (life <=0 && isInPlay()){ GameObserver * game = GameObserver::GetInstance(); game->mLayers->stackLayer()->addPutInGraveyard(this);