2014-03-17 22:51:07 +03:00
|
|
|
/*
|
|
|
|
* IGameCallback.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
|
|
|
|
*
|
|
|
|
*/
|
2011-12-14 00:23:17 +03:00
|
|
|
#include "StdInc.h"
|
2008-12-27 03:01:59 +02:00
|
|
|
#include "IGameCallback.h"
|
2011-12-14 00:23:17 +03:00
|
|
|
|
2014-04-20 10:13:37 +03:00
|
|
|
#include "CHeroHandler.h" // for CHeroHandler
|
2015-02-02 10:25:26 +02:00
|
|
|
#include "spells/CSpellHandler.h"// for CSpell
|
2017-08-20 09:18:07 +02:00
|
|
|
#include "CSkillHandler.h"// for CSkill
|
2011-05-03 06:14:18 +03:00
|
|
|
#include "NetPacks.h"
|
2013-03-06 21:49:56 +03:00
|
|
|
#include "CBonusTypeHandler.h"
|
2014-06-25 17:11:07 +03:00
|
|
|
#include "CModHandler.h"
|
2022-06-28 10:05:30 +02:00
|
|
|
#include "BattleFieldHandler.h"
|
2022-09-15 10:06:54 +02:00
|
|
|
#include "ObstacleHandler.h"
|
2013-02-19 01:37:22 +03:00
|
|
|
|
2016-09-10 02:32:40 +02:00
|
|
|
#include "serializer/CSerializer.h" // for SAVEGAME_MAGIC
|
|
|
|
#include "serializer/BinaryDeserializer.h"
|
|
|
|
#include "serializer/BinarySerializer.h"
|
|
|
|
#include "serializer/CLoadIntegrityValidator.h"
|
|
|
|
#include "rmg/CMapGenOptions.h"
|
|
|
|
#include "mapping/CCampaignHandler.h"
|
2014-06-05 19:52:14 +03:00
|
|
|
#include "mapObjects/CObjectClassesHandler.h"
|
2014-06-25 17:11:07 +03:00
|
|
|
#include "StartInfo.h"
|
|
|
|
#include "CGameState.h"
|
2015-12-02 21:05:10 +02:00
|
|
|
#include "mapping/CMap.h"
|
2015-12-02 21:39:53 +02:00
|
|
|
#include "CPlayerState.h"
|
2018-01-05 19:21:07 +02:00
|
|
|
#include "CSkillHandler.h"
|
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
|
|
|
#include "ScriptHandler.h"
|
2018-01-05 19:21:07 +02:00
|
|
|
|
|
|
|
#include "serializer/Connection.h"
|
2008-12-27 03:01:59 +02:00
|
|
|
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::getFreeTiles(std::vector<int3> & tiles) const
|
2011-05-03 06:14:18 +03:00
|
|
|
{
|
2014-04-20 10:13:37 +03:00
|
|
|
std::vector<int> floors;
|
2022-09-18 16:39:10 +02:00
|
|
|
for(int b = 0; b < gs->map->levels(); ++b)
|
2014-04-20 10:13:37 +03:00
|
|
|
{
|
|
|
|
floors.push_back(b);
|
|
|
|
}
|
|
|
|
const TerrainTile *tinfo;
|
|
|
|
for (auto zd : floors)
|
|
|
|
{
|
|
|
|
for (int xd = 0; xd < gs->map->width; xd++)
|
|
|
|
{
|
|
|
|
for (int yd = 0; yd < gs->map->height; yd++)
|
|
|
|
{
|
|
|
|
tinfo = getTile(int3 (xd,yd,zd));
|
2022-06-20 16:39:50 +02:00
|
|
|
if (tinfo->terType.isLand() && tinfo->terType.isPassable() && !tinfo->blocked) //land and free
|
2014-04-20 10:13:37 +03:00
|
|
|
tiles.push_back (int3 (xd,yd,zd));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-05-03 06:14:18 +03:00
|
|
|
}
|
|
|
|
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::getTilesInRange(std::unordered_set<int3, ShashInt3> & tiles, int3 pos, int radious, boost::optional<PlayerColor> player, int mode, int3::EDistanceFormula distanceFormula) const
|
2009-03-14 13:25:25 +02:00
|
|
|
{
|
2013-03-03 20:06:03 +03:00
|
|
|
if(!!player && *player >= PlayerColor::PLAYER_LIMIT)
|
2009-03-14 13:25:25 +02:00
|
|
|
{
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->error("Illegal call to getTilesInRange!");
|
2009-03-14 13:25:25 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-10-02 23:55:46 +02:00
|
|
|
if(radious == CBuilding::HEIGHT_SKYSHIP) //reveal entire map
|
2009-11-11 19:45:03 +02:00
|
|
|
getAllTiles (tiles, player, -1, 0);
|
|
|
|
else
|
2009-03-14 13:25:25 +02:00
|
|
|
{
|
2013-06-26 14:18:27 +03:00
|
|
|
const TeamState * team = !player ? nullptr : gs->getPlayerTeam(*player);
|
2009-11-11 19:45:03 +02:00
|
|
|
for (int xd = std::max<int>(pos.x - radious , 0); xd <= std::min<int>(pos.x + radious, gs->map->width - 1); xd++)
|
2009-03-14 13:25:25 +02:00
|
|
|
{
|
2009-11-11 19:45:03 +02:00
|
|
|
for (int yd = std::max<int>(pos.y - radious, 0); yd <= std::min<int>(pos.y + radious, gs->map->height - 1); yd++)
|
2009-03-14 13:25:25 +02:00
|
|
|
{
|
2015-12-04 20:08:09 +02:00
|
|
|
int3 tilePos(xd,yd,pos.z);
|
2016-02-10 17:36:56 +02:00
|
|
|
double distance = pos.dist(tilePos, distanceFormula);
|
2015-12-04 20:08:09 +02:00
|
|
|
|
2009-11-11 19:45:03 +02:00
|
|
|
if(distance <= radious)
|
|
|
|
{
|
2013-03-03 20:06:03 +03:00
|
|
|
if(!player
|
2022-09-18 16:39:10 +02:00
|
|
|
|| (mode == 1 && (*team->fogOfWarMap)[pos.z][xd][yd] == 0)
|
|
|
|
|| (mode == -1 && (*team->fogOfWarMap)[pos.z][xd][yd] == 1)
|
2009-11-11 19:45:03 +02:00
|
|
|
)
|
|
|
|
tiles.insert(int3(xd,yd,pos.z));
|
|
|
|
}
|
2009-03-14 13:25:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::getAllTiles(std::unordered_set<int3, ShashInt3> & tiles, boost::optional<PlayerColor> Player, int level, int surface) const
|
2009-08-19 09:56:53 +03:00
|
|
|
{
|
2013-03-03 20:06:03 +03:00
|
|
|
if(!!Player && *Player >= PlayerColor::PLAYER_LIMIT)
|
2009-08-19 09:56:53 +03:00
|
|
|
{
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->error("Illegal call to getAllTiles !");
|
2009-08-19 09:56:53 +03:00
|
|
|
return;
|
|
|
|
}
|
2009-08-20 13:30:00 +03:00
|
|
|
bool water = surface == 0 || surface == 2,
|
|
|
|
land = surface == 0 || surface == 1;
|
|
|
|
|
|
|
|
std::vector<int> floors;
|
|
|
|
if(level == -1)
|
|
|
|
{
|
2022-09-18 16:39:10 +02:00
|
|
|
for(int b = 0; b < gs->map->levels(); ++b)
|
2009-08-20 13:30:00 +03:00
|
|
|
{
|
|
|
|
floors.push_back(b);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
floors.push_back(level);
|
|
|
|
|
2013-06-29 16:05:48 +03:00
|
|
|
for (auto zd : floors)
|
2009-08-19 09:56:53 +03:00
|
|
|
{
|
2014-04-20 10:13:37 +03:00
|
|
|
|
2009-08-20 13:30:00 +03:00
|
|
|
for (int xd = 0; xd < gs->map->width; xd++)
|
2009-08-19 09:56:53 +03:00
|
|
|
{
|
2009-08-20 13:30:00 +03:00
|
|
|
for (int yd = 0; yd < gs->map->height; yd++)
|
2009-08-19 09:56:53 +03:00
|
|
|
{
|
2022-06-20 16:39:50 +02:00
|
|
|
if ((getTile (int3 (xd,yd,zd))->terType.isWater() && water)
|
|
|
|
|| (getTile (int3 (xd,yd,zd))->terType.isLand() && land))
|
2009-08-23 18:02:21 +03:00
|
|
|
tiles.insert(int3(xd,yd,zd));
|
2009-08-19 09:56:53 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::pickAllowedArtsSet(std::vector<const CArtifact *> & out, CRandomGenerator & rand)
|
2010-06-27 19:03:01 +03:00
|
|
|
{
|
2012-09-06 13:39:48 +03:00
|
|
|
for (int j = 0; j < 3 ; j++)
|
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
|
|
|
out.push_back(VLC->arth->objects[VLC->arth->pickRandomArtifact(rand, CArtifact::ART_TREASURE)]);
|
2012-09-06 13:39:48 +03:00
|
|
|
for (int j = 0; j < 3 ; j++)
|
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
|
|
|
out.push_back(VLC->arth->objects[VLC->arth->pickRandomArtifact(rand, CArtifact::ART_MINOR)]);
|
2012-09-06 13:39:48 +03: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
|
|
|
out.push_back(VLC->arth->objects[VLC->arth->pickRandomArtifact(rand, CArtifact::ART_MAJOR)]);
|
2009-05-21 03:55:30 +03:00
|
|
|
}
|
2009-07-26 06:33:13 +03:00
|
|
|
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::getAllowedSpells(std::vector<SpellID> & out, ui16 level)
|
2009-09-24 20:54:02 +03:00
|
|
|
{
|
2011-12-14 00:23:17 +03:00
|
|
|
for (ui32 i = 0; i < gs->map->allowedSpell.size(); i++) //spellh size appears to be greater (?)
|
2009-09-24 20:54:02 +03:00
|
|
|
{
|
2013-02-13 22:35:43 +03: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
|
|
|
const spells::Spell * spell = SpellID(i).toSpell();
|
|
|
|
if(isAllowed(0, spell->getIndex()) && spell->getLevel() == level)
|
2009-09-24 20:54:02 +03: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
|
|
|
out.push_back(spell->getId());
|
2009-09-24 20:54:02 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-10 20:52:23 +02:00
|
|
|
CGameState * CPrivilegedInfoCallback::gameState()
|
2014-04-20 10:13:37 +03:00
|
|
|
{
|
|
|
|
return gs;
|
|
|
|
}
|
2013-02-19 01:37:22 +03:00
|
|
|
|
|
|
|
template<typename Loader>
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::loadCommonState(Loader & in)
|
2013-02-19 01:37:22 +03:00
|
|
|
{
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("Loading lib part of game...");
|
2013-02-19 01:37:22 +03:00
|
|
|
in.checkMagicBytes(SAVEGAME_MAGIC);
|
|
|
|
|
|
|
|
CMapHeader dum;
|
|
|
|
StartInfo *si;
|
|
|
|
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tReading header");
|
2016-09-10 02:32:40 +02:00
|
|
|
in.serializer & dum;
|
2013-02-19 01:37:22 +03:00
|
|
|
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tReading options");
|
2016-09-10 02:32:40 +02:00
|
|
|
in.serializer & si;
|
2013-02-19 01:37:22 +03:00
|
|
|
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tReading handlers");
|
2016-09-10 02:32:40 +02:00
|
|
|
in.serializer & *VLC;
|
2013-02-19 01:37:22 +03:00
|
|
|
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tReading gamestate");
|
2016-09-10 02:32:40 +02:00
|
|
|
in.serializer & gs;
|
2013-02-19 01:37:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
template<typename Saver>
|
2018-02-10 20:52:23 +02:00
|
|
|
void CPrivilegedInfoCallback::saveCommonState(Saver & out) const
|
2013-02-19 01:37:22 +03:00
|
|
|
{
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("Saving lib part of game...");
|
2013-02-19 01:37:22 +03:00
|
|
|
out.putMagicBytes(SAVEGAME_MAGIC);
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tSaving header");
|
2016-09-10 02:32:40 +02:00
|
|
|
out.serializer & static_cast<CMapHeader&>(*gs->map);
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tSaving options");
|
2016-09-10 02:32:40 +02:00
|
|
|
out.serializer & gs->scenarioOps;
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tSaving handlers");
|
2016-09-10 02:32:40 +02:00
|
|
|
out.serializer & *VLC;
|
2017-08-10 18:39:27 +02:00
|
|
|
logGlobal->info("\tSaving gamestate");
|
2016-09-10 02:32:40 +02:00
|
|
|
out.serializer & gs;
|
2013-02-19 01:37:22 +03:00
|
|
|
}
|
|
|
|
|
2014-04-20 13:10:46 +03:00
|
|
|
// hardly memory usage for `-gdwarf-4` flag
|
2018-02-10 20:52:23 +02:00
|
|
|
template DLL_LINKAGE void CPrivilegedInfoCallback::loadCommonState<CLoadIntegrityValidator>(CLoadIntegrityValidator &);
|
|
|
|
template DLL_LINKAGE void CPrivilegedInfoCallback::loadCommonState<CLoadFile>(CLoadFile &);
|
|
|
|
template DLL_LINKAGE void CPrivilegedInfoCallback::saveCommonState<CSaveFile>(CSaveFile &) const;
|
2013-02-19 01:37:22 +03:00
|
|
|
|
2013-04-21 15:49:26 +03:00
|
|
|
TerrainTile * CNonConstInfoCallback::getTile( int3 pos )
|
2009-07-26 06:33:13 +03:00
|
|
|
{
|
|
|
|
if(!gs->map->isInTheMap(pos))
|
2013-06-26 14:18:27 +03:00
|
|
|
return nullptr;
|
2009-07-26 06:33:13 +03:00
|
|
|
return &gs->map->getTile(pos);
|
2010-02-10 04:56:00 +02:00
|
|
|
}
|
|
|
|
|
2013-02-14 02:55:42 +03:00
|
|
|
CGHeroInstance *CNonConstInfoCallback::getHero(ObjectInstanceID objid)
|
2011-05-10 01:20:47 +03:00
|
|
|
{
|
|
|
|
return const_cast<CGHeroInstance*>(CGameInfoCallback::getHero(objid));
|
|
|
|
}
|
|
|
|
|
2013-02-14 02:55:42 +03:00
|
|
|
CGTownInstance *CNonConstInfoCallback::getTown(ObjectInstanceID objid)
|
2011-05-10 01:20:47 +03:00
|
|
|
{
|
|
|
|
return const_cast<CGTownInstance*>(CGameInfoCallback::getTown(objid));
|
|
|
|
}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
TeamState *CNonConstInfoCallback::getTeam(TeamID teamID)
|
2011-05-10 01:20:47 +03:00
|
|
|
{
|
|
|
|
return const_cast<TeamState*>(CGameInfoCallback::getTeam(teamID));
|
|
|
|
}
|
|
|
|
|
2013-03-03 20:06:03 +03:00
|
|
|
TeamState *CNonConstInfoCallback::getPlayerTeam(PlayerColor color)
|
2011-05-10 01:20:47 +03:00
|
|
|
{
|
|
|
|
return const_cast<TeamState*>(CGameInfoCallback::getPlayerTeam(color));
|
|
|
|
}
|
|
|
|
|
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
|
|
|
PlayerState * CNonConstInfoCallback::getPlayerState( PlayerColor color, bool verbose )
|
2011-05-10 01:20:47 +03: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
|
|
|
return const_cast<PlayerState*>(CGameInfoCallback::getPlayerState(color, verbose));
|
2011-05-10 01:20:47 +03:00
|
|
|
}
|
|
|
|
|
2013-02-14 02:55:42 +03:00
|
|
|
CArtifactInstance * CNonConstInfoCallback::getArtInstance( ArtifactInstanceID aid )
|
|
|
|
{
|
2018-03-10 23:19:36 +02:00
|
|
|
return gs->map->artInstances.at(aid.num);
|
2013-02-14 02:55:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
CGObjectInstance * CNonConstInfoCallback::getObjInstance( ObjectInstanceID oid )
|
|
|
|
{
|
2018-03-10 23:19:36 +02:00
|
|
|
return gs->map->objects.at(oid.num);
|
|
|
|
}
|
|
|
|
|
|
|
|
CArmedInstance * CNonConstInfoCallback::getArmyInstance(ObjectInstanceID oid)
|
|
|
|
{
|
|
|
|
return dynamic_cast<CArmedInstance *>(getObjInstance(oid));
|
2013-02-14 02:55:42 +03:00
|
|
|
}
|
|
|
|
|
2013-05-28 00:46:04 +03:00
|
|
|
bool IGameCallback::isVisitCoveredByAnotherQuery(const CGObjectInstance *obj, const CGHeroInstance *hero)
|
|
|
|
{
|
|
|
|
//only server knows
|
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
|
|
|
logGlobal->error("isVisitCoveredByAnotherQuery call on client side");
|
2013-05-28 00:46:04 +03:00
|
|
|
return false;
|
|
|
|
}
|