mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
Buildings requiring nearnby resources now say so - thanks zivvel!
Promotion bonuses no longer override unit-specific ones, but are added - thanks ninjatao!
This commit is contained in:
parent
43ec085b89
commit
defeb7431b
@ -28,14 +28,20 @@ class BattleDamage{
|
||||
|
||||
private fun getGeneralModifiers(combatant: ICombatant, enemy: ICombatant): HashMap<String, Float> {
|
||||
val modifiers = HashMap<String, Float>()
|
||||
fun addToModifiers(BDM:BattleDamageModifier){
|
||||
val text = BDM.getText()
|
||||
if(!modifiers.containsKey(text)) modifiers[text]=0f
|
||||
modifiers[text]=modifiers[text]!!+BDM.modificationAmount
|
||||
}
|
||||
|
||||
if (combatant is MapUnitCombatant) {
|
||||
for (BDM in getBattleDamageModifiersOfUnit(combatant.unit)) {
|
||||
if (BDM.vs == enemy.getUnitType().toString())
|
||||
modifiers[BDM.getText()] = BDM.modificationAmount
|
||||
addToModifiers(BDM)
|
||||
if(BDM.vs == "wounded units" && enemy is MapUnitCombatant && enemy.getHealth()<100)
|
||||
modifiers[BDM.getText()] = BDM.modificationAmount
|
||||
addToModifiers(BDM)
|
||||
if(BDM.vs == "land units" && enemy.getUnitType().isLandUnit())
|
||||
modifiers[BDM.getText()] = BDM.modificationAmount
|
||||
addToModifiers(BDM)
|
||||
}
|
||||
if (combatant.getCivilization().happiness < 0)
|
||||
modifiers["Unhappiness"] = 0.02f * combatant.getCivilization().happiness //https://www.carlsguides.com/strategy/civilization5/war/combatbonuses.php
|
||||
|
@ -60,6 +60,8 @@ class Building : NamedStats(), IConstruction{
|
||||
// buildings that improve resources
|
||||
infoList += improvedResources.joinToString()+ " {provide} ".tr()+ resourceBonusStats.toString()
|
||||
}
|
||||
if(requiredNearbyImprovedResources!=null)
|
||||
infoList += "requires worked "+requiredNearbyImprovedResources!!.joinToString("/")+" near city"
|
||||
if(uniques.isNotEmpty()) infoList += uniques.map { it.tr() }.joinToString()
|
||||
if(cityStrength!=0) infoList+="{City strength} +".tr()+cityStrength
|
||||
if(cityHealth!=0) infoList+="{City health} +".tr()+cityHealth
|
||||
@ -103,6 +105,9 @@ class Building : NamedStats(), IConstruction{
|
||||
stringBuilder.appendln("$resources {provide} $resourceBonusStats".tr())
|
||||
}
|
||||
|
||||
if(requiredNearbyImprovedResources!=null)
|
||||
stringBuilder.appendln("Requires worked "+requiredNearbyImprovedResources!!.joinToString("/")+" near city")
|
||||
|
||||
if(cityStrength!=0) stringBuilder.appendln("{City strength} +".tr() + cityStrength)
|
||||
if(cityHealth!=0) stringBuilder.appendln("{City health} +".tr() + cityHealth)
|
||||
if(xpForNewUnits!=0) stringBuilder.appendln("+$xpForNewUnits {XP for new units}".tr())
|
||||
|
Loading…
Reference in New Issue
Block a user