1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Rename afterCast to applyBattle

* afterXXX will be used in future event-driven mechanics
This commit is contained in:
AlexVinS 2015-01-30 18:40:15 +03:00
parent 66ca4bc0c2
commit c7c235c0ca
6 changed files with 17 additions and 17 deletions

View File

@ -802,7 +802,7 @@ void CSpellWindow::SpellArea::clickRight(tribool down, bool previousState)
std::string dmgInfo;
const CGHeroInstance * hero = owner->myHero;
int causedDmg = owner->myInt->cb->estimateSpellDamage( CGI->spellh->objects[mySpell], (hero ? hero : nullptr));
if(causedDmg == 0 || mySpell == 57) //Titan's Lightning Bolt already has damage info included
if(causedDmg == 0 || mySpell == SpellID::TITANS_LIGHTNING_BOLT) //Titan's Lightning Bolt already has damage info included
dmgInfo = "";
else
{

View File

@ -107,9 +107,9 @@ CSpell::~CSpell()
delete mechanics;
}
void CSpell::afterCast(BattleInfo * battle, const BattleSpellCast * packet) const
void CSpell::applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const
{
mechanics->afterCast(battle, packet);
mechanics->applyBattle(battle, packet);
}
bool CSpell::adventureCast(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const

View File

@ -324,7 +324,7 @@ public:
///Shall be called (only) when applying packets on BOTH SIDES
///implementation of BattleSpellCast applying
void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const;
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const;
private:
void setIsOffensive(const bool val);

View File

@ -1339,7 +1339,7 @@ DLL_LINKAGE void BattleSpellCast::applyGs( CGameState *gs )
const CSpell * spell = SpellID(id).toSpell();
spell->afterCast(gs->curB, this);
spell->applyBattle(gs->curB, this);
}
void actualizeEffect(CStack * s, const std::vector<Bonus> & ef)

View File

@ -146,7 +146,7 @@ public:
bool adventureCast(const SpellCastEnvironment * env, AdventureSpellCastParameters & parameters) const override final;
void battleCast(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters) const override;
void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const override;
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override;
protected:
virtual void applyBattleEffects(const SpellCastEnvironment * env, BattleSpellCastParameters & parameters, SpellCastContext & ctx) const;
@ -237,7 +237,7 @@ class CureMechanics: public DefaultSpellMechanics
public:
CureMechanics(CSpell * s): DefaultSpellMechanics(s){};
void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const override;
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override;
};
class DeathStareMechnics: public DefaultSpellMechanics
@ -253,7 +253,7 @@ class DispellHelpfulMechanics: public DefaultSpellMechanics
public:
DispellHelpfulMechanics(CSpell * s): DefaultSpellMechanics(s){};
void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const override;
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override;
ESpellCastProblem::ESpellCastProblem isImmuneByStack(const CGHeroInstance * caster, const CStack * obj) const override;
};
@ -263,7 +263,7 @@ class DispellMechanics: public DefaultSpellMechanics
public:
DispellMechanics(CSpell * s): DefaultSpellMechanics(s){};
void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const override;
void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const override;
};
class HypnotizeMechanics: public DefaultSpellMechanics
@ -407,7 +407,7 @@ ISpellMechanics * ISpellMechanics::createMechanics(CSpell * s)
///DefaultSpellMechanics
void DefaultSpellMechanics::afterCast(BattleInfo * battle, const BattleSpellCast * packet) const
void DefaultSpellMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const
{
if (packet->castedByHero)
{
@ -1344,9 +1344,9 @@ ESpellCastProblem::ESpellCastProblem CloneMechanics::isImmuneByStack(const CGHer
}
///CureMechanics
void CureMechanics::afterCast(BattleInfo * battle, const BattleSpellCast * packet) const
void CureMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const
{
DefaultSpellMechanics::afterCast(battle, packet);
DefaultSpellMechanics::applyBattle(battle, packet);
for(auto stackID : packet->affectedCres)
{
@ -1394,9 +1394,9 @@ void DeathStareMechnics::applyBattleEffects(const SpellCastEnvironment * env, Ba
///DispellHelpfulMechanics
void DispellHelpfulMechanics::afterCast(BattleInfo * battle, const BattleSpellCast * packet) const
void DispellHelpfulMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const
{
DefaultSpellMechanics::afterCast(battle, packet);
DefaultSpellMechanics::applyBattle(battle, packet);
for(auto stackID : packet->affectedCres)
{
@ -1434,9 +1434,9 @@ ESpellCastProblem::ESpellCastProblem DispellHelpfulMechanics::isImmuneByStack(co
}
///DispellMechanics
void DispellMechanics::afterCast(BattleInfo * battle, const BattleSpellCast * packet) const
void DispellMechanics::applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const
{
DefaultSpellMechanics::afterCast(battle, packet);
DefaultSpellMechanics::applyBattle(battle, packet);
for(auto stackID : packet->affectedCres)
{

View File

@ -46,7 +46,7 @@ public:
static ISpellMechanics * createMechanics(CSpell * s);
virtual void afterCast(BattleInfo * battle, const BattleSpellCast * packet) const = 0;
virtual void applyBattle(BattleInfo * battle, const BattleSpellCast * packet) const = 0;
protected:
CSpell * owner;