1
0
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:
AlexVinS
2018-03-17 17:58:30 +03:00
committed by AlexVinS
parent 11bb46780a
commit ecaa9f5d0b
475 changed files with 22491 additions and 7123 deletions

View File

@ -179,9 +179,9 @@ void CQuest::getVisitText(MetaString &iwText, std::vector<Component> &components
break;
case MISSION_HERO:
//FIXME: portrait may not match hero, if custom portrait was set in map editor
components.push_back(Component(Component::HERO_PORTRAIT, VLC->heroh->heroes[m13489val]->imageIndex, 0, 0));
components.push_back(Component(Component::HERO_PORTRAIT, VLC->heroh->objects[m13489val]->imageIndex, 0, 0));
if(!isCustom)
iwText.addReplacement(VLC->heroh->heroes[m13489val]->name);
iwText.addReplacement(VLC->heroh->objects[m13489val]->name);
break;
case MISSION_KILL_CREATURE:
{
@ -317,7 +317,7 @@ void CQuest::getRolloverText(MetaString &ms, bool onHover) const
}
break;
case MISSION_HERO:
ms.addReplacement(VLC->heroh->heroes[m13489val]->name);
ms.addReplacement(VLC->heroh->objects[m13489val]->name);
break;
case MISSION_PLAYER:
ms.addReplacement(VLC->generaltexth->colors[m13489val]);
@ -400,7 +400,7 @@ void CQuest::getCompletionText(MetaString &iwText, std::vector<Component> &compo
break;
case MISSION_HERO:
if (!isCustomComplete)
iwText.addReplacement(VLC->heroh->heroes[m13489val]->name);
iwText.addReplacement(VLC->heroh->objects[m13489val]->name);
break;
case MISSION_PLAYER:
if (!isCustomComplete)
@ -477,7 +477,7 @@ void CQuest::serializeJson(JsonSerializeFormat & handler, const std::string & fi
}
break;
case MISSION_HERO:
handler.serializeId<ui32>("hero", m13489val, 0, &CHeroHandler::decodeHero, &CHeroHandler::encodeHero);
handler.serializeId<ui32, ui32, HeroTypeID>("hero", m13489val, 0);
break;
case MISSION_PLAYER:
handler.serializeEnum("player", m13489val, PlayerColor::CANNOT_DETERMINE.getNum(), GameConstants::PLAYER_COLOR_NAMES);
@ -817,7 +817,7 @@ void CGSeerHut::completeQuest (const CGHeroInstance * h) const //reward
cb->changeSecSkill(h, SecondarySkill(rID), rVal, false);
break;
case ARTIFACT:
cb->giveHeroNewArtifact(h, VLC->arth->artifacts[rID],ArtifactPosition::FIRST_AVAILABLE);
cb->giveHeroNewArtifact(h, VLC->arth->objects[rID],ArtifactPosition::FIRST_AVAILABLE);
break;
case SPELL:
{
@ -931,15 +931,15 @@ void CGSeerHut::serializeJsonOptions(JsonSerializeFormat & handler)
identifier = CSkillHandler::encodeSkill(rID);
break;
case ARTIFACT:
identifier = ArtifactID(rID).toArtifact()->identifier;
identifier = ArtifactID(rID).toArtifact(VLC->artifacts())->getJsonKey();
amount = 1;
break;
case SPELL:
identifier = SpellID(rID).toSpell()->identifier;
identifier = SpellID(rID).toSpell(VLC->spells())->getJsonKey();
amount = 1;
break;
case CREATURE:
identifier = CreatureID(rID).toCreature()->identifier;
identifier = CreatureID(rID).toCreature(VLC->creatures())->getJsonKey();
break;
default:
assert(false);