Kiss a frog to transform into a frog
This commit is contained in:
parent
c7eb10cc81
commit
d28b993e71
4 changed files with 58 additions and 1 deletions
|
|
@ -564,6 +564,8 @@ class CmdTake(CmdGet, NumberedTargetCommand):
|
|||
# ring, I need to:
|
||||
if self.lhs == "ring" and self.caller.location.key == "Grotto":
|
||||
self.caller.msg("From whom do you want to get this ring?")
|
||||
elif self.lhs == "frog" and self.caller.location.key == "Frog Meadow":
|
||||
self.caller.msg("The little guys are too quick to catch.")
|
||||
else:
|
||||
super().func() # Call the 'get' function instead.
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -30,3 +30,34 @@ class CmdPetSet(CmdSet):
|
|||
"""
|
||||
def at_cmdset_creation(self):
|
||||
self.add(CmdPet)
|
||||
|
||||
|
||||
class CmdKiss(Command):
|
||||
"""
|
||||
Kiss something. Uh, be careful what you kiss.
|
||||
|
||||
Usage:
|
||||
|
||||
kiss [ <creature or thing> ]
|
||||
|
||||
Just because you |wcan|n do this, doesn't mean the creature
|
||||
|wwants|n you to.
|
||||
"""
|
||||
key = "kiss"
|
||||
|
||||
def func(self):
|
||||
"""
|
||||
Implements the kiss command.
|
||||
"""
|
||||
if not self.args:
|
||||
self.caller.msg("Kiss what?")
|
||||
else:
|
||||
self.obj.kiss_response(self.caller, self.args.strip())
|
||||
|
||||
|
||||
class CmdSetKiss(CmdSet):
|
||||
"""
|
||||
Things associated with kisss.
|
||||
"""
|
||||
def at_cmdset_creation(self):
|
||||
self.add(CmdKiss)
|
||||
|
|
|
|||
|
|
@ -196,6 +196,9 @@ class Room(ObjectParent, ExtendedRoom, ContribRPRoom, Listener):
|
|||
|
||||
|
||||
class DabblersRoom(Room):
|
||||
"""
|
||||
Change the description based on the state of the fire.
|
||||
"""
|
||||
def get_display_desc(self, looker):
|
||||
fire = self.search("fire")
|
||||
full_desc = self.db.initial_desc
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import random
|
||||
from .rooms import Room
|
||||
import re
|
||||
|
||||
from evennia import TICKER_HANDLER
|
||||
from evennia.utils import delay
|
||||
|
||||
from typeclasses.rooms import Room
|
||||
|
||||
# -------------------------------------------------------------
|
||||
#
|
||||
|
|
@ -142,3 +144,22 @@ class TimeWeatherRoom(Room):
|
|||
if self.db.previous_weather != msg:
|
||||
self.db.previous_weather = msg
|
||||
self.msg_contents(f"|w{msg}|n\n")
|
||||
|
||||
from commands.pets import (CmdSetKiss)
|
||||
|
||||
class FrogMeadow(TimeWeatherRoom):
|
||||
"""
|
||||
Add the 'kiss' command in this room only.
|
||||
"""
|
||||
def at_object_creation(self):
|
||||
self.cmdset.add(CmdSetKiss, persistent=True)
|
||||
|
||||
def kiss_response(self, kisser, kissed):
|
||||
if re.match(r".*frog.*", kissed):
|
||||
kisser.announce_action("$You() $conj(catch) a cute little frog, and $conj(give) it a kiss.")
|
||||
delay(2, kisser.transmogrify, "frog",
|
||||
"Cute frog with big black eyes and a tiny gold crown.")
|
||||
delay(60, kisser.untransmogrify)
|
||||
delay(62, kisser.msg, "Whew. Glad that effect didn't last that long.")
|
||||
else:
|
||||
kisser.msg("Uh, really? You want to kiss that?")
|
||||
|
|
|
|||
Loading…
Reference in a new issue