1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-20 00:22:54 +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

@@ -602,7 +602,7 @@ void CMapLoaderH3M::readTeamInfo()
void CMapLoaderH3M::readAllowedHeroes()
{
mapHeader->allowedHeroes.resize(VLC->heroh->heroes.size(), true);
mapHeader->allowedHeroes.resize(VLC->heroh->size(), true);
const int bytes = mapHeader->version == EMapFormat::ROE ? 16 : 20;
@@ -646,7 +646,7 @@ void CMapLoaderH3M::readDisposedHeroes()
void CMapLoaderH3M::readAllowedArtifacts()
{
map->allowedArtifact.resize (VLC->arth->artifacts.size(),true); //handle new artifacts, make them allowed by default
map->allowedArtifact.resize (VLC->arth->objects.size(),true); //handle new artifacts, make them allowed by default
// Reading allowed artifacts: 17 or 18 bytes
if(map->version != EMapFormat::ROE)
@@ -660,7 +660,7 @@ void CMapLoaderH3M::readAllowedArtifacts()
// ban combo artifacts
if (map->version == EMapFormat::ROE || map->version == EMapFormat::AB)
{
for(CArtifact * artifact : VLC->arth->artifacts)
for(CArtifact * artifact : VLC->arth->objects)
{
// combo
if (artifact->constituents)
@@ -712,7 +712,7 @@ void CMapLoaderH3M::readAllowedSpellsAbilities()
//do not generate special abilities and spells
for (auto spell : VLC->spellh->objects)
if (spell->isSpecialSpell() || spell->isCreatureAbility())
if (spell->isSpecial() || spell->isCreatureAbility())
map->allowedSpell[spell->id] = false;
}
@@ -873,7 +873,7 @@ bool CMapLoaderH3M::loadArtifactToSlot(CGHeroInstance * hero, int slot)
bool isArt = aid != artmask;
if(isArt)
{
const CArtifact * art = ArtifactID(aid).toArtifact();
const Artifact * art = ArtifactID(aid).toArtifact(VLC->artifacts());
if(nullptr == art)
{
@@ -1370,7 +1370,7 @@ void CMapLoaderH3M::readObjects()
mask[1] = reader.readUInt8();
castleSpec->allowedFactions.clear();
castleSpec->allowedFactions.resize(VLC->townh->factions.size(), false);
castleSpec->allowedFactions.resize(VLC->townh->size(), false);
for(int i = 0; i < MASK_SIZE; i++)
castleSpec->allowedFactions[i] = ((mask[0] & (1 << i))>0);
@@ -1423,7 +1423,7 @@ void CMapLoaderH3M::readObjects()
}
else
{
logGlobal->info("Hero placeholder: %s at %s", VLC->heroh->heroes[htid]->name, objPos.toString());
logGlobal->info("Hero placeholder: %s at %s", VLC->heroh->objects[htid]->name, objPos.toString());
hp->power = 0;
}
@@ -1887,7 +1887,7 @@ void CMapLoaderH3M::readQuest(IQuestObject * guard)
guard->quest->m6creatures.resize(typeNumber);
for(int hh = 0; hh < typeNumber; ++hh)
{
guard->quest->m6creatures[hh].type = VLC->creh->creatures[reader.readUInt16()];
guard->quest->m6creatures[hh].type = VLC->creh->objects[reader.readUInt16()];
guard->quest->m6creatures[hh].count = reader.readUInt16();
}
break;