mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 06:51:30 -04:00
Added Puppet icon - some reorgnizing still needs to be done in regards to puppet vs annex
This commit is contained in:
parent
65b8fe531e
commit
a1f5690e41
BIN
android/Images/OtherIcons/Puppet.png
Normal file
BIN
android/Images/OtherIcons/Puppet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 1011 KiB After Width: | Height: | Size: 1007 KiB |
@ -7,12 +7,10 @@ import com.unciv.logic.automation.UnitAutomation
|
||||
import com.unciv.logic.city.CityInfo
|
||||
import com.unciv.logic.civilization.AlertType
|
||||
import com.unciv.logic.civilization.PopupAlert
|
||||
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
|
||||
import com.unciv.logic.map.TileInfo
|
||||
import com.unciv.models.gamebasics.unit.UnitType
|
||||
import java.util.*
|
||||
import kotlin.math.max
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
/**
|
||||
* Damage calculations according to civ v wiki and https://steamcommunity.com/sharedfiles/filedetails/?id=170194443
|
||||
@ -215,7 +213,7 @@ class Battle(val gameInfo:GameInfo) {
|
||||
if (attacker.getCivInfo().isPlayerCivilization()) {
|
||||
attackerCiv.popupAlerts.add(PopupAlert(AlertType.CityConquered, city.name))
|
||||
} else {
|
||||
city.AnnexCity()
|
||||
city.annexCity()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,10 @@ import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.math.Vector2
|
||||
import com.unciv.Constants
|
||||
import com.unciv.UnCivGame
|
||||
import com.unciv.logic.battle.*
|
||||
import com.unciv.logic.battle.Battle
|
||||
import com.unciv.logic.battle.CityCombatant
|
||||
import com.unciv.logic.battle.ICombatant
|
||||
import com.unciv.logic.battle.MapUnitCombatant
|
||||
import com.unciv.logic.civilization.AlertType
|
||||
import com.unciv.logic.civilization.CivilizationInfo
|
||||
import com.unciv.logic.civilization.PopupAlert
|
||||
@ -18,7 +21,6 @@ import com.unciv.models.gamebasics.tile.ResourceSupplyList
|
||||
import com.unciv.models.gamebasics.tile.ResourceType
|
||||
import com.unciv.models.stats.Stats
|
||||
import com.unciv.ui.utils.withoutItem
|
||||
import kotlin.math.max
|
||||
import kotlin.math.min
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
@ -277,7 +279,7 @@ class CityInfo {
|
||||
getCenterTile().improvement="City ruins"
|
||||
}
|
||||
|
||||
fun AnnexCity() {
|
||||
fun annexCity() {
|
||||
if (conquerer == null) return
|
||||
val attackerCiv = conquerer!!.getCivInfo()
|
||||
val defenderCiv = civInfo
|
||||
@ -343,20 +345,16 @@ class CityInfo {
|
||||
UnCivGame.Current.worldScreen.shouldUpdate=true
|
||||
}
|
||||
|
||||
fun RazeCity() {
|
||||
AnnexCity()
|
||||
isBeingRazed = true
|
||||
}
|
||||
|
||||
fun PuppetCity() {
|
||||
AnnexCity()
|
||||
fun puppetCity() {
|
||||
annexCity()
|
||||
isPuppet = true
|
||||
resistanceCounter = 0
|
||||
}
|
||||
|
||||
fun LiberateCity() {
|
||||
fun liberateCity() {
|
||||
if (foundingCiv == "") {
|
||||
AnnexCity()
|
||||
annexCity()
|
||||
return
|
||||
}
|
||||
|
||||
@ -402,6 +400,7 @@ class CityInfo {
|
||||
UnCivGame.Current.worldScreen.shouldUpdate=true
|
||||
}
|
||||
|
||||
// todo should be in cityStats
|
||||
fun hasExtraAnnexUnhappiness() : Boolean {
|
||||
if (civInfo.civName == foundingCiv || foundingCiv == "" || isPuppet) return false
|
||||
return !containsBuildingUnique("Remove extra unhappiness from annexed cities")
|
||||
|
@ -38,6 +38,11 @@ class CityScreenCityPickerTable(val cityScreen: CityScreen) : Table(){
|
||||
cityNameTable.add(starImage).size(20f).padRight(5f)
|
||||
}
|
||||
|
||||
if(city.isPuppet){
|
||||
val starImage = Image(ImageGetter.getDrawable("OtherIcons/Puppet").tint(Color.LIGHT_GRAY))
|
||||
cityNameTable.add(starImage).size(20f).padRight(5f)
|
||||
}
|
||||
|
||||
val currentCityLabel = Label(city.name + " (" + city.population.population + ")", CameraStageBaseScreen.skin)
|
||||
currentCityLabel.setFontSize(30)
|
||||
currentCityLabel.onClick {
|
||||
|
@ -100,6 +100,12 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
||||
iconTable.add(resistanceImage).size(20f).pad(2f).padLeft(5f)
|
||||
}
|
||||
|
||||
if (city.isPuppet) {
|
||||
val puppetImage = ImageGetter.getImage("OtherIcons/Puppet")
|
||||
puppetImage.setColor(secondaryColor)
|
||||
iconTable.add(puppetImage).size(20f).pad(2f).padLeft(5f)
|
||||
}
|
||||
|
||||
if (city.isBeingRazed) {
|
||||
val fireImage = ImageGetter.getImage("OtherIcons/Fire")
|
||||
iconTable.add(fireImage).size(20f).pad(2f).padLeft(5f)
|
||||
@ -116,7 +122,7 @@ class CityButton(val city: CityInfo, internal val tileGroup: WorldTileGroup, ski
|
||||
} else if (city.civInfo.isCurrentPlayer() && city.isConnectedToCapital()) {
|
||||
val connectionImage = ImageGetter.getStatIcon("CityConnection")
|
||||
connectionImage.color = secondaryColor
|
||||
iconTable.add(connectionImage).size(20f).pad(2f).padLeft(10f)
|
||||
iconTable.add(connectionImage).size(20f).pad(2f).padLeft(5f)
|
||||
}
|
||||
|
||||
val cityButtonText = city.population.population.toString() + " | " + city.name
|
||||
|
@ -65,20 +65,21 @@ class AlertPopup(val worldScreen: WorldScreen, val popupAlert: PopupAlert): Popu
|
||||
&& city.civInfo.civName != city.foundingCiv
|
||||
&& city.conquerer!!.getCivInfo().civName != city.foundingCiv) {
|
||||
add(TextButton("Liberate".tr(), skin).onClick {
|
||||
city.LiberateCity()
|
||||
city.liberateCity()
|
||||
close()
|
||||
}).row()
|
||||
}
|
||||
add(TextButton("Annex".tr(), skin).onClick {
|
||||
city.AnnexCity()
|
||||
city.annexCity()
|
||||
close()
|
||||
}).row()
|
||||
add(TextButton("Puppet City".tr(), skin).onClick {
|
||||
city.PuppetCity()
|
||||
city.puppetCity()
|
||||
close()
|
||||
}).row()
|
||||
add(TextButton("Raze".tr(), skin).onClick {
|
||||
city.RazeCity()
|
||||
city.annexCity()
|
||||
city.isBeingRazed = true
|
||||
close()
|
||||
})
|
||||
}
|
||||
|
@ -491,6 +491,7 @@ Unless otherwise specified, all the following are from [the Noun Project](https:
|
||||
* [Aircraft](https://thenounproject.com/search/?q=aircraft&i=1629000) By Tom Fricker for aircraft icon in city button
|
||||
* [radar scan](https://thenounproject.com/search/?q=range&i=1500234) By icon 54 for Range
|
||||
* [short range radar](https://thenounproject.com/search/?q=air%20range&i=2612731) by Vectors Point for Intercept range
|
||||
* [Puppet](https://thenounproject.com/search/?q=puppet&i=285735) By Ben Davis for puppeted cities
|
||||
|
||||
# Sound credits
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user