Allow to add real free promotions to unit.

This commit is contained in:
Duan Tao 2019-01-29 14:46:24 +08:00
parent 3044fb2978
commit c69f54408b
2 changed files with 3 additions and 3 deletions

View File

@ -15,8 +15,8 @@ class UnitPromotions{
fun xpForNextPromotion() = (numberOfPromotions+1)*10
fun canBePromoted() = XP >= xpForNextPromotion()
fun addPromotion(promotionName:String){
XP -= xpForNextPromotion()
fun addPromotion(promotionName:String, isFree:Boolean = false){
if (!isFree) XP -= xpForNextPromotion()
promotions.add(promotionName)
numberOfPromotions++
unit.updateUniques()

View File

@ -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{