evennia.contrib.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 Weapon WeaponRack
-
class
evennia.contrib.tutorial_world.objects.
TutorialObject
(*args, **kwargs)[source]¶ Bases:
evennia.objects.objects.DefaultObject
This is the baseclass for all objects in the tutorial.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.objects.objects.DefaultObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.TutorialObject'¶
-
typename
= 'TutorialObject'¶
-
exception
-
class
evennia.contrib.tutorial_world.objects.
CmdRead
(**kwargs)[source]¶ Bases:
evennia.commands.command.Command
- Usage:
read [obj]
Read some text of a readable object.
-
key
= 'read'¶
-
locks
= 'cmd:all()'¶
-
help_category
= 'tutorialworld'¶
-
func
()[source]¶ Implements the read command. This simply looks for an Attribute “readable_text” on the object and displays that.
-
aliases
= []¶
-
lock_storage
= 'cmd:all()'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdSetReadable
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
A CmdSet for readables.
-
path
= 'evennia.contrib.tutorial_world.objects.CmdSetReadable'¶
-
-
class
evennia.contrib.tutorial_world.objects.
TutorialReadable
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject
This simple object defines some attributes and
-
at_object_creation
()[source]¶ Called when object is created. We make sure to set the needed Attribute and add the readable cmdset.
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.TutorialReadable'¶
-
typename
= 'TutorialReadable'¶
-
-
class
evennia.contrib.tutorial_world.objects.
CmdClimb
(**kwargs)[source]¶ Bases:
evennia.commands.command.Command
Climb an object
- Usage:
climb <object>
This allows you to climb.
-
key
= 'climb'¶
-
locks
= 'cmd:all()'¶
-
help_category
= 'tutorialworld'¶
-
aliases
= []¶
-
lock_storage
= 'cmd:all()'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdSetClimbable
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
Climbing cmdset
-
path
= 'evennia.contrib.tutorial_world.objects.CmdSetClimbable'¶
-
-
class
evennia.contrib.tutorial_world.objects.
TutorialClimbable
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject
A climbable object. All that is special about it is that it has the “climb” command available on it.
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.TutorialClimbable'¶
-
typename
= 'TutorialClimbable'¶
-
exception
-
class
evennia.contrib.tutorial_world.objects.
Obelisk
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.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.
-
return_appearance
(caller)[source]¶ This hook is called by the look command to get the description of the object. We overload it with our own version.
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.Obelisk'¶
-
typename
= 'Obelisk'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdLight
(**kwargs)[source]¶ Bases:
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
()[source]¶ 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()'¶
-
-
class
evennia.contrib.tutorial_world.objects.
CmdSetLight
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
CmdSet for the lightsource commands
-
key
= 'lightsource_cmdset'¶
-
priority
= 3¶
-
path
= 'evennia.contrib.tutorial_world.objects.CmdSetLight'¶
-
-
class
evennia.contrib.tutorial_world.objects.
LightSource
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject
This implements a light source object.
When burned out, the object will be deleted.
-
at_init
()[source]¶ 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.
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.LightSource'¶
-
typename
= 'LightSource'¶
-
-
class
evennia.contrib.tutorial_world.objects.
CmdShiftRoot
(**kwargs)[source]¶ Bases:
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
= ['shiftroot', 'push', 'move', 'pull']¶
-
locks
= 'cmd:locattr(is_lit)'¶
-
help_category
= 'tutorialworld'¶
-
lock_storage
= 'cmd:locattr(is_lit)'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdPressButton
(**kwargs)[source]¶ Bases:
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'¶
-
lock_storage
= 'cmd:objattr(button_exposed) and objlocattr(is_lit)'¶
-
-
class
evennia.contrib.tutorial_world.objects.
CmdSetCrumblingWall
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
Group the commands for crumblingWall
-
key
= 'crumblingwall_cmdset'¶
-
priority
= 2¶
-
path
= 'evennia.contrib.tutorial_world.objects.CmdSetCrumblingWall'¶
-
-
class
evennia.contrib.tutorial_world.objects.
CrumblingWall
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.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)
-
open_wall
()[source]¶ 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)[source]¶ This is called when someone looks at the wall. We need to echo the current root positions.
-
at_after_traverse
(traverser, source_location)[source]¶ This is called after we traversed this exit. Cleans up and resets the puzzle.
-
reset
()[source]¶ Called by tutorial world runner, or whenever someone successfully traversed the Exit.
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
,evennia.objects.objects.DefaultExit.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
,evennia.objects.objects.DefaultExit.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.CrumblingWall'¶
-
typename
= 'CrumblingWall'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdAttack
(**kwargs)[source]¶ Bases:
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
= ['bash', 'hit', 'kill', 'slash', 'defend', 'chop', 'parry', 'thrust', 'stab', 'fight', 'pierce']¶
-
locks
= 'cmd:all()'¶
-
help_category
= 'tutorialworld'¶
-
lock_storage
= 'cmd:all()'¶
-
-
class
evennia.contrib.tutorial_world.objects.
CmdSetWeapon
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
Holds the attack command.
-
path
= 'evennia.contrib.tutorial_world.objects.CmdSetWeapon'¶
-
-
class
evennia.contrib.tutorial_world.objects.
Weapon
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.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)
-
exception
DoesNotExist
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.Weapon'¶
-
typename
= 'Weapon'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdGetWeapon
(**kwargs)[source]¶ Bases:
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'¶
-
lock_storage
= 'cmd:all()'¶
-
class
evennia.contrib.tutorial_world.objects.
CmdSetWeaponRack
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
The cmdset for the rack.
-
key
= 'weaponrack_cmdset'¶
-
path
= 'evennia.contrib.tutorial_world.objects.CmdSetWeaponRack'¶
-
-
class
evennia.contrib.tutorial_world.objects.
WeaponRack
(*args, **kwargs)[source]¶ Bases:
evennia.contrib.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.
-
produce_weapon
(caller)[source]¶ 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
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned
-
path
= 'evennia.contrib.tutorial_world.objects.WeaponRack'¶
-
typename
= 'WeaponRack'¶