Move read command to character

Fixed a puppet pose of the reset.

Updated the introduction.
This commit is contained in:
Howard Abrams 2025-05-17 11:51:56 -07:00
parent 89d0e5cc7a
commit 4ab02c7bd5
8 changed files with 178 additions and 101 deletions

View file

@ -20,7 +20,7 @@ from evennia.contrib.game_systems.gendersub import SetGender
from evennia.contrib.rpg.rpsystem import RPSystemCmdSet
from evennia.contrib.rpg.character_creator.character_creator import ContribChargenCmdSet
from commands.sittables import CmdNoSitStand
from commands.everyone import CmdTake, CmdThink, CmdSay, CmdWhisper
from commands.everyone import CmdTake, CmdThink, CmdSay, CmdWhisper, CmdRead
from commands.wizards import CmdGM, CmdSpell, CmdGMTrigger, CmdMakeCocktail
class CharacterCmdSet(default_cmds.CharacterCmdSet):
@ -45,6 +45,7 @@ class CharacterCmdSet(default_cmds.CharacterCmdSet):
self.add(extended_room.ExtendedRoomCmdSet)
self.add(CmdSay)
self.add(CmdWhisper)
self.add(CmdRead)
self.add(CmdGM)
self.add(CmdSpell)
self.add(CmdGMTrigger)

View file

@ -240,6 +240,36 @@ class CmdThink(Command):
self.caller.execute_cmd(f"pub :{msg}")
class CmdRead(Command):
"""
Return the inside contents of a book or other readable object.
Usage:
read <target>
To add something to read on target, use the @set command:
@set <target>/inside = 'This is the text to read.'
"""
key = "read"
def func(self):
"""Return the 'inside' attribute."""
target_str = self.args.strip()
if target_str == "":
self.caller.msg("Usage: |gread <object>|n")
return
target = self.caller.search(target_str)
if target:
if target.db.inside:
self.caller.msg(target.db.inside)
else:
self.caller.msg(f"Nothing to read on {target.get_display_name(self.caller)}")
class CmdTake(Command, NumberedTargetCommand):
"""
Take an object from another character or NPC.

View file

@ -83,8 +83,6 @@ class Character(Object, GenderCharacter, ContribRPCharacter):
"""
Make sure we aren't left sitting down when logging out.
"""
self.execute_cmd("pose reset")
if self.db.is_sitting:
chair = self.db.is_sitting
chair.db.sitter = None

View file

@ -292,6 +292,7 @@ class Cocktail(Object):
else:
drinker.msg(choices(EMPTY_COCKTAIL_MSGS, cocktail_type))
self.key = "cocktail glass"
self.aliases = ['glass']
self.db.desc = "An empty cocktail glass"
self.db.amount = self.db.amount - self.sip_amount

View file

@ -28,6 +28,13 @@ class Puppet(Character):
self.msg("\nYou are puppeting |c{name}|n.".format(name=self.key))
self.msg((self.at_look(self.location), {"type": "look"}), options=None)
def at_pre_unpuppet(self, **kwargs):
"""
Reset our pose.
"""
super().at_pre_unpuppet()
self.execute_cmd("pose reset")
def at_post_unpuppet(self, account=None, session=None, **kwargs):
"""
Make the character object remain in the room.

View file

