Send Char.Vitals on combat stamina spend
This commit is contained in:
parent
3d386fbf99
commit
64c25b1025
1 changed files with 12 additions and 1 deletions
|
|
@ -80,8 +80,14 @@ async def do_attack(player: Player, target_args: str, move: CombatMove) -> None:
|
||||||
CombatState.WINDOW,
|
CombatState.WINDOW,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Execute the attack
|
# Execute the attack (deducts stamina)
|
||||||
encounter.attack(move)
|
encounter.attack(move)
|
||||||
|
|
||||||
|
# Send vitals update immediately after stamina deduction
|
||||||
|
from mudlib.gmcp import send_char_vitals
|
||||||
|
|
||||||
|
send_char_vitals(player)
|
||||||
|
|
||||||
if switching:
|
if switching:
|
||||||
await player.send(f"You switch to {move.name}!\r\n")
|
await player.send(f"You switch to {move.name}!\r\n")
|
||||||
else:
|
else:
|
||||||
|
|
@ -106,6 +112,11 @@ async def do_defend(player: Player, _args: str, move: CombatMove) -> None:
|
||||||
|
|
||||||
player.stamina -= move.stamina_cost
|
player.stamina -= move.stamina_cost
|
||||||
|
|
||||||
|
# Send vitals update immediately after stamina deduction
|
||||||
|
from mudlib.gmcp import send_char_vitals
|
||||||
|
|
||||||
|
send_char_vitals(player)
|
||||||
|
|
||||||
# If in combat, queue the defense on the encounter
|
# If in combat, queue the defense on the encounter
|
||||||
encounter = get_encounter(player)
|
encounter = get_encounter(player)
|
||||||
if encounter is not None:
|
if encounter is not None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue