mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there. * Declared existing Entity APIs. * Added basic script context caching * Started Lua script module * Started Lua spell effect API * Started script state persistence * Started battle info callback binding * CommitPackage removed * Extracted spells::Caster to own header; Expanded Spell API. * implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C * !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented * Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key) * Re-enabled VERM macros. * !?GM0 added * !?TM implemented * Added !!MF:N * Started !?OB, !!BM, !!HE, !!OW, !!UN * Added basic support of w-variables * Added support for ERM indirect variables * Made !?FU regular trigger * !!re (ERA loop receiver) implemented * Fixed ERM receivers with zero args.
This commit is contained in:
@@ -8,10 +8,12 @@
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <vcmi/spells/Magic.h>
|
||||
|
||||
#include "CCallbackBase.h"
|
||||
#include "ReachabilityInfo.h"
|
||||
#include "BattleAttackInfo.h"
|
||||
#include "../spells/Magic.h"
|
||||
|
||||
class CGHeroInstance;
|
||||
class CStack;
|
||||
@@ -21,6 +23,19 @@ struct CObstacleInstance;
|
||||
class IBonusBearer;
|
||||
class CRandomGenerator;
|
||||
|
||||
namespace scripting
|
||||
{
|
||||
class Context;
|
||||
class Pool;
|
||||
class Script;
|
||||
}
|
||||
|
||||
namespace spells
|
||||
{
|
||||
class Caster;
|
||||
class Spell;
|
||||
}
|
||||
|
||||
struct DLL_LINKAGE AttackableTiles
|
||||
{
|
||||
std::set<BattleHex> hostileCreaturePositions;
|
||||
@@ -57,14 +72,14 @@ public:
|
||||
RANDOM_GENIE, RANDOM_AIMED
|
||||
};
|
||||
|
||||
boost::optional<int> battleIsFinished() const; //return none if battle is ongoing; otherwise the victorious side (0/1) or 2 if it is a draw
|
||||
boost::optional<int> battleIsFinished() const override; //return none if battle is ongoing; otherwise the victorious side (0/1) or 2 if it is a draw
|
||||
|
||||
std::vector<std::shared_ptr<const CObstacleInstance>> battleGetAllObstaclesOnPos(BattleHex tile, bool onlyBlocking = true) const; //blocking obstacles makes tile inaccessible, others cause special effects (like Land Mines, Moat, Quicksands)
|
||||
std::vector<std::shared_ptr<const CObstacleInstance>> getAllAffectedObstaclesByStack(const CStack * stack) const;
|
||||
std::vector<std::shared_ptr<const CObstacleInstance>> battleGetAllObstaclesOnPos(BattleHex tile, bool onlyBlocking = true) const override;
|
||||
std::vector<std::shared_ptr<const CObstacleInstance>> getAllAffectedObstaclesByStack(const battle::Unit * unit) const override;
|
||||
|
||||
const CStack * battleGetStackByPos(BattleHex pos, bool onlyAlive = true) const;
|
||||
|
||||
const battle::Unit * battleGetUnitByPos(BattleHex pos, bool onlyAlive = true) const;
|
||||
const battle::Unit * battleGetUnitByPos(BattleHex pos, bool onlyAlive = true) const override;
|
||||
|
||||
///returns all alive units excluding turrets
|
||||
battle::Units battleAliveUnits() const;
|
||||
@@ -73,8 +88,6 @@ public:
|
||||
|
||||
void battleGetTurnOrder(std::vector<battle::Units> & out, const size_t maxUnits, const int maxTurns, const int turn = 0, int8_t lastMoved = -1) const;
|
||||
|
||||
void battleGetStackCountOutsideHexes(bool *ac) const; // returns hexes which when in front of a stack cause us to move the amount box back
|
||||
|
||||
///returns reachable hexes (valid movement destinations), DOES contain stack current position
|
||||
std::vector<BattleHex> battleGetAvailableHexes(const battle::Unit * unit, bool addOccupiable, std::vector<BattleHex> * attackable) const;
|
||||
|
||||
@@ -109,7 +122,7 @@ public:
|
||||
|
||||
si8 battleMinSpellLevel(ui8 side) const; //calculates maximum spell level possible to be cast on battlefield - takes into account artifacts of both heroes; if no effects are set, 0 is returned
|
||||
si8 battleMaxSpellLevel(ui8 side) const; //calculates minimum spell level possible to be cast on battlefield - takes into account artifacts of both heroes; if no effects are set, 0 is returned
|
||||
ui32 battleGetSpellCost(const CSpell * sp, const CGHeroInstance * caster) const; //returns cost of given spell
|
||||
int32_t battleGetSpellCost(const spells::Spell * sp, const CGHeroInstance * caster) const; //returns cost of given spell
|
||||
ESpellCastProblem::ESpellCastProblem battleCanCastSpell(const spells::Caster * caster, spells::Mode mode) const; //returns true if there are no general issues preventing from casting a spell
|
||||
|
||||
SpellID battleGetRandomStackSpell(CRandomGenerator & rand, const CStack * stack, ERandomSpell mode) const;
|
||||
|
||||
Reference in New Issue
Block a user