mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-25 21:38:59 +02:00
Hide some spell mechnaics details
This commit is contained in:
parent
2c3a607497
commit
46f99db8d7
@ -71,13 +71,6 @@ namespace SpellConfig
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
BattleSpellCastParameters::BattleSpellCastParameters(const BattleInfo* cb)
|
|
||||||
: spellLvl(0), destination(BattleHex::INVALID), casterSide(0),casterColor(PlayerColor::CANNOT_DETERMINE),casterHero(nullptr), secHero(nullptr),
|
|
||||||
usedSpellPower(0),mode(ECastingMode::HERO_CASTING), casterStack(nullptr), selectedStack(nullptr), cb(cb)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
///CSpell::LevelInfo
|
///CSpell::LevelInfo
|
||||||
CSpell::LevelInfo::LevelInfo()
|
CSpell::LevelInfo::LevelInfo()
|
||||||
:description(""),cost(0),power(0),AIValue(0),smartTarget(true), clearTarget(false), clearAffected(false), range("0")
|
:description(""),cost(0),power(0),AIValue(0),smartTarget(true), clearTarget(false), clearAffected(false), range("0")
|
||||||
|
@ -30,6 +30,9 @@ struct BattleSpellCast;
|
|||||||
class CGameInfoCallback;
|
class CGameInfoCallback;
|
||||||
class CRandomGenerator;
|
class CRandomGenerator;
|
||||||
class CMap;
|
class CMap;
|
||||||
|
struct AdventureSpellCastParameters;
|
||||||
|
struct BattleSpellCastParameters;
|
||||||
|
class SpellCastEnvironment;
|
||||||
|
|
||||||
struct SpellSchoolInfo
|
struct SpellSchoolInfo
|
||||||
{
|
{
|
||||||
@ -41,45 +44,6 @@ struct SpellSchoolInfo
|
|||||||
Bonus::BonusType knoledgeBonus;
|
Bonus::BonusType knoledgeBonus;
|
||||||
};
|
};
|
||||||
|
|
||||||
///callback to be provided by server
|
|
||||||
class DLL_LINKAGE SpellCastEnvironment
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~SpellCastEnvironment(){};
|
|
||||||
virtual void sendAndApply(CPackForClient * info) const = 0;
|
|
||||||
|
|
||||||
virtual CRandomGenerator & getRandomGenerator() const = 0;
|
|
||||||
virtual void complain(const std::string & problem) const = 0;
|
|
||||||
|
|
||||||
virtual const CMap * getMap() const = 0;
|
|
||||||
virtual const CGameInfoCallback * getCb() const = 0;
|
|
||||||
|
|
||||||
virtual bool moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, PlayerColor asker = PlayerColor::NEUTRAL) const =0; //TODO: remove
|
|
||||||
};
|
|
||||||
|
|
||||||
///helper struct
|
|
||||||
struct DLL_LINKAGE BattleSpellCastParameters
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BattleSpellCastParameters(const BattleInfo * cb);
|
|
||||||
int spellLvl;
|
|
||||||
BattleHex destination;
|
|
||||||
ui8 casterSide;
|
|
||||||
PlayerColor casterColor;
|
|
||||||
const CGHeroInstance * casterHero; //deprecated
|
|
||||||
const CGHeroInstance * secHero;
|
|
||||||
int usedSpellPower;
|
|
||||||
ECastingMode::ECastingMode mode;
|
|
||||||
const CStack * casterStack;
|
|
||||||
const CStack * selectedStack;
|
|
||||||
const BattleInfo * cb;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct DLL_LINKAGE AdventureSpellCastParameters
|
|
||||||
{
|
|
||||||
const CGHeroInstance * caster;
|
|
||||||
int3 pos;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class VerticalPosition : ui8{TOP, CENTER, BOTTOM};
|
enum class VerticalPosition : ui8{TOP, CENTER, BOTTOM};
|
||||||
|
|
||||||
|
@ -17,6 +17,14 @@
|
|||||||
#include "BattleSpellMechanics.h"
|
#include "BattleSpellMechanics.h"
|
||||||
#include "CreatureSpellMechanics.h"
|
#include "CreatureSpellMechanics.h"
|
||||||
|
|
||||||
|
BattleSpellCastParameters::BattleSpellCastParameters(const BattleInfo* cb)
|
||||||
|
: spellLvl(0), destination(BattleHex::INVALID), casterSide(0),casterColor(PlayerColor::CANNOT_DETERMINE),casterHero(nullptr), secHero(nullptr),
|
||||||
|
usedSpellPower(0),mode(ECastingMode::HERO_CASTING), casterStack(nullptr), selectedStack(nullptr), cb(cb)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///ISpellMechanics
|
///ISpellMechanics
|
||||||
ISpellMechanics::ISpellMechanics(CSpell * s):
|
ISpellMechanics::ISpellMechanics(CSpell * s):
|
||||||
owner(s)
|
owner(s)
|
||||||
|
@ -15,6 +15,46 @@
|
|||||||
#include "../BattleState.h"
|
#include "../BattleState.h"
|
||||||
#include "../NetPacks.h"
|
#include "../NetPacks.h"
|
||||||
|
|
||||||
|
///callback to be provided by server
|
||||||
|
class DLL_LINKAGE SpellCastEnvironment
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~SpellCastEnvironment(){};
|
||||||
|
virtual void sendAndApply(CPackForClient * info) const = 0;
|
||||||
|
|
||||||
|
virtual CRandomGenerator & getRandomGenerator() const = 0;
|
||||||
|
virtual void complain(const std::string & problem) const = 0;
|
||||||
|
|
||||||
|
virtual const CMap * getMap() const = 0;
|
||||||
|
virtual const CGameInfoCallback * getCb() const = 0;
|
||||||
|
|
||||||
|
virtual bool moveHero(ObjectInstanceID hid, int3 dst, ui8 teleporting, PlayerColor asker = PlayerColor::NEUTRAL) const =0; //TODO: remove
|
||||||
|
};
|
||||||
|
|
||||||
|
///helper struct
|
||||||
|
struct DLL_LINKAGE BattleSpellCastParameters
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
BattleSpellCastParameters(const BattleInfo * cb);
|
||||||
|
int spellLvl;
|
||||||
|
BattleHex destination;
|
||||||
|
ui8 casterSide;
|
||||||
|
PlayerColor casterColor;
|
||||||
|
const CGHeroInstance * casterHero; //deprecated
|
||||||
|
const CGHeroInstance * secHero;
|
||||||
|
int usedSpellPower;
|
||||||
|
ECastingMode::ECastingMode mode;
|
||||||
|
const CStack * casterStack;
|
||||||
|
const CStack * selectedStack;
|
||||||
|
const BattleInfo * cb;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct DLL_LINKAGE AdventureSpellCastParameters
|
||||||
|
{
|
||||||
|
const CGHeroInstance * caster;
|
||||||
|
int3 pos;
|
||||||
|
};
|
||||||
|
|
||||||
class DLL_LINKAGE ISpellMechanics
|
class DLL_LINKAGE ISpellMechanics
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "../lib/CBuildingHandler.h"
|
#include "../lib/CBuildingHandler.h"
|
||||||
#include "../lib/CHeroHandler.h"
|
#include "../lib/CHeroHandler.h"
|
||||||
#include "../lib/spells/CSpellHandler.h"
|
#include "../lib/spells/CSpellHandler.h"
|
||||||
|
#include "../lib/spells/ISpellMechanics.h"
|
||||||
#include "../lib/CGeneralTextHandler.h"
|
#include "../lib/CGeneralTextHandler.h"
|
||||||
#include "../lib/CTownHandler.h"
|
#include "../lib/CTownHandler.h"
|
||||||
#include "../lib/CCreatureHandler.h"
|
#include "../lib/CCreatureHandler.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user