Persist knock and pet commands

This commit is contained in:
Howard Abrams 2025-05-16 21:53:53 -07:00
parent c86d94e59e
commit c4777ef1c2
5 changed files with 36 additions and 8 deletions

View file

@ -9,9 +9,12 @@ class CmdKnock(Command):
""" """
The ability to knock on something, like a door. The ability to knock on something, like a door.
While it would be great if it could be attached to a door or some Usage:
other exit, we need to attach this to the room.
knock
Uh, yeah, you'll need to make sure the ring is in the mouth of the
door knocker.
""" """
key = "knock" key = "knock"
@ -28,6 +31,12 @@ class CmdSetKnock(CmdSet):
class CmdJump(Command): class CmdJump(Command):
""" """
Jump or play in or around puddles. Jump or play in or around puddles.
Usage:
jump
You know you want to do this!
""" """
key = "jump" key = "jump"
aliases = ["play"] aliases = ["play"]
@ -43,10 +52,16 @@ class CmdSetPuddle(CmdSet):
class CmdThrow(Command): 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" key = "throw"
locks = "holds(stick)" locks = "holds(stick)"
# locks = "cmd:holds()"
def func(self): def func(self):
self.obj.do_throw(self.caller) self.obj.do_throw(self.caller)

View file

@ -7,6 +7,12 @@ from commands.command import Command
class CmdPet(Command): class CmdPet(Command):
""" """
Pet a 'friendly' pet. Pet a 'friendly' pet.
Usage:
pet [ <creature> ]
Just because you |wcan|n do this, doesn't mean the creature |wwants|n you to.
""" """
key = "pet" key = "pet"

View file

@ -24,8 +24,8 @@ class CmdFly(Command):
(those are separated by double semicolons). (those are separated by double semicolons).
""" """
key = "^fly" key = "fly"
locks = "call:all()" locks = "cmd:holds()"
def func(self): def func(self):
self.caller.do_fly(self.args.strip()) self.caller.do_fly(self.args.strip())
@ -72,6 +72,14 @@ class CmdGM(MuxCommand):
class CmdSpell(Command): class CmdSpell(Command):
"""
Cast one of the few spells we've created that affect others.
Usage:
spell donkey on lizardman
"""
key = "spell" key = "spell"
aliases = ['cast'] aliases = ['cast']
locks = "cmd:perm(gm) or perm(Admin)" locks = "cmd:perm(gm) or perm(Admin)"

View file

@ -218,7 +218,7 @@ class Friendly(Pet):
""" """
super().at_object_creation() 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: # We have a list of actions that were spammed to the room:
self.db.last_actions = [] self.db.last_actions = []

View file

@ -382,8 +382,7 @@ class Knocker(Object):
] ]
def at_object_creation(self): def at_object_creation(self):
super().at_object_creation() self.cmdset.add_default(CmdSetKnock)
self.cmdset.add(CmdSetKnock)
def do_knock(self, knocker): def do_knock(self, knocker):
if self.has("ring"): if self.has("ring"):