2024-05-27 13:10:24 +00:00
|
|
|
from taleweave.context import action_context, get_dungeon_master
|
|
|
|
from taleweave.utils.world import describe_entity
|
2024-05-05 22:45:18 +00:00
|
|
|
|
|
|
|
|
2024-05-08 01:42:32 +00:00
|
|
|
def action_sleep(unused: bool) -> str:
|
2024-05-05 22:45:18 +00:00
|
|
|
"""
|
|
|
|
Sleep until you are rested.
|
|
|
|
"""
|
|
|
|
|
2024-05-27 01:32:03 +00:00
|
|
|
with action_context() as (action_room, action_character):
|
2024-05-18 22:29:40 +00:00
|
|
|
dungeon_master = get_dungeon_master()
|
|
|
|
outcome = dungeon_master(
|
2024-05-27 01:32:03 +00:00
|
|
|
f"{action_character.name} sleeps in the {action_room.name}. {describe_entity(action_room)}. {describe_entity(action_character)}"
|
2024-05-18 22:29:40 +00:00
|
|
|
"How rested are they? Respond with 'rested' or 'tired'."
|
|
|
|
)
|
2024-05-05 22:45:18 +00:00
|
|
|
|
2024-05-27 01:32:03 +00:00
|
|
|
action_character.attributes["rested"] = outcome
|
2024-05-18 22:29:40 +00:00
|
|
|
return f"You sleep in the {action_room.name} and wake up feeling {outcome}"
|