Gender all characters
And capitalize all messages, allowing lowercase objects, like door knocker.
This commit is contained in:
parent
6e75f9f23a
commit
5d830e03d9
3 changed files with 68 additions and 20 deletions
|
|
@ -16,6 +16,7 @@ own cmdsets by inheriting from them or directly from `evennia.CmdSet`.
|
||||||
|
|
||||||
from evennia import default_cmds
|
from evennia import default_cmds
|
||||||
from evennia.contrib.grid import extended_room
|
from evennia.contrib.grid import extended_room
|
||||||
|
from evennia.contrib.game_systems.gendersub import SetGender
|
||||||
from commands.sittables import CmdNoSitStand
|
from commands.sittables import CmdNoSitStand
|
||||||
from commands.take import CmdTake
|
from commands.take import CmdTake
|
||||||
|
|
||||||
|
|
@ -35,6 +36,7 @@ class CharacterCmdSet(default_cmds.CharacterCmdSet):
|
||||||
super().at_cmdset_creation()
|
super().at_cmdset_creation()
|
||||||
self.add(CmdNoSitStand)
|
self.add(CmdNoSitStand)
|
||||||
self.add(CmdTake())
|
self.add(CmdTake())
|
||||||
|
self.add(SetGender())
|
||||||
self.add(extended_room.ExtendedRoomCmdSet)
|
self.add(extended_room.ExtendedRoomCmdSet)
|
||||||
#
|
#
|
||||||
# any commands you add below will overload the default ones.
|
# any commands you add below will overload the default ones.
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ creation commands.
|
||||||
from re import match
|
from re import match
|
||||||
|
|
||||||
from evennia.objects.objects import DefaultCharacter
|
from evennia.objects.objects import DefaultCharacter
|
||||||
|
from evennia.contrib.game_systems.gendersub import GenderCharacter
|
||||||
from evennia.prototypes.spawner import spawn
|
from evennia.prototypes.spawner import spawn
|
||||||
from evennia.utils import delay, logger
|
from evennia.utils import delay, logger
|
||||||
|
|
||||||
|
|
@ -48,14 +49,13 @@ READ_LETTER = """You read a letter with an oddly familiar penmanship:
|
||||||
(Type 'help start' for details on playing this game)"""
|
(Type 'help start' for details on playing this game)"""
|
||||||
|
|
||||||
|
|
||||||
class Character(Object, DefaultCharacter):
|
class Character(Object, GenderCharacter):
|
||||||
"""
|
"""
|
||||||
The Character just re-implements some of the Object's methods and hooks
|
The Character just re-implements some of the Object's methods and hooks
|
||||||
to represent a Character entity in-game.
|
to represent a Character entity in-game.
|
||||||
|
|
||||||
See mygame/typeclasses/objects.py for a list of
|
See mygame/typeclasses/objects.py for a list of
|
||||||
properties and methods available on all Object child classes like this.
|
properties and methods available on all Object child classes like this.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def at_object_creation(self):
|
def at_object_creation(self):
|
||||||
"called when a character is first created."
|
"called when a character is first created."
|
||||||
|
|
@ -75,6 +75,17 @@ class Character(Object, DefaultCharacter):
|
||||||
self.msg(INTRO)
|
self.msg(INTRO)
|
||||||
self.account.db._last_puppet = self
|
self.account.db._last_puppet = self
|
||||||
|
|
||||||
|
def msg(self, text=None, from_obj=None, session=None, **kwargs):
|
||||||
|
"""
|
||||||
|
Capitalizes messages sent to the user.
|
||||||
|
This just looks better to me.
|
||||||
|
"""
|
||||||
|
if text and isinstance(text, tuple):
|
||||||
|
text = (text[0][0].upper() + text[0][1:], *text[1:])
|
||||||
|
else:
|
||||||
|
text = text[0].upper() + text[1:]
|
||||||
|
super().msg(text, from_obj=from_obj, session=session, **kwargs)
|
||||||
|
|
||||||
def create_letter(self):
|
def create_letter(self):
|
||||||
"create a welcome letter in a character's inventory"
|
"create a welcome letter in a character's inventory"
|
||||||
letter = spawn({
|
letter = spawn({
|
||||||
|
|
|
||||||
|
|
@ -12,74 +12,110 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# And a good description that I can rework:
|
# Note that we give him a male gender:
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:2]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:2]]
|
||||||
|
@gender male
|
||||||
|
# Character: Dabble:2 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# And a good description that I can rework:
|
||||||
|
|
||||||
|
|
||||||
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:3]]
|
||||||
@desc self = A small, hunched old man with a gray vandyke and an eye twinkle.
|
@desc self = A small, hunched old man with a gray vandyke and an eye twinkle.
|
||||||
|
|
||||||
Spectacles perched precariously on the end of his hooked nose, wobble with his head. A jaunty crimson cap contrasts with his dark brown cloak.
|
Spectacles perched precariously on the end of his hooked nose, wobble with his head. A jaunty crimson cap contrasts with his dark brown cloak.
|
||||||
# Character: Dabble:2 ends here
|
# Character: Dabble:3 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# And we create a couple of objects, like a cap:
|
# And we create a couple of objects, like a cap:
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:3]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:4]]
|
||||||
@create cap
|
@create cap
|
||||||
#
|
#
|
||||||
@desc cap = It's crimson. It's jaunty.
|
@desc cap = It's crimson. It's jaunty.
|
||||||
# Character: Dabble:3 ends here
|
# Character: Dabble:4 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# And my staff:
|
# And my staff:
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:4]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:5]]
|
||||||
@create gnarled staff;stick;staff: typeclasses.things.Stick
|
@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.
|
@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
|
# Character: Dabble:5 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# And his special teacup:
|
# And his special teacup:
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:5]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:6]]
|
||||||
@create teacup;cup : typeclasses.drinkables.TeaCup
|
@create teacup;cup : typeclasses.drinkables.TeaCup
|
||||||
#
|
#
|
||||||
@desc teacup = A rustic teacup crafted from clay etched with leaves and runes, with an olive green and brown glaze.
|
@desc teacup = A rustic teacup crafted from clay etched with leaves and runes, with an olive green and brown glaze.
|
||||||
# Character: Dabble:5 ends here
|
# Character: Dabble:6 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Let’s make him a wizard:
|
# Let’s make him a wizard:
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:6]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:7]]
|
||||||
@update self = typeclasses.characters.Wizard
|
@update self = typeclasses.characters.Wizard
|
||||||
# Character: Dabble:6 ends here
|
# Character: Dabble:7 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# And his spells:
|
# And his spells:
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:7]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:8]]
|
||||||
@set self/disappear_msg = "After a raspberry sound, the gnome, Dabbler, disappears in a wisp of smoke."
|
@set self/disappear_msg = "After a raspberry sound, the gnome, Dabbler, disappears in a wisp of smoke."
|
||||||
#
|
#
|
||||||
@set self/reappear_msg = "{{White ^ Light blue ^ Gray}} mist appears...along with the smell of sulphur... ;; When the smoke clears, an old gnome {{emerges ^ materializes ^ shows up, looking a bit confused}}."
|
@set self/reappear_msg = "{{White ^ Light blue ^ Gray}} mist appears...along with the smell of sulphur... ;; When the smoke clears, an old gnome {{emerges ^ materializes ^ shows up, looking a bit confused}}."
|
||||||
# Character: Dabble:7 ends here
|
# Character: Dabble:8 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# And help with the =fly= spell:
|
||||||
|
|
||||||
|
|
||||||
|
# [[file:../../../Dropbox/org/projects/mud.org::*Character: Dabble][Character: Dabble:9]]
|
||||||
|
# nick/object meadow = Frog Meadow
|
||||||
|
nick meadow = ^fly Frog Meadow
|
||||||
|
# Character: Dabble:9 ends here
|
||||||
|
|
||||||
|
|
||||||
|
# The pipe is little more than messages to the smoker and everyone else in the room.
|
||||||
|
|
||||||
|
|
||||||
|
# [[file:../../../Dropbox/org/projects/mud.org::*Pipe][Pipe:1]]
|
||||||
|
@create pipe: typeclasses.things.Pipe
|
||||||
|
# Pipe:1 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# And a desciption:
|
||||||
|
|
||||||
|
|
||||||
|
# [[file:../../../Dropbox/org/projects/mud.org::*Pipe][Pipe:2]]
|
||||||
|
@desc pipe = As tall as its owner with etchings of birds, leaves and magical symbols.
|
||||||
|
# Pipe:2 ends here
|
||||||
|
|
||||||
|
|
||||||
# Rename the Limbo (or starting place) with the name *Forest*. Note the term =mp01= as a global label that matches my map.
|
# Rename the Limbo (or starting place) with the name *Forest*. Note the term =mp01= as a global label that matches my map.
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*The Forest][The Forest:1]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*The Forest][The Forest:1]]
|
||||||
@name here = The Forest;mp01
|
@name here = Grove of the Matriarchs;mp01
|
||||||
# The Forest:1 ends here
|
# The Forest:1 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -204,7 +240,7 @@ Maybe, by sticky, we mean, wizardly-sticky...an absolutely amazing looking stick
|
||||||
|
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Boulder][Boulder:5]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Boulder][Boulder:5]]
|
||||||
@dig Top of Boulder;mp02 : typeclasses.rooms_weather.TimeWeatherRoom = boulder,climb
|
@dig Boulder Top;mp02 : typeclasses.rooms_weather.TimeWeatherRoom = boulder,climb
|
||||||
# Boulder:5 ends here
|
# Boulder:5 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -245,7 +281,6 @@ Wait! You notice a foot hold, and then another. You can |gclimb|n this boulder!
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Top of Boulder][Top of Boulder:1]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Top of Boulder][Top of Boulder:1]]
|
||||||
@teleport mp02
|
@teleport mp02
|
||||||
# @name here = Top of Boulder;mp02
|
|
||||||
# Top of Boulder:1 ends here
|
# Top of Boulder:1 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -261,7 +296,7 @@ Wait! You notice a foot hold, and then another. You can |gclimb|n this boulder!
|
||||||
# Describe the climb down:
|
# Describe the climb down:
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Top of Boulder][Top of Boulder:3]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Top of Boulder][Top of Boulder:3]]
|
||||||
@name climb = climb back down;climb down;climb;down
|
@name climb = climb down;climb;down
|
||||||
# Top of Boulder:3 ends here
|
# Top of Boulder:3 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -932,7 +967,7 @@ west
|
||||||
# And name it:
|
# And name it:
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:7]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Forest Path][Forest Path:7]]
|
||||||
@name here = Forest Path;mp04
|
@name here = Dabbler's Grove;mp04
|
||||||
# Forest Path:7 ends here
|
# Forest Path:7 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1075,7 +1110,7 @@ west
|
||||||
# If it /looks/ like a goblin…
|
# If it /looks/ like a goblin…
|
||||||
|
|
||||||
# [[file:../../../Dropbox/org/projects/mud.org::*Knocker][Knocker:2]]
|
# [[file:../../../Dropbox/org/projects/mud.org::*Knocker][Knocker:2]]
|
||||||
@name knocker = Door knocker;knocker;goblin
|
@name knocker = door knocker;knocker
|
||||||
# Knocker:2 ends here
|
# Knocker:2 ends here
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue