Fix a bug in the teapot
This commit is contained in:
parent
37f3e8d479
commit
6197dd9d92
1 changed files with 7 additions and 7 deletions
|
|
@ -83,14 +83,14 @@ class Teapot(Object):
|
|||
|
||||
def do_make_tea(self, drinker, args):
|
||||
words = Token(args)
|
||||
tea_choice = [tea for tea in TEA_TYPES.keys() if words.contains(tea)][0]
|
||||
|
||||
if tea_choice:
|
||||
self.db.tea_type = tea_choice
|
||||
elif words.empty():
|
||||
self.db.tea_type = random.choice(TEA_TYPES.keys())
|
||||
if words.empty() or words.contains("tea"):
|
||||
self.db.tea_type = random.choice(list(TEA_TYPES.keys()))
|
||||
else:
|
||||
self.db.tea_type = "unknown"
|
||||
tea_choice = [tea for tea in TEA_TYPES.keys() if words.contains(tea)]
|
||||
if len(tea_choice) > 0:
|
||||
self.db.tea_type = tea_choice[0]
|
||||
else:
|
||||
self.db.tea_type = "unknown"
|
||||
desc = TEA_TYPES[self.db.tea_type]
|
||||
|
||||
self.db.desc = f"A large, brown teapot full of {desc}."
|
||||
|
|
|
|||
Loading…
Reference in a new issue