2024-05-05 22:45:18 +00:00
|
|
|
from adventure.context import get_current_context, get_dungeon_master
|
2024-05-16 04:12:06 +00:00
|
|
|
from adventure.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.
|
|
|
|
"""
|
|
|
|
|
|
|
|
_, action_room, action_actor = get_current_context()
|
|
|
|
|
|
|
|
dungeon_master = get_dungeon_master()
|
|
|
|
outcome = dungeon_master(
|
2024-05-16 04:12:06 +00:00
|
|
|
f"{action_actor.name} sleeps in the {action_room.name}. {describe_entity(action_room)}. {describe_entity(action_actor)}"
|
2024-05-05 22:45:18 +00:00
|
|
|
"How rested are they? Respond with 'rested' or 'tired'."
|
|
|
|
)
|
|
|
|
|
|
|
|
action_actor.attributes["rested"] = outcome
|
|
|
|
return f"You sleep in the {action_room.name} and wake up feeling {outcome}"
|