More bug fixes

This commit is contained in:
Howard Abrams 2026-04-23 20:53:15 -07:00
parent 9722db5c45
commit e4afca559b
7 changed files with 131 additions and 25 deletions

View file

@ -305,6 +305,10 @@ class CmdSay(Command):
"""
# Speak to everyone in the room:
if not target:
# Not sure how this is possible:
if not speaker or not speaker.location or not speaker.location.contents:
return
for char in speaker.location.contents:
if hasattr(char, 'other_say') and callable(char.other_say):
logger.info(f"to_puppets: all: {char}")

View file

@ -405,6 +405,9 @@ class LaughterSpell(Spell):
self.send_random_message()
def send_random_message(self):
if not self.obj:
return
self.obj.announce_action(
choice([
"$You() $conj(erupt) into laughter, a deep, rolling sound that fills the room and makes everyone turn to see whats so funny.",

View file

@ -10,6 +10,7 @@ from evennia.prototypes.spawner import spawn
from commands.consumables import CmdSetTrolley, CmdSetMakeConsumable
from typeclasses.exits import Opener
from typeclasses.objects import Object
from utils.scoring import Scores
from utils.word_list import routput # , choices
@ -60,6 +61,11 @@ class Consumable(Litterable):
msg = "You take a bite."
eater.msg(routput(msg))
if self.key == 'candy':
eater.score(Scores.eat_candy)
eater.announce_action("$You() $conj(eat) some candy.",
exclude=eater)
if self.db.amount <= 0:
if self.db.finish_msgs:
msg = random.choice(self.db.finish_msgs)

View file

@ -558,12 +558,10 @@ class WeeBeastie(Friendly, Familiar, Listener, AI):
msg = f"{noun} {how_sniff} sniffs $your() << hand holding a ^>> {edible}. It {how_eat} eats it, and {and_then}."
self.adjust_character(feeder, 100)
edible.delete()
feeder.announce_action(msg)
else:
msg = f"{noun} doesn't appear interested in anything you have."
if msg:
feeder.announce_action(msg)
feeder.msg(msg)
class BHB(Friendly):

View file

@ -347,10 +347,11 @@ class Boat(Script):
"colossal trees on the horizon.", 1)
self.send_to(boat, "In the shadows of the trees sits a dock.", 2)
if num_dockers == 0:
# Since we can assume that raven is always perched on tree
# near the dock, we will always have one too many figures:
if num_dockers < 2:
msg = "You can make out an inviting chair perched on the dock."
elif num_dockers == 1:
elif num_dockers == 2:
msg = "You can see a figure on the dock."
else:
msg = f"You can see {int2str(num_dockers)} figures standing on the dock."

View file

@ -5,18 +5,29 @@ set timeout 30
# Open the log file
log_file results.txt
# Rename the original 'send' to 'real_send'
rename send real_send
# Define a new 'send' procedure
proc send {args} {
puts -nonewline ">> "
flush stdout
# 'uplevel' ensures it executes in the right context
uplevel 1 real_send $args
}
proc expectit {pattern} {
expect {
$pattern {
return
}
timeout {
puts "Error: Expected response '$pattern' not received."
puts "ERROR: Expected response '$pattern' not received."
send "quit\n"
exit 1
}
eof {
puts "Error: Connection closed unexpectedly."
puts "ERROR: Connection closed unexpectedly."
send "quit\n"
exit 1
}
@ -128,7 +139,7 @@ expect {
set phase "night"
}
timeout {
puts "Error: Expected time response not received."
puts "ERROR: Expected time response not received."
send "quit\n"
exit 1
}
@ -151,7 +162,7 @@ switch $phase {
expect "night sky"
}
default {
puts "Error: Unexpected phase value '$phase'."
puts "ERROR: Unexpected phase value '$phase'."
send "quit\n"
exit 1
}
@ -191,7 +202,7 @@ expect {
expect "You drop a stick."
}
timeout {
puts "Error: Expected response for 'get stick' not received."
puts "ERROR: Expected response for 'get stick' not received."
send "quit\n"
exit 1
}
@ -406,14 +417,13 @@ expect {
}
timeout {
if {$phase == "night"} {
puts "The beast is in bed now."
puts "NOTE: The beast is in bed now."
} else {
puts "Where is the beast? It is $phase?"
puts "NOTE: Where is the beast? It is $phase?"
}
}
}
puts "Where the hell are we?"
send "east\n"
expectit "Glittering Glade"
@ -438,6 +448,43 @@ sleep 1
send "blue door\n"
expectit "Wyldwood Bar"
send "read sign\n"
expectit "Cocktails"
send "get sign\n"
expectit "impossible to remove"
send "say to bartender Good day, sir. May I have a Sylvan Serenade, please?\n"
expectit "Sylvan Serenade"
send "drink\n"
expectit "You"
send "drink\n"
expectit "You"
send "drink\n"
expectit "You"
send "drink\n"
expectit "You"
send "drink\n"
expectit "You have nothing to drink"
send "say Thank you, sir\n"
expectit "Thank you"
send "get candy\n"
expectit "You grab a candy"
send "eat candy\n"
expectit "\n"
# Let's keep a candy to feed the wee beastie
send "get candy\n"
expectit "You grab a candy"
# Until we write tests for the bar...
send "leave\n"
expectit "Glittering Glade"
@ -489,7 +536,7 @@ send "hut\n"
expectit "The door, and its landing, are still too high and out of reach"
# Let's wait to make sure that the hut eventually breaks free ...
puts "Waiting for the hut to break free of its bonds..."
puts "NOTE: Waiting for the hut to break free of its bonds..."
set timeout 90
expectit "The hut, straining against its bounds, finally breaks free"
set timeout 30
@ -830,6 +877,9 @@ expectit "You are in a cozy and casual place"
send "pet beastie\n"
expectit "beastie"
send "feed beastie\n"
expectit "candy"
send "feed beastie\n"
expectit "beastie doesn't appear interested in anything you have."
@ -846,6 +896,10 @@ send "eat scone\n"
# Too much variableness here.
# expectit "You"
# Get another scone for the road ... and to feed the beast.
send "get scone\n"
expect -re "You get.*scone"
send "make green\n"
expectit "You make a teapot"
@ -964,7 +1018,7 @@ expect -re "Imp"
# We left our tester in the Secret room, so ...
send "leave\n"
expectit "Cozy House"
expect "Cozy House"
send "look up stairs\n"
expectit "Ornate black irons banister outline the thick wood planks that form steps leading to some lofty alcove."
@ -1018,7 +1072,7 @@ expectit "A curious figure wearing dark robes and a gleaming white skull of a ma
send "look ears\n"
expectit "They look real, and twitch as if alive."
puts "Waiting to get a pipe as a gift."
puts "NOTE: Waiting to get a pipe as a gift."
set timeout 240
expectit "gives you a pipe"
set timeout 20
@ -1058,6 +1112,9 @@ expectit "Grove of the Matriarchs"
send "east\n"
expectit "Frog Meadow"
send "feed beast\n"
expectit "scone"
send "look tickleweed\n"
expectit "Patches of this vivid grass vibrates as if giggling."
@ -1124,7 +1181,7 @@ send "leave\n"
expectit "Grotto"
send "fill bottle\n"
expectit "fresh spring water"
expectit "still water"
send "east\n"
expectit "Grove"
@ -1138,8 +1195,8 @@ expectit "Lair"
send "look mushrooms\n"
expectit "Slender blue tendrils"
send "get mushrooms\n"
expectit "sack of mushrooms"
send "get mushroom\n"
expectit "dreamshade mushroom"
send "leave\n"
expectit "Frog Meadow"
@ -1148,7 +1205,7 @@ send "south\n"
expectit "Mellow Marsh"
send "get glitter\n"
expectit "sack of pixie dust"
expectit "wad of pixie dust"
send "north\n"
expectit "Frog Meadow"
@ -1159,6 +1216,7 @@ expectit "Grove"
send "south\n"
expectit "Lazy Dock"
set timeout 120
send "blow horn\n"
# expectit "You blow your horn"
expectit "The giant leaf slows as it arrives next to the dock."
@ -1169,7 +1227,7 @@ expectit "The giant leaf gently bobs in the surf of this island, allowing you to
send "disembark\n"
expectit "Lonely Island"
send "pick moonberry\n"
send "get moonberry\n"
expectit "You collect a handful of moonberries"
# While we are here, we should solve the puzzle...but...
@ -1178,6 +1236,7 @@ expectit "The giant leaf slows as it arrives and docks allowing you to disembark
send "disembark\n"
expectit "Lazy Dock"
set timeout 30
send "north\n"
expectit "Grove"

View file

@ -1270,17 +1270,36 @@ py me.search("squirrel").backstory("squirrel")
# And all the RP system stuff:
# [[file:../../../projects/mud.org::*Bartender][Bartender:3]]
@set bartender/gender = "male"
# Bartender:3 ends here
# As well as the automation:
# [[file:../../../projects/mud.org::*Bartender][Bartender:8]]
# [[file:../../../projects/mud.org::*Bartender][Bartender:9]]
py me.search("bartender").backstory("tavern")
# Bartender:8 ends here
# Bartender:9 ends here
# [[file:../../../projects/mud.org::*Automated Responses][Automated Responses:2]]
@set bartender/arrive = "4 ;; say Welcome to the |wWyldwood Bar|n. Read the sign for a list of our cocktails, and let me know what you'd like to drink."
# Automated Responses:2 ends here
# Lets convert the Bartender to a Chatbot using [[file:~/src/moss-n-puddles/personalities/tavern.md][tavern.md]]. This way, talking to the Bartender *answers* from everyone.
# [[file:../../../projects/mud.org::*Puppeting][Puppeting:1]]
@set bartender/personality = "tavern"
#
@set bartender/personality_file = "personalities/tavern.md"
# Puppeting:1 ends here
# Need a channel to chat about the game:
@ -2090,6 +2109,22 @@ py timed_script = evennia.create_script(key="Create Horns",
@py bt = self.search('old lady'); bt.sdesc.add('old lady'); bt.db.pose = 'playing with a deck of cards'
# Trampoli the Witch:3 ends here
# Lets set this Chatbot to use [[file:~/src/moss-n-puddles/personalities/witch.md][witch.md]].
# [[file:../../../projects/mud.org::*Trampoli the Witch][Trampoli the Witch:4]]
@set bartender/personality = "witch"
#
@set bartender/personality_file = "personalities/witch.md"
# Trampoli the Witch:4 ends here
# And some poses:
# [[file:../../../projects/mud.org::*Trampoli the Witch][Trampoli the Witch:5]]
@set old lady/pose_sleep = "napping soundly in bed on the upstairs loft"
#