# 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)

  Bases: `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`

    Bases: `evennia.objects.objects.DefaultObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.objects.objects.DefaultObject.MultipleObjectsReturned`

  `path` = 'evennia.contrib.tutorials.tutorial_world.objects.TutorialObject'
  `typename` = 'TutorialObject'

class `evennia.contrib.tutorials.tutorial_world.objects.``CmdRead`(**kwargs)

  Bases: `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)

  Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `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)

  Bases: `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)

  Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `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)

  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`()

    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)

  Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `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)

  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` = ['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)

  Bases: `evennia.commands.command.Command`

  Presses a button.

  `key` = 'press'
  `aliases` = ['press button', 'button', 'push 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': 'press button button push button', 'category': 'tutorialworld', 'key': 'press', 'no_prefix': ' press button button push button', 'tags': '', 'text': '\n Presses a button.\n '}

class `evennia.contrib.tutorials.tutorial_world.objects.``CmdSetCrumblingWall`(cmdsetobj=None, key=None)

  Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`, `evennia.objects.objects.DefaultExit.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `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)

  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` = ['kill', 'thrust', 'defend', 'fight', 'stab', 'slash', 'parry', 'hit', 'pierce', 'chop', 'bash']
  `locks` = 'cmd:all()'
  `help_category` = 'tutorialworld'
  `func`()

    Implements the stab

  `lock_storage` = 'cmd:all()'
  `search_index_entry` = {'aliases': 'kill thrust defend fight stab slash parry hit pierce chop bash', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' kill thrust defend fight stab slash parry hit pierce chop bash', '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)

  Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `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)

  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'
  `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)

  Bases: `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)

  Bases: `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`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.DoesNotExist`

  exception `MultipleObjectsReturned`

    Bases: `evennia.contrib.tutorials.tutorial_world.objects.TutorialObject.MultipleObjectsReturned`

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