mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 18:47:16 +01:00
contrib/chargen.py code cleaning, update markup
Also remove commented code and redundant code
This commit is contained in:
parent
b1be4ade62
commit
9b391fbe6b
1 changed files with 9 additions and 10 deletions
|
|
@ -37,6 +37,7 @@ from evennia import default_cmds, managers
|
|||
|
||||
CHARACTER_TYPECLASS = settings.BASE_CHARACTER_TYPECLASS
|
||||
|
||||
|
||||
class CmdOOCLook(default_cmds.CmdLook):
|
||||
"""
|
||||
ooc look
|
||||
|
|
@ -96,7 +97,6 @@ class CmdOOCLook(default_cmds.CmdLook):
|
|||
return
|
||||
|
||||
# not inspecting a character. Show the OOC info.
|
||||
charobjs = []
|
||||
charnames = []
|
||||
if self.caller.db._character_dbrefs:
|
||||
dbrefs = self.caller.db._character_dbrefs
|
||||
|
|
@ -104,18 +104,18 @@ class CmdOOCLook(default_cmds.CmdLook):
|
|||
charnames = [charobj.key for charobj in charobjs if charobj]
|
||||
if charnames:
|
||||
charlist = "The following Character(s) are available:\n\n"
|
||||
charlist += "\n\r".join(["{w %s{n" % charname for charname in charnames])
|
||||
charlist += "\n\n Use {w@ic <character name>{n to switch to that Character."
|
||||
charlist += "\n\r".join(["|w %s|n" % charname for charname in charnames])
|
||||
charlist += "\n\n Use |w@ic <character name>|n to switch to that Character."
|
||||
else:
|
||||
charlist = "You have no Characters."
|
||||
string = \
|
||||
""" You, %s, are an {wOOC ghost{n without form. The world is hidden
|
||||
""" You, %s, are an |wOOC ghost|n without form. The world is hidden
|
||||
from you and besides chatting on channels your options are limited.
|
||||
You need to have a Character in order to interact with the world.
|
||||
|
||||
%s
|
||||
|
||||
Use {wcreate <name>{n to create a new character and {whelp{n for a
|
||||
Use |wcreate <name>|n to create a new character and |whelp|n for a
|
||||
list of available commands.""" % (self.caller.key, charlist)
|
||||
self.caller.msg(string)
|
||||
|
||||
|
|
@ -160,13 +160,13 @@ class CmdOOCCharacterCreate(Command):
|
|||
charname = self.args.strip()
|
||||
old_char = managers.objects.get_objs_with_key_and_typeclass(charname, CHARACTER_TYPECLASS)
|
||||
if old_char:
|
||||
self.caller.msg("Character {c%s{n already exists." % charname)
|
||||
self.caller.msg("Character |c%s|n already exists." % charname)
|
||||
return
|
||||
# create the character
|
||||
|
||||
new_character = create_object(CHARACTER_TYPECLASS, key=charname)
|
||||
if not new_character:
|
||||
self.caller.msg("{rThe Character couldn't be created. This is a bug. Please contact an admin.")
|
||||
self.caller.msg("|rThe Character couldn't be created. This is a bug. Please contact an admin.")
|
||||
return
|
||||
# make sure to lock the character to only be puppeted by this player
|
||||
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Immortals) or pperm(Immortals)" %
|
||||
|
|
@ -179,7 +179,7 @@ class CmdOOCCharacterCreate(Command):
|
|||
else:
|
||||
avail_chars = [new_character.id]
|
||||
self.caller.db._character_dbrefs = avail_chars
|
||||
self.caller.msg("{gThe Character {c%s{g was successfully created!" % charname)
|
||||
self.caller.msg("|gThe Character |c%s|g was successfully created!" % charname)
|
||||
|
||||
|
||||
class OOCCmdSetCharGen(default_cmds.PlayerCmdSet):
|
||||
|
|
@ -187,7 +187,6 @@ class OOCCmdSetCharGen(default_cmds.PlayerCmdSet):
|
|||
Extends the default OOC cmdset.
|
||||
"""
|
||||
def at_cmdset_creation(self):
|
||||
"Install everything from the default set, then overload"
|
||||
#super(OOCCmdSetCharGen, self).at_cmdset_creation()
|
||||
"""Install everything from the default set, then overload"""
|
||||
self.add(CmdOOCLook())
|
||||
self.add(CmdOOCCharacterCreate())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue