1
0
Fork 0
taleweave-ai/adventure/sim_systems/hygiene_actions.py

22 lines
929 B
Python
Raw Normal View History

2024-05-05 22:45:18 +00:00
from adventure.context import get_current_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.
"""
_, action_room, action_actor = get_current_context()
hygiene = action_actor.attributes.get("hygiene", "clean")
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)}"
2024-05-05 22:45:18 +00:00
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."
)
action_actor.attributes["clean"] = outcome.strip().lower()
return f"You wash yourself in the {action_room.name} and feel {outcome}"