moss-n-puddles/commands/drinkables.py
Howard Abrams 37f3e8d479 Tea and teacups.
Dabbler's room will produce a tea cup for each person.

A teapot can make different types of teas, or even just a random one.
2025-02-02 00:02:49 -08:00

68 lines
1.4 KiB
Python
Executable file

#!/usr/bin/env python
from evennia import Command, CmdSet
import random
class CmdDrinkTea(Command):
"""
Drink tea.
"""
key = "drink"
aliases = "sip"
def func(self):
self.obj.do_drink(self.caller)
class CmdMakeTea(Command):
"""
Make a pot of magical tea.
"""
key = "make"
aliases = ["make tea"]
locks = "cmd:all()"
def func(self):
"""
Make a pot of tea. Optional accept the type of tea.
"""
self.obj.do_make_tea(self.caller, self.args.strip())
class CmdFillTeacup(Command):
"""
Fill the teacup with whatever is in the teapot.
"""
key = "fill"
aliases = "pour"
def func(self):
self.obj.do_fill(self.caller)
class CmdGetTeacup(Command):
"""
Get a teacup.
"""
key = "get teacup"
aliases = ["get cup", "pickup cup", "pickup teacup", "take cup", "take teacup"]
locks = "cmd:all()"
def func(self):
"""
Get a teacup from the container. It will
itself handle all messages.
"""
self.obj.produce_teacup(self.caller)
class CmdSetTeacup(CmdSet):
def at_cmdset_creation(self):
self.add(CmdDrinkTea)
class CmdSetTeapot(CmdSet):
def at_cmdset_creation(self):
self.add(CmdMakeTea)
self.add(CmdFillTeacup)
class CmdSetTrolley(CmdSet):
def at_cmdset_creation(self):
self.add(CmdGetTeacup)