From f5bd6b27941131ef31bf33823a07955b1afff008 Mon Sep 17 00:00:00 2001 From: "wrenczes@gmail.com" Date: Tue, 26 Apr 2011 06:15:58 +0000 Subject: [PATCH] Removed ABasicAbilityModifierUntilEOT. Zeth, please review - I started to try to fix the array notation of this class, but then realized that the compiler was optimizing out this class entirely out of the binary - it's not currently used at all. Is this deprecated, and just got left behind..? (If you do have a reason to put it back, let's find a more compact way to write this.) --- projects/mtg/include/AllAbilities.h | 77 ----------------------------- 1 file changed, 77 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 026e9a542..c9d7995c2 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1378,83 +1378,6 @@ public: }; -//Modifies an ability until end of turn. Needs a target -class ABasicAbilityModifierUntilEOT: public TargetAbility -{ -public: - MTGCardInstance * mTargets[50]; - int nbTargets; - int modifier; - int stateBeforeActivation[50]; - int ability; - ABasicAbilityModifierUntilEOT(int _id, MTGCardInstance * _source, int _ability, ManaCost * _cost, TargetChooser * _tc = NULL, - int _modifier = 1) : - TargetAbility(_id, _source, _cost, 0), modifier(_modifier), ability(_ability) - { - aType = MTGAbility::STANDARDABILITYGRANT; - abilitygranted = ability; - nbTargets = 0; - tc = _tc; - if (!tc) tc = NEW TypeTargetChooser("creature",_source); - } - - void Update(float dt) - { - if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UNTAP) - { - for (int i = 0; i < nbTargets; i++) - { - MTGCardInstance * mTarget = mTargets[i]; - if (mTarget && mTarget->basicAbilities[ability]) - { - mTarget->basicAbilities[ability] = stateBeforeActivation[i]; - } - } - nbTargets = 0; - } - TargetAbility::Update(dt); - } - - int resolve() - { - MTGCardInstance * mTarget = tc->getNextCardTarget(); - if (mTarget) - { - mTargets[nbTargets] = mTarget; - stateBeforeActivation[nbTargets] = mTarget->basicAbilities[ability]; - mTarget->basicAbilities[ability] = modifier; - nbTargets++; - } - return 1; - } - - int addToGame() - { - resolve(); - return ActivatedAbility::addToGame(); - } - - const char * getMenuText() - { - return Constants::MTGBasicAbilities[ability]; - } - - virtual ostream& toString(ostream& out) const - { - out << "ABasicAbilityModifierUntilEOT ::: mTargets : " << mTargets << " ; nbTargets : " << nbTargets << " ; modifier : " - << modifier << " ; stateBeforeActivation : " << stateBeforeActivation << " ; ability : " << ability << " ("; - return TargetAbility::toString(out) << ")"; - } - - ABasicAbilityModifierUntilEOT * clone() const - { - ABasicAbilityModifierUntilEOT * a = NEW ABasicAbilityModifierUntilEOT(*this); - a->isClone = 1; - return a; - } - -}; - /*Instants that modifies a basic ability until end of turn */ class AInstantBasicAbilityModifierUntilEOT: public InstantAbility {