mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 10:18:26 +07:00
Adjust city attack strength. Also shown in unittable when selected.
This commit is contained in:
@ -18,7 +18,7 @@
|
||||
},
|
||||
{
|
||||
name:"Oligarchy",
|
||||
description:"Units in cities cost no Maintenance",
|
||||
description:"Units in cities cost no Maintenance, garrisoned city +50% attacking strength",
|
||||
row:1,
|
||||
column:5
|
||||
},
|
||||
|
@ -111,6 +111,10 @@ class BattleDamage{
|
||||
else modifiers["Attacker Bonus"] = bonus
|
||||
}
|
||||
}
|
||||
else if (attacker is CityCombatant) {
|
||||
if (attacker.getCivInfo().policies.isAdopted("Oligarchy") && attacker.city.getCenterTile().militaryUnit != null)
|
||||
modifiers["Oligarchy"] = 0.5f
|
||||
}
|
||||
|
||||
if (attacker.isMelee()) {
|
||||
val numberOfAttackersSurroundingDefender = defender.getTile().neighbors.count {
|
||||
|
@ -22,7 +22,7 @@ class CityCombatant(val city: CityInfo) : ICombatant {
|
||||
}
|
||||
|
||||
override fun getUnitType(): UnitType = UnitType.City
|
||||
override fun getAttackingStrength(): Int = getCityStrength()/5 // I remember reading this but I don't recall where
|
||||
override fun getAttackingStrength(): Int = getCityStrength()*2/5 // I remember reading this but I don't recall where
|
||||
override fun getDefendingStrength(): Int{
|
||||
if(isDefeated()) return 1
|
||||
return getCityStrength()
|
||||
@ -54,5 +54,4 @@ class CityCombatant(val city: CityInfo) : ICombatant {
|
||||
}
|
||||
|
||||
override fun toString(): String {return city.name} // for debug
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ class UnitTable(val worldScreen: WorldScreen) : Table(){
|
||||
unitDescriptionTable.defaults().pad(2f).padRight(5f)
|
||||
unitDescriptionTable.add("Strength".tr())
|
||||
unitDescriptionTable.add(CityCombatant(city).getCityStrength().toString()).row()
|
||||
unitDescriptionTable.add("Ranged Strength".tr())
|
||||
unitDescriptionTable.add(CityCombatant(city).getAttackingStrength().toString()).row()
|
||||
|
||||
selectedUnitHasChanged = true
|
||||
}
|
||||
|
Reference in New Issue
Block a user