mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Resolved #2929 - Can no longer destroy original capitals by nuke
This commit is contained in:
parent
01d6698b7a
commit
04d4c9c9bf
@ -59,6 +59,7 @@
|
|||||||
"outerColor": [181, 232, 232],
|
"outerColor": [181, 232, 232],
|
||||||
"innerColor": [68,142,249],
|
"innerColor": [68,142,249],
|
||||||
"unique": "HELLENIC_LEAGUE",
|
"unique": "HELLENIC_LEAGUE",
|
||||||
|
"uniques": ["City-State Influence degrades at half rate", "City-State Influence recovers at twice the normal rate"]
|
||||||
"cities": ["Athens","Sparta","Corinth","Argos","Knossos","Mycenae","Pharsalos","Ephesus","Halicarnassus","Rhodes",
|
"cities": ["Athens","Sparta","Corinth","Argos","Knossos","Mycenae","Pharsalos","Ephesus","Halicarnassus","Rhodes",
|
||||||
"Eretria","Pergamon","Miletos","Megara","Phocaea","Sicyon","Tiryns","Samos","Mytilene","Chios",
|
"Eretria","Pergamon","Miletos","Megara","Phocaea","Sicyon","Tiryns","Samos","Mytilene","Chios",
|
||||||
"Paros","Elis","Syracuse","Herakleia","Gortyn","Chalkis","Pylos","Pella","Naxos","Sicyon",
|
"Paros","Elis","Syracuse","Herakleia","Gortyn","Chalkis","Pylos","Pella","Naxos","Sicyon",
|
||||||
@ -83,6 +84,7 @@
|
|||||||
"outerColor": [9, 112, 84],
|
"outerColor": [9, 112, 84],
|
||||||
"innerColor": [255,255,255],
|
"innerColor": [255,255,255],
|
||||||
"unique": "ART_OF_WAR",
|
"unique": "ART_OF_WAR",
|
||||||
|
"uniques": ["Great General provides double combat bonus", "[Great General] is earned [50]% faster"]
|
||||||
"cities": ["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong",
|
"cities": ["Beijing","Shanghai","Guangzhou","Nanjing","Xian","Chengdu","Hangzhou","Tianjin","Macau","Shandong",
|
||||||
"Kaifeng","Ningbo","Baoding","Yangzhou","Harbin","Chongqing","Luoyang","Kunming","Taipei","Shenyang",
|
"Kaifeng","Ningbo","Baoding","Yangzhou","Harbin","Chongqing","Luoyang","Kunming","Taipei","Shenyang",
|
||||||
"Taiyuan","Tainan","Dalian","Lijiang","Wuxi","Suzhou","Maoming","Shaoguan","Yangjiang","Heyuan","Huangshi",
|
"Taiyuan","Tainan","Dalian","Lijiang","Wuxi","Suzhou","Maoming","Shaoguan","Yangjiang","Heyuan","Huangshi",
|
||||||
@ -111,6 +113,7 @@
|
|||||||
"outerColor": [ 231, 213, 0],
|
"outerColor": [ 231, 213, 0],
|
||||||
"innerColor": [98,10,210],
|
"innerColor": [98,10,210],
|
||||||
"unique": "MONUMENT_BUILDERS",
|
"unique": "MONUMENT_BUILDERS",
|
||||||
|
"uniques": ["+[20]% Production when constructing [Wonders]"]
|
||||||
"cities": ["Thebes","Memphis","Heliopolis","Elephantine","Alexandria","Pi-Ramesses","Giza","Byblos","Akhetaten",
|
"cities": ["Thebes","Memphis","Heliopolis","Elephantine","Alexandria","Pi-Ramesses","Giza","Byblos","Akhetaten",
|
||||||
"Hieraconpolis","Abydos","Asyut","Avaris","Lisht","Buto","Edfu","Pithom","Busiris","Kahun","Athribis",
|
"Hieraconpolis","Abydos","Asyut","Avaris","Lisht","Buto","Edfu","Pithom","Busiris","Kahun","Athribis",
|
||||||
"Mendes","Elashmunein","Tanis","Bubastis","Oryx","Sebennytus","Akhmin","Karnak","Luxor","El Kab","Armant",
|
"Mendes","Elashmunein","Tanis","Bubastis","Oryx","Sebennytus","Akhmin","Karnak","Luxor","El Kab","Armant",
|
||||||
|
@ -245,7 +245,8 @@ object Battle {
|
|||||||
|
|
||||||
if(thisCombatant.getCivInfo().isMajorCiv()) {
|
if(thisCombatant.getCivInfo().isMajorCiv()) {
|
||||||
var greatGeneralPointsModifier = 1f
|
var greatGeneralPointsModifier = 1f
|
||||||
if (thisCombatant.getCivInfo().nation.unique == UniqueAbility.ART_OF_WAR)
|
// Yeah sue me I didn't parse these params
|
||||||
|
if (thisCombatant.getCivInfo().hasUnique("[Great General] is earned [50]% faster"))
|
||||||
greatGeneralPointsModifier += 0.5f
|
greatGeneralPointsModifier += 0.5f
|
||||||
if (thisCombatant.unit.hasUnique("Combat very likely to create Great Generals"))
|
if (thisCombatant.unit.hasUnique("Combat very likely to create Great Generals"))
|
||||||
greatGeneralPointsModifier += 1f
|
greatGeneralPointsModifier += 1f
|
||||||
@ -336,10 +337,10 @@ object Battle {
|
|||||||
val city = tile.getCity()
|
val city = tile.getCity()
|
||||||
if (city != null && city.location == tile.position) {
|
if (city != null && city.location == tile.position) {
|
||||||
city.health = 1
|
city.health = 1
|
||||||
if (city.population.population <= 5) {
|
if (city.population.population <= 5 && city.isOriginalCapital) {
|
||||||
city.destroyCity()
|
city.destroyCity()
|
||||||
} else {
|
} else {
|
||||||
city.population.population -= 5
|
city.population.population = max(city.population.population-5, 1)
|
||||||
city.population.unassignExtraPopulation()
|
city.population.unassignExtraPopulation()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -330,10 +330,10 @@ class CityStats {
|
|||||||
return stats
|
return stats
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getStatPercentBonusesFromPolicies(cityConstructions: CityConstructions): Stats {
|
private fun getStatPercentBonusesFromPolicies(): Stats {
|
||||||
val stats = Stats()
|
val stats = Stats()
|
||||||
|
|
||||||
val currentConstruction = cityConstructions.getCurrentConstruction()
|
val currentConstruction = cityInfo.cityConstructions.getCurrentConstruction()
|
||||||
if (currentConstruction.name == Constants.settler && cityInfo.isCapital()
|
if (currentConstruction.name == Constants.settler && cityInfo.isCapital()
|
||||||
&& cityInfo.civInfo.hasUnique("Training of settlers increased +50% in capital"))
|
&& cityInfo.civInfo.hasUnique("Training of settlers increased +50% in capital"))
|
||||||
stats.production += 50f
|
stats.production += 50f
|
||||||
@ -353,12 +353,13 @@ class CityStats {
|
|||||||
val placeholderParams = unique.getPlaceholderParameters()
|
val placeholderParams = unique.getPlaceholderParameters()
|
||||||
val filter = placeholderParams[1]
|
val filter = placeholderParams[1]
|
||||||
if (currentConstruction.name == filter
|
if (currentConstruction.name == filter
|
||||||
|| (filter=="military units" && currentConstruction is BaseUnit && !currentConstruction.unitType.isCivilian())
|
|| (filter == "military units" && currentConstruction is BaseUnit && !currentConstruction.unitType.isCivilian())
|
||||||
|| (filter=="Buildings" && currentConstruction is Building && !currentConstruction.isWonder))
|
|| (filter == "Buildings" && currentConstruction is Building && !currentConstruction.isWonder)
|
||||||
|
|| (filter == "Wonders" && currentConstruction is Building && currentConstruction.isWonder))
|
||||||
stats.production += placeholderParams[0].toInt()
|
stats.production += placeholderParams[0].toInt()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cityConstructions.getBuiltBuildings().any { it.isWonder }
|
if (cityInfo.cityConstructions.getBuiltBuildings().any { it.isWonder }
|
||||||
&& cityInfo.civInfo.hasUnique("+33% culture in all cities with a world wonder"))
|
&& cityInfo.civInfo.hasUnique("+33% culture in all cities with a world wonder"))
|
||||||
stats.culture += 33f
|
stats.culture += 33f
|
||||||
if (cityInfo.civInfo.hasUnique("+25% gold in capital") && cityInfo.isCapital())
|
if (cityInfo.civInfo.hasUnique("+25% gold in capital") && cityInfo.isCapital())
|
||||||
@ -406,7 +407,7 @@ class CityStats {
|
|||||||
fun updateStatPercentBonusList() {
|
fun updateStatPercentBonusList() {
|
||||||
val newStatPercentBonusList = LinkedHashMap<String, Stats>()
|
val newStatPercentBonusList = LinkedHashMap<String, Stats>()
|
||||||
newStatPercentBonusList["Golden Age"] = getStatPercentBonusesFromGoldenAge(cityInfo.civInfo.goldenAges.isGoldenAge())
|
newStatPercentBonusList["Golden Age"] = getStatPercentBonusesFromGoldenAge(cityInfo.civInfo.goldenAges.isGoldenAge())
|
||||||
newStatPercentBonusList["Policies"] = getStatPercentBonusesFromPolicies(cityInfo.cityConstructions)
|
newStatPercentBonusList["Policies"] = getStatPercentBonusesFromPolicies()
|
||||||
newStatPercentBonusList["Buildings"] = getStatPercentBonusesFromBuildings()
|
newStatPercentBonusList["Buildings"] = getStatPercentBonusesFromBuildings()
|
||||||
newStatPercentBonusList["Railroad"] = getStatPercentBonusesFromRailroad()
|
newStatPercentBonusList["Railroad"] = getStatPercentBonusesFromRailroad()
|
||||||
newStatPercentBonusList["Marble"] = getStatPercentBonusesFromMarble()
|
newStatPercentBonusList["Marble"] = getStatPercentBonusesFromMarble()
|
||||||
|
@ -167,19 +167,22 @@ class DiplomacyManager() {
|
|||||||
return otherCivDiplomacy().getTurnsToRelationshipChange()
|
return otherCivDiplomacy().getTurnsToRelationshipChange()
|
||||||
|
|
||||||
if (civInfo.isCityState() && !otherCiv().isCityState()) {
|
if (civInfo.isCityState() && !otherCiv().isCityState()) {
|
||||||
val hasCityStateInfluenceBonus = otherCiv().nation.unique == UniqueAbility.HELLENIC_LEAGUE
|
val dropPerTurn = getCityStateInfluenceDegradeRate()
|
||||||
val dropPerTurn = if(hasCityStateInfluenceBonus) .5f else 1f
|
when {
|
||||||
|
relationshipLevel() >= RelationshipLevel.Ally -> return ceil((influence - 60f) / dropPerTurn).toInt() + 1
|
||||||
if (relationshipLevel() >= RelationshipLevel.Ally)
|
relationshipLevel() >= RelationshipLevel.Friend -> return ceil((influence - 30f) / dropPerTurn).toInt() + 1
|
||||||
return ceil((influence - 60f) / dropPerTurn).toInt() + 1
|
else -> return 0
|
||||||
else if (relationshipLevel() >= RelationshipLevel.Friend)
|
}
|
||||||
return ceil((influence - 30f) / dropPerTurn).toInt() + 1
|
|
||||||
else
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getCityStateInfluenceDegradeRate(): Float {
|
||||||
|
if(otherCiv().hasUnique("City-State Influence degrades at half rate"))
|
||||||
|
return .5f
|
||||||
|
else return 1f
|
||||||
|
}
|
||||||
|
|
||||||
fun canDeclareWar() = turnsToPeaceTreaty()==0 && diplomaticStatus != DiplomaticStatus.War
|
fun canDeclareWar() = turnsToPeaceTreaty()==0 && diplomaticStatus != DiplomaticStatus.War
|
||||||
//Used for nuke
|
//Used for nuke
|
||||||
fun canAttack() = turnsToPeaceTreaty()==0
|
fun canAttack() = turnsToPeaceTreaty()==0
|
||||||
@ -288,9 +291,8 @@ class DiplomacyManager() {
|
|||||||
private fun nextTurnCityStateInfluence() {
|
private fun nextTurnCityStateInfluence() {
|
||||||
val initialRelationshipLevel = relationshipLevel()
|
val initialRelationshipLevel = relationshipLevel()
|
||||||
|
|
||||||
val hasCityStateInfluenceBonus = otherCiv().nation.unique == UniqueAbility.HELLENIC_LEAGUE
|
val increment = if (otherCiv().hasUnique("City-State Influence recovers at twice the normal rate")) 2f else 1f
|
||||||
val increment = if (hasCityStateInfluenceBonus) 2f else 1f
|
val decrement = getCityStateInfluenceDegradeRate()
|
||||||
val decrement = if (hasCityStateInfluenceBonus) .5f else 1f
|
|
||||||
|
|
||||||
if (influence > restingPoint)
|
if (influence > restingPoint)
|
||||||
influence = max(restingPoint, influence - decrement)
|
influence = max(restingPoint, influence - decrement)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user