mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 15:27:50 +07:00
Added "Must be next to []" unique for tile improvements
This commit is contained in:
@ -6,7 +6,9 @@
|
|||||||
"food": 1,
|
"food": 1,
|
||||||
"turnsToBuild": 7,
|
"turnsToBuild": 7,
|
||||||
"techRequired": "Agriculture",
|
"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",
|
"name": "Lumber mill",
|
||||||
@ -184,7 +186,9 @@
|
|||||||
"terrainsCanBeBuiltOn": ["Hill"],
|
"terrainsCanBeBuiltOn": ["Hill"],
|
||||||
"food": 1,
|
"food": 1,
|
||||||
"turnsToBuild": 7,
|
"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"
|
"techRequired": "Construction"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -307,6 +307,11 @@ open class TileInfo {
|
|||||||
"Cannot be built on bonus resource" in improvement.uniques && resource != null
|
"Cannot be built on bonus resource" in improvement.uniques && resource != null
|
||||||
&& getTileResource().resourceType == ResourceType.Bonus -> false
|
&& getTileResource().resourceType == ResourceType.Bonus -> false
|
||||||
improvement.terrainsCanBeBuiltOn.contains(topTerrain.name) -> true
|
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 == "Road" && roadStatus == RoadStatus.None -> true
|
||||||
improvement.name == "Railroad" && this.roadStatus != RoadStatus.Railroad -> true
|
improvement.name == "Railroad" && this.roadStatus != RoadStatus.Railroad -> true
|
||||||
improvement.name == "Remove Road" && this.roadStatus == RoadStatus.Road -> true
|
improvement.name == "Remove Road" && this.roadStatus == RoadStatus.Road -> true
|
||||||
|
Reference in New Issue
Block a user