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.)
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user