mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Fixed bugs with fallout (#5379)
* Fixed bugs with fallout * Reordered uniques * Reviews * Added missing unique targets
This commit is contained in:
parent
71405b93aa
commit
97da979a04
@ -152,12 +152,13 @@
|
|||||||
{
|
{
|
||||||
"name": "Fallout",
|
"name": "Fallout",
|
||||||
"type": "TerrainFeature",
|
"type": "TerrainFeature",
|
||||||
"food": -3,
|
|
||||||
"production": -3,
|
|
||||||
"gold": -3,
|
|
||||||
"movementCost": 2,
|
"movementCost": 2,
|
||||||
"unbuildable": true,
|
"unbuildable": true,
|
||||||
"defenceBonus": -0.15,
|
"uniques": ["Nullifies all other stats this tile provides", "Doesn't generate naturally"],
|
||||||
|
// For map editor only - the generator won't place it without code or enabling uniques
|
||||||
|
// If the map generator is ever updated to always take these into account, it should also take the "Doesn't generate naturally" unique into account
|
||||||
|
"occursOn": ["Grassland","Plains","Desert","Tundra","Snow","Forest","Jungle","Hill","Flood plains","Marsh","Oasis"]
|
||||||
|
"defenceBonus": -0.15
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Oasis",
|
"name": "Oasis",
|
||||||
|
@ -218,10 +218,12 @@ open class TileInfo {
|
|||||||
var stats = getBaseTerrain().clone()
|
var stats = getBaseTerrain().clone()
|
||||||
|
|
||||||
for (terrainFeatureBase in getTerrainFeatures()) {
|
for (terrainFeatureBase in getTerrainFeatures()) {
|
||||||
if (terrainFeatureBase.overrideStats)
|
when {
|
||||||
stats = terrainFeatureBase.clone()
|
terrainFeatureBase.hasUnique(UniqueType.NullifyYields) ->
|
||||||
else
|
return terrainFeatureBase.clone()
|
||||||
stats.add(terrainFeatureBase)
|
terrainFeatureBase.overrideStats -> stats = terrainFeatureBase.clone()
|
||||||
|
else -> stats.add(terrainFeatureBase)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (naturalWonder != null) {
|
if (naturalWonder != null) {
|
||||||
|
@ -261,7 +261,7 @@ class TradeEvaluation {
|
|||||||
fun evaluatePeaceCostForThem(ourCivilization: CivilizationInfo, otherCivilization: CivilizationInfo): Int {
|
fun evaluatePeaceCostForThem(ourCivilization: CivilizationInfo, otherCivilization: CivilizationInfo): Int {
|
||||||
val ourCombatStrength = ourCivilization.getStatForRanking(RankingType.Force)
|
val ourCombatStrength = ourCivilization.getStatForRanking(RankingType.Force)
|
||||||
val theirCombatStrength = otherCivilization.getStatForRanking(RankingType.Force)
|
val theirCombatStrength = otherCivilization.getStatForRanking(RankingType.Force)
|
||||||
if (ourCombatStrength*1.5f >= theirCombatStrength && theirCombatStrength * 1.5f >= ourCombatStrength)
|
if (ourCombatStrength * 1.5f >= theirCombatStrength && theirCombatStrength * 1.5f >= ourCombatStrength)
|
||||||
return 0 // we're roughly equal, there's no huge power imbalance
|
return 0 // we're roughly equal, there's no huge power imbalance
|
||||||
if (ourCombatStrength == 0) return -1000
|
if (ourCombatStrength == 0) return -1000
|
||||||
if (theirCombatStrength == 0) return 1000 // Chumps got no combat units
|
if (theirCombatStrength == 0) return 1000 // Chumps got no combat units
|
||||||
|
@ -6,6 +6,7 @@ import com.unciv.models.ruleset.Belief
|
|||||||
import com.unciv.models.ruleset.Ruleset
|
import com.unciv.models.ruleset.Ruleset
|
||||||
import com.unciv.models.ruleset.RulesetStatsObject
|
import com.unciv.models.ruleset.RulesetStatsObject
|
||||||
import com.unciv.models.ruleset.unique.UniqueTarget
|
import com.unciv.models.ruleset.unique.UniqueTarget
|
||||||
|
import com.unciv.models.ruleset.unique.UniqueType
|
||||||
import com.unciv.ui.civilopedia.FormattedLine
|
import com.unciv.ui.civilopedia.FormattedLine
|
||||||
import com.unciv.ui.utils.colorFromRGB
|
import com.unciv.ui.utils.colorFromRGB
|
||||||
|
|
||||||
@ -75,7 +76,7 @@ class Terrain : RulesetStatsObject() {
|
|||||||
textList += FormattedLine("$stats")
|
textList += FormattedLine("$stats")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (occursOn.isNotEmpty()) {
|
if (occursOn.isNotEmpty() && !hasUnique(UniqueType.NoNaturalGeneration)) {
|
||||||
textList += FormattedLine()
|
textList += FormattedLine()
|
||||||
if (occursOn.size == 1) {
|
if (occursOn.size == 1) {
|
||||||
with (occursOn[0]) {
|
with (occursOn[0]) {
|
||||||
|
@ -57,20 +57,44 @@ enum class UniqueTarget(val inheritsFrom:UniqueTarget?=null) {
|
|||||||
|
|
||||||
enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
||||||
|
|
||||||
|
//////////////////////////////////////// GLOBAL UNIQUES ////////////////////////////////////////
|
||||||
|
|
||||||
|
/////// Stat providing uniques
|
||||||
|
|
||||||
Stats("[stats]", UniqueTarget.Global),
|
Stats("[stats]", UniqueTarget.Global),
|
||||||
StatsPerCity("[stats] [cityFilter]", UniqueTarget.Global),
|
StatsPerCity("[stats] [cityFilter]", UniqueTarget.Global),
|
||||||
|
@Deprecated("As of 3.16.16", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.WARNING)
|
||||||
|
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists", UniqueTarget.Global),
|
||||||
|
|
||||||
StatPercentBonus("[amount]% [Stat]", UniqueTarget.Global),
|
StatPercentBonus("[amount]% [Stat]", UniqueTarget.Global),
|
||||||
|
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
|
||||||
|
|
||||||
|
RemoveAnnexUnhappiness("Remove extra unhappiness from annexed cities", UniqueTarget.Building),
|
||||||
|
|
||||||
ConsumesResources("Consumes [amount] [resource]",
|
/////// City-State related uniques
|
||||||
UniqueTarget.Improvement, UniqueTarget.Building, UniqueTarget.Unit), // No conditional support as of yet
|
|
||||||
ProvidesResources("Provides [amount] [resource]",
|
|
||||||
UniqueTarget.Improvement, UniqueTarget.Building),
|
|
||||||
|
|
||||||
|
// I don't like the fact that currently "city state bonuses" are separate from the "global bonuses",
|
||||||
|
// todo: merge city state bonuses into global bonuses
|
||||||
|
CityStateStatsPerTurn("Provides [stats] per turn", UniqueTarget.CityState), // Should not be Happiness!
|
||||||
|
CityStateStatsPerCity("Provides [stats] [cityFilter] per turn", UniqueTarget.CityState),
|
||||||
|
CityStateHappiness("Provides [amount] Happiness", UniqueTarget.CityState),
|
||||||
|
CityStateMilitaryUnits("Provides military units every ≈[amount] turns", UniqueTarget.CityState), // No conditional support as of yet
|
||||||
|
CityStateUniqueLuxury("Provides a unique luxury", UniqueTarget.CityState), // No conditional support as of yet
|
||||||
|
|
||||||
|
|
||||||
|
/////// Other global uniques
|
||||||
|
|
||||||
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
|
FreeUnits("[amount] units cost no maintenance", UniqueTarget.Global),
|
||||||
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global),
|
UnitMaintenanceDiscount("[amount]% maintenance costs for [mapUnitFilter] units", UniqueTarget.Global),
|
||||||
BonusStatsFromCityStates("[amount]% [stat] from City-States", UniqueTarget.Global),
|
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
||||||
RemoveAnnexUnhappiness("Remove extra unhappiness from annexed cities", UniqueTarget.Building),
|
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs", UniqueTarget.Global),
|
||||||
|
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
||||||
|
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs", UniqueTarget.Global),
|
||||||
|
|
||||||
|
ConsumesResources("Consumes [amount] [resource]",
|
||||||
|
UniqueTarget.Improvement, UniqueTarget.Building, UniqueTarget.Unit),
|
||||||
|
ProvidesResources("Provides [amount] [resource]",
|
||||||
|
UniqueTarget.Improvement, UniqueTarget.Building),
|
||||||
|
|
||||||
GrowthPercentBonus("[amount]% growth [cityFilter]", UniqueTarget.Global),
|
GrowthPercentBonus("[amount]% growth [cityFilter]", UniqueTarget.Global),
|
||||||
@Deprecated("As of 3.16.14", ReplaceWith("[amount]% growth [cityFilter]"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.16.14", ReplaceWith("[amount]% growth [cityFilter]"), DeprecationLevel.WARNING)
|
||||||
@ -78,15 +102,15 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
@Deprecated("As of 3.16.14", ReplaceWith("[amount]% growth [cityFilter] <when not at war>"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.16.14", ReplaceWith("[amount]% growth [cityFilter] <when not at war>"), DeprecationLevel.WARNING)
|
||||||
GrowthPercentBonusWhenNotAtWar("+[amount]% growth [cityFilter] when not at war", UniqueTarget.Global),
|
GrowthPercentBonusWhenNotAtWar("+[amount]% growth [cityFilter] when not at war", UniqueTarget.Global),
|
||||||
|
|
||||||
TileProvidesYieldWithoutPopulation("Tile provides yield without assigned population", UniqueTarget.Terrain, UniqueTarget.Improvement),
|
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
||||||
|
ProvidesFreeBuildings("Provides a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
||||||
|
GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
||||||
|
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
FreeExtraBeliefs("May choose [amount] additional [beliefType] beliefs when [foundingOrEnhancing] a religion", UniqueTarget.Global),
|
||||||
DecreasedUnitMaintenanceCostsByFilter("-[amount]% [mapUnitFilter] unit maintenance costs"), // No conditional support
|
FreeExtraAnyBeliefs("May choose [amount] additional of any type when [foundingOrEnhancing] a religion", UniqueTarget.Global),
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[amount]% maintenance costs for [mapUnitFilter] units"), DeprecationLevel.WARNING)
|
|
||||||
DecreasedUnitMaintenanceCostsGlobally("-[amount]% unit upkeep costs"), // No conditional support
|
|
||||||
@Deprecated("As of 3.16.16", ReplaceWith("[stats] <if this city has at least [amount] specialists>"), DeprecationLevel.WARNING)
|
|
||||||
StatBonusForNumberOfSpecialists("[stats] if this city has at least [amount] specialists"), // No conditional support
|
|
||||||
|
|
||||||
|
///////////////////////////////////////// UNIT UNIQUES /////////////////////////////////////////
|
||||||
|
|
||||||
Strength("[amount]% Strength", UniqueTarget.Unit, UniqueTarget.Global),
|
Strength("[amount]% Strength", UniqueTarget.Unit, UniqueTarget.Global),
|
||||||
|
|
||||||
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
||||||
@ -100,35 +124,6 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.17.3", ReplaceWith("[amount]% Strength"), DeprecationLevel.WARNING)
|
||||||
CombatBonus("+[amount]% Combat Strength", UniqueTarget.Unit),
|
CombatBonus("+[amount]% Combat Strength", UniqueTarget.Unit),
|
||||||
|
|
||||||
|
|
||||||
// TODO: Unify these (I'm in favor of "gain a free" above "provides" because it fits more cases)
|
|
||||||
ProvidesFreeBuildings("Provides a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
|
||||||
GainFreeBuildings("Gain a free [buildingName] [cityFilter]", UniqueTarget.Global),
|
|
||||||
|
|
||||||
FreeExtraBeliefs("May choose [amount] additional [beliefType] beliefs when [foundingOrEnhancing] a religion", UniqueTarget.Global),
|
|
||||||
FreeExtraAnyBeliefs("May choose [amount] additional of any type when [foundingOrEnhancing] a religion", UniqueTarget.Global),
|
|
||||||
|
|
||||||
// I don't like the fact that currently "city state bonuses" are separate from the "global bonuses",
|
|
||||||
// todo: merge city state bonuses into global bonuses
|
|
||||||
CityStateStatsPerTurn("Provides [stats] per turn", UniqueTarget.CityState), // Should not be Happiness!
|
|
||||||
CityStateStatsPerCity("Provides [stats] [cityFilter] per turn", UniqueTarget.CityState),
|
|
||||||
CityStateHappiness("Provides [amount] Happiness", UniqueTarget.CityState),
|
|
||||||
CityStateMilitaryUnits("Provides military units every ≈[amount] turns", UniqueTarget.CityState), // No conditional support as of yet
|
|
||||||
CityStateUniqueLuxury("Provides a unique luxury", UniqueTarget.CityState), // No conditional support as of yet
|
|
||||||
|
|
||||||
NaturalWonderNeighborCount("Must be adjacent to [amount] [simpleTerrain] tiles", UniqueTarget.Terrain),
|
|
||||||
NaturalWonderNeighborsRange("Must be adjacent to [amount] to [amount] [simpleTerrain] tiles", UniqueTarget.Terrain),
|
|
||||||
NaturalWonderSmallerLandmass("Must not be on [amount] largest landmasses", UniqueTarget.Terrain),
|
|
||||||
NaturalWonderLargerLandmass("Must be on [amount] largest landmasses", UniqueTarget.Terrain),
|
|
||||||
NaturalWonderLatitude("Occurs on latitudes from [amount] to [amount] percent of distance equator to pole", UniqueTarget.Terrain),
|
|
||||||
NaturalWonderGroups("Occurs in groups of [amount] to [amount] tiles", UniqueTarget.Terrain),
|
|
||||||
NaturalWonderConvertNeighbors("Neighboring tiles will convert to [baseTerrain]", UniqueTarget.Terrain),
|
|
||||||
|
|
||||||
// The "Except [terrainFilter]" could theoretically be implemented with a conditional
|
|
||||||
NaturalWonderConvertNeighborsExcept("Neighboring tiles except [baseTerrain] will convert to [baseTerrain]", UniqueTarget.Terrain),
|
|
||||||
|
|
||||||
TerrainGrantsPromotion("Grants [promotion] ([comment]) to adjacent [mapUnitFilter] units for the rest of the game", UniqueTarget.Terrain),
|
|
||||||
|
|
||||||
// The following block gets cached in MapUnit for faster getMovementCostBetweenAdjacentTiles
|
// The following block gets cached in MapUnit for faster getMovementCostBetweenAdjacentTiles
|
||||||
DoubleMovementOnTerrain("Double movement in [terrainFilter]", UniqueTarget.Unit),
|
DoubleMovementOnTerrain("Double movement in [terrainFilter]", UniqueTarget.Unit),
|
||||||
@Deprecated("As of 3.17.1", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.WARNING)
|
@Deprecated("As of 3.17.1", ReplaceWith("Double movement in [terrainFilter]"), DeprecationLevel.WARNING)
|
||||||
@ -146,8 +141,27 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget) {
|
|||||||
CannotEnterOcean("Cannot enter ocean tiles", UniqueTarget.Unit),
|
CannotEnterOcean("Cannot enter ocean tiles", UniqueTarget.Unit),
|
||||||
CannotEnterOceanUntilAstronomy("Cannot enter ocean tiles until Astronomy", UniqueTarget.Unit),
|
CannotEnterOceanUntilAstronomy("Cannot enter ocean tiles until Astronomy", UniqueTarget.Unit),
|
||||||
|
|
||||||
|
//////////////////////////////////////// TERRAIN UNIQUES ////////////////////////////////////////
|
||||||
|
|
||||||
|
NaturalWonderNeighborCount("Must be adjacent to [amount] [simpleTerrain] tiles", UniqueTarget.Terrain),
|
||||||
|
NaturalWonderNeighborsRange("Must be adjacent to [amount] to [amount] [simpleTerrain] tiles", UniqueTarget.Terrain),
|
||||||
|
NaturalWonderSmallerLandmass("Must not be on [amount] largest landmasses", UniqueTarget.Terrain),
|
||||||
|
NaturalWonderLargerLandmass("Must be on [amount] largest landmasses", UniqueTarget.Terrain),
|
||||||
|
NaturalWonderLatitude("Occurs on latitudes from [amount] to [amount] percent of distance equator to pole", UniqueTarget.Terrain),
|
||||||
|
NaturalWonderGroups("Occurs in groups of [amount] to [amount] tiles", UniqueTarget.Terrain),
|
||||||
|
NaturalWonderConvertNeighbors("Neighboring tiles will convert to [baseTerrain]", UniqueTarget.Terrain),
|
||||||
|
|
||||||
|
// The "Except [terrainFilter]" could theoretically be implemented with a conditional
|
||||||
|
NaturalWonderConvertNeighborsExcept("Neighboring tiles except [baseTerrain] will convert to [baseTerrain]", UniqueTarget.Terrain),
|
||||||
|
|
||||||
// Conditionals
|
TerrainGrantsPromotion("Grants [promotion] ([comment]) to adjacent [mapUnitFilter] units for the rest of the game", UniqueTarget.Terrain),
|
||||||
|
|
||||||
|
TileProvidesYieldWithoutPopulation("Tile provides yield without assigned population", UniqueTarget.Terrain, UniqueTarget.Improvement),
|
||||||
|
NullifyYields("Nullifies all other stats this tile provides", UniqueTarget.Terrain),
|
||||||
|
|
||||||
|
NoNaturalGeneration("Doesn't generate naturally", UniqueTarget.Terrain),
|
||||||
|
|
||||||
|
///////////////////////////////////////// CONDITIONALS /////////////////////////////////////////
|
||||||
|
|
||||||
ConditionalWar("when at war", UniqueTarget.Conditional),
|
ConditionalWar("when at war", UniqueTarget.Conditional),
|
||||||
ConditionalNotWar("when not at war", UniqueTarget.Conditional),
|
ConditionalNotWar("when not at war", UniqueTarget.Conditional),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user