mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 21:35:14 -04:00
Merge pull request #443 from ninjatao/free_promotions
Allow to add real free promotions to unit.
This commit is contained in:
commit
24d2a2c320
@ -15,10 +15,12 @@ class UnitPromotions{
|
||||
fun xpForNextPromotion() = (numberOfPromotions+1)*10
|
||||
fun canBePromoted() = XP >= xpForNextPromotion()
|
||||
|
||||
fun addPromotion(promotionName:String){
|
||||
fun addPromotion(promotionName:String, isFree:Boolean = false){
|
||||
if (!isFree) {
|
||||
XP -= xpForNextPromotion()
|
||||
promotions.add(promotionName)
|
||||
numberOfPromotions++
|
||||
}
|
||||
promotions.add(promotionName)
|
||||
unit.updateUniques()
|
||||
unit.civInfo.updateViewableTiles() // some promotions give the unit bonus sight
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ class BaseUnit : INamed, IConstruction, ICivilopedia {
|
||||
if(unit.type in listOf(UnitType.Melee,UnitType.Mounted,UnitType.Armor)
|
||||
&& construction.cityInfo.getBuildingUniques()
|
||||
.contains("All newly-trained melee, mounted, and armored units in this city receive the Drill I promotion"))
|
||||
unit.promotions.addPromotion("Drill I")
|
||||
unit.promotions.addPromotion("Drill I", isFree = true)
|
||||
}
|
||||
|
||||
fun getUpgradeUnit(civInfo: CivilizationInfo):BaseUnit{
|
||||
|
Loading…
x
Reference in New Issue
Block a user