From 0230d5dc20a614ac0bee0dcdc9d4a630adda0b17 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Thu, 17 Apr 2025 20:37:18 -0700 Subject: [PATCH] Change text randomization from {{...}} to <<..>> This doesn't interfere with Python's formatting. --- commands/lighting.py | 1 - commands/wizards.py | 2 +- typeclasses/characters.py | 6 +-- typeclasses/consumables.py | 39 +++++++++++--------- typeclasses/drinkables.py | 56 ++++++++++++++-------------- typeclasses/fishing.py | 14 +++---- typeclasses/pets.py | 10 ++--- typeclasses/readables.py | 12 ++++-- typeclasses/things.py | 66 ++++++++++++++++----------------- typeclasses/tutorial.py | 10 ++--- utils/word_list.py | 8 ++-- world/version1.ev | 75 +++++++++++++++----------------------- 12 files changed, 144 insertions(+), 155 deletions(-) diff --git a/commands/lighting.py b/commands/lighting.py index be4a9f7..8130bee 100755 --- a/commands/lighting.py +++ b/commands/lighting.py @@ -9,7 +9,6 @@ class CmdLight(Command): """ key = "light" - aliases = ["burn"] # only allow this command if command.obj is carried by caller. # locks = "cmd:holds()" diff --git a/commands/wizards.py b/commands/wizards.py index b2cb7ec..60ba6e4 100755 --- a/commands/wizards.py +++ b/commands/wizards.py @@ -10,7 +10,7 @@ class CmdFly(Command): Make sure you set the following properties, for instance: @set self/disappear_msg = "The wizard disappears in a puff of smoke." - @set self/reappear_msg = "A plume of {{white ^ light blue ^ gray ^ }} smoke appears... ;; When the smoke clears, a wizard {{emerges ^ materializes}}." + @set self/reappear_msg = "A plume of <> smoke appears... ;; When the smoke clears, a wizard <>." @set self/appear_delay = 3 The last setting is the number of seconds between message segments diff --git a/typeclasses/characters.py b/typeclasses/characters.py index 124f4ae..8d7fb48 100644 --- a/typeclasses/characters.py +++ b/typeclasses/characters.py @@ -24,7 +24,7 @@ from .tutorial import TutorBird, TutorialState INTRO = """ As the surrounding mists dissipate, you find yourself in an ancient, halcyon forest dripping with moss. You see an envelope of parchment wedged under a scaly protrusion of bark...inside, a letter in familiar penmanship, personally addressed to you, which you pick up. -A little blue bird flies by you, almost grazing your ear!""" +A little gray bird flies by you, almost grazing your ear!""" READ_LETTER = """You read a letter with an oddly familiar penmanship: @@ -80,9 +80,7 @@ class Character(Object, GenderCharacter): Capitalizes messages sent to the user. This just looks better to me. """ - if text and isinstance(text, tuple): - text = (text[0][0].upper() + text[0][1:], *text[1:]) - else: + if text and isinstance(text, str) and len(text) > 0: text = text[0].upper() + text[1:] super().msg(text, from_obj=from_obj, session=session, **kwargs) diff --git a/typeclasses/consumables.py b/typeclasses/consumables.py index 583abbb..e0c89a2 100755 --- a/typeclasses/consumables.py +++ b/typeclasses/consumables.py @@ -23,8 +23,8 @@ class Consumable(Object): @set berries/amount = 10 # How many berries do you eat at a time: @set berries/eat_amount = 3 - @set berries/eat_msg = "Sweet and slightly tart. {{Delicious ^ Tangy ^ Mmmm}}." - @set berries/finish_msg = "Those were {{delicious ^ great}}." + @set berries/eat_msg = "Sweet and slightly tart. <>." + @set berries/finish_msg = "Those were <>." """ amount = 4 eat_amount = 1 @@ -73,7 +73,7 @@ class Producer(Object): @set bush/make_verb = "pick some" # This one is optional as it defaults to Consumable: @set bush/make_class = "typeclasses.consumables.Consumable" - @set bush/make_desc = "Bright red berry with flecks of {{purple ^ violet ^ orange}}." + @set bush/make_desc = "Bright red berry with flecks of <>." # How many berries are there when you pick them? @set bush/make_amount = 10 @@ -81,12 +81,12 @@ class Producer(Object): @set bush/make_eat_amount = 3 # Either a single msg: - @set bush/make_eat_msg = "Sweet and slightly tart. {{Delicious ^ Tangy ^ Mmmm}}." + @set bush/make_eat_msg = "Sweet and slightly tart. <>." # Or many: - @set bush/make_eat_msgs = {{ "Sweet and slightly tart.", "[Delicious ^ Tangy ^ Mmmm}}.", + @set bush/make_eat_msgs = [ "Sweet and slightly tart.", "<>.", "Ooo...that one was sour.", "That was a bit ripe, but still good.", - "So sweet with a hint of {{orange ^ maple}}." ] - @set bush/make_finish_msg = "Those were {{delicious ^ great}}." + "So sweet with a hint of <>." ] + @set bush/make_finish_msg = "Those were <>." """ def at_object_creation(self): self.cmdset.add_default(CmdSetMakeConsumable) @@ -121,7 +121,7 @@ class Producer(Object): # ---------------------------------------------------------------------- TEACUP_DESCS = [ - "A rustic, clay teacup carefully crafted on a wheel. Beautiful {{dark red ^ olive green ^ navy blue}} glaze.", + "A rustic, clay teacup carefully crafted on a wheel. Beautiful <> glaze.", "A fine example of Royal Albert teacup, sporting a design of violet azaleas. Perfect for a black tea.", "A Wings of Grace style teacup with blue butterflies. Perfect for some Earl Grey.", "A dark brown Yixing clay teacup. Perfect for an Oolong tea.", @@ -212,9 +212,9 @@ class Trolley(Producer): "aliases": ["wood", "kindling", "logs"], })[0] wood.location = caller - caller.msg(routput("You {{get ^ pick up ^ grab}} " - "{{some wood ^ couple logs ^ a log ^ a few pieces of wood}} " - "{{from the woodbox ^ from the box on the hearth ^ for the fireplace ^ }}.")) + caller.msg(routput("You <> " + "<> " + "<>.")) def do_bake(self): """ @@ -225,22 +225,25 @@ class Trolley(Producer): self.db.make_name = name self.db.make_aliases = ["scone", "scones"] - self.db.make_desc = routput("A {{tasty ^ yummy ^ delicious}}-looking {0}", name) + self.db.make_desc = routput("A <>-looking {0}", name) self.db.make_amount = 3 self.db.make_eat_amount = 1 msgs = [ - "{{ Delicious ^ Mmmm ^ So good ^ Really good}}.", + "Delicious.", + "So good", + "Really good.", + 'Mmmmm', ] if todays_scone.get('taste'): - msgs += [f"You {{can ^ }} {{really ^ }} {{notice ^ taste}} the {todays_scone.get('taste')}."] + msgs += ['You <> <> <> the ' + todays_scone.get('taste') + '.'] if todays_scone.get('tastes'): for taste in todays_scone.get('tastes'): - msgs += [f"You {{can ^ }} {{really ^ }} {{notice ^ taste}} the {taste}."] + msgs += ['You <> <> <> the ' + taste + '.'] if todays_scone.get('expression'): - msgs += [f"{{Really ^ So}} {todays_scone.get('expression')}."] + msgs += [f"<> {todays_scone.get('expression')}."] self.db.make_eat_msgs = msgs - self.db.make_finish_msg = "That was {{delicious ^ great ^ really good}}." + self.db.make_finish_msg = "That was <>." - self.location.msg_contents(routput("{{New ^ Aromatic ^ Fresh ^ Freshly baked}} scones {{magically ^ suddenly ^ mystically ^ enchantingly ^ }} appear {{on a plate ^ on plates ^ }} on the trolley.")) + self.location.msg_contents(routput("<> scones <> appear <> on the trolley.")) diff --git a/typeclasses/drinkables.py b/typeclasses/drinkables.py index 42f9562..057351f 100755 --- a/typeclasses/drinkables.py +++ b/typeclasses/drinkables.py @@ -7,45 +7,45 @@ from utils.word_list import routput, choices import random TEA_TYPES = { - "black": "a rich, bold and {{malty ^ fragrant ^ almost spicy}} black tea", - "green": "a green tea with {{grassy ^ floral ^ vanilla ^ vegetal}} notes", - "oolong": "a complex and {{earthy ^ floral}} oolong", - "matcha": "a frothy and aromatic matcha of the most vibrant green", - "white": "a subtle tea with notes of {{rose ^ berries ^ chamomile flowers}}", - "pu-erh": "an earthy, almost mushroom flavored, pu-erh tea", - "puerh": "an earthy, almost mushroom flavored, pu-erh tea", - "barley": "a nutty herbal infusion of barley with just a hint of smokiness", - "chaga": "an earthy, mushroomy chaga infusion", - "hibiscus": "a dark red, tart herbal infusion of roselle flowers", - "chai": "a spicy chai tea, tempered with milk and sweetness", - "herbal": "an herbal infusion of {{chamomile ^ mint ^ chicory root ^ lavender}}", - "earl": "a flowery Earl Grey tea", - "chamomile": "a relaxing, yet subtle infusion of chamomile flowers that makes you want to go to sleep", - "mint": "a blend of peppermint and spearmint to create the ultimate minty herbal infusion", - "chrysanthemum": "a lovely, floral infusion of chrysanthemum flowers", - "dandelion": "a roasted herbal infusion of dandelions that tastes a bit like coffee", - "rooibos": "an almost {{sweet and ^ }} {{woody ^ nutty ^ vanilla-y}} rooibos herbal infusion", + 'black': 'a rich, bold and <> black tea', + 'green': 'a green tea with <> notes', + 'oolong': 'a complex and <> oolong', + 'matcha': 'a frothy and aromatic matcha of the most vibrant green', + 'white': 'a subtle tea with notes of <>', + 'pu-erh': 'an earthy, almost mushroom flavored, pu-erh tea', + 'puerh': 'an earthy, almost mushroom flavored, pu-erh tea', + 'barley': 'a nutty herbal infusion of barley with just a hint of smokiness', + 'chaga': 'an earthy, mushroomy chaga infusion', + 'hibiscus': 'a dark red, tart herbal infusion of roselle flowers', + 'chai': 'a spicy chai tea, tempered with milk and sweetness', + 'herbal': 'an herbal infusion of <>', + 'earl': 'a flowery Earl Grey tea', + 'chamomile': 'a relaxing, yet subtle infusion of chamomile flowers that makes you want to go to sleep', + 'mint': 'a blend of peppermint and spearmint to create the ultimate minty herbal infusion', + 'chrysanthemum': 'a lovely, floral infusion of chrysanthemum flowers', + 'dandelion': 'a roasted herbal infusion of dandelions that tastes a bit like coffee', + 'rooibos': 'an almost <> <> rooibos herbal infusion', # Why limit to teas ... sure, this tea pot could make coffee ... } FILL_MSGS = [ - "You fill your {{teacup ^ cup}} with {1}.", - "You pour {{some ^ }} {0} tea into your {{teacup ^ cup}}.", + 'You fill your <> with {1}.', + 'You pour <> {0} tea into your <>.', ] DRINK_MSGS = [ - "You take a sip of {0} tea.", - "You take a sip of {0} tea {{in ^ from}} your {{teacup ^ cup}}.", - "You {{sip ^ sample ^ drink}} from your {{teacup ^ cup}}.", - "You savor {1} in your {{teacup ^ cup}}.", + 'You take a sip of {0} tea.', + 'You take a sip of {0} tea <> your <>.', + 'You <> from your <>.', + 'You savor {1} in your <>.', ] EMPTY_MSGS = [ - "Your {{teacup ^ cup}} is empty. Perhaps you can |gmake|n some |gtea|n?", + 'Your <> is empty. Perhaps you can |gmake|n some |gtea|n?', "Your cup certainly doesn't runneth over, as it be quite empty.", - "Alas, you find your cup devoid of any sort of watery infusion.", - "You notice your cup is empty.", - "It appears that you need to refill your tea cup." + 'Alas, you find your cup devoid of any sort of watery infusion.', + 'You notice your cup is empty.', + 'It appears that you need to refill your tea cup.' ] diff --git a/typeclasses/fishing.py b/typeclasses/fishing.py index 3b0db0b..1842878 100755 --- a/typeclasses/fishing.py +++ b/typeclasses/fishing.py @@ -151,10 +151,10 @@ class Fish(CarriableNPC): A visual way to delete the fish. """ if fisher.location == fisher.search("mp06"): - fisher.msg(routput("You {{toss ^ heave ^ throw}} the fish back into the {{water ^ pond}}.")) + fisher.msg(routput("You <> the fish back into the <>.")) fisher.msg(routput("The fish says, \"Bye for now. If you want to talk again, just drop me a line!\"")) else: - fisher.msg(routput("You {{toss ^ heave ^ throw}} the fish, and an {{ eagle ^ hawk }} swoops {{ down ^ }} and snatches it. I'm sure it will carry the fish back to the pond for you.")) + fisher.msg(routput("You <> the fish, and an << eagle ^ hawk >> swoops << down ^ >> and snatches it. I'm sure it will carry the fish back to the pond for you.")) self.delete() def get_name(): @@ -166,8 +166,8 @@ class Fish(CarriableNPC): return routput(random.choice([ "A walleye with big bulbous eyes that clearly doesn't get no respect.", "A bass with amazing neck confidence giving it a most excellent head bob." - "A rainbow trout missing the {{red ^ yellow ^ green ^ blue}} from its iridescent stripe.", - "A brown trout colored {{red ^ blue ^ purple ^ orange}}.", + "A rainbow trout missing the <> from its iridescent stripe.", + "A brown trout colored <>.", # "A spiny perch", # "A salmon", # "A pike", @@ -205,9 +205,9 @@ class FishingPole(Object): else: fisher.db.fishing = Fishing.CAST fisher.msg(routput(random.choice([ - "You cast out far into the {{water ^ pond}}.", - "You cast close to the {{dock ^ shore}}.", - "You cast off to the {{right ^ left}} where you {{think you ^ }} see a dark pocket.", + "You cast out far into the <>.", + "You cast close to the <>.", + "You cast off to the <> where you <> see a dark pocket.", ]))) def do_reel(self, fisher): diff --git a/typeclasses/pets.py b/typeclasses/pets.py index c875ffd..2554ec3 100755 --- a/typeclasses/pets.py +++ b/typeclasses/pets.py @@ -535,16 +535,16 @@ class BHB(Friendly): case Reaction.INTERESTED: msg = choices(""" - The beast {{runs ^ hurries}} at the stick, then looks at , {{wondering ^ curious as to ^ pondering}} what to do with a stick the flies back to its owner. ;; - The beast {{rushes ^ runs at}} the stick, and then veers off, thundering around the {{field ^ meadow}}. The stick returns to your hand. + The beast <> at the stick, then looks at , <> what to do with a stick the flies back to its owner. ;; + The beast <> the stick, and then veers off, thundering around the <>. The stick returns to your hand. """) self.adjust_character(thrower, 30) case _: msg = choices(""" - The {{big hairy ^ }} beast {{dashes ^ runs ^ jumps ^ leaps into the air ^ leaps}} and {{catches ^ snags ^ grabs}} the stick in midair, and drops it in front of . ;; - The {{big hairy ^ }} beast {{gallops ^ trumbles ^ trots}} over to the stick and {{dances ^ prances ^ hops}} around the stick before bringing it back to . ;; - The {{big hairy ^ }} beast {{gallops ^ trumbles ^ trots}} over to the stick and {{dances ^ prances ^ hops}} around the stick before bringing it back to .""") + The <> beast <> and <> the stick in midair, and drops it in front of . ;; + The <> beast <> over to the stick and <> around the stick before bringing it back to . ;; + The <> beast <> over to the stick and <> around the stick before bringing it back to .""") self.adjust_character(thrower, 10) if msg: split_party_msg(thrower, msg) diff --git a/typeclasses/readables.py b/typeclasses/readables.py index efc4634..a4963bb 100755 --- a/typeclasses/readables.py +++ b/typeclasses/readables.py @@ -186,6 +186,12 @@ class Letter(Readable): class Book(Readable): + def at_object_creation(self): + """ + called at creation + """ + self.cmdset.add_default(CmdSetBook) + def do_read(self, reader): super().do_read(reader) reader.location.msg_contents(routput(f"{reader.name} reads a book. You notice the title, |w{self.db.title}|n."), @@ -223,12 +229,12 @@ class Books(Object): title = random.choice(list(BOOKS.keys())) return ( title, - routput("""a {{worn ^ barely read ^ pristine copy of a ^ }} - {{leather-bound ^ vellum-bound ^ }} book, titled, |w{0}|n + routput("""a <> + <> book, titled, |w{0}|n """, title), routput( """ - You {{open ^ open up ^ crack open}} your book, entitled, + You <> your book, entitled, |w{0}|n, and read the {1} {2} of {3}. """, title, diff --git a/typeclasses/things.py b/typeclasses/things.py index d87e3ae..261124b 100755 --- a/typeclasses/things.py +++ b/typeclasses/things.py @@ -20,9 +20,9 @@ class Trinket(Object): """ msgs = [ - "You see a crystal ball. When the swirling vortex stops, It reads, '{{Why not? ^ Don't even think about it ^ Maybe, maybe not ^ Sure, just don't tell}}'.", + "You see a crystal ball. When the swirling vortex stops, It reads, '<>'.", "You find a deck of Tarot cards, but the card of Death has been replaced by a worker in an office cubical that reads, 'Mostly Death'.", - "You see a statue of a {{black ^ red ^ yellow}} dragon in the shape of a question mark. You have to ask yourself, Why?", + "You see a statue of a <> dragon in the shape of a question mark. You have to ask yourself, Why?", "A Venus fly trap in a shell surrounded by chubby cherubs.", "You see a statue of a large rat. Did it just blink? Wow, after it ran away you think that was a rat of unusual size.", "An ancient Colombian grave owl holding a sign that reads, 'Cannibals don't eat clowns? They taste funny.'", @@ -31,7 +31,7 @@ class Trinket(Object): "A troll doll with an outie belly button. Everyone knows that trolls are not placental mammals, but reproduce through a complex series of... wait, you haven't had this talk with your parents, yet?", "A small statue of a flexing giant. When you push its belly, it says, 'Its not my fault I'm the biggest and the strongest. I don't even exercise.'", "You see a license plate from the State of Utah that reads HEATHEN, and think, what is the significance of hens in heat? Oh, and you also think, what is a license plate doing in a fantasy game about escaping the clamors of last stage capitalism?", - "You find a brilliant {{blue ^ green ^ iridescent}} scarf around a book, but as soon as you remove it, the book tries to bite you. After it chases you around the room, you double back, jump on it, breaking its spine (which is lets out a sad yelp), and wrap the scarf back around it. Maybe you've seen enough stuff on these shelves for a while.", + "You find a brilliant <> scarf around a book, but as soon as you remove it, the book tries to bite you. After it chases you around the room, you double back, jump on it, breaking its spine (which is lets out a sad yelp), and wrap the scarf back around it. Maybe you've seen enough stuff on these shelves for a while.", ] def at_object_creation(self): @@ -69,7 +69,7 @@ class Wood(Object): self.db.plural = "some logs" self.db.desc = routput(choice([ "Its log, its log, it's big, it's heavy, it's wood.", - "Some {{logs ^ wood}} for the fireplace.", + "Some <> for the fireplace.", ])) @@ -89,9 +89,9 @@ class Stick(Object): else: thrower.msg(choices([ "Yer a wizard, {0}!", - "{{Did you see that? ^ }} It clipped the leaf on that tree before returning.", - "This is a {{fun ^ pleasant ^ nice}} {{past-time ^ game}}.", - "Maybe we should get a pet {{or beast ^ beastie ^ }} in here who would love to play.", + "<> It clipped the leaf on that tree before returning.", + "This is a <> <>.", + "Maybe we should get a pet <> in here who would love to play.", ], thrower.name.capitalize())) self.location.msg_contents(f"{thrower.name} throws a stick.", exclude=thrower) @@ -110,13 +110,13 @@ class Puddle(Object): "This is great fun. You feel childish.") else: player.msg(routput(choice([ - "You don't care {{how muddy ^ who notices}}, you jump in again!", - "Mud? Whatever. You {{splash ^ jump}} in {{^ again}}.", + "You don't care <>, you jump in again!", + "Mud? Whatever. You <> in <<^ again>>.", "You splash around in the puddle.", "You jump in the puddle again.", "This time you dance a little as you kick up your heels.", ]) + " You feel " + choice([ - "{{so much ^ }} better.", + "<> better.", "carefree.", "child-like and free.", "irresponsible.", @@ -184,7 +184,7 @@ class Knocker(Object): "Well, I suppose I could give you a |mhint|n.", ] hint_responses = [ - "A hint does sound fair. [Should I|I should] come up with a |mriddle|n{{, huh ^ }}?" + "A hint does sound fair. <> come up with a |mriddle|n<<, huh ^ >>?" ] riddle_responses = [ "Aged in barrels, smooth and neat, in a glass by the fire, I'm a treat.", @@ -220,9 +220,9 @@ class Knocker(Object): # A _sequence_ of responses, from what is this password business, to give me a hint, to give me the riddle ... [question_msg, Knocker_Convo.RIDDLE, [ - "Nope. Would {{ya ^ you}} like another riddle?", - "You {{really ^ }} think that is the answer?", - "Personally, {{I think ^}} that riddle could not {{be ^ have been}} more clear." + "Nope. Would <> like another riddle?", + "You <> think that is the answer?", + "Personally, <> that riddle could not <> more clear." ], None], [yes_msg, Knocker_Convo.HINT, riddle_responses, Knocker_Convo.RIDDLE], ["riddle", Knocker_Convo.ANY, riddle_responses, Knocker_Convo.RIDDLE], @@ -250,7 +250,7 @@ class Knocker(Object): "Just to let you know, the door is locked.", """ I shouldn't be telling you this, - but I like the cut of your {{suit ^ cloak ^ jib}}. + but I like the cut of your <>. So, you see, if you speak the |mpassword|n, wait, I've said too much. """ ], Knocker_Convo.DOOR], @@ -273,7 +273,7 @@ class Knocker(Object): ], None], [r"thanks|thank you", Knocker_Convo.ANY, [ - "You're {{very ^ }} welcome.", + "You're <> welcome.", "Glad to be of service." ], None], @@ -282,43 +282,43 @@ class Knocker(Object): "Excellent.", ], None], [no_msg, Knocker_Convo.ANY, [ - "Well, it's true. Just ask the {{raven ^ trees ^ gnome}}.", + "Well, it's true. Just ask the <>.", ], None], [question_msg, Knocker_Convo.ANY, [ - "What about {{me ^ it ^ 'im}}?", + "What about <>?", "I dunno...", ], None], ] after_unlocked_responses = [ """ - We could {{feign ^ pretend ^ play make-believe}} and - {{carry on ^ continue ^ persist}} this {{conversation ^ charade}}, - but we both know that |wyou|n know the {{password ^ secret ^ secret word ^ magic}}, + We could <> and + <> this <>, + but we both know that |wyou|n know the <>, and can go through the |gdoor|n now. """, """ - {{Sure ^ Why not ^ Why yes}}, let's {{feign ^ pretend ^ play make-believe that}} you - don't know the {{password ^ secret ^ secret word ^ magic}}, and - {{carry on ^ continue ^ persist}} this conversation. + <>, let's <> you + don't know the <>, and + <> this conversation. """, ] cant_hear_responses = [ - "{{Sorry. ^ What was that? ^ Did you say something?}} I'm hard of hearing on account of the brass ears.", + "<> I'm hard of hearing on account of the brass ears.", "Brass ears. Yeah, not the best at hearing.", - "Yeah, These brass ears don't hear much except for the |m{{secret ^ magic ^ }} password|n.", + "Yeah, These brass ears don't hear much except for the |m<> password|n.", ] unknown_responses = [ - "Are you talking to me or the goblin {{in the bushes ^ up the tree ^ behind the rock}}?", + "Are you talking to me or the goblin <>?", "Knock, knock.", "What do you mean?", - "Of course I like {{hard candy ^ squirrels ^ apples}}. Who {{doesn't ^ wouldn't ^ do you know that doesn't}}?", - "No thank you, I can't eat {{apples ^ kumquats ^ figs}}, what with the brass teeth and a lack of guts.", - "Tea? While that would be {{nice ^ sweet}} of you, I can't really hold a cup.", + "Of course I like <>. Who <>?", + "No thank you, I can't eat <>, what with the brass teeth and a lack of guts.", + "Tea? While that would be <> of you, I can't really hold a cup.", "I'm fine, thanks. How are you?", - "I'll say, {{we have had ^ that is}} a spell of weather.", + "I'll say, <> a spell of weather.", ] def at_object_creation(self): @@ -414,9 +414,9 @@ class Knocker(Object): response = "In a shape of a bald goblin, the brass door knocker in the center of the red door" if self.has("brass ring"): response += " holds a ring in its mouth. " - response += "{{You think it ^ You are sure it ^ You could've sworn it ^ It}} {{just ^ }} winked at you." + response += "<> <> winked at you." else: - response += " {{smiles ^ looks}} at you expectantly. " + response += " <> at you expectantly. " return routput(response) diff --git a/typeclasses/tutorial.py b/typeclasses/tutorial.py index 79fe2cb..0ab1a46 100755 --- a/typeclasses/tutorial.py +++ b/typeclasses/tutorial.py @@ -71,11 +71,11 @@ MSGS = { } MSGS_WAITING = [ - "The {{little ^ gray ^ }} {{ bird ^ cockatiel }} {{on your shoulder ^ }} preens itself.", - "The {{little ^ gray ^ }} {{ bird ^ cockatiel }} {{on your shoulder ^ }} {{looks ^ stares}} at you {{expectantly ^ waiting ^ patiently}}.", - "The {{ bird ^ cockatiel }} looks up at the sky. \"It rains here often,\" it says.", - "The {{ bird ^ cockatiel }} looks up at the sky. \"Looks like rain is coming,\" it says.", - "\"I like the rain,\" the {{ bird ^ cockatiel }} says, \"as it keeps the moss green and the puddles full.\"", + "The <> << bird ^ cockatiel >> <> preens itself.", + "The <> << bird ^ cockatiel >> <> <> at you <>.", + "The << bird ^ cockatiel >> looks up at the sky. \"It rains here often,\" it says.", + "The << bird ^ cockatiel >> looks up at the sky. \"Looks like rain is coming,\" it says.", + "\"I like the rain,\" the << bird ^ cockatiel >> says, \"as it keeps the moss green and the puddles full.\"", "\"They say if you don't like the weather,\" tweets the bird, \"just wait.\"", ] diff --git a/utils/word_list.py b/utils/word_list.py index 3630c48..0ce5d8c 100755 --- a/utils/word_list.py +++ b/utils/word_list.py @@ -13,7 +13,7 @@ def routput(text, *substitutions): Return string with internal word choices replaced randomly. For instance, the string: - 'This feels {{^ very ^ quite}} {{nice^cozy^comfortable}}.' + 'This feels <<^ very ^ quite>> <>.' Could return any of the following strings: @@ -23,8 +23,8 @@ def routput(text, *substitutions): """ if text: acc = [] - for s in text.split("{{"): - selections, *rest = s.split("}}") + for s in text.split("<<"): + selections, *rest = s.split(">>") choice = random.choice(re.split(r"\s*\^\s*", selections)) acc = acc + [choice] + rest @@ -32,7 +32,7 @@ def routput(text, *substitutions): # If a choice is at the end of a sentence, and we could have # "no choice", as in: - # "He searches {{thoroughly ^ quickly ^}}." + # "He searches <>." # We don't want a version that looks like: # "He searches # ." # with a space before the punctuation: diff --git a/world/version1.ev b/world/version1.ev index 19f6a1a..0a0733b 100644 --- a/world/version1.ev +++ b/world/version1.ev @@ -65,50 +65,24 @@ Spectacles perched precariously on the end of his hooked nose, wobble with his h -# Let’s make him a wizard: - - -# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:7]] -@update self = typeclasses.characters.Wizard -# Character: Dabble:7 ends here - - - # And his spells: -# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:8]] +# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:7]] @set self/disappear_msg = "After a raspberry sound, the gnome, Dabbler, disappears in a wisp of smoke." # -@set self/reappear_msg = "{{White ^ Light blue ^ Gray}} mist appears...along with the smell of sulphur... ;; When the smoke clears, an old gnome {{emerges ^ materializes ^ shows up, looking a bit confused}}." -# Character: Dabble:8 ends here +@set self/reappear_msg = "<> mist appears...along with the smell of sulphur... ;; When the smoke clears, an old gnome <>." +# Character: Dabble:7 ends here # And help with the =fly= spell: -# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:9]] +# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:8]] # nick/object meadow = Frog Meadow nick meadow = ^fly Frog Meadow -# Character: Dabble:9 ends here - - -# The pipe is little more than messages to the smoker and everyone else in the room. - - -# [[file:../../../Dropbox/org/projects/mud.org::*Pipe][Pipe:1]] -@create pipe: typeclasses.things.Pipe -# Pipe:1 ends here - - - -# And a desciption: - - -# [[file:../../../Dropbox/org/projects/mud.org::*Pipe][Pipe:2]] -@desc pipe = As tall as its owner with etchings of birds, leaves and magical symbols. -# Pipe:2 ends here +# Character: Dabble:8 ends here # Rename the Limbo (or starting place) with the name *Forest*. Note the term =mp01= as a global label that matches my map. @@ -669,7 +643,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:22]] -@set beast/scared_msg = "It seems {{skiddish ^ afraid ^ skiddish and afraid}} as it tries to hide behind a tall clump of grass. Yeah, it doesn't do a good job of hiding." +@set beast/scared_msg = "It seems <> as it tries to hide behind a tall clump of grass. Yeah, it doesn't do a good job of hiding." # The Lair of the Beast:22 ends here @@ -687,7 +661,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:24]] -@set beast/interested_msg = "It seems {{curious ^ interested}} in what you are doing {{here ^ }}. ;; Its {{ ^ large, ^ big,}} yellow eyes watch your every move." +@set beast/interested_msg = "It seems <> in what you are doing <>. ;; Its << ^ large, ^ big,>> yellow eyes watch your every move." # The Lair of the Beast:24 ends here @@ -696,7 +670,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:25]] -@set beast/friendly_msg = "It sits next to you, as its big, friendly eyes gaze as you. ;; It {{leaps over ^ runs up ^ bounces up ^ }} to you, wagging its tail-less behind. ;; It lays down next to you." +@set beast/friendly_msg = "It sits next to you, as its big, friendly eyes gaze as you. ;; It <> to you, wagging its tail-less behind. ;; It lays down next to you." # The Lair of the Beast:25 ends here @@ -705,7 +679,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:26]] -@set beast/sleeping_actions = "The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} lets loose a {{big, ^ huge, ^ large, ^ tremendous, ^ }} snore. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} growls in its sleep. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} twitches its {{leg ^ legs ^ paw ^ nose}}. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{shifts ^ rolls}} on its {{big, ^ huge, ^ large, ^ tremendous, ^ }} mattress." +@set beast/sleeping_actions = "The <> <> <> lets loose a <> snore. ;; The <> <> <> growls in its sleep. ;; The <> <> <> twitches its <>. ;; The <> <> <> <> on its <> mattress." # The Lair of the Beast:26 ends here @@ -726,7 +700,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:28]] -@set beast/concerned_actions = "The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{is ^ seems}} concerned by your presence in the {{meadow ^ field}}. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} seems concerned. Maybe it's hungry.. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} seems concerned and keeps its distance.." +@set beast/concerned_actions = "The <> <> <> <> concerned by your presence in the <>. ;; The <> <> <> seems concerned. Maybe it's hungry.. ;; The <> <> <> seems concerned and keeps its distance.." # The Lair of the Beast:28 ends here @@ -735,7 +709,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:29]] -@set beast/interested_actions = "The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} seems {{curious ^ interested}} in what you are doing {{here ^ }}. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} seems curious about you. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} stands on its hind legs. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{stares at ^ watches ^ follows}} you with its {{large, ^ big, ^ }} yellow eyes." +@set beast/interested_actions = "The <> <> <> seems <> in what you are doing <>. ;; The <> <> <> seems curious about you. ;; The <> <> <> stands on its hind legs. ;; The <> <> <> <> you with its <> yellow eyes." # The Lair of the Beast:29 ends here @@ -744,7 +718,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:30]] -@set beast/friendly_actions = "The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} wagging its backend{{, ^ as it seems}} happy to see . ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} hoping to play with . ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} flops over in front of wriggling {{its back ^ }} on the ground. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} next to you. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} chases butterflies around the {{field ^ meadow ^ grass ^ flowers}}." +@set beast/friendly_actions = "The <> <> <> <> <> wagging its backend<<, ^ as it seems>> happy to see . ;; The <> <> <> <> <> hoping to play with . ;; The <> <> <> flops over in front of wriggling <> on the ground. ;; The <> <> <> <> <> next to you. ;; The <> <> <> chases butterflies around the <>." # The Lair of the Beast:30 ends here @@ -753,7 +727,7 @@ lair # [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:31]] -@set beast/ecstatic_actions = "The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} to give a sloppy {{kiss ^ lick}}. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} wagging its backend as it seems {{very ^ }} excited to see . ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} hoping to play with . ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} flops over in front of happily wriggling on the ground. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} excitedly {{thunders ^ stomps ^ tramps ^ clomps ^ rumbles ^ rolls}} {{across the field ^ across the meadow ^ over}} next to you. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} {{happily ^ joyfully}} leaps into air. ;; The {{big, ^ huge, ^ large, ^ tremendous, ^ }} {{hairy ^ slobbery ^ horned ^ clawed ^ }} {{brute ^ beast ^ monster}} chases butterflies around the {{field ^ meadow ^ grass ^ flowers}}." +@set beast/ecstatic_actions = "The <> <> <> <> <> to give a sloppy <>. ;; The <> <> <> <> <> wagging its backend as it seems <> excited to see . ;; The <> <> <> <> <> hoping to play with . ;; The <> <> <> flops over in front of happily wriggling on the ground. ;; The <> <> <> excitedly <> <> next to you. ;; The <> <> <> <> leaps into air. ;; The <> <> <> chases butterflies around the <>." # The Lair of the Beast:31 ends here @@ -1055,7 +1029,7 @@ west # And the bush needs to know the /description/ of the Consumable, so that it can attach that: # [[file:../../../Dropbox/org/projects/mud.org::*Berry Bush][Berry Bush:7]] -@set bush/make_desc = "Bright red berry with flecks of {{purple ^ violet ^ orange}}." +@set bush/make_desc = "Bright red berry with flecks of <>." # Berry Bush:7 ends here @@ -1078,7 +1052,7 @@ west # We can either have a single /eat/ message: # [[file:../../../Dropbox/org/projects/mud.org::*Berry Bush][Berry Bush:10]] -@set bush/make_eat_msg = "Sweet and slightly tart. {{Delicious ^ Tangy ^ Mmmm}}." +@set bush/make_eat_msg = "Sweet and slightly tart. <>." # Berry Bush:10 ends here @@ -1086,7 +1060,7 @@ west # Or many messages that can be randomly selected: # [[file:../../../Dropbox/org/projects/mud.org::*Berry Bush][Berry Bush:11]] -@set bush/make_eat_msgs = [ "Sweet and slightly tart.", "{{Delicious ^ Tangy ^ Mmmm}}.", "Ooo...that one was sour.", "That was a bit ripe, but still good.", "So sweet with a hint of {{orange ^ maple}}." ] +@set bush/make_eat_msgs = [ "Sweet and slightly tart.", "<>.", "Ooo...that one was sour.", "That was a bit ripe, but still good.", "So sweet with a hint of <>." ] # Berry Bush:11 ends here @@ -1094,7 +1068,7 @@ west # Let the user know when they consumed them all. # [[file:../../../Dropbox/org/projects/mud.org::*Berry Bush][Berry Bush:12]] -@set bush/make_finish_msg = "Those were {{delicious ^ great}}." +@set bush/make_finish_msg = "Those were <>." # Berry Bush:12 ends here @@ -1574,14 +1548,23 @@ py here.search("trolley").do_bake() # @set chairs/singular = "an overstuffed chair" # -@set chairs/extra = "This feels {{ ^ very ^ quite}} {{nice ^ cozy ^ comfortable}}.|n" +@set chairs/extra = "This feels << ^ very ^ quite>> <>.|n" # Chairs:5 ends here +# Let’s make him a wizard: + + +# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:6]] +@update self = typeclasses.characters.Wizard +# Chairs:6 ends here + + + # And now that we are done, say it: -# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:6]] +# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:7]] say I have finished this, the first version, of my creation. -# Chairs:6 ends here +# Chairs:7 ends here