diff --git a/commands/misc.py b/commands/misc.py new file mode 100755 index 0000000..7f83fa9 --- /dev/null +++ b/commands/misc.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +from .command import Command +from evennia import CmdSet + + +class CmdJump(Command): + """ + Jump or play in or around puddles. + """ + key = "jump" + aliases = ["play"] + + def func(self): + self.obj.do_jump(self.caller) + + +class CmdSetPuddle(CmdSet): + def at_cmdset_creation(self): + self.add(CmdJump) diff --git a/typeclasses/fishing.py b/typeclasses/fishing.py index e1ac799..5ae7f7e 100755 --- a/typeclasses/fishing.py +++ b/typeclasses/fishing.py @@ -136,7 +136,8 @@ class Fish(CarriableNPC): elif self.db.spoken == 803: self.at_say("Sorry for all the puns. I feel so GILL-ty.") - elif self.db.spoken > 1000 and self.db.spoken % (24 * 60 * 60 / self.fish_tick): + # Let's attempt to tell a bad joke once a day: + elif self.db.spoken > 1000 and self.db.spoken % (24 * 60 * 60 / self.fish_tick) == 0: self.at_say(get_joke()) self.db.spoken += 1 diff --git a/typeclasses/readables.py b/typeclasses/readables.py index 2e5cced..3f2c0ae 100755 --- a/typeclasses/readables.py +++ b/typeclasses/readables.py @@ -71,6 +71,7 @@ class CmdLookBook(Command): """ Respond with a new book to look at. """ + priority = 3 key = "look book" aliases = "l book" @@ -92,8 +93,6 @@ class CmdReadBook(Command): Return the inside contents of the book. """ key = "read" - aliases = "open book" - def func(self): self.obj.do_read(self.caller) @@ -119,7 +118,6 @@ class CmdDropBook(Command): class CmdSetBook(CmdSet): - # mergetype = "Replace" priority = 2 def at_cmdset_creation(self): @@ -153,6 +151,17 @@ class Readable(Object): "called when 'read'." reader.msg(self.db.inside) + def do_burn(self, reader, drop=True): + """ + Throwing and burning books and signs. + Leave (ie. drop) or destroy? + """ + if drop: + super().at_drop(reader) + else: + reader.msg("The {self.name} is gone.") + self.delete() + class Letter(Readable): """ diff --git a/typeclasses/things.py b/typeclasses/things.py index dc1ba53..5f96b99 100755 --- a/typeclasses/things.py +++ b/typeclasses/things.py @@ -26,6 +26,8 @@ class Unhider(Object): The idea is .... ugh. @set thing/ """ + pass + class Returnable(Object): """ This object can't go far from one or two locations. @@ -33,6 +35,34 @@ class Returnable(Object): """ pass +class Puddle(Object): + def at_object_creation(self): + self.cmdset.add_default(CmdSetPuddle) + + def do_jump(self, player): + player.db.jumped_times = (player.db.jumped_times or 0) + 1 + if player.db.jumped_times == 1: + player.msg("You jump in the puddle! " + "This is great fun. You feel childish.") + else: + player.msg(routput(choice([ + "You don't care [how muddy|who notices], you jump in again!", + "Mud? Whatever. You [splash|jump] in[| again].", + "You splash around in the puddle.", + "You jump in the puddle again.", + "This time you dance a little as you kick up your heels.", + ]) + " You feel " + choice([ + "[so much|] better.", + "carefree.", + "child-like and free.", + "irresponsible.", + "happy.", + "great.", + ]))) + + self.location.msg_contents(f"{player.name} jumps in the puddle.", + exclude=player) + class Knocker(Object): """ Special object that listens to what is said in the room, and @@ -220,7 +250,6 @@ class Knocker(Object): def get_display_things(self, looker): return "" - def msg(self, text=None, from_obj=None, **kwargs): "Custom msg() method reacting to say." if from_obj != self: diff --git a/world/version1.ev b/world/version1.ev index b8b3b7f..b39d9de 100644 --- a/world/version1.ev +++ b/world/version1.ev @@ -133,6 +133,34 @@ And now, assume that character by typing: # The Forest:5 ends here +# With my name, I need to have an object to go with it. + + +# [[file:../../../projects/mud.org::*Puddles][Puddles:1]] +@create/drop puddle : typeclasses.things.Puddle +# Puddles:1 ends here + + + +# And an elusive description: + + +# [[file:../../../projects/mud.org::*Puddles][Puddles:2]] +@desc puddle = A large puddle formed from a recent rainshower, invites you to shed your years and jump in and splash around to reconnect with your youth. +# Puddles:2 ends here + + + +# And keep it locked down: + + +# [[file:../../../projects/mud.org::*Puddles][Puddles:3]] +@lock puddle = get:false() +# +@set puddle/get_err_msg = "As the water slips through your fingers, you realize the apt metaphor of attempting to grasp at your youth. +# Puddles:3 ends here + + # More details about the room that describes aspects of the boulder in the =desc= above. First, the symbol: # [[file:../../../projects/mud.org::*Boulder][Boulder:1]]