2017-07-20 06:08:49 +02:00
|
|
|
/*
|
|
|
|
* Obstacle.cpp, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include "StdInc.h"
|
|
|
|
|
|
|
|
#include "Obstacle.h"
|
|
|
|
|
|
|
|
#include "Registry.h"
|
|
|
|
#include "../ISpellMechanics.h"
|
|
|
|
|
|
|
|
#include "../../battle/IBattleState.h"
|
|
|
|
#include "../../battle/CBattleInfoCallback.h"
|
2024-08-28 21:33:56 +02:00
|
|
|
#include "../../entities/building/TownFortifications.h"
|
2023-10-23 12:59:15 +02:00
|
|
|
#include "../../networkPacks/PacksForClientBattle.h"
|
2017-07-20 06:08:49 +02:00
|
|
|
#include "../../serializer/JsonSerializeFormat.h"
|
2024-06-01 17:28:17 +02:00
|
|
|
|
|
|
|
#include <vstd/RNG.h>
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
namespace spells
|
|
|
|
{
|
|
|
|
namespace effects
|
|
|
|
{
|
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
using RelativeShape = std::vector<std::vector<BattleHex::EDir>>;
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
static void serializeRelativeShape(JsonSerializeFormat & handler, const std::string & fieldName, RelativeShape & value)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
static const std::vector<std::string> EDirMap =
|
|
|
|
{
|
|
|
|
"TL",
|
|
|
|
"TR",
|
|
|
|
"R",
|
|
|
|
"BR",
|
|
|
|
"BL",
|
|
|
|
"L",
|
|
|
|
};
|
|
|
|
|
|
|
|
{
|
|
|
|
JsonArraySerializer outer = handler.enterArray(fieldName);
|
|
|
|
outer.syncSize(value, JsonNode::JsonType::DATA_VECTOR);
|
|
|
|
|
|
|
|
for(size_t outerIndex = 0; outerIndex < outer.size(); outerIndex++)
|
|
|
|
{
|
|
|
|
JsonArraySerializer inner = outer.enterArray(outerIndex);
|
|
|
|
inner.syncSize(value.at(outerIndex), JsonNode::JsonType::DATA_STRING);
|
|
|
|
|
|
|
|
for(size_t innerIndex = 0; innerIndex < inner.size(); innerIndex++)
|
|
|
|
{
|
|
|
|
std::string temp;
|
|
|
|
|
|
|
|
if(handler.saving)
|
|
|
|
{
|
2023-01-04 17:38:55 +02:00
|
|
|
auto index = value.at(outerIndex).at(innerIndex);
|
|
|
|
if (index < EDirMap.size())
|
|
|
|
temp = EDirMap[index];
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inner.serializeString(innerIndex, temp);
|
|
|
|
|
|
|
|
if(!handler.saving)
|
|
|
|
{
|
2023-02-11 17:18:53 +02:00
|
|
|
value.at(outerIndex).at(innerIndex) = static_cast<BattleHex::EDir>(vstd::find_pos(EDirMap, temp));
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!handler.saving)
|
|
|
|
{
|
|
|
|
if(value.empty())
|
|
|
|
value.emplace_back();
|
|
|
|
|
|
|
|
if(value.back().empty())
|
|
|
|
value.back().emplace_back(BattleHex::EDir::NONE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
void ObstacleSideOptions::serializeJson(JsonSerializeFormat & handler)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
2023-02-07 00:40:01 +02:00
|
|
|
serializeRelativeShape(handler, "shape", shape);
|
|
|
|
serializeRelativeShape(handler, "range", range);
|
|
|
|
|
2023-09-04 12:03:15 +02:00
|
|
|
handler.serializeStruct("appearSound", appearSound);
|
2023-08-23 14:07:50 +02:00
|
|
|
handler.serializeStruct("appearAnimation", appearAnimation);
|
|
|
|
handler.serializeStruct("animation", animation);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
handler.serializeInt("offsetY", offsetY);
|
|
|
|
}
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
void Obstacle::adjustAffectedHexes(std::set<BattleHex> & hexes, const Mechanics * m, const Target & spellTarget) const
|
|
|
|
{
|
|
|
|
EffectTarget effectTarget = transformTarget(m, spellTarget, spellTarget);
|
|
|
|
|
|
|
|
const ObstacleSideOptions & options = sideOptions.at(m->casterSide);
|
|
|
|
|
|
|
|
for(auto & destination : effectTarget)
|
|
|
|
{
|
2024-06-24 03:23:26 +02:00
|
|
|
for(const auto & transformation : options.shape)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
BattleHex hex = destination.hexValue;
|
|
|
|
|
2024-06-24 03:23:26 +02:00
|
|
|
for(auto direction : transformation)
|
2017-07-20 06:08:49 +02:00
|
|
|
hex.moveInDirection(direction, false);
|
|
|
|
|
|
|
|
if(hex.isValid())
|
|
|
|
hexes.insert(hex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Obstacle::applicable(Problem & problem, const Mechanics * m) const
|
|
|
|
{
|
2023-03-19 02:44:10 +02:00
|
|
|
if(hidden && !hideNative && m->battle()->battleHasNativeStack(m->battle()->otherSide(m->casterSide)))
|
2023-03-19 20:34:50 +02:00
|
|
|
return m->adaptProblem(ESpellCastProblem::NO_APPROPRIATE_TARGET, problem);
|
|
|
|
|
2017-07-20 06:08:49 +02:00
|
|
|
return LocationEffect::applicable(problem, m);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Obstacle::applicable(Problem & problem, const Mechanics * m, const EffectTarget & target) const
|
|
|
|
{
|
|
|
|
if(!m->isMassive())
|
|
|
|
{
|
|
|
|
const bool requiresClearTiles = m->requiresClearTiles();
|
|
|
|
const ObstacleSideOptions & options = sideOptions.at(m->casterSide);
|
|
|
|
|
|
|
|
if(target.empty())
|
|
|
|
return noRoomToPlace(problem, m);
|
|
|
|
|
|
|
|
for(const auto & destination : target)
|
|
|
|
{
|
2024-06-24 03:23:26 +02:00
|
|
|
for(const auto & transformation : options.shape)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
BattleHex hex = destination.hexValue;
|
2024-06-24 03:23:26 +02:00
|
|
|
for(auto direction : transformation)
|
2017-07-20 06:08:49 +02:00
|
|
|
hex.moveInDirection(direction, false);
|
|
|
|
|
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.
2018-03-17 16:58:30 +02:00
|
|
|
if(!isHexAvailable(m->battle(), hex, requiresClearTiles))
|
2017-07-20 06:08:49 +02:00
|
|
|
return noRoomToPlace(problem, m);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return LocationEffect::applicable(problem, m, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectTarget Obstacle::transformTarget(const Mechanics * m, const Target & aimPoint, const Target & spellTarget) const
|
|
|
|
{
|
|
|
|
const ObstacleSideOptions & options = sideOptions.at(m->casterSide);
|
|
|
|
|
|
|
|
EffectTarget ret;
|
|
|
|
|
|
|
|
if(!m->isMassive())
|
|
|
|
{
|
2023-02-07 00:40:01 +02:00
|
|
|
for(const auto & spellDestination : spellTarget)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
2023-02-07 00:40:01 +02:00
|
|
|
for(const auto & rangeShape : options.range)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
BattleHex hex = spellDestination.hexValue;
|
|
|
|
|
|
|
|
for(auto direction : rangeShape)
|
|
|
|
hex.moveInDirection(direction, false);
|
|
|
|
|
|
|
|
ret.emplace_back(hex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
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.
2018-03-17 16:58:30 +02:00
|
|
|
void Obstacle::apply(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
2023-03-16 00:49:40 +02:00
|
|
|
if(patchCount > 0)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
std::vector<BattleHex> availableTiles;
|
2023-03-16 00:49:40 +02:00
|
|
|
auto insertAvailable = [&m](const BattleHex & hex, std::vector<BattleHex> & availableTiles)
|
2017-07-20 06:08:49 +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.
2018-03-17 16:58:30 +02:00
|
|
|
if(isHexAvailable(m->battle(), hex, true))
|
2017-07-20 06:08:49 +02:00
|
|
|
availableTiles.push_back(hex);
|
2023-03-16 00:49:40 +02:00
|
|
|
};
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-03-16 00:49:40 +02:00
|
|
|
if(m->isMassive())
|
|
|
|
for(int i = 0; i < GameConstants::BFIELD_SIZE; i++)
|
|
|
|
insertAvailable(BattleHex(i), availableTiles);
|
|
|
|
else
|
|
|
|
for(const auto & destination : target)
|
|
|
|
insertAvailable(destination.hexValue, availableTiles);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-03-16 00:49:40 +02:00
|
|
|
RandomGeneratorUtil::randomShuffle(availableTiles, *server->getRNG());
|
|
|
|
const int patchesToPut = std::min(patchCount, static_cast<int>(availableTiles.size()));
|
2017-07-20 06:08:49 +02:00
|
|
|
EffectTarget randomTarget;
|
|
|
|
randomTarget.reserve(patchesToPut);
|
|
|
|
for(int i = 0; i < patchesToPut; i++)
|
|
|
|
randomTarget.emplace_back(availableTiles.at(i));
|
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.
2018-03-17 16:58:30 +02:00
|
|
|
placeObstacles(server, m, randomTarget);
|
2023-03-16 00:49:40 +02:00
|
|
|
return;
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
2023-03-16 00:49:40 +02:00
|
|
|
|
|
|
|
placeObstacles(server, m, target);
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void Obstacle::serializeJsonEffect(JsonSerializeFormat & handler)
|
|
|
|
{
|
|
|
|
handler.serializeBool("hidden", hidden);
|
|
|
|
handler.serializeBool("passable", passable);
|
|
|
|
handler.serializeBool("trap", trap);
|
2023-03-16 00:49:40 +02:00
|
|
|
handler.serializeBool("removeOnTrigger", removeOnTrigger);
|
|
|
|
handler.serializeBool("hideNative", hideNative);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
handler.serializeInt("patchCount", patchCount);
|
|
|
|
handler.serializeInt("turnsRemaining", turnsRemaining, -1);
|
2023-03-19 02:16:02 +02:00
|
|
|
handler.serializeId("triggerAbility", triggerAbility, SpellID::NONE);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
handler.serializeStruct("attacker", sideOptions.at(BattleSide::ATTACKER));
|
|
|
|
handler.serializeStruct("defender", sideOptions.at(BattleSide::DEFENDER));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Obstacle::isHexAvailable(const CBattleInfoCallback * cb, const BattleHex & hex, const bool mustBeClear)
|
|
|
|
{
|
|
|
|
if(!hex.isAvailable())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if(!mustBeClear)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
if(cb->battleGetUnitByPos(hex, true))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
auto obst = cb->battleGetAllObstaclesOnPos(hex, false);
|
|
|
|
|
|
|
|
for(auto & i : obst)
|
|
|
|
if(i->obstacleType != CObstacleInstance::MOAT)
|
|
|
|
return false;
|
|
|
|
|
2024-08-28 21:33:56 +02:00
|
|
|
if(cb->battleGetFortifications().wallsHealth != 0)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
2023-01-13 00:35:58 +02:00
|
|
|
EWallPart part = cb->battleHexToWallPart(hex);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-01-13 13:00:07 +02:00
|
|
|
if(part == EWallPart::INVALID)
|
2017-07-20 06:08:49 +02:00
|
|
|
return true;//no fortification here
|
2023-01-13 13:00:07 +02:00
|
|
|
else if(part == EWallPart::INDESTRUCTIBLE_PART_OF_GATE)
|
2023-01-13 15:44:42 +02:00
|
|
|
return true; // location accessible
|
2023-01-13 13:00:07 +02:00
|
|
|
else if(part == EWallPart::INDESTRUCTIBLE_PART)
|
2017-07-20 06:08:49 +02:00
|
|
|
return false;//indestructible part (cant be checked by battleGetWallState)
|
|
|
|
else if(part == EWallPart::BOTTOM_TOWER || part == EWallPart::UPPER_TOWER)
|
|
|
|
return false;//destructible, but should not be available
|
|
|
|
else if(cb->battleGetWallState(part) != EWallState::DESTROYED && cb->battleGetWallState(part) != EWallState::NONE)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Obstacle::noRoomToPlace(Problem & problem, const Mechanics * m)
|
|
|
|
{
|
|
|
|
MetaString text;
|
2023-06-18 11:18:25 +02:00
|
|
|
text.appendLocalString(EMetaText::GENERAL_TXT, 181);//No room to place %s here
|
|
|
|
text.replaceRawString(m->getSpellName());
|
2017-07-20 06:08:49 +02:00
|
|
|
problem.add(std::move(text));
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
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.
2018-03-17 16:58:30 +02:00
|
|
|
void Obstacle::placeObstacles(ServerCallback * server, const Mechanics * m, const EffectTarget & target) const
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
const ObstacleSideOptions & options = sideOptions.at(m->casterSide);
|
|
|
|
|
|
|
|
BattleObstaclesChanged pack;
|
2023-09-08 15:35:43 +02:00
|
|
|
pack.battleID = m->battle()->getBattle()->getBattleID();
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2024-08-11 22:22:35 +02:00
|
|
|
auto all = m->battle()->battleGetAllObstacles(BattleSide::ALL_KNOWING);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
int obstacleIdToGive = 1;
|
|
|
|
for(auto & one : all)
|
|
|
|
if(one->uniqueID >= obstacleIdToGive)
|
|
|
|
obstacleIdToGive = one->uniqueID + 1;
|
|
|
|
|
|
|
|
for(const Destination & destination : target)
|
|
|
|
{
|
|
|
|
SpellCreatedObstacle obstacle;
|
|
|
|
obstacle.uniqueID = obstacleIdToGive++;
|
|
|
|
obstacle.pos = destination.hexValue;
|
2023-03-19 02:16:02 +02:00
|
|
|
obstacle.obstacleType = CObstacleInstance::SPELL_CREATED;
|
2023-03-30 23:49:51 +02:00
|
|
|
obstacle.ID = m->getSpellIndex();
|
2017-07-20 06:08:49 +02:00
|
|
|
|
|
|
|
obstacle.turnsRemaining = turnsRemaining;
|
|
|
|
obstacle.casterSpellPower = m->getEffectPower();
|
|
|
|
obstacle.spellLevel = m->getEffectLevel();//todo: level of indirect effect should be also configurable
|
|
|
|
obstacle.casterSide = m->casterSide;
|
|
|
|
|
2023-03-16 00:49:40 +02:00
|
|
|
obstacle.nativeVisible = !hideNative;
|
2017-07-20 06:08:49 +02:00
|
|
|
obstacle.hidden = hidden;
|
|
|
|
obstacle.passable = passable;
|
2023-03-30 23:49:51 +02:00
|
|
|
obstacle.trigger = triggerAbility;
|
2017-07-20 06:08:49 +02:00
|
|
|
obstacle.trap = trap;
|
|
|
|
obstacle.removeOnTrigger = removeOnTrigger;
|
|
|
|
|
2022-12-12 21:17:15 +02:00
|
|
|
obstacle.appearSound = options.appearSound;
|
2017-07-20 06:08:49 +02:00
|
|
|
obstacle.appearAnimation = options.appearAnimation;
|
|
|
|
obstacle.animation = options.animation;
|
|
|
|
|
|
|
|
obstacle.animationYOffset = options.offsetY;
|
|
|
|
|
|
|
|
obstacle.customSize.clear();
|
|
|
|
obstacle.customSize.reserve(options.shape.size());
|
|
|
|
|
2023-02-07 00:40:01 +02:00
|
|
|
for(const auto & shape : options.shape)
|
2017-07-20 06:08:49 +02:00
|
|
|
{
|
|
|
|
BattleHex hex = destination.hexValue;
|
|
|
|
|
|
|
|
for(auto direction : shape)
|
|
|
|
hex.moveInDirection(direction, false);
|
|
|
|
|
|
|
|
obstacle.customSize.emplace_back(hex);
|
|
|
|
}
|
|
|
|
|
|
|
|
pack.changes.emplace_back();
|
|
|
|
obstacle.toInfo(pack.changes.back());
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!pack.changes.empty())
|
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.
2018-03-17 16:58:30 +02:00
|
|
|
server->apply(&pack);
|
2017-07-20 06:08:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2022-07-26 15:07:42 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|