Get the database in sync with new way of hiding things

This commit is contained in:
Howard Abrams 2025-04-14 10:41:55 -07:00
parent 45959b01ce
commit 46590de8ab
4 changed files with 140 additions and 70 deletions

View file

@ -137,9 +137,12 @@ class Character(Object, DefaultCharacter):
To use this, simply add the following lock:
@lock thing = view:tag(hidden_thing, mp)
@set thing/hidden_tag = target
@lock thing = view:tag(hidden_target)
Where thing is the single name of the hidden object.
And 'target' is some label. If not given, this defaults
to the name of the thing.
"""
hidden_tag = target.db.hidden_tag or f"hidden_{target}"
lock_string = f"view:tag({hidden_tag})"

View file

@ -412,8 +412,8 @@ class BHB(Friendly):
else:
return "It currently slumbers on its huge mattress."
def update_state(self):
def update_state(self, *args, **kwargs):
msg = None
wake_hour = self.db.wake_hour or 8
sleep_hour = self.db.sleep_hour or 20

View file

@ -5,7 +5,7 @@ Rooms are simple containers that has no location of their own.
"""
import datetime
from datetime import datetime
from evennia import utils
from evennia.utils import gametime
@ -39,7 +39,7 @@ class Room(ObjectParent, ExtendedRoom):
(Minute, Hour, Time of Day, Season)
"""
timestamp = gametime.gametime(absolute=True)
datestamp = datetime.datetime.fromtimestamp(timestamp)
datestamp = datetime.fromtimestamp(timestamp)
return (datestamp.minute, datestamp.hour,
self.get_time_of_day(), self.get_season())

View file

@ -22,6 +22,28 @@ Spectacles perched precariously on the end of his hooked nose, wobble with his h
# Character: Dabble:2 ends here
# And we create a couple of objects, like a cap:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:3]]
@create cap
#
@desc cap = It's crimson. It's jaunty.
# Character: Dabble:3 ends here
# And my staff:
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:4]]
@create gnarled staff;stick;staff: typeclasses.things.Stick
#
@desc stick = An oaken staff with a sprig of two leaves next to a swirling ball of crystal embedded near the top.
# Character: Dabble:4 ends here
# Rename the Limbo (or starting place) with the name *Forest*. Note the term =mp01= as a global label that matches my map.
@ -169,7 +191,9 @@ Wait! You notice a foot hold, and then another. You can |bclimb|n this boulder!
# To take advantage of our [[Hidden Things]], we put the right tag on it:
# [[file:../../../Dropbox/org/projects/mud.org::*Boulder][Boulder:7]]
@lock boulder = view:tag(hidden_boulder, mp)
@set boulder/hidden_tag = hidden_boulder
#
@lock boulder = view:tag(hidden_boulder)
# Boulder:7 ends here
@ -177,7 +201,7 @@ Wait! You notice a foot hold, and then another. You can |bclimb|n this boulder!
# And give it some aliases:
# [[file:../../../Dropbox/org/projects/mud.org::*Boulder][Boulder:8]]
@name boulder = boulder;climb;climb up
@name boulder = climb the boulder;boulder;climb;climb up
# Boulder:8 ends here
# [[file:../../../Dropbox/org/projects/mud.org::*Boulder][Boulder:9]]
@ -249,7 +273,7 @@ Wait! You notice a foot hold, and then another. You can |bclimb|n this boulder!
# Can we hide it too?
# [[file:../../../Dropbox/org/projects/mud.org::*Top of Boulder][Top of Boulder:9]]
@lock moss = view:tag(hidden_moss, mp)
@lock moss = view:tag(hidden_moss)
# Top of Boulder:9 ends here
@ -358,25 +382,34 @@ east
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:13]]
@detail stream;field = A slow-moving stream meanders like a snake in the grassy field. Tiny, cute green frogs cling to grass stems that hang over the water.
@detail stream;field = A slow-moving stream meanders like a snake in the grassy field. Little green frogs cling to grass stems hanging over the water.
# Field:13 ends here
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:14]]
@detail waterfall;water = Cascading down the cliff in three sections, each section of this giant waterfall widens ending in a large pool.
Wait! Is there a large cave hidden behind the water?
# And detail the frogs:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:14]]
@detail frog;frogs = Cute little guys with their big black eyes. Too quick to catch.
# Field:14 ends here
# Can a detail cover its hidden-ness?
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:15]]
@detail lair = A large entrance to a dark, and foul-smelling cave. The waterfall is so loud, you can't hear anything that may live there.
@detail waterfall;water = Cascading down the cliff in three sections, each section of this giant waterfall widens ending in a large pool.
Wait! Is there a large cave entrance hidden behind the water?
# Field:15 ends here
# And a detail if they look at the shadow in the field:
# [[file:../../../Dropbox/org/projects/mud.org::*Field][Field:16]]
@detail shadow = You see a big, hairy beast with long teeth and claws. Its great horns, tipped in black, point to the sky.
# Field:16 ends here
# To create a place for our big, hairy beast to sleep, first jump to the Meadow:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:1]]
@ -388,7 +421,7 @@ Wait! Is there a large cave hidden behind the water?
# From the Meadow, we create a lair /behind/ the water.
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:2]]
@dig lair = cave;lair;inside,outside;leave
@dig lair = cave entrance;cave;lair;inside,outside;leave
# The Lair of the Beast:2 ends here
@ -396,7 +429,9 @@ Wait! Is there a large cave hidden behind the water?
# And we make it hidden:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:3]]
@lock lair = view:tag(hidden_cave, mp)
@set lair/hidden_tag = hidden_cave
#
@lock lair = view:tag(hidden_cave)
# The Lair of the Beast:3 ends here
@ -444,139 +479,168 @@ lair
# And a description of the mattress:
# And a description of leaving:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:9]]
@detail mattress = Looks comfortable, if you could just get a leg up to get on it...
@desc leave = You can see the waterfall cascading just outside the cave entrance.
# The Lair of the Beast:9 ends here
# And the leaving message:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:10]]
@set leave/traverse_msg = "You leave the dark cave and pass behind the waterfall for the meadow beyond."
# The Lair of the Beast:10 ends here
# And a description of the mattress:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:11]]
@detail mattress = Looks comfortable, if you could just get a leg up to get on it...
# The Lair of the Beast:11 ends here
# And we create the Big, Hairy Beast:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:10]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:12]]
@create/drop big hairy beast;bhb;beast;hairy beast;monster: typeclasses.pets.BHB
# The Lair of the Beast:10 ends here
# The Lair of the Beast:12 ends here
# And lets hide it until we are ready:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:13]]
@set beast/hidden_tag = hidden_beast
#
@lock beast = view:tag(hidden_beast)
# The Lair of the Beast:13 ends here
# And a general description that will be /expanded/ with its current reaction.
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:11]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:14]]
@desc beast = A big, hairy beast with long claws and teeth.
# The Lair of the Beast:11 ends here
# The Lair of the Beast:14 ends here
# Cant get this:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:12]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:15]]
@lock beast = get:false()
#
@set beast/get_err_msg = "You can't pick that up, as that beast is far larger than you."
# The Lair of the Beast:12 ends here
# The Lair of the Beast:15 ends here
# And set its sleepy time at 8pm …
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:13]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:16]]
@set beast/sleep_hour = 21
# The Lair of the Beast:13 ends here
# The Lair of the Beast:16 ends here
# It will wake at 8am …
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:14]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:17]]
@set beast/wake_hour = 8
# The Lair of the Beast:14 ends here
# The Lair of the Beast:17 ends here
# Lets set some behavior levels. For instance, the beast is sad when he doesnt see its friends:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:15]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:18]]
@set beast/loneliness_amount = -2
# The Lair of the Beast:15 ends here
# The Lair of the Beast:18 ends here
# It seem to warm up the to new characters hanging around the area, but not as much as those that would interact with it:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:16]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:19]]
@set beast/shyness_amount = 3
# The Lair of the Beast:16 ends here
# The Lair of the Beast:19 ends here
# How active should this pet be? Seems like at the moment, it shouldnt be too obnoxious. This setting is a percentage, so 12 is /12%/, which returns a message only 12% of the /ticks/ (where a tick is about a minute).
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:17]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:20]]
@set beast/active_amount = 10
# The Lair of the Beast:17 ends here
# The Lair of the Beast:20 ends here
# It isnt that scared of new people, as it will ignore them when someone it knows is around.
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:18]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:21]]
@set beast/new_character_reaction = 'ignores'
# The Lair of the Beast:18 ends here
# The Lair of the Beast:21 ends here
# Seems we should make descriptions for all the states that happen when you look at them. These are appended to the standard description.
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:19]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:22]]
@set beast/scared_msg = "It seems [skiddish|afraid|skiddish and afraid] as it tries to hide behind a tall clump of grass. Yeah, it doesn't do a good job of hiding."
# The Lair of the Beast:19 ends here
# The Lair of the Beast:22 ends here
# Concerned level:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:20]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:23]]
@set beast/concerned_msg = "Its large, yellow eyes stare at you from a safe distance."
# The Lair of the Beast:20 ends here
# The Lair of the Beast:23 ends here
# Interested level:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:21]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:24]]
@set beast/interested_msg = "It seems [curious|interested] in what you are doing [here|]. ;; Its [|large,|big,] yellow eyes watch your every move."
# The Lair of the Beast:21 ends here
# The Lair of the Beast:24 ends here
# Friendly level:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:22]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:25]]
@set beast/friendly_msg = "It sits next to you, as its big, friendly eyes gaze as you. ;; It [leaps over|runs up|bounces up|] to you, wagging its tail-less behind. ;; It lays down next to you."
# The Lair of the Beast:22 ends here
# The Lair of the Beast:25 ends here
# When the beast is sleeping, we can some times spam the room with the snores:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:23]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:26]]
@set beast/sleeping_actions = "The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] lets loose a [big,|huge,|large,|tremendous,|] snore. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] growls in its sleep. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] twitches its [leg|legs|paw|nose]. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [shifts|rolls] on its [big,|huge,|large,|tremendous,|] mattress."
# The Lair of the Beast:23 ends here
# The Lair of the Beast:26 ends here
@ -585,54 +649,46 @@ lair
# The scared level doesnt last long, so lets just leave one message:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:24]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:27]]
@set beast/scared_actions = "A shadow hovers at the edge of the meadow.."
# The Lair of the Beast:24 ends here
# The Lair of the Beast:27 ends here
# And a detail if they look at it:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:25]]
@detail shadow = "You see a big, hairy beast with long teeth and claws. Its great horns, tipped in black, point to the sky."
# The Lair of the Beast:25 ends here
# Concerned actions:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:26]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:28]]
@set beast/concerned_actions = "The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [is|seems] concerned by your presence in the [meadow|field]. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] seems concerned. Maybe it's hungry.. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] seems concerned and keeps its distance.."
# The Lair of the Beast:26 ends here
# The Lair of the Beast:28 ends here
# Interested actions:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:27]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:29]]
@set beast/interested_actions = "The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] seems [curious|interested] in what you are doing [here|]. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] seems curious about you. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] stands on its hind legs. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [stares at|watches|follows] you with its [large,|big,|] yellow eyes."
# The Lair of the Beast:27 ends here
# The Lair of the Beast:29 ends here
# Friendly actions:
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:28]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:30]]
@set beast/friendly_actions = "The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] wagging its backend[,| as it seems] happy to see <you>. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] hoping to play with <you>. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] flops over in front of <you> wriggling [its back|] on the ground. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] next to you. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] chases butterflies around the [field|meadow|grass|flowers]."
# The Lair of the Beast:28 ends here
# The Lair of the Beast:30 ends here
# The ecstatic states are just a bit more than friendly.
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:29]]
# [[file:../../../Dropbox/org/projects/mud.org::*The Lair of the Beast][The Lair of the Beast:31]]
@set beast/ecstatic_actions = "The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] to give <you> a sloppy [kiss|lick]. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] wagging its backend as it seems [|very] excited to see <you>. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] hoping to play with <you>. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] flops over in front of <you> happily wriggling on the ground. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] excitedly [thunders|stomps|tramps|clomps|rumbles|rolls] [across the field|across the meadow|over] next to you. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] [happily|joyfully] leaps into air. ;; The [big,|huge,|large,|tremendous,|] [hairy|slobbery|horned|clawed|] [brute|beast|monster] chases butterflies around the [field|meadow|grass|flowers]."
# The Lair of the Beast:29 ends here
# The Lair of the Beast:31 ends here
# The dock leads out into the large pond. The break in the trees lets you see the sky. Looks like a nice place to relax.
@ -1030,7 +1086,9 @@ west
# Although we can interact with it, lets not make it obvious that it is an object:
# [[file:../../../Dropbox/org/projects/mud.org::*Knocker][Knocker:7]]
@lock ring = view:tag(hidden_ring, mp)
@set ring/hidden_tag = hidden_ring
#
@lock ring = view:tag(hidden_ring)
# Knocker:7 ends here
@ -1364,7 +1422,7 @@ py here.search("trolley").do_bake()
# [[file:../../../Dropbox/org/projects/mud.org::*Trolley of Scones][Trolley of Scones:4]]
@lock trolley = view:tag(hidden_ring, mp)
@lock trolley = view:tag(hidden_trolley)
# Trolley of Scones:4 ends here
@ -1443,3 +1501,12 @@ py here.search("trolley").do_bake()
#
@set chairs/extra = "This feels [|very|quite] [nice|cozy|comfortable].|n"
# Chairs:5 ends here
# And now that we are done, say it:
# [[file:../../../Dropbox/org/projects/mud.org::*Chairs][Chairs:6]]
say I have finished this, the first version, of my creation.
# Chairs:6 ends here