@ -1,15 +1,14 @@
#!/usr/bin/python
import random
from evennia import Command, CmdSet
from evennia.utils import logger
from evennia.prototypes.spawner import spawn
from typeclasses.objects import Object
from typeclasses.rooms import DabblersRoom
from utils.word_list import routput
import random
BOOK_EMOTIONS = [
"sad",
"heartfelt",
@ -67,6 +66,7 @@ BOOKS = {
"The Wyrm in the Willows": "small dragon from the countryside who learns to cook without burning the meal first",
}
class CmdLookBook(Command):
"""
Respond with a new book to look at.
@ -91,15 +91,6 @@ class CmdTakeBook(Command):
self.obj.do_take(self.caller)
class CmdReadBook(Command):
"""
Return the inside contents of the book.
"""
key = "read"
def func(self):
self.obj.do_read(self.caller)
class CmdBurnBook(Command):
"""
Destroy the instance of the book
@ -123,12 +114,11 @@ class CmdDropBook(Command):
class CmdSetRead(CmdSet):
def at_cmdset_creation(self):
self.add(CmdReadBook)
pass # self.add(CmdReadBook)
class CmdSetBook(CmdSet):
def at_cmdset_creation(self):
self.add(CmdReadBook)
self.add(CmdBurnBook)
self.add(CmdDropBook)
@ -149,15 +139,7 @@ class Readable(Object):
@desc sign = A tall wooden post.
@set sign/inside = "What happens when you read it."
"""
def at_object_creation(self):
"""
called at creation
"""
self.cmdset.add_default(CmdSetRead)
def do_read(self, reader):
"called when 'read'."
reader.msg(self.db.inside)
pass
class Letter(Readable):

View file

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>RPG for the Moss and Puddles Mud</title>
<meta name="generator" content="Org Mode" />
<style>
<style type="text/css">
#content { max-width: 60em; margin: auto; }
.title { text-align: center;
margin-bottom: .2em; }
@ -191,10 +191,10 @@
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { }
</style>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Literata:ital,wght@0,300;0,600;1,300;1,600&amp;display=swap" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Overpass:ital,wght@0,300;0,600;1,300;1,600&amp;display=swap" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&amp;display=swap" /><style>body { font-family: 'Literata', sans-serif; color: #333; }
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Literata:ital,wght@0,300;0,600;1,300;1,600&amp;display=swap" /><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css2?family=Overpass:ital,wght@0,300;0,600;1,300;1,600&amp;display=swap" /><style>body { font-family: 'Literata', sans-serif; color: #333; }
h1,h2,h3,h4,h5 { font-family: 'Overpass', sans-serif; color: #333; }
code { font-family: 'Source Code Pro'; color: steelblue }
pre { font-family: 'Source Code Pro'; background-color: #eee; border-color: #aaa; }
code { color: steelblue }
pre { background-color: #eee; border-color: #aaa; }
a { text-decoration-style: dotted }
@media (prefers-color-scheme: dark) {
body { background-color: #1d1f21; color: white; }
@ -207,9 +207,9 @@ a { text-decoration-style: dotted }
</head>
<body>
<div id="content" class="content">
<div id="outline-container-org41c2d92" class="outline-2">
<h2 id="org41c2d92">An Invitation to My New Game</h2>
<div class="outline-text-2" id="text-org41c2d92">
<div id="outline-container-orgdbe180d" class="outline-2">
<h2 id="orgdbe180d">An Invitation to My New Game</h2>
<div class="outline-text-2" id="text-orgdbe180d">
<blockquote>
<p>
“Great party, Shane,” you say as you grab your coat, “by the way, how did you meet the little person, and while we talked for some time, I cant remember his name.”
@ -229,16 +229,76 @@ Even the description he gave you to get to this bar sounded wild. From the Glads
</blockquote>
<p>
Sorry, I guess Im still in <i>memoir-writing-mode</i>, but I have an idea for a casual, <i>role-play heavy</i> RPG for us I call, <b>Sitting on Moss and Jumping in Puddles</b> where we play as either Fey denizens of this <i>Otherworld</i> or more normal fantasy characters, who tripped and landed in the middle of a <i>faery circle</i>, and now finds themselves outside time, caught at a tavern in a Feywild™ domain. Since I sent you this (or some brilliant person forwarded it to you), this might interest you.
Sorry, I guess Im still in <i>memoir-writing-mode</i> after my six-week sabbatical, but I have an idea for a casual, <i>role-play heavy</i> RPG for us I call, <b>Sitting on Moss and Jumping in Puddles</b> where we play as either Fey denizens of this <i>Otherworld</i> or more normal fantasy characters, who tripped and landed in the middle of a <i>faery circle</i>, and now finds themselves outside time, caught at a tavern in a Feywild™ domain. Since I sent you this (or some brilliant person forwarded it to you), this might interest you.
</p>
<p>
Keep in mind that my idea is <i>different</i>.
Keep in mind that my idea is <i>different</i> and may not be for everyone. So no offense if you ignore this.
</p>
<p>
The <i>goal</i> (at least, at the beginning) of this game is “just role play”, or maybe I should say, “not funny improv”? I mean, you make your character <i>interesting</i> and <i>entertaining</i> to everyone and do a “yes, and” to the characters other players puppet.
Perhaps think of it as an extended Session Zero. After a bit (if we find it fun), I will start to add exploration, puzzles, and maybe combat.
The <i>goal</i> (at least, at the beginning) of these game sessions is “just role play”, or maybe I should say, “not funny improv”? I mean, you make your character <i>interesting</i> and <i>entertaining</i> to everyone and do a “yes, and” to the characters other players puppet.
</p>
<p>
This works like a <i>chat channel</i>, so no audio/video for the online games. Looks a bit like:
</p>
<blockquote>
<p>
The pixies atop the giant, red-capped mushroom begin another tune.
</p>
<p>
White mist appears&#x2026;along with the smell of sulphur&#x2026; When the smoke clears, an old gnome materializes.
</p>
<p>
The old gnome happily asks you, &ldquo;Ah, a wanderer from the Mud World, I see. You look familiar, old chap, have we met before?&rdquo;
</p>
<p>
&gt;&gt; <code>say Gosh, I dunno, Mister, I don't ... Why are you so small?</code> <br />
You ask, &ldquo;Gosh, I dunno, Mister, I don&rsquo;t &#x2026; Why are you so small?&rdquo;
</p>
<p>
The old gnome indignantly asks, &ldquo;Judge me by my stature, will you?&rdquo;
</p>
<p>
&gt;&gt; <code>say I didn't mean no offense!</code> <br />
You exclaim, &ldquo;I didn&rsquo;t mean no offense!&rdquo;
</p>
<p>
The old gnome slams his staff against the floor. The room goes completely dark.
</p>
<p>
The music stops abruptly.
</p>
<p>
In the darkness, you see a pair of large red eyes, and a low gutteral growl.
</p>
<p>
The old gnome whispers to you, &ldquo;No offense taken, mah boy.&rdquo;
</p>
<p>
The glowing orbs along the branches of this room relight and the music, starts again.
</p>
<p>
&gt;&gt; <code>say/carefully Nice to meet yer acquaintance, sir.</code> <br />
You carefully say, "Nice to meet yer acquaintance, sir.”
</p>
</blockquote>
<p>
Essentially we each type commands that add to <i>story</i> that emerges in this chat channel.
</p>
<p>
@ -250,33 +310,42 @@ The game is <i>ultra casual</i>, so you can drop in (and leave) any time you wis
</p>
<p>
Does this sound fun? If so, start thinking of an interesting character you can use to entertain us all. You can log in any time you want to get a feel for the interface, and create a character (and you can create more than one character, so dont fear commitment). The portal to the Bar, however, will be open from 7 to 9pm PST on Monday (once you are in the bar, you can stay as long as you want).
Does this sound fun? If so, start thinking of an interesting character you can use to entertain us all. You can log in any time you want to get a feel for the interface, and create a character (and you can create more than one character, so dont fear commitment). You can change anything about your character (so again, dont fear commitment).
</p>
<p>
While I am still planning on a bi-weekly game at my place, well play this game online weekly on either Monday or Tuesday evenings. I am basing the underlying rules on <i>Knave</i> (an overly simple OSR RPG), but the <i>interface</i> that Ive created will gloss over that, so nothing really to learn there.
After logging in, you can wander around the Land of Wyldwood, but the portal to the Bar (where we will all gather for the “adventure”), opens from 7 to 9pm PST on Tuesdays (once you are in the bar, you can stay as long as you want).
</p>
<p>
Let me clarify my choice of using the word “adventure” in the previous paragraph. As a GM, I will be bringing interesting NPCs and events to this “Bar,” that you, as a character, can “interact,” but my vision focuses on the players characters. Perhaps you can think of the first few sesssions, as an extended Session Zero. After a bit (if we find it fun), I will start to add exploration, puzzles, and maybe combat. If you have questions about this, reach out.
</p>
<p>
While I am still planning on a bi-weekly game at my place, well play this game online weekly on Tuesday evenings starting on Tuesday the 27th of May.
</p>
<p>
I am basing the underlying rules on <i>Knave</i> (an overly simple OSR RPG), but the <i>interface</i> that Ive created will gloss over that, so nothing really to learn there.
The interface Ive programmed has an online help system and a tutorial to walk you through how to play, but what follows is a one page summary of how to use this game interface:
</p>
<p>
First, log in via <a href="https://www.howardabrams.com/cozy">https://www.howardabrams.com/cozy</a> and click the <b>Enter</b> button (if you would rather not use a web browser, you can install any MUD application, and connect to <code>howardabrams.com</code> and port <code>4000</code>). Next, create an account by typing:
First, log in via <a href="https://www.howardabrams.com/cozy">https://www.howardabrams.com/cozy</a> and click the <b>Enter</b> button (if you would rather not use a web browser, you can install any MUD application, and connect to <code>howardabrams.com</code> at port <code>4000</code>). Next, create an account by typing:
</p>
<pre class="example" id="org5bf0a83">
<pre class="example" id="org9b8e573">
create username password
</pre>
<p>
And just use your name for the <code>username</code> and swap out a more interesting password. You will then log into the system each time, by typing:
</p>
<pre class="example" id="org8d5fd84">
<pre class="example" id="org777f7b9">
connect username password
</pre>
<p>
The first time you log in, you enter the character creator, a text-base wizard interface, where you can type <code>back</code> and <code>next</code> to answer prompts answering questions about your character. You will need to know the following:
The first time you log in, you enter the character creator, a text-base wizard interface, where you can type <code>back</code> and <code>next</code> to answer prompts answering questions about your character. You will need to answer the following:
</p>
<ol class="org-ol">
@ -288,13 +357,16 @@ The first time you log in, you enter the character creator, a text-base wizard i
</ol>
<p>
Thats it for making a character. To play, you basically type commands. Again, the game has a tutorial for new characters to walk you through this process, but the key ones we will use for <i>role playing</i> include:
Thats it for making a character. I mentioned this before, but Ill say it again, during the game, you can change everything about your character, so if you arent sure, start with anything.
</p>
<p>
To play, you basically type commands. Again, the game has a tutorial for new characters to walk you through this process, but the key ones we will use for <i>role playing</i> include:
</p>
</div>
<div id="outline-container-orgdff94b7" class="outline-3">
<h3 id="orgdff94b7">say</h3>
<div class="outline-text-3" id="text-orgdff94b7">
<div id="outline-container-org2a3ed0d" class="outline-3">
<h3 id="org2a3ed0d">say</h3>
<div class="outline-text-3" id="text-org2a3ed0d">
<p>
Type <code>say</code> and a phrase to say something so that everyone in the area can hear that. Because we use this command so much, and we want to make the text to read more interesting, it has a number of <i>aliases</i>, including:
</p>
@ -303,32 +375,32 @@ Type <code>say</code> and a phrase to say something so that everyone in the area
<li><p>
<code>ask</code>, so that it may read:
</p>
<pre class="example" id="org2012abd">
<pre class="example" id="org3cd8f83">
Beardless dwarf asks, “How are you?”
</pre></li>
<li><p>
<code>reply</code>, so it may read:
</p>
<pre class="example" id="org06e45eb">
<pre class="example" id="org0f2bfee">
Tall, blond elf replies, “Well, and you?”
</pre></li>
<li><code>respond</code>, <code>yell</code>, and <code>scream</code>, are similar.</li>
<li><p>
<code>"</code> and <code>'</code> are shortcuts allowing you to type: <code>"Greetings</code> to have it read:
</p>
<pre class="example" id="org2774d8a">
<pre class="example" id="org92b66e4">
Beardless dwarfless says, “Greetings”
</pre></li>
</ul>
</div>
</div>
<div id="outline-container-orgbfccaed" class="outline-3">
<h3 id="orgbfccaed">whisper</h3>
<div class="outline-text-3" id="text-orgbfccaed">
<div id="outline-container-org8345e42" class="outline-3">
<h3 id="org8345e42">whisper</h3>
<div class="outline-text-3" id="text-org8345e42">
<p>
Allows you to say someone to a character that no one else will hear. So typing:
</p>
<pre class="example" id="org9eabec0">
<pre class="example" id="orgdb358bc">
whisper gnome = Hey there, wake up!
</pre>
@ -337,32 +409,32 @@ Will only send the message to the character matching the short description, <i>g
</p>
</div>
</div>
<div id="outline-container-org778a2f4" class="outline-3">
<h3 id="org778a2f4">emote</h3>
<div class="outline-text-3" id="text-org778a2f4">
<div id="outline-container-org0d10ffc" class="outline-3">
<h3 id="org0d10ffc">emote</h3>
<div class="outline-text-3" id="text-org0d10ffc">
<p>
This command allows you to state anything else, you want. Essentially turning the chat channel into a bit of a novel. For instance:
</p>
<pre class="example" id="org8ea7de1">
<pre class="example" id="orgda363a1">
emote grins
</pre>
<p>
Will simply show:
</p>
<pre class="example" id="org91ff10d">
<pre class="example" id="org7ab296f">
Beardless dwarf grins
</pre>
<p>
However, entering:
</p>
<pre class="example" id="org02b3982">
<pre class="example" id="org9406ec3">
From the corner of the room, /me walks over to /elf.
</pre>
<p>
Would read:
</p>
<pre class="example" id="org56690b3">
<pre class="example" id="org09af75b">
From the corner of the room, beardless dwarf walks over to tall, blonde elf.
</pre>
@ -375,19 +447,19 @@ Why use the <code>/me</code> and <code>/elf</code>? See the next command…
</p>
</div>
</div>
<div id="outline-container-org3ff2dc8" class="outline-3">
<h3 id="org3ff2dc8">recog</h3>
<div class="outline-text-3" id="text-org3ff2dc8">
<div id="outline-container-org48c9424" class="outline-3">
<h3 id="org48c9424">recog</h3>
<div class="outline-text-3" id="text-org48c9424">
<p>
This command allows you to sort-of rename someone. For instance, if you knew the elfs name was Shasta, you could type
</p>
<pre class="example" id="orga8fee0c">
<pre class="example" id="orgfc61a76">
recog elf = Shasta
</pre>
<p>
and now the previous example would read:
</p>
<pre class="example" id="org36622fc">
<pre class="example" id="org25a6d2a">
From the corner of the room, beardless dwarf walks over to Shasta.
</pre>
<p>
@ -395,10 +467,9 @@ But this would be a label for a character <i>only for you</i>. Others may have t
</p>
</div>
</div>
<div id="outline-container-org8c0ee69" class="outline-3">
<h3 id="org8c0ee69">pub</h3>
<div class="outline-text-3" id="text-org8c0ee69">
<div id="outline-container-orgdcfe772" class="outline-3">
<h3 id="orgdcfe772">pub</h3>
<div class="outline-text-3" id="text-orgdcfe772">
<p>
Use this command to send a message to the <i>out-of-character public channel</i>. All logged in users receive these OOC messages, prefixed by your <i>username</i>, not your <i>character</i>.
</p>
@ -406,14 +477,14 @@ Use this command to send a message to the <i>out-of-character public channel</i>
<p>
Typing something like:
</p>
<pre class="example" id="org24cfb19">
<pre class="example" id="orgcb17b5b">
pub Is anyone here yet?
</pre>
<p>
Might show a transcript like:
</p>
<pre class="example" id="org6b21062">
<pre class="example" id="orga000a03">
[Public] howard: Is anyone here yet?
[Public] rick: Yeah. I just got here.
</pre>
@ -427,15 +498,14 @@ I have more commands for getting and drinking Fey cocktails, and exhibiting thei
</p>
</div>
</div>
<div id="outline-container-org2cf26c2" class="outline-3">
<h3 id="org2cf26c2">page (or tell)</h3>
<div class="outline-text-3" id="text-org2cf26c2">
<div id="outline-container-org1dc786d" class="outline-3">
<h3 id="org1dc786d">page (or tell)</h3>
<div class="outline-text-3" id="text-org1dc786d">
<p>
Like the <code>pub</code> command above, this allows you to talk to another player directly. I expect we will use this primarily for talking to the GM during the game session. For instance:
</p>
<pre class="example" id="org6a7069f">
<pre class="example" id="org867be50">
tell howard I am here.
</pre>
@ -443,7 +513,7 @@ tell howard I am here.
And you might see:
</p>
<pre class="example" id="org924cef4">
<pre class="example" id="orgdc9cde1">
You paged howard with: 'I am here.'.
Account howard pages: Great.
</pre>

View file

@ -94,6 +94,8 @@ You also notice a glowing orb... and then another, and another. The field, fille
# Closing the Portal:1 ends here
# [[file:../../../projects/mud-rpg.org::*Closing the Portal][Closing the Portal:2]]
@teleport Frog Meadow
#
@roomstate portal_open
# Closing the Portal:2 ends here
@ -159,7 +161,7 @@ py bt = self.search('Bartender'); bt.db.gender = 'male'; bt.db._sdesc = 'blonde
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:1]]
@create/drop shrub;bush;awakened shrub: typeclasses.puppets.Puppet
@create/drop shrub;bush;chalkboard;awakened shrub: typeclasses.puppets.Puppet
# Awakened Shrub:1 ends here
@ -169,6 +171,8 @@ py bt = self.search('Bartender'); bt.db.gender = 'male'; bt.db._sdesc = 'blonde
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:2]]
@desc shrub = If a small shrub had the facial muscles to smile and show how much it enjoys itself, this lil' guy would be it. The short leaves indicates it once was a boxwood, but the way it nurses that glass of water shows those days are way behind. When you look its way, it waves a branch at you.
You notice one of its branches clutch a small chalkboard while another holds a piece of chalk.
# Awakened Shrub:2 ends here
@ -194,31 +198,13 @@ py bt = self.search('shrub'); bt.db.gender = 'neutral'; bt.db._sdesc = 'shrub';
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:7]]
@create chalkboard : typeclasses.readables.Readable
@set shrub/inside = "Hello, My name is Shrub McShrubberson. What's yours?"
# Awakened Shrub:7 ends here
# And write something on it.
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:8]]
@set chalkboard/inside = "Hello, My name is Shrub McShrubberson"
# Awakened Shrub:8 ends here
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:9]]
@desc chalkboard = A small chalkboard with a wood frame.
@desc chalkboard = The shrub is holding a small chalkboard with a wood frame.
# Awakened Shrub:9 ends here
# And give it to the bush baby:
# [[file:../../../projects/mud-rpg.org::*Awakened Shrub][Awakened Shrub:10]]
give chalkboard to shrub
# Awakened Shrub:10 ends here
# Cocktails
# Lets create a sign for the list of cocktails:
@ -240,6 +226,7 @@ give chalkboard to shrub
# Might as well allow the user to read it:
# [[file:../../../projects/mud-rpg.org::*Cocktails][Cocktails:3]]
@set sign/inside = |wCocktails|n
- Moonlit Mirage
@ -277,6 +264,7 @@ give chalkboard to shrub
# The preps come in three forms with how detailed we want to spam the room.
# [[file:../../../projects/mud-rpg.org::*Cocktails][Cocktails:6]]
@set bartender/triggers:session1 = {
"prep1": {