mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Added "Must be next to []" unique for tile improvements
This commit is contained in:
parent
0543c6473f
commit
e292c210c8
@ -6,7 +6,9 @@
|
||||
"food": 1,
|
||||
"turnsToBuild": 7,
|
||||
"techRequired": "Agriculture",
|
||||
"uniques": ["Can also be built on tiles adjacent to fresh water", "[+1 Food] on [fresh water] tiles once [Civil Service] is discovered", "[+1 Food] on [non-fresh water] tiles once [Fertilizer] is discovered"],
|
||||
"uniques": ["Can also be built on tiles adjacent to fresh water",
|
||||
"[+1 Food] on [fresh water] tiles once [Civil Service] is discovered",
|
||||
"[+1 Food] on [non-fresh water] tiles once [Fertilizer] is discovered"],
|
||||
},
|
||||
{
|
||||
"name": "Lumber mill",
|
||||
@ -184,7 +186,9 @@
|
||||
"terrainsCanBeBuiltOn": ["Hill"],
|
||||
"food": 1,
|
||||
"turnsToBuild": 7,
|
||||
"uniques": ["[+1 Food] for each adjacent [Mountain]", "Cannot be built on bonus resource", "[+1 Food] on [fresh water] tiles once [Civil Service] is discovered", "[+1 Food] on [non-fresh water] tiles once [Fertilizer] is discovered"],
|
||||
"uniques": ["[+1 Food] for each adjacent [Mountain]", "Cannot be built on bonus resource",
|
||||
"[+1 Food] on [fresh water] tiles once [Civil Service] is discovered",
|
||||
"[+1 Food] on [non-fresh water] tiles once [Fertilizer] is discovered"],
|
||||
"techRequired": "Construction"
|
||||
},
|
||||
|
||||
|
@ -307,6 +307,11 @@ open class TileInfo {
|
||||
"Cannot be built on bonus resource" in improvement.uniques && resource != null
|
||||
&& getTileResource().resourceType == ResourceType.Bonus -> false
|
||||
improvement.terrainsCanBeBuiltOn.contains(topTerrain.name) -> true
|
||||
improvement.uniqueObjects.filter { it.placeholderText == "Must be next to []" }.any {
|
||||
val filter = it.params[0]
|
||||
if (filter == "River") return@any !isAdjacentToRiver()
|
||||
else return@any !neighbors.any { it.matchesUniqueFilter(filter) }
|
||||
} -> false
|
||||
improvement.name == "Road" && roadStatus == RoadStatus.None -> true
|
||||
improvement.name == "Railroad" && this.roadStatus != RoadStatus.Railroad -> true
|
||||
improvement.name == "Remove Road" && this.roadStatus == RoadStatus.Road -> true
|
||||
|
Loading…
Reference in New Issue
Block a user