mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-04 09:42:40 +02:00
Merge pull request #4965 from vcmi/sealed_zone
New type of zone - "sealed"
This commit is contained in:
commit
306ee95496
@ -12,7 +12,7 @@
|
||||
"properties" : {
|
||||
"type" : {
|
||||
"type" : "string",
|
||||
"enum" : ["playerStart", "cpuStart", "treasure", "junction"]
|
||||
"enum" : ["playerStart", "cpuStart", "treasure", "junction", "sealed"]
|
||||
},
|
||||
"size" : { "type" : "number", "minimum" : 1 },
|
||||
"owner" : {},
|
||||
|
@ -28,10 +28,11 @@
|
||||
|
||||
/// List of game settings that were overriden by this template. See config/gameConfig.json in vcmi install directory for possible values
|
||||
/// Settings defined here will always override any settings from vcmi or from mods
|
||||
"settings" : {
|
||||
"heroes" : {
|
||||
"perPlayerOnMapCap" : 1
|
||||
}
|
||||
"settings" :
|
||||
{
|
||||
"heroes" :
|
||||
{
|
||||
"perPlayerOnMapCap" : 1
|
||||
}
|
||||
},
|
||||
|
||||
@ -59,7 +60,11 @@
|
||||
```json5
|
||||
{
|
||||
// Type of this zone. Possible values are:
|
||||
// "playerStart", "cpuStart", "treasure", "junction"
|
||||
// "playerStart" - Starting zone for a "human or CPU" players
|
||||
// "cpuStart" - Starting zone for "CPU only" players
|
||||
// "treasure" - Generic neutral zone
|
||||
// "junction" - Neutral zone with narrow passages only. The rest of area is filled with obstacles.
|
||||
// "sealed" - Decorative impassable zone completely filled with obstacles
|
||||
"type" : "playerStart",
|
||||
|
||||
// relative size of zone
|
||||
|
@ -335,7 +335,8 @@ void ZoneOptions::serializeJson(JsonSerializeFormat & handler)
|
||||
"cpuStart",
|
||||
"treasure",
|
||||
"junction",
|
||||
"water"
|
||||
"water",
|
||||
"sealed"
|
||||
};
|
||||
|
||||
handler.serializeEnum("type", type, zoneTypes);
|
||||
|
@ -28,7 +28,8 @@ enum class ETemplateZoneType
|
||||
CPU_START,
|
||||
TREASURE,
|
||||
JUNCTION,
|
||||
WATER
|
||||
WATER,
|
||||
SEALED
|
||||
};
|
||||
|
||||
namespace EWaterContent // Not enum class, because it's used in method RandomMapTab::setMapGenOptions
|
||||
|
@ -138,7 +138,7 @@ void Zone::initFreeTiles()
|
||||
});
|
||||
dAreaPossible.assign(possibleTiles);
|
||||
|
||||
if(dAreaFree.empty())
|
||||
if(dAreaFree.empty() && getType() != ETemplateZoneType::SEALED)
|
||||
{
|
||||
// Fixme: This might fail fot water zone, which doesn't need to have a tile in its center of the mass
|
||||
dAreaPossible.erase(pos);
|
||||
@ -348,6 +348,16 @@ void Zone::fractalize()
|
||||
tilesToIgnore.clear();
|
||||
}
|
||||
}
|
||||
else if (type == ETemplateZoneType::SEALED)
|
||||
{
|
||||
//Completely block all the tiles in the zone
|
||||
auto tiles = areaPossible()->getTiles();
|
||||
for(const auto & t : tiles)
|
||||
map.setOccupied(t, ETileType::BLOCKED);
|
||||
possibleTiles.clear();
|
||||
dAreaFree.clear();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Handle special case - place Monoliths at the edge of a zone
|
||||
|
Loading…
Reference in New Issue
Block a user