mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-28 21:58:54 +07:00
Added Barracks and Armory buildings to increase XP of units built in the city
This commit is contained in:
@ -30,6 +30,7 @@ class Building : NamedStats(), IConstruction{
|
||||
var cannotBeBuiltWith: String? = null
|
||||
var cityStrength=0
|
||||
var cityHealth=0
|
||||
var xpForNewUnits=0
|
||||
|
||||
// Uniques
|
||||
var providesFreeBuilding: String? = null
|
||||
@ -56,6 +57,7 @@ class Building : NamedStats(), IConstruction{
|
||||
if(unique!=null) infoList += unique!!.tr()
|
||||
if(cityStrength!=0) infoList+="{City strength} +".tr()+cityStrength
|
||||
if(cityHealth!=0) infoList+="{City health} +".tr()+cityHealth
|
||||
if(xpForNewUnits!=0) infoList+= "+$xpForNewUnits {XP for new units}".tr()
|
||||
return infoList.joinToString()
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,8 @@ class Unit : INamed, IConstruction, ICivilopedia {
|
||||
}
|
||||
|
||||
override fun postBuildEvent(construction: CityConstructions) {
|
||||
construction.cityInfo.civInfo.placeUnitNearTile(construction.cityInfo.location, name)
|
||||
val unit = construction.cityInfo.civInfo.placeUnitNearTile(construction.cityInfo.location, name)
|
||||
unit.promotions.XP += construction.getBuiltBuildings().sumBy { it.xpForNewUnits }
|
||||
}
|
||||
|
||||
override fun toString(): String = name
|
||||
|
Reference in New Issue
Block a user