evennia.contrib.tutorials.tutorial_world.objects

TutorialWorld - basic objects - Griatch 2011

This module holds all “dead” object definitions for the tutorial world. Object-commands and -cmdsets are also defined here, together with the object.

Objects:

TutorialObject

TutorialReadable TutorialClimbable Obelisk LightSource CrumblingWall TutorialWeapon TutorialWeaponRack

class evennia.contrib.tutorials.tutorial_world.objects.TutorialObject(*args, **kwargs)[源代码]

基类:evennia.objects.objects.DefaultObject

This is the baseclass for all objects in the tutorial.

at_object_creation()[源代码]

Called when the object is first created.

reset()[源代码]

Resets the object, whatever that may mean.

exception DoesNotExist

基类:evennia.objects.objects.DefaultObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.objects.objects.DefaultObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.TutorialObject'
typename = 'TutorialObject'
class evennia.contrib.tutorials.tutorial_world.objects.CmdRead(**kwargs)[源代码]

基类:evennia.commands.command.Command

Usage:

read [obj]

Read some text of a readable object.

key = 'read'
locks = 'cmd:all()'
help_category = 'tutorialworld'
func()[源代码]

Implements the read command. This simply looks for an Attribute “readable_text” on the object and displays that.

aliases = []
lock_storage = 'cmd:all()'
search_index_entry = {'aliases': '', 'category': 'tutorialworld', 'key': 'read', 'no_prefix': ' ', 'tags': '', 'text': '\n Usage:\n read [obj]\n\n Read some text of a readable object.\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdSetReadable(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

A CmdSet for readables.

at_cmdset_creation()[源代码]

Called when the cmdset is created.

path = 'evennia.contrib.tutorials.tutorial_world.objects.CmdSetReadable'
class evennia.contrib.tutorials.tutorial_world.objects.TutorialReadable(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject

This simple object defines some attributes and

at_object_creation()[源代码]

Called when object is created. We make sure to set the needed Attribute and add the readable cmdset.

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.TutorialReadable'
typename = 'TutorialReadable'
class evennia.contrib.tutorials.tutorial_world.objects.CmdClimb(**kwargs)[源代码]

基类:evennia.commands.command.Command

Climb an object

Usage:

climb <object>

This allows you to climb.

key = 'climb'
locks = 'cmd:all()'
help_category = 'tutorialworld'
func()[源代码]

Implements function

aliases = []
lock_storage = 'cmd:all()'
search_index_entry = {'aliases': '', 'category': 'tutorialworld', 'key': 'climb', 'no_prefix': ' ', 'tags': '', 'text': '\n Climb an object\n\n Usage:\n climb <object>\n\n This allows you to climb.\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdSetClimbable(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

Climbing cmdset

at_cmdset_creation()[源代码]

populate set

path = 'evennia.contrib.tutorials.tutorial_world.objects.CmdSetClimbable'
class evennia.contrib.tutorials.tutorial_world.objects.TutorialClimbable(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject

A climbable object. All that is special about it is that it has the “climb” command available on it.

at_object_creation()[源代码]

Called at initial creation only

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.TutorialClimbable'
typename = 'TutorialClimbable'
class evennia.contrib.tutorials.tutorial_world.objects.Obelisk(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject

This object changes its description randomly, and which is shown determines which order “clue id” is stored on the Character for future puzzles.

Important Attribute:
puzzle_descs (list): list of descriptions. One of these is

picked randomly when this object is looked at and its index in the list is used as a key for to solve the puzzle.

at_object_creation()[源代码]

Called when object is created.

return_appearance(caller)[源代码]

This hook is called by the look command to get the description of the object. We overload it with our own version.

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.Obelisk'
typename = 'Obelisk'
class evennia.contrib.tutorials.tutorial_world.objects.CmdLight(**kwargs)[源代码]

基类:evennia.commands.command.Command

Creates light where there was none. Something to burn.

key = 'on'
aliases = ['light', 'burn']
locks = 'cmd:holds()'
help_category = 'tutorialworld'
func()[源代码]

Implements the light command. Since this command is designed to sit on a “lightable” object, we operate only on self.obj.

lock_storage = 'cmd:holds()'
search_index_entry = {'aliases': 'light burn', 'category': 'tutorialworld', 'key': 'on', 'no_prefix': ' light burn', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdSetLight(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

CmdSet for the lightsource commands

key = 'lightsource_cmdset'
priority = 3
at_cmdset_creation()[源代码]

called at cmdset creation

path = 'evennia.contrib.tutorials.tutorial_world.objects.CmdSetLight'
class evennia.contrib.tutorials.tutorial_world.objects.LightSource(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject

This implements a light source object.

When burned out, the object will be deleted.

at_init()[源代码]

If this is called with the Attribute is_giving_light already set, we know that the timer got killed by a server reload/reboot before it had time to finish. So we kill it here instead. This is the price we pay for the simplicity of the non-persistent delay() method.

at_object_creation()[源代码]

Called when object is first created.

light()[源代码]

Light this object - this is called by Light command.

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.LightSource'
typename = 'LightSource'
class evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot(**kwargs)[源代码]

基类:evennia.commands.command.Command

Shifts roots around.

Usage:

shift blue root left/right shift red root left/right shift yellow root up/down shift green root up/down

key = 'shift'
aliases = ['pull', 'shiftroot', 'move', 'push']
locks = 'cmd:locattr(is_lit)'
help_category = 'tutorialworld'
parse()[源代码]

Custom parser; split input by spaces for simplicity.

func()[源代码]
Implement the command.

blue/red - vertical roots yellow/green - horizontal roots

lock_storage = 'cmd:locattr(is_lit)'
search_index_entry = {'aliases': 'pull shiftroot move push', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' pull shiftroot move push', 'tags': '', 'text': '\n Shifts roots around.\n\n Usage:\n shift blue root left/right\n shift red root left/right\n shift yellow root up/down\n shift green root up/down\n\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdPressButton(**kwargs)[源代码]

基类:evennia.commands.command.Command

Presses a button.

key = 'press'
aliases = ['button', 'push button', 'press button']
locks = 'cmd:objattr(button_exposed) and objlocattr(is_lit)'
help_category = 'tutorialworld'
func()[源代码]

Implements the command

lock_storage = 'cmd:objattr(button_exposed) and objlocattr(is_lit)'
search_index_entry = {'aliases': 'button push button press button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' button push button press button', 'tags': '', 'text': '\n Presses a button.\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdSetCrumblingWall(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

Group the commands for crumblingWall

key = 'crumblingwall_cmdset'
priority = 2
at_cmdset_creation()[源代码]

called when object is first created.

path = 'evennia.contrib.tutorials.tutorial_world.objects.CmdSetCrumblingWall'
class evennia.contrib.tutorials.tutorial_world.objects.CrumblingWall(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject, evennia.objects.objects.DefaultExit

This is a custom Exit.

The CrumblingWall can be examined in various ways, but only if a lit light source is in the room. The traversal itself is blocked by a traverse: lock on the exit that only allows passage if a certain attribute is set on the trying account.

Important attribute
destination - this property must be set to make this a valid exit

whenever the button is pushed (this hides it as an exit until it actually is)

at_init()[源代码]

Called when object is recalled from cache.

at_object_creation()[源代码]

called when the object is first created.

open_wall()[源代码]

This method is called by the push button command once the puzzle is solved. It opens the wall and sets a timer for it to reset itself.

return_appearance(caller)[源代码]

This is called when someone looks at the wall. We need to echo the current root positions.

at_post_traverse(traverser, source_location)[源代码]

This is called after we traversed this exit. Cleans up and resets the puzzle.

at_failed_traverse(traverser)[源代码]

This is called if the account fails to pass the Exit.

reset()[源代码]

Called by tutorial world runner, or whenever someone successfully traversed the Exit.

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist, evennia.objects.objects.DefaultExit.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned, evennia.objects.objects.DefaultExit.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.CrumblingWall'
typename = 'CrumblingWall'
class evennia.contrib.tutorials.tutorial_world.objects.CmdAttack(**kwargs)[源代码]

基类:evennia.commands.command.Command

Attack the enemy. Commands:

stab <enemy> slash <enemy> parry

stab - (thrust) makes a lot of damage but is harder to hit with. slash - is easier to land, but does not make as much damage. parry - forgoes your attack but will make you harder to hit on next

enemy attack.

key = 'attack'
aliases = ['fight', 'defend', 'bash', 'kill', 'parry', 'chop', 'thrust', 'hit', 'stab', 'slash', 'pierce']
locks = 'cmd:all()'
help_category = 'tutorialworld'
func()[源代码]

Implements the stab

lock_storage = 'cmd:all()'
search_index_entry = {'aliases': 'fight defend bash kill parry chop thrust hit stab slash pierce', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' fight defend bash kill parry chop thrust hit stab slash pierce', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\n parry\n\n stab - (thrust) makes a lot of damage but is harder to hit with.\n slash - is easier to land, but does not make as much damage.\n parry - forgoes your attack but will make you harder to hit on next\n enemy attack.\n\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdSetWeapon(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

Holds the attack command.

at_cmdset_creation()[源代码]

called at first object creation.

path = 'evennia.contrib.tutorials.tutorial_world.objects.CmdSetWeapon'
class evennia.contrib.tutorials.tutorial_world.objects.TutorialWeapon(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject

This defines a bladed weapon.

Important attributes (set at creation):

hit - chance to hit (0-1) parry - chance to parry (0-1) damage - base damage given (modified by hit success and

type of attack) (0-10)

at_object_creation()[源代码]

Called at first creation of the object

reset()[源代码]

When reset, the weapon is simply deleted, unless it has a place to return to.

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.TutorialWeapon'
typename = 'TutorialWeapon'
class evennia.contrib.tutorials.tutorial_world.objects.CmdGetWeapon(**kwargs)[源代码]

基类:evennia.commands.command.Command

Usage:

get weapon

This will try to obtain a weapon from the container.

key = 'get weapon'
aliases = []
locks = 'cmd:all()'
help_category = 'tutorialworld'
func()[源代码]

Get a weapon from the container. It will itself handle all messages.

lock_storage = 'cmd:all()'
search_index_entry = {'aliases': '', 'category': 'tutorialworld', 'key': 'get weapon', 'no_prefix': ' ', 'tags': '', 'text': '\n Usage:\n get weapon\n\n This will try to obtain a weapon from the container.\n '}
class evennia.contrib.tutorials.tutorial_world.objects.CmdSetWeaponRack(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

The cmdset for the rack.

key = 'weaponrack_cmdset'
at_cmdset_creation()[源代码]

Called at first creation of cmdset

path = 'evennia.contrib.tutorials.tutorial_world.objects.CmdSetWeaponRack'
class evennia.contrib.tutorials.tutorial_world.objects.TutorialWeaponRack(*args, **kwargs)[源代码]

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject

This object represents a weapon store. When people use the “get weapon” command on this rack, it will produce one random weapon from among those registered to exist on it. This will also set a property on the character to make sure they can’t get more than one at a time.

Attributes to set on this object:
available_weapons: list of prototype-keys from

WEAPON_PROTOTYPES, the weapons available in this rack.

no_more_weapons_msg - error message to return to accounts

who already got one weapon from the rack and tries to grab another one.

at_object_creation()[源代码]

called at creation

produce_weapon(caller)[源代码]

This will produce a new weapon from the rack, assuming the caller hasn’t already gotten one. When doing so, the caller will get Tagged with the id of this rack, to make sure they cannot keep pulling weapons from it indefinitely.

exception DoesNotExist

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist

exception MultipleObjectsReturned

基类:evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned

path = 'evennia.contrib.tutorials.tutorial_world.objects.TutorialWeaponRack'
typename = 'TutorialWeaponRack'