Limit the number of items carried

As well as the creation of a "closing door" which I should apply globally.
This commit is contained in:
Howard Abrams 2026-05-08 22:07:29 -07:00
parent 5f2df4341e
commit d377ab1a0e
7 changed files with 323 additions and 119 deletions

View file

@ -111,6 +111,15 @@ class ChatBot(AI, Puppet):
elif len(chars) > 1: elif len(chars) > 1:
delay(3, self.greet) delay(3, self.greet)
def goodbye(self, new_room=None):
if self.location.key == "Wyldwood Bar":
self.do_cmd("drop drink")
if self.location.characters_here():
system_prompt = self.setting_and_backstory()
messages = [{"role": "user", "content": "Say goodbye."}]
reply = self._think(system_prompt, messages)
self.process_thoughts(reply)
class Bartender(ChatBot): class Bartender(ChatBot):
""" """
@ -436,18 +445,9 @@ class Dragon(Traveler):
"say Look at all these luscious peoples.", "say Look at all these luscious peoples.",
"emote waves to everyone.", "emote waves to everyone.",
"emote waves to everybody." "emote waves to everybody."
] ])
delay(5, self.do_cmd, cmd) delay(5, self.do_cmd, cmd)
def goodbye(self, new_room=None):
if self.location.key == "Wyldwood Bar":
self.do_cmd("drop drink")
if self.location.characters_here():
system_prompt = self.setting_and_backstory()
messages = [{"role": "user", "content": "Say goodbye."}]
reply = self._think(system_prompt, messages)
self.process_thoughts(reply)
class TravelingNPC(Script): class TravelingNPC(Script):
""" """

View file

