mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-13 12:27:40 +07:00
Added health conditionals (#5707)
* Added health conditionals * Whenefied conditional
This commit is contained in:
parent
ce158d0c44
commit
4107ff3386
@ -83,6 +83,10 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s
|
||||
|| (state.unit != null && state.unit.matchesFilter(condition.params[0]))
|
||||
UniqueType.ConditionalAttacking -> state.combatAction == CombatAction.Attack
|
||||
UniqueType.ConditionalDefending -> state.combatAction == CombatAction.Defend
|
||||
UniqueType.ConditionalAboveHP ->
|
||||
state.ourCombatant != null && state.ourCombatant.getHealth() > condition.params[0].toInt()
|
||||
UniqueType.ConditionalBelowHP ->
|
||||
state.ourCombatant != null && state.ourCombatant.getHealth() < condition.params[0].toInt()
|
||||
UniqueType.ConditionalInTiles ->
|
||||
state.attackedTile != null && state.attackedTile.matchesFilter(condition.params[0])
|
||||
UniqueType.ConditionalVsLargerCiv -> {
|
||||
|
@ -433,6 +433,8 @@ enum class UniqueType(val text:String, vararg targets: UniqueTarget, val flags:
|
||||
ConditionalDefending("when defending", UniqueTarget.Conditional),
|
||||
ConditionalInTiles("when fighting in [tileFilter] tiles", UniqueTarget.Conditional),
|
||||
ConditionalForeignContinent("on foreign continents", UniqueTarget.Conditional),
|
||||
ConditionalAboveHP("when above [amount] HP", UniqueTarget.Conditional),
|
||||
ConditionalBelowHP("when below [amount] HP", UniqueTarget.Conditional),
|
||||
|
||||
/////// tile conditionals
|
||||
ConditionalNeighborTiles("with [amount] to [amount] neighboring [tileFilter] tiles", UniqueTarget.Conditional),
|
||||
|
@ -213,7 +213,7 @@ class Translations : LinkedHashMap<String, TranslationEntry>(){
|
||||
// Whenever this string is changed, it should also be changed in the translation files!
|
||||
// It is mostly used as the template for translating the order of conditionals
|
||||
const val englishConditionalOrderingString =
|
||||
"<for [mapUnitFilter] units> <vs cities> <vs [mapUnitFilter] units> <when fighting in [tileFilter] tiles> <when attacking> <when defending> <if this city has at least [amount] specialists> <when at war> <when not at war> <while the empire is happy> <during a Golden Age> <during the [era]> <before the [era]> <starting from the [era]> <with [techOrPolicy]> <without [techOrPolicy]>"
|
||||
"<for [mapUnitFilter] units> <above [amount] HP> <below [amount] HP> <vs cities> <vs [mapUnitFilter] units> <when fighting in [tileFilter] tiles> <when attacking> <when defending> <if this city has at least [amount] specialists> <when at war> <when not at war> <while the empire is happy> <during a Golden Age> <during the [era]> <before the [era]> <starting from the [era]> <with [techOrPolicy]> <without [techOrPolicy]>"
|
||||
const val conditionalUniqueOrderString = "ConditionalsPlacement"
|
||||
const val shouldCapitalizeString = "StartWithCapitalLetter"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user