This commit is contained in:
Yair Morgenstern 2018-12-06 11:41:49 +02:00
commit e53f8d8933
9 changed files with 153 additions and 131 deletions

View File

@ -378,3 +378,5 @@ All the following are from [the Noun Project](https://thenounproject.com) licenc
* [Banner](https://thenounproject.com/term/banner/866282/) By Emir Palavan for embarked units
* [Arrow](https://thenounproject.com/term/arrow/18123/) By uzeir syarief for moving between idle units
* [Replace](https://thenounproject.com/search/?q=replace&i=17858) By Mike Rowe, AU
* [Resistance](https://thenounproject.com/term/revolution/1315305/) By By HeadsOfBirds, GB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 786 KiB

After

Width:  |  Height:  |  Size: 793 KiB

View File

@ -143,6 +143,8 @@ class Battle(val gameInfo:GameInfo) {
}
city.moveToCiv(attacker.getCivilization())
city.resistanceCounter = city.population.population
city.cityStats.update()
}
if(city.cityConstructions.isBuilt("Palace")){

View File

@ -21,6 +21,7 @@ class CityInfo {
var location: Vector2 = Vector2.Zero
var name: String = ""
var health = 200
var resistanceCounter = 0
var population = PopulationManager()
var cityConstructions = CityConstructions()
@ -182,6 +183,7 @@ class CityInfo {
}
}
else population.nextTurn(stats.food)
if (resistanceCounter > 0) resistanceCounter--
if(this in civInfo.cities) { // city was not destroyed
health = min(health + 20, getMaxHealth())

View File

@ -316,7 +316,8 @@ class CityStats {
baseStatList = newBaseStatList
val newCurrentCityStats = Stats() // again, we don't edit the existing currentCityStats directly, in order to avoid concurrency exceptions
for (stat in baseStatList.values) newCurrentCityStats.add(stat)
if (cityInfo.resistanceCounter <= 0)
for (stat in baseStatList.values) newCurrentCityStats.add(stat)
if(newCurrentCityStats.production<1) newCurrentCityStats.production=1f
currentCityStats = newCurrentCityStats

View File

@ -38,6 +38,9 @@ class CityStatsTable(val cityScreen: CityScreen) : Table(){
+ " (" + city.expansion.cultureStored + "/" + city.expansion.getCultureToNextTile() + ")")
cityStatsValues["Population"] = city.population.getFreePopulation().toString() + "/" + city.population.population
cityStatsValues["Happiness"] = city.cityStats.getCityHappiness().values.sum().toInt().toString()
if (city.resistanceCounter > 0) {
cityStatsValues["Resistance"] = city.resistanceCounter.toString()
}
for (key in cityStatsValues.keys) {
add(ImageGetter.getStatIcon(key)).size(20f).align(Align.right)

View File

@ -42,6 +42,11 @@ class CityButton(val city: CityInfo, skin: Skin): Table(skin){
add(healthBar).colspan(3).row()
}
if(city.resistanceCounter > 0){
val resistanceImage = ImageGetter.getImage("StatIcons/Resistance.png")
add(resistanceImage).size(20f).pad(2f).padLeft(5f)
}
if (city.isBeingRazed) {
val fireImage = ImageGetter.getImage("OtherIcons/Fire.png")
add(fireImage).size(20f).pad(2f).padLeft(5f)