1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Water zones get monster strength ZONE_NONE during their creation instead of a hardcoded check for zone type WATER at guard creation time.

Also preliminary preparations for water zone customization in the template json.
This commit is contained in:
Warzyw647 2023-05-31 00:24:52 +02:00
parent af3c6abb5e
commit 4c513e8bb0
2 changed files with 5 additions and 2 deletions

View File

@ -108,6 +108,9 @@ void RmgMap::initTiles(CMapGenerator & generator)
options.setType(ETemplateZoneType::WATER);
auto zone = std::make_shared<Zone>(*this, generator);
zone->setOptions(options);
//std::set<FactionID> allowedMonsterFactions({FactionID::CASTLE, FactionID::INFERNO}); // example of filling allowed monster factions
//zone->setMonsterTypes(allowedMonsterFactions); // can be set here, probably from template json, along with the treasure ranges and densities
zone->monsterStrength = EMonsterStrength::ZONE_NONE; // can be set to other value, probably from a new field in the template json
zones[zone->getId()] = zone;
break;
}

View File

@ -527,8 +527,8 @@ size_t TreasurePlacer::getPossibleObjectsSize() const
}
bool TreasurePlacer::isGuardNeededForTreasure(int value)
{// no guard in a zone with "monsters: none", in a water zone and for small treasures
return zone.monsterStrength != EMonsterStrength::ZONE_NONE && zone.getType() != ETemplateZoneType::WATER && value > minGuardedValue;
{// no guard in a zone with "monsters: none" and for small treasures; water zones cen get monster strength ZONE_NONE elsewhere if needed
return zone.monsterStrength != EMonsterStrength::ZONE_NONE && value > minGuardedValue;
}
std::vector<ObjectInfo*> TreasurePlacer::prepareTreasurePile(const CTreasureInfo& treasureInfo)