@ -150,6 +150,16 @@ class Producer(Object):
""" """
Create a configurable consumable, given to picker. Create a configurable consumable, given to picker.
""" """
# If the producer has configured limits, then we exit early:
# @set reeds/make_limit = 1
# @set reeds/make_limit_msg = "One ten-foot pole is sufficient."
limit = self.db.make_limit
if limit:
owns = picker.has(self.db.make_name)
if len(owns) >= limit:
picker.msg(self.db.make_limit_msg or "You can't get any more.")
return
consumable = spawn({ consumable = spawn({
"typeclass": self.db.make_class or (kwargs['type'] "typeclass": self.db.make_class or (kwargs['type']
if 'type' in kwargs else if 'type' in kwargs else

View file

@ -107,17 +107,14 @@ class ObjectParent:
character.has(typeclasses.drinkables.TeaCup) character.has(typeclasses.drinkables.TeaCup)
""" """
for i in self.contents: return [i
if isinstance(item, str) and (i.key == item or i.aliases.get(item)): for i in self.contents
return i if (isinstance(item, str)
and (i.key == item
if item is type(i): or i.aliases.get(item)))
return i or item is type(i)
or i == item
if i == item: ]
return i
return None
def client_height(self): def client_height(self):
""" """

View file

@ -145,7 +145,7 @@ class CreateSticks(Script):
stick = spawn({ stick = spawn({
"typeclass": "typeclasses.things.Stick", "typeclass": "typeclasses.things.Stick",
"key": "stick", "key": "stick",
"desc": """Its brown and sticky.""", "desc": """Its brown and sticky...and wizardly.""",
})[0] })[0]
stick.location = woods stick.location = woods
woods.msg_contents("A stick falls from one of the trees and lands on the ground near your feet.") woods.msg_contents("A stick falls from one of the trees and lands on the ground near your feet.")

View file

@ -360,6 +360,41 @@ class Stick(Object):
else: else:
thrower.msg("I think you should be outside or a place with more room before you throw that stick around.") thrower.msg("I think you should be outside or a place with more room before you throw that stick around.")
def do_use(self, user, obj):
"""
Opens a door, and sets a timer to close it.
"""
if user.location.key == "Lair":
if not obj or obj.key == "mattress" or obj.key == "trapdoor":
trapdoor = user.search("trapdoor")
if trapdoor:
if self.key == "ten-foot pole":
user.announce_action("$You() $conj(snap) $pron(your) ten-foot pole in half.")
name = "two parts of the pole"
else:
name = self.key
user.announce_action(f"$You() $conj(prop) the {name} under the mattress, and $conj(open) the trapdoor. {obj}")
trapdoor.do_open()
self.delete()
class ClosingDoor(Opener):
def do_open(self):
super.do_open()
delay_time = self.db.open_for or 60
here = self.db.room
there = self.db.exit.destination
here_msg = self.db.room_close_msg or \
f"The {self.name} closes."
there_msg = self.db.exit_close_msg or \
f"The {self.name} closes."
delay(delay_time, self.do_close)
delay(delay_time, here.msg_contents, here_msg)
delay(delay_time, there.msg_contents, there_msg)
class Wand(Stick): class Wand(Stick):
def at_object_creation(self): def at_object_creation(self):

View file

@ -518,7 +518,7 @@ send "look fireflies\n"
expectit "A passing firefly shows it to actually be" expectit "A passing firefly shows it to actually be"
send "look pixies\n" send "look pixies\n"
expectit "The pixies ignore you as their coreography keeps them focused on their dance." expectit "The pixies ignore you as their choreography keeps them focused on their dance."
send "look grass\n" send "look grass\n"
expectit "Guess this kind of grass doesn't mind the wet environment." expectit "Guess this kind of grass doesn't mind the wet environment."

View file

@ -41,7 +41,7 @@ pose looking awesome
# [[file:../../../projects/mud.org::*The Grove of the Matriarchs][The Grove of the Matriarchs:2]] # [[file:../../../projects/mud.org::*The Grove of the Matriarchs][The Grove of the Matriarchs:2]]
@desc here = A giant, moss-covered |Yboulder|n hides a |Yhollow recess|n as it stands among immense |Ytrees|n that etch the sky and slice the clouds in the <evening>darkening twilight</evening><morning>awakening dawn</morning><afternoon>lazy afternoon</afternoon><night>night sky</night>. <morning>With the morning light, you can hear the dawn chorus of birds</morning><afternoon>The afternoon breeze carries the buzzing of insects around giant colorful |Yflowers|n</afternoon><evening>You can't hear much now as most of the forest creatures are settling down for the night</evening><night>In the darkness, you can hear crickets and an occassional owl</night>. A footpath winds around the giant, moss-covered tree roots to the East and West. To the south, a dock juts into a lavender sea. @desc here = A giant, moss-covered |Yboulder|n hides a |Yhollow recess|n as it stands among immense |Ytrees|n that etch the sky and slice the clouds in the <evening>darkening twilight</evening><morning>awakening dawn</morning><afternoon>lazy afternoon</afternoon><night>night sky</night>. <morning>With the morning light, you can hear the dawn chorus of birds</morning><afternoon>The afternoon breeze carries the buzzing of insects around giant colorful |Yflowers|n</afternoon><evening>You can't hear much now as most of the forest creatures are settling down for the night</evening><night>In the darkness, you can hear crickets and an occasional owl</night>. A footpath winds around the giant, moss-covered tree roots to the East and West. To the south, a dock juts into a lavender sea.
# The Grove of the Matriarchs:2 ends here # The Grove of the Matriarchs:2 ends here
@ -200,7 +200,7 @@ py timed_script = evennia.create_script(key="Create Sticks",
# The runes use multibyte unicode which screws up the =telnet= client. # The runes use multi-byte Unicode which screws up the =telnet= client.
# [[file:../../../projects/mud.org::*Boulder][Boulder:4]] # [[file:../../../projects/mud.org::*Boulder][Boulder:4]]
@detail runes;rune = The runes read ᛞ ᚪ ᛒ ᛚ ᚱ @detail runes;rune = The runes read ᛞ ᚪ ᛒ ᛚ ᚱ
@ -583,7 +583,7 @@ py me.search("squirrel").backstory("squirrel")
# Along with a mesage: # Along with a message:
# [[file:../../../projects/mud.org::*Frog Meadow][Frog Meadow:7]] # [[file:../../../projects/mud.org::*Frog Meadow][Frog Meadow:7]]
@set footpath/traverse_msg = "You leave the open meadow for the footpath through the giant trees. The yellow flowers nod goodbye to you..." @set footpath/traverse_msg = "You leave the open meadow for the footpath through the giant trees. The yellow flowers nod goodbye to you..."
@ -680,7 +680,7 @@ py me.search("squirrel").backstory("squirrel")
# We put this location hint in the Alchemy Tome: # We put this location hint in the Alchemy Tome:
# #+begin_quote # #+begin_quote
# A purple grass, often called tickleweed since it vibrates as if laughing. The herb hunter canfind this in fields and meadows throughout the area. # A purple grass, often called tickleweed since it vibrates as if laughing. The herb hunter can find this in fields and meadows throughout the area.
# #+end_quote # #+end_quote
# And we create it: # And we create it:
@ -797,7 +797,7 @@ py me.search("squirrel").backstory("squirrel")
# And the description: # And the description:
# [[file:../../../projects/mud.org::*Mattress][Mattress:2]] # [[file:../../../projects/mud.org::*Mattress][Mattress:2]]
@desc mattress = Looks comfortable, albeit tall, but it does not smell very good. Perhaps that is due to the |Ymushrooms|n surrounding its base? @desc mattress = Looks comfortable, albeit tall, but doesn't smell good. Perhaps that is due to the |Ymushrooms|n sprouting from its base?|/|/The corner of the mattress covers a |Ytrapdoor|n!?
# Mattress:2 ends here # Mattress:2 ends here
@ -821,37 +821,48 @@ py me.search("squirrel").backstory("squirrel")
# And textual descriptions the object can use: # Can you /push/ or /pull/ it?
# [[file:../../../projects/mud.org::*Mattress][Mattress:5]] # [[file:../../../projects/mud.org::*Mattress][Mattress:5]]
@set mattress/pull_msg = "Mattresses are such difficult creatures to manipulate. When you pull on a corner, it slips from your hands. Perhaps you could |guse|n something to help?"
#
@set mattress/push_msg = "Mattresses are such difficult creatures to manipulate. Such a heavy beast. Your pushing allows you to reach and pull on the trapdoor, but not enough to keep it open. Perhaps you could |guse|n something to prop it out of the way?"
# Mattress:5 ends here
# And textual descriptions the object can use:
# [[file:../../../projects/mud.org::*Mattress][Mattress:6]]
@set mattress/adjective = "on" @set mattress/adjective = "on"
# #
@set mattress/article = "the" @set mattress/article = "the"
# #
@set mattress/singular = "the mattress" @set mattress/singular = "the mattress"
# #
@set mattress/extra = "This feels << ^ very ^ quite>> <<nice ^ cozy ^ comfortable>>.|n" @set mattress/extra = "This feels << ^ very ^ quite>> <<nice ^ cozy ^ comfortable>>, even if it smells bad.|n"
# Mattress:5 ends here # Mattress:6 ends here
# And a better description when sitting down: # And a better description when sitting down:
# [[file:../../../projects/mud.org::*Mattress][Mattress:6]] # [[file:../../../projects/mud.org::*Mattress][Mattress:7]]
@set mattress/response = "$You() $conj(sit) on the large mattress." @set mattress/response = "$You() $conj(sit) on the large mattress."
# Mattress:6 ends here # Mattress:7 ends here
# And a trim on the things to see: # And a trim on the things to see:
# [[file:../../../projects/mud.org::*Mattress][Mattress:7]] # [[file:../../../projects/mud.org::*Mattress][Mattress:8]]
@lock mattress = view:tag(hidden_mattress) @lock mattress = view:tag(hidden_mattress)
# #
@set mattress/hidden_tag = "hidden_mattress" @set mattress/hidden_tag = "hidden_mattress"
# Mattress:7 ends here # Mattress:8 ends here
# Part of the [[Potions and their Ingredients][Alchemist Path]], we use /dream mushrooms/ to create a [[Trippy Potion]]. # Part of the [[Potions and their Ingredients][Alchemist Path]], we use /dream mushrooms/ to create a [[Trippy Potion]].
@ -1080,83 +1091,83 @@ py me.search("squirrel").backstory("squirrel")
# To the east of the meadow, lets make a glade back inside the Forest: # To the east of the meadow, lets make a glade back inside the Forest:
# [[file:../../../projects/mud.org::*Glade][Glade:1]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:1]]
@teleport mp05 @teleport mp05
# Glade:1 ends here # Glittering Glade:1 ends here
# And we use the =tunnel= command this time: # And we use the =tunnel= command this time:
# [[file:../../../projects/mud.org::*Glade][Glade:2]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:2]]
@dig Glittering Glade;mp20 : typeclasses.rooms.Room = east footpath into another forest;east;glade;e,west footpath to meadow;footpath;west;w;path @dig Glittering Glade;mp19 : typeclasses.rooms.Room = east footpath into another forest;east;glade;e,west footpath to meadow;footpath;west;w;path
# Glade:2 ends here # Glittering Glade:2 ends here
# A description if they look east: # A description if they look east:
# [[file:../../../projects/mud.org::*Glade][Glade:3]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:3]]
@desc east = Looking at the forest on the east side shows a footpath illuminated by dancing glowing orbs. @desc east = Looking at the forest on the east side shows a footpath illuminated by dancing glowing orbs.
# Glade:3 ends here # Glittering Glade:3 ends here
# [[file:../../../projects/mud.org::*Glade][Glade:4]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:4]]
@detail orbs = The orbs swirl around in a circular pattern creating a mesmerizing vortex of light leading deep into the forest. @detail orbs = The orbs swirl around in a circular pattern creating a mesmerizing vortex of light leading deep into the forest.
# Glade:4 ends here # Glittering Glade:4 ends here
# And a nice journey message to go east out of the forest: # And a nice journey message to go east out of the forest:
# [[file:../../../projects/mud.org::*Glade][Glade:5]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:5]]
@set east/traverse_msg = "You step into this dark forest onto a footpath illuminated by swirling orbs of light. You follow the path until it opens into a glade." @set east/traverse_msg = "You step into this dark forest onto a footpath illuminated by swirling orbs of light. You follow the path until it opens into a glade."
# Glade:5 ends here # Glittering Glade:5 ends here
# Before we label it, we follow =east=: # Before we label it, we follow =east=:
# [[file:../../../projects/mud.org::*Glade][Glade:6]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:6]]
@teleport mp20 @teleport mp19
# Glade:6 ends here # Glittering Glade:6 ends here
# And the description wont have day/night, but we can /reference/ it: # And the description wont have day/night, but we can /reference/ it:
# [[file:../../../projects/mud.org::*Glade][Glade:7]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:7]]
@desc here = The footpath ends in a beautiful glade. While the thick canopy above blocks <morning>the morning light</morning><afternoon>the daylight</afternoon><evening>the glowing twilight</evening><night>any light that might show</night>, the glade is illuminated by swirling |Yorbs|n of light. You see a round, stone |Ytable|n and a blue painted |Ydoor|n embedded in a giant tree. @desc here = The footpath ends in a beautiful glade. While the thick canopy above blocks <morning>the morning light</morning><afternoon>the daylight</afternoon><evening>the glowing twilight</evening><night>any light that might show</night>, the glade is illuminated by swirling |Yorbs|n of light. You see a round, stone |Ytable|n and a blue painted |Ydoor|n embedded in a giant tree.
# Glade:7 ends here # Glittering Glade:7 ends here
# [[file:../../../projects/mud.org::*Glade][Glade:8]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:8]]
@detail orbs = The orbs swirl above illuminating the glade. @detail orbs = The orbs swirl above illuminating the glade.
# Glade:8 ends here # Glittering Glade:8 ends here
# [[file:../../../projects/mud.org::*Glade][Glade:9]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:9]]
@detail trees = Ancient trees surround this glade like walls. @detail trees = Ancient trees surround this glade like walls.
# Glade:9 ends here # Glittering Glade:9 ends here
# [[file:../../../projects/mud.org::*Glade][Glade:10]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:10]]
@detail tree = The largest tree stands at one end of the glade, forms steps from this roots that lead to a |Ydoor|n embedded in its bark. @detail tree = The largest tree stands at one end of the glade, forms steps from this roots that lead to a |Ydoor|n embedded in its bark.
# Glade:10 ends here # Glittering Glade:10 ends here
# A description if they look back towards the west: # A description if they look back towards the west:
# [[file:../../../projects/mud.org::*Glade][Glade:11]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:11]]
@desc west = The footpath leads out of the forest to a meadow. @desc west = The footpath leads out of the forest to a meadow.
# Glade:11 ends here # Glittering Glade:11 ends here
# And a nice journey message to go east out of the forest: # And a nice journey message to go east out of the forest:
# [[file:../../../projects/mud.org::*Glade][Glade:12]] # [[file:../../../projects/mud.org::*Glittering Glade][Glittering Glade:12]]
@set west/traverse_msg = "You followed the illuminated footpath until you exit the forest into a meadow." @set west/traverse_msg = "You followed the illuminated footpath until you exit the forest into a meadow."
# Glade:12 ends here # Glittering Glade:12 ends here
# Not only does the /table/ in this glade offers a riddle, but also arbitrates the answer of the puzzle to unlock the blue door into the tavern. As a special object, it can listen for words, and perform commands: # Not only does the /table/ in this glade offers a riddle, but also arbitrates the answer of the puzzle to unlock the blue door into the tavern. As a special object, it can listen for words, and perform commands:
@ -1186,7 +1197,7 @@ py me.search("squirrel").backstory("squirrel")
# The table shouldnt be stealable: # The table shouldnt be steal-able:
# [[file:../../../projects/mud.org::*Stone Table][Stone Table:5]] # [[file:../../../projects/mud.org::*Stone Table][Stone Table:5]]
@lock table = get:false() @lock table = get:false()
@ -1230,7 +1241,7 @@ py me.search("squirrel").backstory("squirrel")
# Openable if you have the correct tag: # Open-able if you have the correct tag:
# [[file:../../../projects/mud.org::*Blue Door][Blue Door:4]] # [[file:../../../projects/mud.org::*Blue Door][Blue Door:4]]
@lock blue door = traverse:tag(open_blue_door) @lock blue door = traverse:tag(open_blue_door)
@ -1403,7 +1414,7 @@ py me.search("bartender").backstory("tavern")
# Mellow Marsh:12 ends here # Mellow Marsh:12 ends here
# [[file:../../../projects/mud.org::*Mellow Marsh][Mellow Marsh:13]] # [[file:../../../projects/mud.org::*Mellow Marsh][Mellow Marsh:13]]
@detail pixie;pixies = The pixies ignore you as their coreography keeps them focused on their dance. @detail pixie;pixies = The pixies ignore you as their choreography keeps them focused on their dance.
# Mellow Marsh:13 ends here # Mellow Marsh:13 ends here
# [[file:../../../projects/mud.org::*Mellow Marsh][Mellow Marsh:14]] # [[file:../../../projects/mud.org::*Mellow Marsh][Mellow Marsh:14]]
@ -1576,19 +1587,30 @@ py me.search("heron").backstory("heron")
# They shouldnt be able to make too many poles:
# [[file:../../../projects/mud.org::*Ten-foot Poles][Ten-foot Poles:6]]
@set reeds/make_limit = 1
#
@set reeds/make_limit_msg = "You can't make more poles when you are already holding one."
# Ten-foot Poles:6 ends here
# And the reeds needs to know the /description/ of the Consumable, so that it can attach that: # And the reeds needs to know the /description/ of the Consumable, so that it can attach that:
# [[file:../../../projects/mud.org::*Ten-foot Poles][Ten-foot Poles:7]] # [[file:../../../projects/mud.org::*Ten-foot Poles][Ten-foot Poles:8]]
@set reeds/make_desc = "A long pole shaved from a marsh reed." @set reeds/make_desc = "A long pole shaved from a marsh reed."
# Ten-foot Poles:7 ends here # Ten-foot Poles:8 ends here
# How much is there when you pick them? # How much is there when you pick them?
# [[file:../../../projects/mud.org::*Ten-foot Poles][Ten-foot Poles:8]] # [[file:../../../projects/mud.org::*Ten-foot Poles][Ten-foot Poles:9]]
@set reeds/make_amount = 1 @set reeds/make_amount = 1
# Ten-foot Poles:8 ends here # Ten-foot Poles:9 ends here
# Part of the [[Potions and their Ingredients][Alchemist Path]], we use /pixie dust/ to create a [[Trippy Potion]]. # Part of the [[Potions and their Ingredients][Alchemist Path]], we use /pixie dust/ to create a [[Trippy Potion]].
@ -1877,7 +1899,7 @@ py me.search("heron").backstory("heron")
# And the individiaul choices are more appearance, and possibly smell, without claiming to be /worldly herbs/. Would like to add some dried red and other colored leaves to make it more fantastical. # And the individual choices are more appearance, and possibly smell, without claiming to be /worldly herbs/. Would like to add some dried red and other colored leaves to make it more fantastical.
# [[file:../../../projects/mud.org::*Herbs][Herbs:4]] # [[file:../../../projects/mud.org::*Herbs][Herbs:4]]
@ -2142,7 +2164,7 @@ py timed_script = evennia.create_script(key="Create Horns",
# And an unpuppeted, sleeping, description: # And an un-puppeted, sleeping, description:
# [[file:../../../projects/mud.org::*Trampoli the Witch][Trampoli the Witch:7]] # [[file:../../../projects/mud.org::*Trampoli the Witch][Trampoli the Witch:7]]
@ -2177,7 +2199,7 @@ py timed_script = evennia.create_script(key="Create Horns",
# With a mesage about leaving the trees so that I dont have to repeat that in the room description: # With a message about leaving the trees so that I dont have to repeat that in the room description:
# [[file:../../../projects/mud.org::*Lazy Dock][Lazy Dock:3]] # [[file:../../../projects/mud.org::*Lazy Dock][Lazy Dock:3]]
@set south/traverse_msg = "You follow a path down and step out from under giant trees to see the sky." @set south/traverse_msg = "You follow a path down and step out from under giant trees to see the sky."
@ -2394,7 +2416,7 @@ py me.search("raven").backstory("raven")
# With a mesage about leaving the trees so that I dont have to repeat that in the room description: # With a message about leaving the trees so that I dont have to repeat that in the room description:
# [[file:../../../projects/mud.org::*Sandy Shore][Sandy Shore:2]] # [[file:../../../projects/mud.org::*Sandy Shore][Sandy Shore:2]]
@set south/traverse_msg = "Leaving the dock, you want along the soft sandy shore next to the Lavender Sea, enjoying the mesmerizing sound of the surf... until you come to a shack that blocks your stroll." @set south/traverse_msg = "Leaving the dock, you want along the soft sandy shore next to the Lavender Sea, enjoying the mesmerizing sound of the surf... until you come to a shack that blocks your stroll."
@ -2784,7 +2806,7 @@ py me.search("raven").backstory("raven")
# The knocker shouldnt be stealable: # The knocker shouldnt be steal-able:
# [[file:../../../projects/mud.org::*Knocker][Knocker:3]] # [[file:../../../projects/mud.org::*Knocker][Knocker:3]]
@lock knocker = get:false() @lock knocker = get:false()
@ -3007,7 +3029,7 @@ py me.search("raven").backstory("raven")
# Add some initial ambience: # Add some initial ambiance:
# [[file:../../../projects/mud.org::*Inside][Inside:6]] # [[file:../../../projects/mud.org::*Inside][Inside:6]]
@ -3320,7 +3342,7 @@ pose gnome/default = smoking his pipe
# And an unpuppeted, sleeping, description: # And an un-puppeted, sleeping, description:
# [[file:../../../projects/mud.org::*Character: Dabbler][Character: Dabbler:8]] # [[file:../../../projects/mud.org::*Character: Dabbler][Character: Dabbler:8]]
@ -3739,8 +3761,10 @@ py here.search("cabinet").do_bake()
# Tea Service:2 ends here # Tea Service:2 ends here
# And of course, you cant steal the tea pot: # And of course, you cant steal the tea pot:
# [[file:../../../projects/mud.org::*Tea Service][Tea Service:3]] # [[file:../../../projects/mud.org::*Tea Service][Tea Service:3]]
@lock teapot = get:false() @lock teapot = get:false()
# #
@ -4481,6 +4505,187 @@ py bt = self.search('head'); bt.sdesc.add('curious figure'); bt.db.pose = 'sitti
# Pull up a Log:4 ends here # Pull up a Log:4 ends here
# The entrance to the dungeon experience will be under the mattress in [[Lair][the Lair]].
# [[file:../../../projects/mud.org::*Dark Tunnel][Dark Tunnel:1]]
@tel/quiet mp07
#
@dig Dark Tunnel;mp20:typeclasses.rooms_dark.DarkRoom = ladder down into the dark;down;ladder;tunnel,ladder to trapdoor;trapdoor;up;ladder
#
@desc ladder = Through the open trapdoor, you see a ladder that you can climb down into a cold, damp darkness.
#
@set ladder/traverse_msg = "With the trapdoor open, you climb down the ladder into the darkness... Suddenly, your foot slips, and you fall, landing on the stone floor!"
#
# @set here/open_exit = $search(ladder down into the dark)
#
# @set here/open_item = "trapdoor"
#
@teleport/tonone ladder down into the dark
# Dark Tunnel:1 ends here
# And we create a trapdoor in the Lair:
# [[file:../../../projects/mud.org::*Dark Tunnel][Dark Tunnel:2]]
@create/drop trapdoor:typeclasses.things.ClosingDoor
#
@desc trapdoor = A wood door with reinforced iron bands on the floor, under the heavy mattress.
#
@lock trapdoor = get:false()
#
@set trapdoor/get_err_msg = "Are you mad? The trapdoor is securely attached to the floor ... and under the heavy mattress."
#
@set trapdoor/pull_msg = "Sorry, you can't open the trapdoor when the mattress is resting on it."
#
@set trapdoor/hidden_tag = "hidden_trapdoor"
#
@lock trapdoor = view:tag(hidden_trapdoor)
# Dark Tunnel:2 ends here
# What does it take to open it?
# [[file:../../../projects/mud.org::*Dark Tunnel][Dark Tunnel:3]]
@lock trapdoor = traverse:tag(enter_dungeon, mp)
#
# Trapdoor should stay open for 5 minutes:
@set trapdoor/open_for = 300
#
@set trapdoor/exit = $search(ladder down into the dark)
#
@set trapdoor/exit_close_msg = "The trapdoor slams shut from above. Uh oh."
#
@set trapdoor/room = $search(Lair)
#
@set trapdoor/room_close_msg = "The stick breaks, and the trapdoor slams shut from the weight of the mattress."
# Dark Tunnel:3 ends here
# Lets get into the Dungeon and work from it there.
# [[file:../../../projects/mud.org::*Dark Tunnel][Dark Tunnel:4]]
@teleport/quiet mp18
#
@desc here = A cold, musty tunnel made of |Ystone blocks|n, tapered to form an large dome overhead. You hear a slight whistling sound, which may explain why this unground place is neither dusty or musty.
#
@desc ladder = A metal ladder where a slimy mildew of sorts has grown on the bottom rungs. Better be careful.
#
@set ladder/traverse_msg = "You carefully ascend up the ladder, but you find the trapdoor hard to open, as if something heavy is on top of it. With all your might, you manage to push and squeeze through it."
#
@detail trapdoor = A wood door with reinforced iron bands on the floor.
#
@detail stone blocks;stone;blocks = The stone blocks that support the tunnel are well made, and for the most part, keep out water. But the crevises seem mortared with a green mildew.
# Dark Tunnel:4 ends here
# Lets connect the Bar to the Lair through a labyrinth of tunnels.
# [[file:../../../projects/mud.org::*Dungeon WIP][Dungeon WIP:1]]
@teleport/quiet mp21
#
# Create the next room...
@desc down = The tunnel continues down into the darkness.
#
@set down/traverse_msg = "You carefully pick your way down the tunnel. It curves. It veers. It corners...."
#
@dig Tunnel End;mp18:typeclasses.rooms_dark.DarkRoom = ladder down into the dark;down;ladder;tunnel,ladder to trapdoor;trapdoor;up;ladder;door
#
@desc ladder = Through the open trapdoor, you see a ladder that you can climb down into a cold, damp darkness.
#
@set ladder/traverse_msg = "With the trapdoor open, you climb down the ladder into the darkness... Suddenly, your foot slips, and you fall, landing on the stone floor!"
#
@set here/open_exit = $search(ladder down into the dark)
#
@set here/open_item = "trapdoor"
#
@teleport/tonone ladder down into the dark
# Dungeon WIP:1 ends here
# Lets bring the “ladder” exit back by opening and closing the trapdoor:
# [[file:../../../projects/mud.org::*Dungeon WIP][Dungeon WIP:2]]
@set here/open_exit_msg = "$You() $conj(open) the trapdoor, revealing a ladder leading down into darkness."
#
@set here/close_exit_msg = "$You() $conj(close) the trapdoor. Don't want anyone to fall in."
# Dungeon WIP:2 ends here
# And lets create the trapdoor:
# [[file:../../../projects/mud.org::*Dungeon WIP][Dungeon WIP:3]]
@create/drop trapdoor
#
@desc trapdoor = A wood door with reinforced iron bands on the floor. An iron ring allows you to |gopen|n it.
#
@lock trapdoor = get:false()
#
@set trapdoor/get_err_msg = "The hinges of the trapdoor allows you to |gopen|n the door, but not take it."
#
@set trapdoor/pull_msg = "Sorry, the command you are looking for is |gopen|n...not pull. Good guess, though."
# Dungeon WIP:3 ends here
# Lets enter the belly of this beast.
# [[file:../../../projects/mud.org::*Dungeon WIP][Dungeon WIP:4]]
@teleport/quiet mp18
#
@desc here = A cold, musty tunnel made of stone blocks, tapered to form an arch overhead. A ladder here leads up to a trapdoor, and the tunnel continues on into the distance.
#
@desc ladder = A metal ladder where a slimy mildew of sorts has grown on the bottom rungs. Better be careful.
#
@set ladder/traverse_msg = "You carefully ascend up the ladder, opening the trapdoor."
#
@detail trapdoor = A wood door with reinforced iron bands on the floor. An iron ring allows you to |gopen|n it.
#
@detail stone;blocks = The stone blocks that support the tunnel are well made, and for the most part, keep out water. But the crevises seem mortared with a green mildew.
# Dungeon WIP:4 ends here
# Lets make the end of the tunnel look a lot like the beginning:
# Lets create another trapdoor and a ladder leading to the Lair:
# [[file:../../../projects/mud.org::*Dungeon WIP][Dungeon WIP:5]]
@open ladder to trapdoor;trapdoor;up;ladder;climb,ladder down into the dark;down;ladder = mp07
#
@desc ladder = A metal ladder where a slimy mildew of sorts has grown on the bottom rungs. Better be careful.
#
@set ladder/traverse_msg = "You carefully ascend up the ladder, opening the trapdoor."
#
#
@detail trapdoor = A wood door with reinforced iron bands on the floor. An iron ring allows you to |gopen|n it.
#
@detail stone;blocks = The stone blocks that support the tunnel are well made, and for the most part, keep out water. But the crevises seem mortared with a green mildew.
# Dungeon WIP:5 ends here
# [[file:../../../projects/mud.org::*Dungeon WIP][Dungeon WIP:6]]
@desc down = The tunnel continues down into the darkness.
#
@set down/traverse_msg = "You carefully pick your way down the tunnel. It curves. It veers. It corners...."
# Dungeon WIP:6 ends here
# The deep forest is a place where all the Puppets can hang out when not in use. # The deep forest is a place where all the Puppets can hang out when not in use.
# [[file:../../../projects/mud.org::*Deep Forest][Deep Forest:1]] # [[file:../../../projects/mud.org::*Deep Forest][Deep Forest:1]]
@ -4548,9 +4753,7 @@ py bt = self.search('head'); bt.sdesc.add('curious figure'); bt.db.pose = 'sitti
# [[file:../../../projects/mud.org::*Darol the Flamboyant Dragon][Darol the Flamboyant Dragon:2]] # [[file:../../../projects/mud.org::*Darol the Flamboyant Dragon][Darol the Flamboyant Dragon:2]]
@update dragon = typeclasses.chatbots.Dragon py darol = me.search("Darol") ; darol.sdesc.add("tiny, orange dragon") ; darol.backstory("dragon")
#
py darol = me.search("dragon") ; darol.sdesc.add("tiny, orange dragon") ; darol.backstory("dragon")
# Darol the Flamboyant Dragon:2 ends here # Darol the Flamboyant Dragon:2 ends here
@ -4571,47 +4774,6 @@ py darol = me.search("dragon") ; darol.sdesc.add("tiny, orange dragon") ; darol.
@script Sir Roblees = typeclasses.chatbots.TravelingNPC @script Sir Roblees = typeclasses.chatbots.TravelingNPC
# Darol the Flamboyant Dragon:4 ends here # Darol the Flamboyant Dragon:4 ends here
# [[file:../../../projects/mud.org::*Rick the Barbarian][Rick the Barbarian:1]]
@create/drop Rick: typeclasses.chatbots.Traveler
#
@set Rick/gender = "her"
#
@set Rick/pose = "twirling a tendril like a mustache"
#
@set Rick/pose_sleep = "twirling a tendril like a mustache"
# Rick the Barbarian:1 ends here
# Then wake her.
# [[file:../../../projects/mud.org::*Rick the Barbarian][Rick the Barbarian:2]]
py rick = me.search("rick") ; rick.sdesc.add("large barbarian") ; rick.backstory("barbarian")
# Rick the Barbarian:2 ends here
# This Dwarf will be in the dungeons, but I would like them to come out at times.
# [[file:../../../projects/mud.org::*George the Dwarf Tinkerer][George the Dwarf Tinkerer:1]]
@create/drop George: typeclasses.chatbots.Chatbot
#
@set George/gender = "him"
#
@set George/pose = "looking at some blueprints"
#
@set George/pose_sleep = "snoozing"
# George the Dwarf Tinkerer:1 ends here
# Then wake it.
# [[file:../../../projects/mud.org::*George the Dwarf Tinkerer][George the Dwarf Tinkerer:2]]
py george = me.search("george") ; george.sdesc.add("white-haired dwarf") ; george.backstory("dwarf")
# George the Dwarf Tinkerer:2 ends here
# And now that we are done, say it: # And now that we are done, say it: