From ffbcd3f2d0eafabcf1d151a0235ef8ce444ac547 Mon Sep 17 00:00:00 2001 From: "wagic.the.homebrew@gmail.com" Date: Sun, 17 Jan 2010 12:05:40 +0000 Subject: [PATCH] ERwan -fix issue 297 - also removed the "untapBlockers" system. The idea was nice but incorrectly implemented, and only 2 cards were using it so far. --- projects/mtg/Makefile | 2 +- projects/mtg/bin/Res/sets/RV/_cards.dat | 5 + projects/mtg/include/AllAbilities.h | 21 ---- projects/mtg/include/Blocker.h | 55 ---------- projects/mtg/include/ConstraintResolver.h | 14 --- projects/mtg/include/GameObserver.h | 1 + projects/mtg/include/MTGAbility.h | 32 ++++++ projects/mtg/include/MTGCardInstance.h | 2 - projects/mtg/src/Blocker.cpp | 125 ---------------------- projects/mtg/src/CardDescriptor.cpp | 1 - projects/mtg/src/ConstraintResolver.cpp | 42 -------- projects/mtg/src/GameObserver.cpp | 13 ++- projects/mtg/src/MTGAbility.cpp | 42 ++++---- projects/mtg/src/MTGCardInstance.cpp | 7 -- projects/mtg/src/MTGGameZones.cpp | 2 +- projects/mtg/template.vcproj | 16 --- 16 files changed, 74 insertions(+), 306 deletions(-) delete mode 100644 projects/mtg/include/Blocker.h delete mode 100644 projects/mtg/include/ConstraintResolver.h delete mode 100644 projects/mtg/src/Blocker.cpp delete mode 100644 projects/mtg/src/ConstraintResolver.cpp diff --git a/projects/mtg/Makefile b/projects/mtg/Makefile index 038370287..7d1121fb7 100644 --- a/projects/mtg/Makefile +++ b/projects/mtg/Makefile @@ -1,4 +1,4 @@ -OBJS = objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIMomirPlayer.o objs/AIPlayer.o objs/AIStats.o objs/Blocker.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/CardEffect.o objs/CardPrimitive.o objs/CardSelector.o objs/ConstraintResolver.o objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o objs/DeckDataWrapper.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o objs/GameObserver.o objs/GameOptions.o objs/GameState.o objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o objs/GameStateMenu.o objs/GameStateOptions.o objs/GameStateShop.o objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o objs/Logger.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGRules.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/Pos.o objs/PriceList.o objs/ReplacementEffects.o objs/Rules.o objs/ShopItem.o objs/SimpleMenu.o objs/SimpleMenuItem.o objs/SimplePad.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.o objs/Token.o objs/Translate.o objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o objs/WCachedResource.o objs/Tasks.o +OBJS = objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIMomirPlayer.o objs/AIPlayer.o objs/AIStats.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/CardEffect.o objs/CardPrimitive.o objs/CardSelector.o objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o objs/DeckDataWrapper.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o objs/GameObserver.o objs/GameOptions.o objs/GameState.o objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o objs/GameStateMenu.o objs/GameStateOptions.o objs/GameStateShop.o objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o objs/Logger.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGRules.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/Pos.o objs/PriceList.o objs/ReplacementEffects.o objs/Rules.o objs/ShopItem.o objs/SimpleMenu.o objs/SimpleMenuItem.o objs/SimplePad.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.o objs/Token.o objs/Translate.o objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o objs/WCachedResource.o objs/Tasks.o DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS)) RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache) diff --git a/projects/mtg/bin/Res/sets/RV/_cards.dat b/projects/mtg/bin/Res/sets/RV/_cards.dat index 48e6beb25..d7cb8598c 100644 --- a/projects/mtg/bin/Res/sets/RV/_cards.dat +++ b/projects/mtg/bin/Res/sets/RV/_cards.dat @@ -1408,6 +1408,8 @@ type=Instant text=Mana Vault doesn't untap during your untap step. At the beginning of your upkeep, you may pay {4}. If you do, untap Mana Vault. At the beginning of your draw step, if Mana Vault is tapped, it deals 1 damage to you. {T}: Add {3} to your mana pool. id=1124 name=Mana Vault +auto=doesnotuntap +auto={4}:untap myUpkeepOnly rarity=R mana={1} type=Artifact @@ -1581,6 +1583,9 @@ text=Enchant creature When Paralyze enters the battlefield, tap enchanted crea target=creature id=1171 name=Paralyze +auto=tap +auto=doesnotuntap +auto={4}:untap upkeepOlny rarity=C mana={B} type=Enchantment diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 1290d514c..97efc28aa 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1405,27 +1405,6 @@ class GenericInstantAbility: public InstantAbility{ }; -//Untap Blockers with simple Mana Mechanism -class AUntapManaBlocker: public UntapBlocker{ - public: - AUntapManaBlocker(int id, MTGCardInstance * card, ManaCost * _cost):UntapBlocker(id, card, _cost){ - } - - AUntapManaBlocker(int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost):UntapBlocker(id, card,_target, _cost){ - } - virtual ostream& toString(ostream& out) const - { - out << "AUntapManaBlocker ::: ("; - return UntapBlocker::toString(out) << ")"; - } - AUntapManaBlocker * clone() const{ - AUntapManaBlocker * a = NEW AUntapManaBlocker(*this); - a->isClone = 1; - return a; - } -}; - - //Circle of Protections class ACircleOfProtection: public TargetAbility{ protected: diff --git a/projects/mtg/include/Blocker.h b/projects/mtg/include/Blocker.h deleted file mode 100644 index 0d4fc1df4..000000000 --- a/projects/mtg/include/Blocker.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _BLOCKER_H_ -#define _BLOCKER_H_ - - -#define MAX_BLOCKERS 64 // Currently needs to be equal to MAX_GUI_OBJECTS in JGE/JGui.h. - - -#include "MTGAbility.h" - - -class ManaCost; -class GameObserver; -class MTGAbility; - -class UntapBlocker : public MTGAbility { - protected: - ManaCost * manaCost; - int currentPhase; - void init(ManaCost * _cost); - public: - virtual ManaCost * untapManaCost(){return manaCost;}; - virtual int unblock(){return 1;}; - UntapBlocker(int id, MTGCardInstance * card, ManaCost * _cost); - UntapBlocker(int id, MTGCardInstance * card); - UntapBlocker(int id, MTGCardInstance * card, MTGCardInstance *_target); - UntapBlocker(int id, MTGCardInstance * card, MTGCardInstance *_target, ManaCost * _cost); - ~UntapBlocker(); - virtual void Update(float dt); - virtual int destroy(); - virtual UntapBlocker * clone() const; -}; - - -class UntapBlockers { - protected: - int cursor; - int blockers[MAX_BLOCKERS]; - GameObserver * game; - public: - UntapBlockers(); - ~UntapBlockers(); - int Add (UntapBlocker * ability); - int Remove (UntapBlocker * ability); - int init(); - UntapBlocker * next(); - int rewind(); - int isEmpty(); -}; - - -#include "ManaCost.h" -#include "GameObserver.h" - -#endif - diff --git a/projects/mtg/include/ConstraintResolver.h b/projects/mtg/include/ConstraintResolver.h deleted file mode 100644 index 7cf28ecc2..000000000 --- a/projects/mtg/include/ConstraintResolver.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _CONSTRAINTRESOLVER_H_ -#define _CONSTRAINTRESOLVER_H_ - -#include "GameObserver.h" -#include "MTGCardInstance.h" - - -class ConstraintResolver { - protected: - public: - static int untap(GameObserver * game, MTGCardInstance * card); -}; - -#endif diff --git a/projects/mtg/include/GameObserver.h b/projects/mtg/include/GameObserver.h index f73ce8205..80437f4bf 100644 --- a/projects/mtg/include/GameObserver.h +++ b/projects/mtg/include/GameObserver.h @@ -31,6 +31,7 @@ class GameObserver{ int nbPlayers; int currentPlayerId; + int untap(MTGCardInstance * card); public: CombatStep combatStep; diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index d5b2c0bbe..98fd5308d 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -119,6 +119,38 @@ class ActivatedAbility:public MTGAbility{ MY_EOT = 15, MY_CLEANUP = 16, MY_AFTER_EOT = 17, + + OPPONENT_BEFORE_BEGIN = 23, + OPPONENT_UNTAP = 24, + OPPONENT_UPKEEP = 25, + OPPONENT_DRAW = 26, + OPPONENT_FIRSTMAIN = 27, + OPPONENT_COMBATBEGIN = 28, + OPPONENT_COMBATATTACKERS = 29, + OPPONENT_COMBATBLOCKERS = 30, + OPPONENT_COMBATDAMAGE = 31, + OPPONENT_COMBATEND = 32, + OPPONENT_SECONDMAIN = 33, + OPPONENT_ENDOFTURN = 34, + OPPONENT_EOT = 35, + OPPONENT_CLEANUP = 36, + OPPONENT_AFTER_EOT = 37, + + BEFORE_BEGIN = 43, + UNTAP = 44, + UPKEEP = 45, + DRAW = 46, + FIRSTMAIN = 47, + COMBATBEGIN = 48, + COMBATATTACKERS = 49, + COMBATBLOCKERS = 50, + COMBATDAMAGE = 51, + COMBATEND = 52, + SECONDMAIN = 53, + ENDOFTURN = 54, + EOT = 55, + CLEANUP = 56, + AFTER_EOT = 57, }; int restrictions; int needsTapping; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 0c2fb39e7..45888d97f 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -33,7 +33,6 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable { int tapped; int lifeOrig; - UntapBlockers * untapBlockers; MTGPlayerCards * belongs_to; MTGAbility * untapBlockerAbilities[10]; MTGCardInstance * getNextPartner(); @@ -105,7 +104,6 @@ class MTGCardInstance: public CardPrimitive, public MTGCard, public Damageable { MTGCard * model; MTGCardInstance(); MTGCardInstance(MTGCard * card, MTGPlayerCards * _belongs_to); - UntapBlockers * getUntapBlockers(); int regenerate(); int triggerRegenerate(); Player * controller(); diff --git a/projects/mtg/src/Blocker.cpp b/projects/mtg/src/Blocker.cpp deleted file mode 100644 index f839e72c5..000000000 --- a/projects/mtg/src/Blocker.cpp +++ /dev/null @@ -1,125 +0,0 @@ -#include "../include/config.h" -#include "../include/Blocker.h" - -UntapBlocker::UntapBlocker(int id, MTGCardInstance * card):MTGAbility(id, card){ - init ( NEW ManaCost()); -} - -UntapBlocker::UntapBlocker(int id, MTGCardInstance * card, ManaCost * _cost):MTGAbility(id, card){ - init(_cost); -} -UntapBlocker::UntapBlocker(int id, MTGCardInstance * card, MTGCardInstance *_target):MTGAbility(id, card,_target){ - init ( NEW ManaCost()); -} -UntapBlocker::UntapBlocker(int id, MTGCardInstance * card, MTGCardInstance *_target, ManaCost * _cost):MTGAbility(id, card,_target){ - init(_cost); -} - -UntapBlocker::~UntapBlocker(){ - SAFE_DELETE(manaCost); -} - -void UntapBlocker::init(ManaCost * _cost){ - currentPhase = -1; - manaCost = _cost; -} - -UntapBlocker * UntapBlocker::clone() const{ - UntapBlocker * a = NEW UntapBlocker(*this); - a->isClone = 1; - return a; -} - - -//Default behaviour for blockers : they block the card they're attached to -void UntapBlocker::Update(float dt){ - game = GameObserver::GetInstance(); - int newPhase = game->getCurrentGamePhase(); - if (newPhase != currentPhase){ - MTGCardInstance * _target; - if (target){ - _target = (MTGCardInstance *) target; - }else{ - _target = source; - } - _target->getUntapBlockers()->Add(this); -#if defined (WIN32) || defined (LINUX) - char buf[4096]; - sprintf(buf, "Adding Blocker to %s \n", _target->getName().c_str()); - OutputDebugString(buf); -#endif - } - currentPhase = newPhase; -} - -int UntapBlocker::destroy(){ - MTGCardInstance * _target; - if (target){ - _target = (MTGCardInstance *) target; - }else{ - _target = source; - } - _target->getUntapBlockers()->Remove(this); - return 1; -} - -UntapBlockers::UntapBlockers(){ - init(); -} - - - -int UntapBlockers::init(){ - cursor = -1; - - for (int i=0; i< MAX_BLOCKERS ; i++){ - blockers[i] = 0; - } - - return 1; -} - -int UntapBlockers::Add (UntapBlocker * ability){ - game = GameObserver::GetInstance(); - int index = game->mLayers->actionLayer()->getIndexOf(ability); - blockers[index] = 1; - return index; -} -int UntapBlockers::Remove (UntapBlocker * ability){ - game = GameObserver::GetInstance(); - int index = game->mLayers->actionLayer()->getIndexOf(ability); - blockers[index] = 0; - return index; -} - -int UntapBlockers::rewind(){ - cursor = -1; - return 1; -} - -UntapBlocker * UntapBlockers::next(){ - cursor++; - game = GameObserver::GetInstance(); - while (blockers[cursor] == 0){ - cursor ++; - if (cursor == MAX_BLOCKERS){ - cursor = -1; - return NULL; - } - } - return (UntapBlocker *) (game->mLayers->actionLayer()->getByIndex(cursor)); -} - - - -int UntapBlockers::isEmpty(){ - for (int i=0; i< MAX_BLOCKERS ; i++){ - if (blockers[i]) - return 0; - } - return 1; -} - -UntapBlockers::~UntapBlockers(){ - -} diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index bf3a3cf29..4a5f4283a 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -19,7 +19,6 @@ int CardDescriptor::init(){ defenser = NULL; banding = NULL; //Remove unnecessary pointers - SAFE_DELETE(untapBlockers); SAFE_DELETE(counters); SAFE_DELETE(previous); return result; diff --git a/projects/mtg/src/ConstraintResolver.cpp b/projects/mtg/src/ConstraintResolver.cpp deleted file mode 100644 index c01345182..000000000 --- a/projects/mtg/src/ConstraintResolver.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "../include/config.h" -#include "../include/ConstraintResolver.h" - - -int ConstraintResolver::untap(GameObserver * game, MTGCardInstance * card){ - if (!card->isUntapping()){ - return 0; - } - if (card->has(Constants::DOESNOTUNTAP)) return 0; - int ok = 1; - ManaCost * untapManaCost = NEW ManaCost(); - UntapBlockers * blockers = card->getUntapBlockers(); - UntapBlocker * blocker; - blockers->rewind(); - Player * player = game->currentPlayer; - while ((blocker = blockers->next())){ -#if defined (WIN32) || defined (LINUX) - char buf[4096]; - sprintf(buf, "next\n"); - OutputDebugString(buf); -#endif - untapManaCost->add(blocker->untapManaCost()); - } - if (player->getManaPool()->canAfford(untapManaCost)){ - blockers->rewind(); - while ((blocker = blockers->next())){ - if (!blocker->unblock()){ - ok = 0; - break; - } - } - }else{ - ok = 0; - } - - if (ok) { - player->getManaPool()->pay(untapManaCost); - card->attemptUntap(); - } - delete untapManaCost; - return ok; -} diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 439bf5975..4f14571ce 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -435,7 +435,7 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){ mLayers->actionLayer()->setMenuObject(object); } }else if (card->isTapped() && card->controller() == currentPlayer){ - ConstraintResolver::untap(this, card); + untap(card); } @@ -443,6 +443,17 @@ void GameObserver::cardClick (MTGCardInstance * card, Targetable * object){ } +int GameObserver::untap(MTGCardInstance * card) { + if (!card->isUntapping()){ + return 0; + } + if (card->has(Constants::DOESNOTUNTAP)) return 0; + + card->attemptUntap(); + return 1; +} + + TargetChooser * GameObserver::getCurrentTargetChooser(){ TargetChooser * _tc = mLayers->actionLayer()->getCurrentTargetChooser(); if (_tc) return _tc; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index c7fcf8a50..f63611ec1 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -147,14 +147,18 @@ int AbilityFactory::parseRestriction(string s){ if (s.find("myturnonly") != string::npos) return ActivatedAbility::PLAYER_TURN_ONLY; if (s.find("assorcery") != string::npos) return ActivatedAbility::AS_SORCERY; - size_t found = s.find("my"); - if (found !=string::npos){ - for (int i = 0; i < Constants::NB_MTG_PHASES; i++){ - string toFind = "my"; - toFind.append(Constants::MTGPhaseCodeNames[i]).append("only"); - found = s.find(toFind); - if (found != string::npos){ - return ActivatedAbility::MY_BEFORE_BEGIN + i; + string types[] = {"my","opponent", ""}; + int starts[] = {ActivatedAbility::MY_BEFORE_BEGIN,ActivatedAbility::OPPONENT_BEFORE_BEGIN,ActivatedAbility::BEFORE_BEGIN}; + for (int j = 0; j < 3; ++j){ + size_t found = s.find(types[j]); + if (found !=string::npos){ + for (int i = 0; i < Constants::NB_MTG_PHASES; i++){ + string toFind = types[j]; + toFind.append(Constants::MTGPhaseCodeNames[i]).append("only"); + found = s.find(toFind); + if (found != string::npos){ + return starts[j] + i; + } } } } @@ -1206,12 +1210,8 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ game->addObserver(NEW AConvertLandToCreatures(id, card, "forest")); break; } - case 1124: //Mana Vault + case 1124: //Mana Vault (the rest is softcoded!) { - int output[] = {Constants::MTG_COLOR_ARTIFACT, 3}; - game->addObserver(NEW AManaProducer(_id,card,card,NEW ManaCost(output,1))); - int cost[] = {Constants::MTG_COLOR_ARTIFACT, 4}; - game->addObserver(NEW AUntapManaBlocker(_id+1, card, NEW ManaCost(cost,1))); game->addObserver(NEW ARegularLifeModifierAura(_id+2, card, card, Constants::MTG_PHASE_DRAW, -1, 1)); break; } @@ -1336,13 +1336,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){ } break; } - case 1171: //Paralyze - { - int cost[] = {Constants::MTG_COLOR_ARTIFACT, 4}; - game->addObserver(NEW AUntapManaBlocker(_id, card,card->target, NEW ManaCost(cost,1))); - card->target->tap(); - break; - } case 1172: //Pestilence { game->addObserver(NEW APestilence(_id, card)); @@ -1736,6 +1729,15 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana) if (cPhase != restrictions - MY_BEFORE_BEGIN + Constants::MTG_PHASE_BEFORE_BEGIN) return 0; } + if (restrictions>= OPPONENT_BEFORE_BEGIN && restrictions <= OPPONENT_AFTER_EOT){ + if (player == game->currentPlayer) return 0; + if (cPhase != restrictions - OPPONENT_BEFORE_BEGIN + Constants::MTG_PHASE_BEFORE_BEGIN) return 0; + } + + if (restrictions>= BEFORE_BEGIN && restrictions <= AFTER_EOT){ + if (cPhase != restrictions - BEFORE_BEGIN + Constants::MTG_PHASE_BEFORE_BEGIN) return 0; + } + if (card == source && source->controller()==player && (!needsTapping || (!source->isTapped() && !source->hasSummoningSickness()))){ if (!cost) return 1; if (!mana) mana = player->getManaPool(); diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 81f8cabca..f54c2fa66 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -81,7 +81,6 @@ void MTGCardInstance::copy(MTGCardInstance * card){ MTGCardInstance::~MTGCardInstance(){ LOG("==Deleting MTGCardInstance=="); - SAFE_DELETE(untapBlockers); SAFE_DELETE(counters); SAFE_DELETE(previous); LOG("==Deleting MTGCardInstance Succesfull=="); @@ -102,7 +101,6 @@ void MTGCardInstance::initMTGCI(){ doDamageTest = 1; belongs_to=NULL; tapped = 0; - untapBlockers = NULL; untapping = 0; summoningSickness = 1; target = NULL; @@ -159,11 +157,6 @@ int MTGCardInstance::removeType(int id, int removeAll){ return result; } -UntapBlockers * MTGCardInstance::getUntapBlockers(){ - if (!untapBlockers) untapBlockers = NEW UntapBlockers(); - return untapBlockers; -} - int MTGCardInstance::isInPlay(){ GameObserver * game = GameObserver::GetInstance(); for (int i = 0 ; i < 2 ; i++){ diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 5da57da96..dc1c148ad 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -338,7 +338,7 @@ void MTGInPlay::untapAll(){ for (i = 0; i < nb_cards; i ++){ MTGCardInstance * card = cards[i]; card->setUntapping(); - if (!card->basicAbilities[Constants::DOESNOTUNTAP] && card->getUntapBlockers()->isEmpty()){ + if (!card->basicAbilities[Constants::DOESNOTUNTAP]){ card->attemptUntap(); } } diff --git a/projects/mtg/template.vcproj b/projects/mtg/template.vcproj index ef83b2e8a..b912402ab 100644 --- a/projects/mtg/template.vcproj +++ b/projects/mtg/template.vcproj @@ -338,10 +338,6 @@ RelativePath=".\src\AIStats.cpp" > - - @@ -362,10 +358,6 @@ RelativePath=".\src\CardSelector.cpp" > - - @@ -749,10 +741,6 @@ RelativePath=".\include\AllAbilities.h" > - - @@ -781,10 +769,6 @@ RelativePath=".\include\config.h" > - -