63 lines
2.3 KiB
Python
63 lines
2.3 KiB
Python
"""
|
|
Characters
|
|
|
|
Characters are (by default) Objects setup to be puppeted by Accounts.
|
|
They are what you "see" in game. The Character class in this module
|
|
is setup to be the "default" character type created by the default
|
|
creation commands.
|
|
|
|
"""
|
|
from evennia import DefaultCharacter
|
|
from evennia.utils.evmenu import EvMenu
|
|
|
|
|
|
class Character(DefaultCharacter):
|
|
"""
|
|
The Character defaults to reimplementing some of base Object's hook methods with the
|
|
following functionality:
|
|
|
|
at_basetype_setup - always assigns the DefaultCmdSet to this object type
|
|
(important!)sets locks so character cannot be picked up
|
|
and its commands only be called by itself, not anyone else.
|
|
(to change things, use at_object_creation() instead).
|
|
at_after_move(source_location) - Launches the "look" command after every move.
|
|
at_post_unpuppet(account) - when Account disconnects from the Character, we
|
|
store the current location in the pre_logout_location Attribute and
|
|
move it to a None-location so the "unpuppeted" character
|
|
object does not need to stay on grid. Echoes "Account has disconnected"
|
|
to the room.
|
|
at_pre_puppet - Just before Account re-connects, retrieves the character's
|
|
pre_logout_location Attribute and move it back on the grid.
|
|
at_post_puppet - Echoes "AccountName has entered the game" to the room.
|
|
|
|
"""
|
|
|
|
def at_object_creation(self):
|
|
self.db.money = 50
|
|
self.db.name = "NO_NAME"
|
|
self.db.age = 0
|
|
self.db.strength = 10
|
|
self.db.dexterity = 10
|
|
self.db.intelligence = 10
|
|
self.db.health = 10
|
|
self.db.hitpoints = 10
|
|
self.db.currenthp = 10
|
|
self.db.will = 10
|
|
self.db.perception = 10
|
|
self.db.fatiguepoints = 10
|
|
self.db.currentfatigue = 0
|
|
self.db.basicspeed = 10
|
|
self.db.basicsmove = 10
|
|
self.db.alignment = 4
|
|
self.db.gender = 4
|
|
self.db.xp = 0
|
|
self.db.level = 1
|
|
self.db.attribpoints = 100
|
|
self.db.skills = []
|
|
self.db.skillproperties = {}
|
|
self.db.skillevel = {}
|
|
self.db.created = 0
|
|
|
|
def at_post_puppet(self):
|
|
if self.db.created == 0:
|
|
EvMenu(self, "world.intromenu") |