1
0
Fork 0
taleweave-ai/adventure/systems/sim/hygiene_actions.py

22 lines
961 B
Python
Raw Normal View History

from adventure.context import action_context, get_dungeon_master
from adventure.utils.world import describe_entity
2024-05-05 22:45:18 +00:00
def action_wash(unused: bool) -> str:
2024-05-05 22:45:18 +00:00
"""
Wash yourself.
"""
with action_context() as (action_room, action_actor):
hygiene = action_actor.attributes.get("hygiene", "clean")
2024-05-05 22:45:18 +00:00
dungeon_master = get_dungeon_master()
outcome = dungeon_master(
f"{action_actor.name} washes themselves in the {action_room.name}. {describe_entity(action_room)}. {describe_entity(action_actor)}"
f"{action_actor.name} was {hygiene} to start with. How clean are they after washing? Respond with 'clean' or 'dirty'."
"If the room has a shower or running water, they should be cleaner. If the room is dirty, they should end up dirtier."
)
2024-05-05 22:45:18 +00:00
action_actor.attributes["clean"] = outcome.strip().lower()
return f"You wash yourself in the {action_room.name} and feel {outcome}"