Resolves #11193 - above/below HP conditionals work outside of combat

This commit is contained in:
Yair Morgenstern 2024-02-25 22:45:21 +02:00
parent 72fa2a3f48
commit 83655bbd34

View File

@ -202,10 +202,10 @@ object Conditionals {
UniqueType.ConditionalUnitWithoutPromotion -> relevantUnit?.promotions?.promotions?.contains(condition.params[0]) == false
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.ConditionalAboveHP -> state.unit != null && state.unit.health > condition.params[0].toInt()
|| state.ourCombatant != null && state.ourCombatant.getHealth() > condition.params[0].toInt()
UniqueType.ConditionalBelowHP -> state.unit != null && state.unit.health < condition.params[0].toInt()
||state.ourCombatant != null && state.ourCombatant.getHealth() < condition.params[0].toInt()
UniqueType.ConditionalHasNotUsedOtherActions ->
state.unit == null || // So we get the action as a valid action in BaseUnit.hasUnique()
state.unit.abilityToTimesUsed.isEmpty()