diff --git a/projects/mtg/bin/Res/sets/SHM/_cards.dat b/projects/mtg/bin/Res/sets/SHM/_cards.dat index 53a6bf04e..61609862c 100644 --- a/projects/mtg/bin/Res/sets/SHM/_cards.dat +++ b/projects/mtg/bin/Res/sets/SHM/_cards.dat @@ -270,19 +270,6 @@ subtype=Merfolk Rogue toughness=2 [/card] [card] -text=Flying, haste. When you play Demigod of Revenge, return all cards named Demigod of Revenge from your graveyard to play. -id=153972 -name=Demigod of Revenge -auto=moveTo(myinplay) all(Demigod of Revenge|mygraveyard) -abilities=flying,haste -rarity=R -type=Creature -mana={BR}{BR}{BR}{BR}{BR} -power=5 -subtype=Spirit Avatar -toughness=4 -[/card] -[card] text=You may put a green creature card from your hand into play. id=154003 target=creature[green]|myhand @@ -329,8 +316,8 @@ mana={3}{R} [/card] [card] text=Whenever you play a black spell, Emberstrike Duo gets +1/+1 until end of turn. Whenever you play a red spell, Emberstrike Duo gains first strike until end of turn. -auto=@movedTo(*[red]|mystack):1/1 -auto=@movedTo(*[red]|mystack):first strike +auto=@movedTo(*[red]|mystack):1/1 ueot +auto=@movedTo(*[red]|mystack):first strike ueot id=153307 name=Emberstrike Duo rarity=C @@ -514,8 +501,8 @@ toughness=3 [/card] [card] text=Whenever you play a blue spell, Gravelgill Duo gets +1/+1 until end of turn. Whenever you play a black spell, Gravelgill Duo gains fear until end of turn. -auto=@movedTo(*[blue]|mystack):1/1 -auto=@movedTo(*[blue]|mystack):fear +auto=@movedTo(*[blue]|mystack):1/1 ueot +auto=@movedTo(*[blue]|mystack):fear ueot id=153308 name=Gravelgill Duo rarity=C @@ -1069,8 +1056,8 @@ toughness=2 [/card] [card] text=Whenever you play a green spell, Safehold Duo gets +1/+1 until end of turn. Whenever you play a white spell, Safehold Duo gains vigilance until end of turn. -auto=@movedTo(*[green]|mystack):1/1 -auto=@movedTo(*[white]|mystack):vigilance +auto=@movedTo(*[green]|mystack):1/1 ueot +auto=@movedTo(*[white]|mystack):vigilance ueot id=153963 name=Safehold Duo rarity=C @@ -1254,8 +1241,8 @@ subtype=Swamp [/card] [card] text=Whenever you play a red spell, Tattermunge Duo gets +1/+1 until end of turn. Whenever you play a green spell, Tattermunge Duo gains forestwalk until end of turn. -auto=@movedTo(*[red]|mystack):1/1 -auto=@movedTo(*[green]|mystack):forestwalk +auto=@movedTo(*[red]|mystack):1/1 ueot +auto=@movedTo(*[green]|mystack):forestwalk ueot id=153282 name=Tattermunge Duo rarity=C @@ -1291,8 +1278,8 @@ toughness=1 [/card] [card] text=Whenever you play a white spell, Thistledown Duo gets +1/+1 until end of turn. Whenever you play a blue spell, Thistledown Duo gains flying until end of turn. -auto=@movedTo(*[white]|mystack):1/1 -auto=@movedTo(*[blue]|mystack):flying +auto=@movedTo(*[white]|mystack):1/1 ueot +auto=@movedTo(*[blue]|mystack):flying ueot id=153301 name=Thistledown Duo rarity=C @@ -1460,6 +1447,7 @@ toughness=4 [card] text=Flying Attacking creatures you control have lifelink. id=146090 +abilities=flying auto=lord(creature[attacking]|myinplay) lifelink name=Windbrisk Raptor rarity=R diff --git a/projects/mtg/bin/Res/sets/SHM/todo.dat b/projects/mtg/bin/Res/sets/SHM/todo.dat index 29d16ccb0..a96d52631 100644 --- a/projects/mtg/bin/Res/sets/SHM/todo.dat +++ b/projects/mtg/bin/Res/sets/SHM/todo.dat @@ -235,6 +235,20 @@ subtype=Giant Warrior toughness=7 [/card] [card] +#This card has been reported to crash the game when played from a graveyard. Let's test it +text=Flying, haste. When you play Demigod of Revenge, return all cards named Demigod of Revenge from your graveyard to play. +id=153972 +name=Demigod of Revenge +auto=moveTo(myinplay) all(Demigod of Revenge|mygraveyard) +abilities=flying,haste +rarity=R +type=Creature +mana={BR}{BR}{BR}{BR}{BR} +power=5 +subtype=Spirit Avatar +toughness=4 +[/card] +[card] text=Trample Whenever Deus of Calamity deals 6 or more damage to an opponent, destroy target land that player controls. id=146773 name=Deus of Calamity diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 2b65c06e6..d26f4fc58 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -42,6 +42,8 @@ ashen_firebeast2.txt barbed_sliver.txt basal_sliver.txt beacon_of_unrest.txt +belligerent_hatchling.txt +benalish_knight.txt #befoul.txt blessed_wine.txt #blinking_spirit.txt @@ -153,6 +155,7 @@ rhox_meditant2.txt righteous_cause.txt rootwalla.txt royal_assassin.txt +safehold_duo.txt sedge_sliver.txt seismic_assault.txt siege_gang_commander.txt diff --git a/projects/mtg/bin/Res/test/belligerent_hatchling.txt b/projects/mtg/bin/Res/test/belligerent_hatchling.txt new file mode 100644 index 000000000..d192758b3 --- /dev/null +++ b/projects/mtg/bin/Res/test/belligerent_hatchling.txt @@ -0,0 +1,30 @@ +#Bug: Belligerent Hatchling doesn't lose its counters +[INIT] +FIRSTMAIN +[PLAYER1] +manapool:{R} +inplay:belligerent hatchling +hand:shock +[PLAYER2] +[DO] +shock +p2 +next +#begin +next +#attackers +belligerent hatchling +next +#blockers +next +#damage +next +#end of combat +[ASSERT] +COMBATEND +[PLAYER1] +inplay:belligerent hatchling +graveyard:shock +[PLAYER2] +life:15 +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/benalish_knight.txt b/projects/mtg/bin/Res/test/benalish_knight.txt new file mode 100644 index 000000000..6bbbcf937 --- /dev/null +++ b/projects/mtg/bin/Res/test/benalish_knight.txt @@ -0,0 +1,28 @@ +#Bug: Benalish Knight offers to block from hand +[INIT] +COMBATATTACKERS +[PLAYER1] +inplay:grizzly bears +[PLAYER2] +hand:benalish knight +inplay:plains,mountain,swamp +[DO] +grizzly bears +next +#blockers +plains +mountain +swamp +benalish knight +benalish knight +next +#damage +next +#end +[ASSERT] +COMBATEND +[PLAYER1] +graveyard:grizzly bears +[PLAYER2] +inplay:plains,mountain,swamp,benalish knight +[END] \ No newline at end of file diff --git a/projects/mtg/bin/Res/test/safehold_duo.txt b/projects/mtg/bin/Res/test/safehold_duo.txt new file mode 100644 index 000000000..c3e29d874 --- /dev/null +++ b/projects/mtg/bin/Res/test/safehold_duo.txt @@ -0,0 +1,43 @@ +#Bug:Safehold duo keeps its bonus at end of turn +[INIT] +FIRSTMAIN +[PLAYER1] +inplay:safehold duo +manapool:{g} +hand:wall of wood +[PLAYER2] +[DO] +wall of wood +next +#begin +next +#attackers +safehold duo +next +#blockers +eot +eot +next +#upkeep +next +#draw +next +#main +next +#beigin +next +#attackers +safehold duo +next +#blockers +next +#damage +next +#end combat +[ASSERT] +COMBATEND +[PLAYER1] +inplay:safehold duo,wall of wood +[PLAYER2] +life:15 +[END] \ No newline at end of file diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 686bdde54..15b9156a2 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -76,7 +76,7 @@ class AACounter: public ActivatedAbility{ _target->counters->addCounter(power, toughness); } }else{ - for (int i=0; i < nb; i++){ + for (int i=0; i < -nb; i++){ _target->counters->removeCounter(power, toughness); } } diff --git a/projects/mtg/include/GameOptions.h b/projects/mtg/include/GameOptions.h index 7bbd1a942..fd40a6e71 100644 --- a/projects/mtg/include/GameOptions.h +++ b/projects/mtg/include/GameOptions.h @@ -19,6 +19,7 @@ using std::string; #define OPTIONS_PLASMAEFFECT "plasmaEffect" #define OPTIONS_INTERRUPTMYSPELLS "interruptMySpells" #define OPTIONS_INTERRUPTMYABILITIES "interruptMyAbilities" +#define OPTIONS_OSD "displayOSD" // WALDORF - added #define OPTIONS_INTERRUPT_SECONDS "interruptSeconds" diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index ce0e499e6..f14c47e6f 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -29,6 +29,7 @@ void GameStateOptions::Start() optionsList->Add(NEW OptionItem(OPTIONS_SFXVOLUME, "SFX volume", 100, 10)); optionsList->Add(NEW OptionItem(OPTIONS_INTERRUPTMYSPELLS, "interrupt my spells")); optionsList->Add(NEW OptionItem(OPTIONS_INTERRUPTMYABILITIES, "interrupt my abilities")); + optionsList->Add(NEW OptionItem(OPTIONS_OSD, "Display InGame extra information")); // WALDORF - added next line optionsList->Add(NEW OptionItem(OPTIONS_INTERRUPT_SECONDS, "Seconds to pause for an Interrupt", 20, 1)); if (GameOptions::GetInstance()->values[OPTIONS_DIFFICULTY_MODE_UNLOCKED].getIntValue()) { diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 193342711..bb544abc9 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -545,13 +545,15 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NULL; } - + int forceUEOT = 0; + found = s.find("ueot"); + if (found!= string::npos) forceUEOT = 1; //Change Power/Toughness int power, toughness; if ( parsePowerToughness(s,&power, &toughness)){ if (!activated){ - if(card->hasType("instant") || card->hasType("sorcery")){ + if(card->hasType("instant") || card->hasType("sorcery") || forceUEOT){ return NEW AInstantPowerToughnessModifierUntilEOT(id, card, target,power,toughness); } return NEW APowerToughnessModifier(id, card, target,power,toughness); @@ -578,7 +580,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG int modifier = 1; if (found > 0 && s[found-1] == '-') modifier = 0; if (!activated){ - if(card->hasType("instant") || card->hasType("sorcery") ) return NEW AInstantBasicAbilityModifierUntilEOT(id, card,target, j,modifier); + if(card->hasType("instant") || card->hasType("sorcery") || forceUEOT){ + return NEW AInstantBasicAbilityModifierUntilEOT(id, card,target, j,modifier); + } return NEW ABasicAbilityModifier(id, card,target, j,modifier); } return NEW ABasicAbilityAuraModifierUntilEOT(id, card,target, NULL,j,modifier); diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 3d9a0f18d..ea3a0ce0c 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -342,6 +342,7 @@ int MTGCardInstance::canBlock(){ if (tapped) return 0; if (basicAbilities[Constants::CANTBLOCK]) return 0; if (!isACreature())return 0; + if (!isInPlay()) return 0; return 1; } diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 5ab5ee3f1..b02745636 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1,6 +1,7 @@ #include "../include/config.h" #include "../include/MTGRules.h" #include "../include/Translate.h" +#include "../include/GameOptions.h" MTGPutInPlayRule::MTGPutInPlayRule(int _id):MTGAbility(_id, NULL){ aType=MTGAbility::PUT_INTO_PLAY; @@ -371,6 +372,7 @@ int HUDDisplay::receiveEvent(WEvent * event){ return 0; } void HUDDisplay::Render(){ + if (!GameOptions::GetInstance()->values[OPTIONS_OSD].getIntValue()) return; if (!events.size()) return; f->SetColor(ARGB(255,255,255,255));