diff --git a/typeclasses/drinkables.py b/typeclasses/drinkables.py index cf07a2b..1f085ba 100755 --- a/typeclasses/drinkables.py +++ b/typeclasses/drinkables.py @@ -128,6 +128,7 @@ class Teapot(Object): COCKTAILS = [ { "title": "Moonlit Mirage", + "type": "cocktail", "desc": "A shimmering, colorful drink, garnished with glitter and a twist of tart, almost sour fruit.", "flavors": ["lemon", "tartness", "sweetness"], "effects": [ @@ -137,6 +138,7 @@ COCKTAILS = [ }, { "title": "Puck's Revenge", + "type": "cocktail", "desc": "A vibrant concoction of fruit juices and sparkling fairy dust, served in a glass shaped like a flower.", "flavors": ["fruity", "... fairy dust?"], "effects": [ @@ -146,12 +148,14 @@ COCKTAILS = [ }, { "title": "Glimmering Gossamer", + "type": "cocktail", "desc": "A delicate blend of elderflower liqueur and sparkling wine, adorned with a butterfly-shaped ice cube.", "flavors": ["elderflower"], "effects": ["The butterfly shaped ice cube just started fluttering, and flew away."] }, { "title": "Whimsical Willow", + "type": "cocktail", "desc": "A herbal infusion of gin, rosemary, and elderberry, served with a sprig of fresh mint and a splash of tonic.", "flavors": ["fresh mint", "rosemary", "elderberry"], "effects": [ @@ -161,6 +165,7 @@ COCKTAILS = [ }, { "title": "Charmed Chalice", + "type": "cocktail", "desc": "A mysterious potion that glows softly, made with enchanted spirits and a hint of honey, served in a chalice that changes shape.", "flavors": ["honey"], "effects": [ @@ -171,6 +176,7 @@ COCKTAILS = [ }, { "title": "Enchanted Elixir", + "type": "cocktail", "desc": "A deep blue drink with hints of blueberry and a touch of magic, served with a glowing ice sphere.", "flavors": ["blueberry", "blue"], "effects": [ @@ -183,6 +189,7 @@ COCKTAILS = [ }, { "title": "Sylvan Serenade", + "type": "cocktail", "desc": "A melodic blend of apple cider and spiced rum, garnished with a cinnamon stick and a slice of star fruit.", "flavors": ["apple", "cider", "spices", "cinnamon"], "effects": [ @@ -192,6 +199,7 @@ COCKTAILS = [ }, { "title": "Brambleberry Bliss", + "type": "cocktail", "desc": "A sweet and tart mix of brambleberries and gin, served over crushed ice with a sprinkle of edible flowers.", "flavors": ["brambleberries", "berry", "floral"], "effects": [ @@ -203,6 +211,7 @@ COCKTAILS = [ }, { "title": "Twilight Tonic", + "type": "cocktail", "desc": "A dark, mysterious drink made with blackcurrant and tonic water, served with a slice of lime and a hint of mint.", "flavors": ["lime", "blackcurrant", "mint"], "effects": [ @@ -211,7 +220,64 @@ COCKTAILS = [ ] }, { - "title": "A 'water'", + "title": "Bee Knees", + "type": "mead", + "desc": "Slightly fizzy, slightly sweet, served with a wedge of honeycomb.", + "flavors": ["honey", "vanilla"], + "effects": [ + "You feel like a dwarf in a tunnel digging a hole. Diggy, diggy hole!", + "Just like being in the Mud World." + ] + }, + { + "title": "whisky", + "type": "whisky", + "desc": "A dram of smokey, amber ambrosia.", + "flavors": ["tar", "peat", "smoke", "brine", "vanilla", "toffee"], + "effects": [ + "This reminds you of your travels in the Mud World.", + "Lovely.", + "Friendships and conversations distilled in a glass.", + "A dram to << certainly ^ >> << savor ^ cherish ^ enjoy>>.", + "Here's to friends that aren't here to share." + ] + }, + { + "title": "whiskey", + "type": "whiskey", + "desc": "A dram of strong, amber ambrosia.", + "flavors": ["vanilla", "toffee"], + "effects": [ + "This reminds you of your travels in the Mud World.", + "Lovely.", + "Friendships and conversations distilled in a glass.", + "A dram to << certainly ^ >> << savor ^ cherish ^ enjoy>>.", + "Here's to friends that aren't here to share." + ] + }, + { + "title": "ale", + "type": "beer", + "desc": "A malty, only slightly carbonated, opaque beverage with overt herbal notes.", + "flavors": ["rosemary", "bog myrtle", "yarrow"], + "effects": [ + "Wonder where they got the recipe, twelfth century England?", + "Tastes like drinking a loaf of bread." + ] + }, + { + "title": "red wine", + "type": "wine", + "desc": "A rich glass a blood red color with notes of raspberries and toffee.", + "flavors": ["earthiness", "toffee", "raspberries"], + "effects": [ + "Ah, what was the name of the land in the Mud World?", + "You swirl your glass and watch the legs return to the bottom.", + ] + }, + { + "title": "water", + "type": "water", "desc": "A clean cocktail with absolutely no taste.", "flavors": ["water", "blandness"], "effects": [ @@ -221,31 +287,25 @@ COCKTAILS = [ "Your liver is thanking you." ] }, - { - "title": "Bee Knees", - "desc": "Slightly fizzy, slightly sweet, served with a wedge of honeycomb.", - "flavors": ["honey", "vanilla"], - "effects": [ - "You feel like a dwarf in a tunnel digging a hole. Diggy, diggy hole!", - "Just like being in the Mud World." - ] - }, ] DRINK_COCKTAIL_MSGS = [ - 'You take a <> of your << |w{0}|n ^ cocktail >>.', # 0 == title - 'You << notice ^ savor ^ relish ^ enjoy >> the {1}.', # 1 == flavors + # 0 -> drink title or name + # 1 -> type of drink, e.g. cocktail or whiskey + # 2 -> one of the flavors + 'You take a <> of your << |w{0}|n ^ {1} ^ drink >>.', + 'You <> your << |w{0}|n ^ {1} ^ drink >>.', + 'You << notice ^ savor ^ relish ^ enjoy >> the {2}.', ] EMPTY_COCKTAIL_MSGS = [ - 'That drink went down fast.', - 'Hrm ... did you enjoy that?', + 'That {1} went down fast.', + 'Hrm ... did you enjoy that {1}?', 'You drain your glass.', "You've finished that concoction.", ] -# py Cocktail.make(self, "mirage") class Cocktail(Object): fill_amount = 4 sip_amount = 1 @@ -255,20 +315,22 @@ class Cocktail(Object): Create for 'owner', a drink that matches 'name'. If name doesn't match, get a random one. """ - details = random.choice(COCKTAILS) if name: rx = r".*" + name + r".*" details = [c for c in COCKTAILS if re.match(rx, c.get("title"), re.IGNORECASE)] if len(details) > 0: details = details[0] + else: + details = random.choice(COCKTAILS) drink = spawn({ "typeclass": "typeclasses.drinkables.Cocktail", - "key": details.get("title") + " cocktail", - "aliases": ["drink", "glass"], + "key": details.get("title"), + "aliases": ["drink", "glass", "cocktail"], "desc": details.get("desc") })[0] + drink.db.cocktail_type = details.get("type") drink.db.flavors = details.get("flavors") drink.db.effects = details.get("effects") drink.db.amount = Cocktail.fill_amount @@ -291,21 +353,23 @@ class Cocktail(Object): if amount > 2: flavor = random.choice(cocktail_flavors) - drinker.msg(choices(DRINK_COCKTAIL_MSGS, cocktail_type, flavor)) + drinker.msg(choices(DRINK_COCKTAIL_MSGS, self.key, cocktail_type, flavor)) elif amount > 0: - drinker.msg(random.choice(self.db.effects)) + drinker.msg(choices(self.db.effects, self.key, cocktail_type)) else: - drinker.msg(choices(EMPTY_COCKTAIL_MSGS, cocktail_type)) + drinker.msg(choices(EMPTY_COCKTAIL_MSGS, self.key, cocktail_type)) self.key = "cocktail glass" - self.aliases = ['glass'] + self.aliases.add('glass') self.db.desc = "An empty cocktail glass" self.db.amount = self.db.amount - self.sip_amount def at_pre_drop(self, dropper): if dropper.location.key == 'Wyldwood Bar': - dropper.msg(routput(f"<< A ^ The >> mushroom << man ^ person >> << bounces ^ shimmies over ^ appears >> and takes the {self.name} << from you ^ >>.") - ) + dropper.msg(routput(f"<< A ^ The >> mushroom << man ^ person >> << bounces ^ shimmies over ^ appears >> and takes the {self.name} << from you ^ >>.")) + self.delete() + elif dropper.location.key == "Dabbler's House": + dropper.msg(routput(f"The {self.db.cocktail_type} << falls ^ drops >> to the << floor ^ ground >> and shatters! A dust ball from under the chair forms into a little impish-looking fellow, who cleans it all before disappearing.")) self.delete() else: return True