mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
Reduced scope of CBattleInterface spellSelMode
This commit is contained in:
@ -98,7 +98,7 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe
|
|||||||
std::shared_ptr<CPlayerInterface> att, std::shared_ptr<CPlayerInterface> defen)
|
std::shared_ptr<CPlayerInterface> att, std::shared_ptr<CPlayerInterface> defen)
|
||||||
: background(nullptr), queue(nullptr), attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0),
|
: background(nullptr), queue(nullptr), attackingHeroInstance(hero1), defendingHeroInstance(hero2), animCount(0),
|
||||||
activeStack(nullptr), mouseHoveredStack(nullptr), stackToActivate(nullptr), selectedStack(nullptr), previouslyHoveredHex(-1),
|
activeStack(nullptr), mouseHoveredStack(nullptr), stackToActivate(nullptr), selectedStack(nullptr), previouslyHoveredHex(-1),
|
||||||
currentlyHoveredHex(-1), attackingHex(-1), stackCanCastSpell(false), creatureCasting(false), spellDestSelectMode(false), spellSelMode(NO_LOCATION), spellToCast(nullptr), sp(nullptr),
|
currentlyHoveredHex(-1), attackingHex(-1), stackCanCastSpell(false), creatureCasting(false), spellDestSelectMode(false), spellToCast(nullptr), sp(nullptr),
|
||||||
siegeH(nullptr), attackerInt(att), defenderInt(defen), curInt(att), animIDhelper(0),
|
siegeH(nullptr), attackerInt(att), defenderInt(defen), curInt(att), animIDhelper(0),
|
||||||
givenCommand(nullptr), myTurn(false), resWindow(nullptr), moveStarted(false), moveSoundHander(-1), bresult(nullptr)
|
givenCommand(nullptr), myTurn(false), resWindow(nullptr), moveStarted(false), moveSoundHander(-1), bresult(nullptr)
|
||||||
{
|
{
|
||||||
@ -1385,7 +1385,7 @@ void CBattleInterface::castThisSpell(SpellID spellID)
|
|||||||
const CGHeroInstance * castingHero = (attackingHeroInstance->tempOwner == curInt->playerID) ? attackingHeroInstance : defendingHeroInstance;
|
const CGHeroInstance * castingHero = (attackingHeroInstance->tempOwner == curInt->playerID) ? attackingHeroInstance : defendingHeroInstance;
|
||||||
assert(castingHero); // code below assumes non-null hero
|
assert(castingHero); // code below assumes non-null hero
|
||||||
sp = spellID.toSpell();
|
sp = spellID.toSpell();
|
||||||
spellSelMode = ANY_LOCATION;
|
PossibleActions spellSelMode = ANY_LOCATION;
|
||||||
|
|
||||||
const CSpell::TargetInfo ti(sp, castingHero->getSpellSchoolLevel(sp));
|
const CSpell::TargetInfo ti(sp, castingHero->getSpellSchoolLevel(sp));
|
||||||
|
|
||||||
|
@ -158,7 +158,6 @@ private:
|
|||||||
bool stackCanCastSpell; //if true, active stack could possibly cast some target spell
|
bool stackCanCastSpell; //if true, active stack could possibly cast some target spell
|
||||||
bool creatureCasting; //if true, stack currently aims to cats a spell
|
bool creatureCasting; //if true, stack currently aims to cats a spell
|
||||||
bool spellDestSelectMode; //if true, player is choosing destination for his spell - only for GUI / console
|
bool spellDestSelectMode; //if true, player is choosing destination for his spell - only for GUI / console
|
||||||
PossibleActions spellSelMode;
|
|
||||||
BattleAction * spellToCast; //spell for which player is choosing destination
|
BattleAction * spellToCast; //spell for which player is choosing destination
|
||||||
const CSpell * sp; //spell pointer for convenience
|
const CSpell * sp; //spell pointer for convenience
|
||||||
si32 creatureSpellToCast;
|
si32 creatureSpellToCast;
|
||||||
@ -194,7 +193,7 @@ private:
|
|||||||
const CBattleInterface * owner;
|
const CBattleInterface * owner;
|
||||||
public:
|
public:
|
||||||
const CGTownInstance * town; //besieged town
|
const CGTownInstance * town; //besieged town
|
||||||
|
|
||||||
SiegeHelper(const CGTownInstance * siegeTown, const CBattleInterface * _owner); //c-tor
|
SiegeHelper(const CGTownInstance * siegeTown, const CBattleInterface * _owner); //c-tor
|
||||||
~SiegeHelper(); //d-tor
|
~SiegeHelper(); //d-tor
|
||||||
|
|
||||||
@ -335,13 +334,13 @@ public:
|
|||||||
void battleStacksEffectsSet(const SetStackEffect & sse); //called when a specific effect is set to stacks
|
void battleStacksEffectsSet(const SetStackEffect & sse); //called when a specific effect is set to stacks
|
||||||
void castThisSpell(SpellID spellID); //called when player has chosen a spell from spellbook
|
void castThisSpell(SpellID spellID); //called when player has chosen a spell from spellbook
|
||||||
void displayEffect(ui32 effect, int destTile, bool areaEffect = true); //displays custom effect on the battlefield
|
void displayEffect(ui32 effect, int destTile, bool areaEffect = true); //displays custom effect on the battlefield
|
||||||
|
|
||||||
void displaySpellCast(SpellID spellID, BattleHex destinationTile, bool areaEffect = true); //displays spell`s cast animation
|
void displaySpellCast(SpellID spellID, BattleHex destinationTile, bool areaEffect = true); //displays spell`s cast animation
|
||||||
void displaySpellEffect(SpellID spellID, BattleHex destinationTile, bool areaEffect = true); //displays spell`s affected animation
|
void displaySpellEffect(SpellID spellID, BattleHex destinationTile, bool areaEffect = true); //displays spell`s affected animation
|
||||||
void displaySpellHit(SpellID spellID, BattleHex destinationTile, bool areaEffect = true); //displays spell`s affected animation
|
void displaySpellHit(SpellID spellID, BattleHex destinationTile, bool areaEffect = true); //displays spell`s affected animation
|
||||||
|
|
||||||
void displaySpellAnimation(const CSpell::TAnimation & animation, BattleHex destinationTile, bool areaEffect = true);
|
void displaySpellAnimation(const CSpell::TAnimation & animation, BattleHex destinationTile, bool areaEffect = true);
|
||||||
|
|
||||||
void battleTriggerEffect(const BattleTriggerEffect & bte);
|
void battleTriggerEffect(const BattleTriggerEffect & bte);
|
||||||
void setBattleCursor(const int myNumber); //really complex and messy, sets attackingHex
|
void setBattleCursor(const int myNumber); //really complex and messy, sets attackingHex
|
||||||
void endAction(const BattleAction* action);
|
void endAction(const BattleAction* action);
|
||||||
@ -365,7 +364,7 @@ public:
|
|||||||
friend class CPlayerInterface;
|
friend class CPlayerInterface;
|
||||||
friend class CButton;
|
friend class CButton;
|
||||||
friend class CInGameConsole;
|
friend class CInGameConsole;
|
||||||
|
|
||||||
friend class CBattleResultWindow;
|
friend class CBattleResultWindow;
|
||||||
friend class CBattleHero;
|
friend class CBattleHero;
|
||||||
friend class CSpellEffectAnimation;
|
friend class CSpellEffectAnimation;
|
||||||
|
Reference in New Issue
Block a user