refactor(combat): single source active_buffs/active_conditions
This commit is contained in:
@@ -1066,7 +1066,6 @@ class CombatEngine:
|
||||
source="maneuver: trip",
|
||||
)
|
||||
)
|
||||
target.conditions.append(CONDITIONS_BY_NAME["prone"])
|
||||
self._log(
|
||||
f"round {self._current_round} {state.combatant.id}: trip vs "
|
||||
f"{target.combatant.id} d20={m.roll}+{m.attacker_cmb}={m.total} "
|
||||
@@ -1136,7 +1135,6 @@ class CombatEngine:
|
||||
source=f"maneuver: grapple by {state.combatant.id}",
|
||||
)
|
||||
)
|
||||
target.conditions.append(CONDITIONS_BY_NAME["grappled"])
|
||||
target.grappled_with = state.combatant.id
|
||||
state.grappled_with = target.combatant.id
|
||||
self._log(
|
||||
@@ -1304,7 +1302,6 @@ class CombatEngine:
|
||||
source=f"hex: evil_eye by {state.combatant.id}",
|
||||
)
|
||||
)
|
||||
target.conditions.append(CONDITIONS_BY_NAME["shaken"])
|
||||
self._log(
|
||||
f"round {self._current_round} {state.combatant.id}: evil eye on "
|
||||
f"{target.combatant.id} -> shaken (1r)"
|
||||
@@ -1328,7 +1325,6 @@ class CombatEngine:
|
||||
source=f"hex: slumber by {state.combatant.id}",
|
||||
)
|
||||
)
|
||||
target.conditions.append(CONDITIONS_BY_NAME["asleep"])
|
||||
self._log(
|
||||
f"round {self._current_round} {state.combatant.id}: slumber on "
|
||||
f"{target.combatant.id} -> asleep (1r)"
|
||||
@@ -1452,11 +1448,6 @@ class CombatEngine:
|
||||
source=f"inspire courage by {state.combatant.id}",
|
||||
)
|
||||
)
|
||||
# Also update old effects field for backwards compatibility
|
||||
ally.effects.extend((
|
||||
StatModifier(target="attack", value=1, bonus_type="morale"),
|
||||
StatModifier(target="damage", value=1, bonus_type="morale"),
|
||||
))
|
||||
self._log(
|
||||
f"round {self._current_round} {state.combatant.id}: "
|
||||
f"inspire courage +1 morale attack/damage to {len(affected)} allies"
|
||||
@@ -1665,7 +1656,6 @@ class CombatEngine:
|
||||
source=f"spell: {spell_name}",
|
||||
)
|
||||
)
|
||||
target.conditions.append(cond)
|
||||
return f"{effect.condition_name} ({effect.duration_rounds}r)"
|
||||
|
||||
def _apply_heal_effect(
|
||||
@@ -1696,7 +1686,6 @@ class CombatEngine:
|
||||
source=f"spell: {spell_name}",
|
||||
)
|
||||
)
|
||||
target.effects.extend(effect.modifiers)
|
||||
return f"buff {len(effect.modifiers)} mods ({effect.duration_rounds}r)"
|
||||
|
||||
def _apply_area_effect(
|
||||
|
||||
Reference in New Issue
Block a user