mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +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:
@ -26,7 +26,7 @@ void CArmedInstance::randomizeArmy(int type)
|
||||
{
|
||||
int level = randID / 2;
|
||||
bool upgrade = randID % 2;
|
||||
elem.second->setType(VLC->townh->factions[type]->town->creatures[level][upgrade]);
|
||||
elem.second->setType((*VLC->townh)[type]->town->creatures[level][upgrade]);
|
||||
|
||||
randID = -1;
|
||||
}
|
||||
@ -67,7 +67,7 @@ void CArmedInstance::updateMoraleBonusFromArmy()
|
||||
for(auto slot : Slots())
|
||||
{
|
||||
const CStackInstance * inst = slot.second;
|
||||
const CCreature * creature = VLC->creh->creatures[inst->getCreatureID()];
|
||||
const CCreature * creature = VLC->creh->objects[inst->getCreatureID()];
|
||||
|
||||
factions.insert(creature->faction);
|
||||
// Check for undead flag instead of faction (undead mummies are neutral)
|
||||
@ -82,7 +82,7 @@ void CArmedInstance::updateMoraleBonusFromArmy()
|
||||
|
||||
for(TFaction f : factions)
|
||||
{
|
||||
if (VLC->townh->factions[f]->alignment != EAlignment::EVIL)
|
||||
if ((*VLC->townh)[f]->alignment != EAlignment::EVIL)
|
||||
mixableFactions++;
|
||||
}
|
||||
if (mixableFactions > 0)
|
||||
@ -129,7 +129,7 @@ void CArmedInstance::armyChanged()
|
||||
CBonusSystemNode * CArmedInstance::whereShouldBeAttached(CGameState *gs)
|
||||
{
|
||||
if(tempOwner < PlayerColor::PLAYER_LIMIT)
|
||||
return gs->getPlayer(tempOwner);
|
||||
return gs->getPlayerState(tempOwner);
|
||||
else
|
||||
return &gs->globalEffects;
|
||||
}
|
||||
|
Reference in New Issue
Block a user