From 3007ddc0934bb4917cdd61f043dd6fb26ba30da9 Mon Sep 17 00:00:00 2001 From: zethfoxster Date: Sun, 24 Jul 2016 11:08:08 -0400 Subject: [PATCH 1/2] added oplifetotal...or readded, i swear this was already in a long time ago when I added lifetotal as a variable. either way. --- projects/mtg/include/AllAbilities.h | 5 +++++ projects/mtg/src/MTGCardInstance.cpp | 6 +++--- projects/mtg/src/MTGRules.cpp | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index ea8750b18..16f409e43 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -596,6 +596,10 @@ private: if(card->playerTarget) intValue = card->playerTarget->curses.size(); } + else if (s == "oplifetotal") + { + intValue = target->controller()->opponent()->life; + } else if (s == "lifetotal") { intValue = target->controller()->life; @@ -3296,6 +3300,7 @@ public: game->removeObserver(abilities[card]); abilities.erase(card); } + resolve(); return 1; } diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index de9b36f6f..91f5404fc 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -635,15 +635,15 @@ Player * MTGCardInstance::controller() int MTGCardInstance::canAttack() { - if (basicAbilities[(int)Constants::CANTATTACK]) + if (has(Constants::CANTATTACK)) return 0; - if (basicAbilities[(int)Constants::FLYERSONLY] && !basicAbilities[(int)Constants::FLYING]) + if (has(Constants::FLYERSONLY) && !has(Constants::FLYING)) return 0; if (tapped) return 0; if (hasSummoningSickness()) return 0; - if (basicAbilities[(int)Constants::DEFENSER] && !basicAbilities[(int)Constants::CANATTACK]) + if (has(Constants::DEFENSER) && !has(Constants::CANATTACK)) return 0; if (!isCreature()) return 0; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 134456d79..6793a2ac1 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -760,7 +760,7 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost * ManaCost * cost = card->getManaCost(); cost->Dump(); #endif - if (alternateManaCost->extraCosts) + if (alternateManaCost->extraCosts && !playerMana->canAfford(card->getManaCost())) { //offerings handle thier own casting and cost payments. //we add this condiational here because offering can also have a completely different From 61068ee166776629e0e2b3404e4b5b07743bc9f8 Mon Sep 17 00:00:00 2001 From: zethfoxster Date: Sun, 24 Jul 2016 11:12:13 -0400 Subject: [PATCH 2/2] big whoops here, this would be a disastrous change. --- projects/mtg/include/AllAbilities.h | 1 - 1 file changed, 1 deletion(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 16f409e43..94d176f18 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -3300,7 +3300,6 @@ public: game->removeObserver(abilities[card]); abilities.erase(card); } - resolve(); return 1; }