mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
Unified two uniques into one more descriptive unique (#6380)
* Unified two uniques into one more descriptive unique * Fixed fallout generation & typo
This commit is contained in:
parent
dcd8e6c845
commit
367a427436
@ -181,7 +181,7 @@
|
||||
"uniques": ["Rough terrain",
|
||||
"Provides a one-time Production bonus to the closest city when cut down",
|
||||
"Blocks line-of-sight from tiles at same elevation",
|
||||
"Resistant to nukes", "Can be destroyed by nukes",
|
||||
"[25]% Chance to be destroyed by nukes",
|
||||
"A Region is formed with at least [30]% [Forest] tiles, with priority [3]",
|
||||
"A Region is formed with at least [35]% [Forest] tiles and [Jungle] tiles, with priority [3]",
|
||||
"A Region can not contain more [Jungle] tiles than [Forest] tiles",
|
||||
@ -201,16 +201,18 @@
|
||||
"unbuildable": true,
|
||||
"defenceBonus": 0.25,
|
||||
"occursOn": ["Plains","Grassland"],
|
||||
"uniques": ["Rough terrain",
|
||||
"uniques": [
|
||||
"Rough terrain",
|
||||
"Blocks line-of-sight from tiles at same elevation",
|
||||
"Resistant to nukes", "Can be destroyed by nukes",
|
||||
"[25]% Chance to be destroyed by nukes",
|
||||
"[-1] to Fertility for Map Generation",
|
||||
"A Region is formed with at least [30]% [Jungle] tiles, with priority [2]",
|
||||
"A Region is formed with at least [35]% [Jungle] tiles and [Forest] tiles, with priority [2]",
|
||||
"A Region can not contain more [Forest] tiles than [Jungle] tiles",
|
||||
"Considered [Food] when determining start locations <in all except [Grassland] Regions>",
|
||||
"Considered [Desirable] when determining start locations <in all except [Grassland] Regions>",
|
||||
"Every [33] tiles with this terrain will receive a major deposit of a strategic resource."]
|
||||
"Every [33] tiles with this terrain will receive a major deposit of a strategic resource."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Marsh",
|
||||
|
@ -178,10 +178,11 @@
|
||||
"unbuildable": true,
|
||||
"defenceBonus": 0.25,
|
||||
"occursOn": ["Tundra","Plains","Grassland","Hill"],
|
||||
"uniques": ["Rough terrain",
|
||||
"uniques": [
|
||||
"Rough terrain",
|
||||
"Provides a one-time Production bonus to the closest city when cut down",
|
||||
"Blocks line-of-sight from tiles at same elevation",
|
||||
"Resistant to nukes", "Can be destroyed by nukes",
|
||||
"[25]% Chance to be destroyed by nukes",
|
||||
"A Region is formed with at least [30]% [Forest] tiles, with priority [3]",
|
||||
"A Region is formed with at least [35]% [Forest] tiles and [Jungle] tiles, with priority [3]",
|
||||
"A Region can not contain more [Jungle] tiles than [Forest] tiles",
|
||||
@ -189,7 +190,8 @@
|
||||
"Considered [Production] when determining start locations",
|
||||
"Considered [Food] when determining start locations <in [Forest] Regions>",
|
||||
"Considered [Food] when determining start locations <in [Tundra] Regions>",
|
||||
"Every [39] tiles with this terrain will receive a major deposit of a strategic resource."],
|
||||
"Every [39] tiles with this terrain will receive a major deposit of a strategic resource."
|
||||
],
|
||||
"civilopediaText": [{"text":"A Camp can be built here without cutting it down", "link":"Improvement/Camp"}]
|
||||
},
|
||||
{
|
||||
@ -201,16 +203,18 @@
|
||||
"unbuildable": true,
|
||||
"defenceBonus": 0.25,
|
||||
"occursOn": ["Plains","Grassland"],
|
||||
"uniques": ["Rough terrain",
|
||||
"uniques": [
|
||||
"Rough terrain",
|
||||
"Blocks line-of-sight from tiles at same elevation",
|
||||
"Resistant to nukes", "Can be destroyed by nukes",
|
||||
"[25]% Chance to be destroyed by nukes",
|
||||
"[-1] to Fertility for Map Generation",
|
||||
"A Region is formed with at least [30]% [Jungle] tiles, with priority [2]",
|
||||
"A Region is formed with at least [35]% [Jungle] tiles and [Forest] tiles, with priority [2]",
|
||||
"A Region can not contain more [Forest] tiles than [Jungle] tiles",
|
||||
"Considered [Food] when determining start locations <in all except [Grassland] Regions>",
|
||||
"Considered [Desirable] when determining start locations <in all except [Grassland] Regions>",
|
||||
"Every [33] tiles with this terrain will receive a major deposit of a strategic resource."]
|
||||
"Every [33] tiles with this terrain will receive a major deposit of a strategic resource."
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Marsh",
|
||||
|
@ -648,7 +648,7 @@ object Battle {
|
||||
|
||||
for (tile in hitTiles) {
|
||||
// Handle complicated effects
|
||||
doNukeExplosion(attacker, tile, strength)
|
||||
doNukeExplosionForTile(attacker, tile, strength)
|
||||
}
|
||||
|
||||
// Instead of postBattleAction() just destroy the unit, all other functions are not relevant
|
||||
@ -665,7 +665,7 @@ object Battle {
|
||||
}
|
||||
}
|
||||
|
||||
private fun doNukeExplosion(attacker: MapUnitCombatant, tile: TileInfo, nukeStrength: Int) {
|
||||
private fun doNukeExplosionForTile(attacker: MapUnitCombatant, tile: TileInfo, nukeStrength: Int) {
|
||||
// https://forums.civfanatics.com/resources/unit-guide-modern-future-units-g-k.25628/
|
||||
// https://www.carlsguides.com/strategy/civilization5/units/aircraft-nukes.ph
|
||||
// Testing done by Ravignir
|
||||
@ -707,15 +707,33 @@ object Battle {
|
||||
tile.improvement = null
|
||||
}
|
||||
tile.roadStatus = RoadStatus.None
|
||||
if (tile.isLand && !tile.isImpassible() && !tile.terrainFeatures.contains("Fallout")) {
|
||||
if (tile.isLand && !tile.isImpassible()) {
|
||||
if (tile.hasUnique(UniqueType.DestroyableByNukesChance)) {
|
||||
for (terrainFeature in tile.terrainFeatureObjects) {
|
||||
for (unique in terrainFeature.getMatchingUniques(UniqueType.DestroyableByNukesChance)) {
|
||||
if (Random().nextFloat() < unique.params[0].toFloat() / 100f) {
|
||||
tile.removeTerrainFeature(terrainFeature.name)
|
||||
if (!tile.terrainFeatures.contains("Fallout") && !tile.hasUnique(UniqueType.Indestructible))
|
||||
tile.addTerrainFeature("Fallout")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (Random().nextFloat() < 0.5f && !tile.terrainFeatures.contains("Fallout") && !tile.hasUnique(UniqueType.Indestructible)) {
|
||||
tile.addTerrainFeature("Fallout")
|
||||
}
|
||||
if (!tile.hasUnique(UniqueType.DestroyableByNukes)) return;
|
||||
|
||||
// Deprecated as of 3.19.19 -- If removed, the two successive `if`s above should be merged
|
||||
val destructionChance = if (tile.hasUnique(UniqueType.ResistsNukes)) 0.25f
|
||||
else 0.5f
|
||||
if (Random().nextFloat() < destructionChance) {
|
||||
for (terrainFeature in tile.terrainFeatureObjects)
|
||||
if (terrainFeature.hasUnique(UniqueType.DestroyableByNukes))
|
||||
tile.removeTerrainFeature(terrainFeature.name)
|
||||
if (!tile.hasUnique(UniqueType.Indestructible))
|
||||
tile.addTerrainFeature("Fallout")
|
||||
}
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -532,14 +532,6 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
|
||||
HasQuality("Considered [terrainQuality] when determining start locations", UniqueTarget.Terrain, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
|
||||
ResourceWeighting("Generated with weight [amount]", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
MinorDepositWeighting("Minor deposits generated with weight [amount]", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
LuxuryWeightingForCityStates("Generated near City States with weight [amount]", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
LuxurySpecialPlacement("Special placement during map generation", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
ResourceFrequency("Generated on every [amount] tiles", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
|
||||
StrategicBalanceResource("Guaranteed with Strategic Balance resource option", UniqueTarget.Resource),
|
||||
|
||||
NoNaturalGeneration("Doesn't generate naturally", UniqueTarget.Terrain, UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
TileGenerationConditions("Occurs at temperature between [amount] and [amount] and humidity between [amount] and [amount]", UniqueTarget.Terrain, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
OccursInChains("Occurs in chains at high elevations", UniqueTarget.Terrain, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
@ -548,7 +540,10 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
|
||||
RareFeature("Rare feature", UniqueTarget.Terrain),
|
||||
|
||||
DestroyableByNukesChance("[amount]% chance to be destroyed by nukes", UniqueTarget.Terrain),
|
||||
@Deprecated("as of 3.19.19", ReplaceWith("[25]% chance to be destroyed by nukes"))
|
||||
ResistsNukes("Resistant to nukes", UniqueTarget.Terrain),
|
||||
@Deprecated("as of 3.19.19", ReplaceWith("[50]% chance to be destroyed by nukes"))
|
||||
DestroyableByNukes("Can be destroyed by nukes", UniqueTarget.Terrain),
|
||||
|
||||
FreshWater(Constants.freshWater, UniqueTarget.Terrain),
|
||||
@ -558,6 +553,12 @@ enum class UniqueType(val text: String, vararg targets: UniqueTarget, val flags:
|
||||
ResourceAmountOnTiles("Deposits in [tileFilter] tiles always provide [amount] resources", UniqueTarget.Resource),
|
||||
CityStateOnlyResource("Can only be created by Mercantile City-States", UniqueTarget.Resource),
|
||||
|
||||
ResourceWeighting("Generated with weight [amount]", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
MinorDepositWeighting("Minor deposits generated with weight [amount]", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
LuxuryWeightingForCityStates("Generated near City States with weight [amount]", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
LuxurySpecialPlacement("Special placement during map generation", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
ResourceFrequency("Generated on every [amount] tiles", UniqueTarget.Resource, flags = UniqueFlag.setOfHiddenToUsers),
|
||||
StrategicBalanceResource("Guaranteed with Strategic Balance resource option", UniqueTarget.Resource),
|
||||
|
||||
////// Improvement uniques
|
||||
ImprovementBuildableByFreshWater("Can also be built on tiles adjacent to fresh water", UniqueTarget.Improvement),
|
||||
|
@ -1246,10 +1246,9 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
??? example "Rare feature"
|
||||
Applicable to: Terrain
|
||||
|
||||
??? example "Resistant to nukes"
|
||||
Applicable to: Terrain
|
||||
??? example "[amount]% chance to be destroyed by nukes"
|
||||
Example: "[20]% chance to be destroyed by nukes"
|
||||
|
||||
??? example "Can be destroyed by nukes"
|
||||
Applicable to: Terrain
|
||||
|
||||
??? example "Fresh water"
|
||||
@ -1324,6 +1323,14 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
Applicable to: Improvement
|
||||
|
||||
## Resource uniques
|
||||
??? example "Deposits in [tileFilter] tiles always provide [amount] resources"
|
||||
Example: "Deposits in [Farm] tiles always provide [20] resources"
|
||||
|
||||
Applicable to: Resource
|
||||
|
||||
??? example "Can only be created by Mercantile City-States"
|
||||
Applicable to: Resource
|
||||
|
||||
??? example "Generated with weight [amount]"
|
||||
Example: "Generated with weight [20]"
|
||||
|
||||
@ -1350,14 +1357,6 @@ Simple unique parameters are explained by mouseover. Complex parameters are expl
|
||||
??? example "Guaranteed with Strategic Balance resource option"
|
||||
Applicable to: Resource
|
||||
|
||||
??? example "Deposits in [tileFilter] tiles always provide [amount] resources"
|
||||
Example: "Deposits in [Farm] tiles always provide [20] resources"
|
||||
|
||||
Applicable to: Resource
|
||||
|
||||
??? example "Can only be created by Mercantile City-States"
|
||||
Applicable to: Resource
|
||||
|
||||
## Ruins uniques
|
||||
??? example "Free [baseUnitFilter] found in the ruins"
|
||||
Example: "Free [Melee] found in the ruins"
|
||||
|
Loading…
x
Reference in New Issue
Block a user