From d28b993e710c608f021985623bcbe06e079a03d2 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Sun, 14 Sep 2025 21:54:25 -0700 Subject: [PATCH] Kiss a frog to transform into a frog --- commands/everyone.py | 2 ++ commands/pets.py | 31 +++++++++++++++++++++++++++++++ typeclasses/rooms.py | 3 +++ typeclasses/rooms_weather.py | 23 ++++++++++++++++++++++- 4 files changed, 58 insertions(+), 1 deletion(-) diff --git a/commands/everyone.py b/commands/everyone.py index 4e479bf..f050192 100755 --- a/commands/everyone.py +++ b/commands/everyone.py @@ -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: diff --git a/commands/pets.py b/commands/pets.py index 244d7d4..44c45d9 100755 --- a/commands/pets.py +++ b/commands/pets.py @@ -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 [ ] + + 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) diff --git a/typeclasses/rooms.py b/typeclasses/rooms.py index 7eb72c2..907ded7 100644 --- a/typeclasses/rooms.py +++ b/typeclasses/rooms.py @@ -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 diff --git a/typeclasses/rooms_weather.py b/typeclasses/rooms_weather.py index 1a9cad2..5dd9802 100755 --- a/typeclasses/rooms_weather.py +++ b/typeclasses/rooms_weather.py @@ -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?")