1
0
Fork 0
taleweave-ai/taleweave/systems/sim/hygiene/actions.py

23 lines
1001 B
Python
Raw Permalink Normal View History

from taleweave.context import action_context, get_dungeon_master
from taleweave.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_character):
hygiene = action_character.attributes.get("hygiene", "clean")
2024-05-05 22:45:18 +00:00
dungeon_master = get_dungeon_master()
outcome = dungeon_master(
f"{action_character.name} washes themselves in the {action_room.name}. "
f"{describe_entity(action_room)}. {describe_entity(action_character)}"
f"{action_character.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_character.attributes["clean"] = outcome.strip().lower()
return f"You wash yourself in the {action_room.name} and feel {outcome}"