mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 04:10:22 +07:00
Added Barracks and Armory buildings to increase XP of units built in the city
This commit is contained in:
@ -56,7 +56,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Library",
|
name:"Library",
|
||||||
baseDescription: "Adds 1 science for each 2 population in the city.",
|
|
||||||
hurryCostModifier:25,
|
hurryCostModifier:25,
|
||||||
maintenance:1,
|
maintenance:1,
|
||||||
unique:"+1 Science Per 2 Population",
|
unique:"+1 Science Per 2 Population",
|
||||||
@ -85,6 +84,13 @@
|
|||||||
unique:"Worker construction increased 25%, provides 2 free workers",
|
unique:"Worker construction increased 25%, provides 2 free workers",
|
||||||
requiredTech:"Mathematics"
|
requiredTech:"Mathematics"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Barracks",
|
||||||
|
xpForNewUnits:15,
|
||||||
|
hurryCostModifier:25,
|
||||||
|
maintenance:1,
|
||||||
|
requiredTech:"Bronze Working"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Temple",
|
name:"Temple",
|
||||||
culture:3,
|
culture:3,
|
||||||
@ -282,6 +288,14 @@
|
|||||||
requiredBuildingInAllCities:"Workshop",
|
requiredBuildingInAllCities:"Workshop",
|
||||||
requiredTech:"Machinery"
|
requiredTech:"Machinery"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name:"Armory",
|
||||||
|
xpForNewUnits:15,
|
||||||
|
hurryCostModifier:25,
|
||||||
|
maintenance:1,
|
||||||
|
requiredBuilding:"Barracks",
|
||||||
|
requiredTech:"Steel"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name:"Observatory",
|
name:"Observatory",
|
||||||
baseDescription: "City must be bordering a mountain",
|
baseDescription: "City must be bordering a mountain",
|
||||||
|
@ -397,6 +397,9 @@
|
|||||||
German:"Zeigt [resource] auf der Karte"
|
German:"Zeigt [resource] auf der Karte"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"XP for new units":{
|
||||||
|
}
|
||||||
|
|
||||||
"provide":{ // as in "Camp, Customs House provide +1 Gold"
|
"provide":{ // as in "Camp, Customs House provide +1 Gold"
|
||||||
German:"generieren"
|
German:"generieren"
|
||||||
}
|
}
|
||||||
|
@ -30,6 +30,7 @@ class Building : NamedStats(), IConstruction{
|
|||||||
var cannotBeBuiltWith: String? = null
|
var cannotBeBuiltWith: String? = null
|
||||||
var cityStrength=0
|
var cityStrength=0
|
||||||
var cityHealth=0
|
var cityHealth=0
|
||||||
|
var xpForNewUnits=0
|
||||||
|
|
||||||
// Uniques
|
// Uniques
|
||||||
var providesFreeBuilding: String? = null
|
var providesFreeBuilding: String? = null
|
||||||
@ -56,6 +57,7 @@ class Building : NamedStats(), IConstruction{
|
|||||||
if(unique!=null) infoList += unique!!.tr()
|
if(unique!=null) infoList += unique!!.tr()
|
||||||
if(cityStrength!=0) infoList+="{City strength} +".tr()+cityStrength
|
if(cityStrength!=0) infoList+="{City strength} +".tr()+cityStrength
|
||||||
if(cityHealth!=0) infoList+="{City health} +".tr()+cityHealth
|
if(cityHealth!=0) infoList+="{City health} +".tr()+cityHealth
|
||||||
|
if(xpForNewUnits!=0) infoList+= "+$xpForNewUnits {XP for new units}".tr()
|
||||||
return infoList.joinToString()
|
return infoList.joinToString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,8 @@ class Unit : INamed, IConstruction, ICivilopedia {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun postBuildEvent(construction: CityConstructions) {
|
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
|
override fun toString(): String = name
|
||||||
|
Reference in New Issue
Block a user