From c4777ef1c284ef18eec488d7310075ee2eec5968 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 16 May 2025 21:53:53 -0700 Subject: [PATCH] Persist knock and pet commands --- commands/misc.py | 21 ++++++++++++++++++--- commands/pets.py | 6 ++++++ commands/wizards.py | 12 ++++++++++-- typeclasses/pets.py | 2 +- typeclasses/things.py | 3 +-- 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/commands/misc.py b/commands/misc.py index 86f24f8..6668484 100755 --- a/commands/misc.py +++ b/commands/misc.py @@ -9,9 +9,12 @@ class CmdKnock(Command): """ The ability to knock on something, like a door. - While it would be great if it could be attached to a door or some - other exit, we need to attach this to the room. + Usage: + knock + + Uh, yeah, you'll need to make sure the ring is in the mouth of the + door knocker. """ key = "knock" @@ -28,6 +31,12 @@ class CmdSetKnock(CmdSet): class CmdJump(Command): """ Jump or play in or around puddles. + + Usage: + + jump + + You know you want to do this! """ key = "jump" aliases = ["play"] @@ -43,10 +52,16 @@ class CmdSetPuddle(CmdSet): class CmdThrow(Command): """ - Jump or play in or around puddles. + Throw a stick or a fish back into the water. + + Usage: + + throw [ object ] + """ key = "throw" locks = "holds(stick)" + # locks = "cmd:holds()" def func(self): self.obj.do_throw(self.caller) diff --git a/commands/pets.py b/commands/pets.py index 5ffa552..bebaffe 100755 --- a/commands/pets.py +++ b/commands/pets.py @@ -7,6 +7,12 @@ from commands.command import Command class CmdPet(Command): """ Pet a 'friendly' pet. + + Usage: + + pet [ ] + + Just because you |wcan|n do this, doesn't mean the creature |wwants|n you to. """ key = "pet" diff --git a/commands/wizards.py b/commands/wizards.py index a9a5e67..7575c4c 100755 --- a/commands/wizards.py +++ b/commands/wizards.py @@ -24,8 +24,8 @@ class CmdFly(Command): (those are separated by double semicolons). """ - key = "^fly" - locks = "call:all()" + key = "fly" + locks = "cmd:holds()" def func(self): self.caller.do_fly(self.args.strip()) @@ -72,6 +72,14 @@ class CmdGM(MuxCommand): class CmdSpell(Command): + """ + Cast one of the few spells we've created that affect others. + + Usage: + + spell donkey on lizardman + """ + key = "spell" aliases = ['cast'] locks = "cmd:perm(gm) or perm(Admin)" diff --git a/typeclasses/pets.py b/typeclasses/pets.py index a37e903..bd946bf 100755 --- a/typeclasses/pets.py +++ b/typeclasses/pets.py @@ -218,7 +218,7 @@ class Friendly(Pet): """ super().at_object_creation() - self.cmdset.add(CmdPetSet) + self.cmdset.add(CmdPetSet, persistent=True) # We have a list of actions that were spammed to the room: self.db.last_actions = [] diff --git a/typeclasses/things.py b/typeclasses/things.py index fe35940..94584aa 100755 --- a/typeclasses/things.py +++ b/typeclasses/things.py @@ -382,8 +382,7 @@ class Knocker(Object): ] def at_object_creation(self): - super().at_object_creation() - self.cmdset.add(CmdSetKnock) + self.cmdset.add_default(CmdSetKnock) def do_knock(self, knocker): if self.has("ring"):