|
@@ -268,7 +268,7 @@ void CMapLoaderH3M::readPlayerInfo()
|
|
{
|
|
{
|
|
SHeroName vv;
|
|
SHeroName vv;
|
|
vv.heroId = reader->readHero();
|
|
vv.heroId = reader->readHero();
|
|
- vv.heroName = readLocalizedString(TextIdentifier("header", "heroNames", vv.heroId));
|
|
|
|
|
|
+ vv.heroName = readLocalizedString(TextIdentifier("header", "heroNames", vv.heroId.getNum()));
|
|
|
|
|
|
playerInfo.heroesNames.push_back(vv);
|
|
playerInfo.heroesNames.push_back(vv);
|
|
}
|
|
}
|
|
@@ -381,7 +381,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
case EVictoryConditionType::GATHERRESOURCE:
|
|
case EVictoryConditionType::GATHERRESOURCE:
|
|
{
|
|
{
|
|
EventCondition cond(EventCondition::HAVE_RESOURCES);
|
|
EventCondition cond(EventCondition::HAVE_RESOURCES);
|
|
- cond.objectType = reader->readUInt8();
|
|
|
|
|
|
+ cond.objectType = reader->readGameResID();
|
|
cond.value = reader->readInt32();
|
|
cond.value = reader->readInt32();
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.279");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.279");
|
|
@@ -397,9 +397,9 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
EventExpression::OperatorAll oper;
|
|
EventExpression::OperatorAll oper;
|
|
EventCondition cond(EventCondition::HAVE_BUILDING);
|
|
EventCondition cond(EventCondition::HAVE_BUILDING);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
- cond.objectType = BuildingID::TOWN_HALL + reader->readUInt8();
|
|
|
|
|
|
+ cond.objectType = BuildingID::TOWN_HALL_LEVEL(reader->readUInt8());
|
|
oper.expressions.emplace_back(cond);
|
|
oper.expressions.emplace_back(cond);
|
|
- cond.objectType = BuildingID::FORT + reader->readUInt8();
|
|
|
|
|
|
+ cond.objectType = BuildingID::FORT_LEVEL(reader->readUInt8());
|
|
oper.expressions.emplace_back(cond);
|
|
oper.expressions.emplace_back(cond);
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.283");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.283");
|
|
@@ -414,7 +414,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
assert(allowNormalVictory == true); // not selectable in editor
|
|
assert(allowNormalVictory == true); // not selectable in editor
|
|
assert(appliesToAI == true); // not selectable in editor
|
|
assert(appliesToAI == true); // not selectable in editor
|
|
EventCondition cond(EventCondition::HAVE_BUILDING);
|
|
EventCondition cond(EventCondition::HAVE_BUILDING);
|
|
- cond.objectType = BuildingID::GRAIL;
|
|
|
|
|
|
+ cond.objectType = BuildingID(BuildingID::GRAIL);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
if(cond.position.z > 2)
|
|
if(cond.position.z > 2)
|
|
cond.position = int3(-1, -1, -1);
|
|
cond.position = int3(-1, -1, -1);
|
|
@@ -433,7 +433,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
allowNormalVictory = true; // H3 behavior
|
|
allowNormalVictory = true; // H3 behavior
|
|
assert(appliesToAI == false); // not selectable in editor
|
|
assert(appliesToAI == false); // not selectable in editor
|
|
EventCondition cond(EventCondition::DESTROY);
|
|
EventCondition cond(EventCondition::DESTROY);
|
|
- cond.objectType = Obj::HERO;
|
|
|
|
|
|
+ cond.objectType = MapObjectID(MapObjectID::HERO);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.253");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.253");
|
|
@@ -446,7 +446,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
case EVictoryConditionType::CAPTURECITY:
|
|
case EVictoryConditionType::CAPTURECITY:
|
|
{
|
|
{
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
- cond.objectType = Obj::TOWN;
|
|
|
|
|
|
+ cond.objectType = MapObjectID(MapObjectID::TOWN);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.250");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.250");
|
|
@@ -460,7 +460,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
{
|
|
{
|
|
assert(appliesToAI == true); // not selectable in editor
|
|
assert(appliesToAI == true); // not selectable in editor
|
|
EventCondition cond(EventCondition::DESTROY);
|
|
EventCondition cond(EventCondition::DESTROY);
|
|
- cond.objectType = Obj::MONSTER;
|
|
|
|
|
|
+ cond.objectType = MapObjectID(MapObjectID::MONSTER);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.287");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.287");
|
|
@@ -473,8 +473,8 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
case EVictoryConditionType::TAKEDWELLINGS:
|
|
case EVictoryConditionType::TAKEDWELLINGS:
|
|
{
|
|
{
|
|
EventExpression::OperatorAll oper;
|
|
EventExpression::OperatorAll oper;
|
|
- oper.expressions.emplace_back(EventCondition(EventCondition::CONTROL, 0, Obj::CREATURE_GENERATOR1));
|
|
|
|
- oper.expressions.emplace_back(EventCondition(EventCondition::CONTROL, 0, Obj::CREATURE_GENERATOR4));
|
|
|
|
|
|
+ oper.expressions.emplace_back(EventCondition(EventCondition::CONTROL, 0, Obj(Obj::CREATURE_GENERATOR1)));
|
|
|
|
+ oper.expressions.emplace_back(EventCondition(EventCondition::CONTROL, 0, Obj(Obj::CREATURE_GENERATOR4)));
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.289");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.289");
|
|
specialVictory.onFulfill.appendTextID("core.genrltxt.288");
|
|
specialVictory.onFulfill.appendTextID("core.genrltxt.288");
|
|
@@ -486,7 +486,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
case EVictoryConditionType::TAKEMINES:
|
|
case EVictoryConditionType::TAKEMINES:
|
|
{
|
|
{
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
- cond.objectType = Obj::MINE;
|
|
|
|
|
|
+ cond.objectType = MapObjectID(MapObjectID::MINE);
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.291");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.291");
|
|
specialVictory.onFulfill.appendTextID("core.genrltxt.290");
|
|
specialVictory.onFulfill.appendTextID("core.genrltxt.290");
|
|
@@ -499,7 +499,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
{
|
|
{
|
|
assert(allowNormalVictory == true); // not selectable in editor
|
|
assert(allowNormalVictory == true); // not selectable in editor
|
|
EventCondition cond(EventCondition::TRANSPORT);
|
|
EventCondition cond(EventCondition::TRANSPORT);
|
|
- cond.objectType = reader->readUInt8();
|
|
|
|
|
|
+ cond.objectType = reader->readArtifact8();
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.293");
|
|
specialVictory.effect.toOtherMessage.appendTextID("core.genrltxt.293");
|
|
@@ -513,7 +513,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
{
|
|
{
|
|
assert(appliesToAI == false); // not selectable in editor
|
|
assert(appliesToAI == false); // not selectable in editor
|
|
EventCondition cond(EventCondition::DESTROY);
|
|
EventCondition cond(EventCondition::DESTROY);
|
|
- cond.objectType = Obj::MONSTER;
|
|
|
|
|
|
+ cond.objectType = MapObjectID(MapObjectID::MONSTER);
|
|
|
|
|
|
specialVictory.effect.toOtherMessage.appendTextID("vcmi.map.victoryCondition.eliminateMonsters.toOthers");
|
|
specialVictory.effect.toOtherMessage.appendTextID("vcmi.map.victoryCondition.eliminateMonsters.toOthers");
|
|
specialVictory.onFulfill.appendTextID("vcmi.map.victoryCondition.eliminateMonsters.toSelf");
|
|
specialVictory.onFulfill.appendTextID("vcmi.map.victoryCondition.eliminateMonsters.toSelf");
|
|
@@ -602,7 +602,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
{
|
|
{
|
|
EventExpression::OperatorNone noneOf;
|
|
EventExpression::OperatorNone noneOf;
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
- cond.objectType = Obj::TOWN;
|
|
|
|
|
|
+ cond.objectType = Obj(Obj::TOWN);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
|
|
|
|
noneOf.expressions.emplace_back(cond);
|
|
noneOf.expressions.emplace_back(cond);
|
|
@@ -616,7 +616,7 @@ void CMapLoaderH3M::readVictoryLossConditions()
|
|
{
|
|
{
|
|
EventExpression::OperatorNone noneOf;
|
|
EventExpression::OperatorNone noneOf;
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
EventCondition cond(EventCondition::CONTROL);
|
|
- cond.objectType = Obj::HERO;
|
|
|
|
|
|
+ cond.objectType = Obj(Obj::HERO);
|
|
cond.position = reader->readInt3();
|
|
cond.position = reader->readInt3();
|
|
|
|
|
|
noneOf.expressions.emplace_back(cond);
|
|
noneOf.expressions.emplace_back(cond);
|
|
@@ -708,7 +708,7 @@ void CMapLoaderH3M::readDisposedHeroes()
|
|
{
|
|
{
|
|
map->disposedHeroes[g].heroId = reader->readHero();
|
|
map->disposedHeroes[g].heroId = reader->readHero();
|
|
map->disposedHeroes[g].portrait = reader->readHeroPortrait();
|
|
map->disposedHeroes[g].portrait = reader->readHeroPortrait();
|
|
- map->disposedHeroes[g].name = readLocalizedString(TextIdentifier("header", "heroes", map->disposedHeroes[g].heroId));
|
|
|
|
|
|
+ map->disposedHeroes[g].name = readLocalizedString(TextIdentifier("header", "heroes", map->disposedHeroes[g].heroId.getNum()));
|
|
reader->readBitmaskPlayers(map->disposedHeroes[g].players, false);
|
|
reader->readBitmaskPlayers(map->disposedHeroes[g].players, false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -780,7 +780,7 @@ void CMapLoaderH3M::readAllowedArtifacts()
|
|
{
|
|
{
|
|
if(cond.condition == EventCondition::HAVE_ARTIFACT || cond.condition == EventCondition::TRANSPORT)
|
|
if(cond.condition == EventCondition::HAVE_ARTIFACT || cond.condition == EventCondition::TRANSPORT)
|
|
{
|
|
{
|
|
- map->allowedArtifact.erase(cond.objectType);
|
|
|
|
|
|
+ map->allowedArtifact.erase(cond.objectType.as<ArtifactID>());
|
|
}
|
|
}
|
|
return cond;
|
|
return cond;
|
|
};
|
|
};
|