evennia.contrib.tutorial_examples.cmdset_red_button

This defines the cmdset for the red_button. Here we have defined the commands and the cmdset in the same module, but if you have many different commands to merge it is often better to define the cmdset separately, picking and choosing from among the available commands as to what should be included in the cmdset - this way you can often re-use the commands too.

class evennia.contrib.tutorial_examples.cmdset_red_button.CmdNudge(**kwargs)[source]

Bases: evennia.commands.command.Command

Try to nudge the button’s lid

Usage:

nudge lid

This command will have you try to push the lid of the button away.

key = 'nudge lid'
aliases = ['nudge']
locks = 'cmd:all()'
func()[source]

nudge the lid. Random chance of success to open it.

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush(**kwargs)[source]

Bases: evennia.commands.command.Command

Push the red button

Usage:

push button

key = 'push button'
aliases = ['press button', 'push', 'press']
locks = 'cmd:all()'
func()[source]

Note that we choose to implement this with checking for if the lid is open/closed. This is because this command is likely to be tried regardless of the state of the lid.

An alternative would be to make two versions of this command and tuck them into the cmdset linked to the Open and Closed lid-state respectively.

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass(**kwargs)[source]

Bases: evennia.commands.command.Command

smash glass

Usage:

smash glass

Try to smash the glass of the button.

key = 'smash glass'
aliases = ['smash lid', 'smash', 'break lid']
locks = 'cmd:all()'
func()[source]

The lid won’t open, but there is a small chance of causing the lamp to break.

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid(**kwargs)[source]

Bases: evennia.commands.command.Command

open lid

Usage:

open lid

key = 'open lid'
aliases = ['open', 'open button']
locks = 'cmd:all()'
func()[source]

simply call the right function.

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.CmdCloseLid(**kwargs)[source]

Bases: evennia.commands.command.Command

close the lid

Usage:

close lid

Closes the lid of the red button.

key = 'close lid'
aliases = ['close']
locks = 'cmd:all()'
func()[source]

Close the lid

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook(**kwargs)[source]

Bases: evennia.commands.command.Command

Looking around in darkness

Usage:

look <obj>

… not that there’s much to see in the dark.

key = 'look'
aliases = ['examine', 'ex', 'listen', 'feel', 'get', 'l']
locks = 'cmd:all()'
func()[source]

This replaces all the senses when blinded.

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindHelp(**kwargs)[source]

Bases: evennia.commands.command.Command

Help function while in the blinded state

Usage:

help

key = 'help'
aliases = ['h']
locks = 'cmd:all()'
func()[source]

Give a message.

help_category = 'general'
lock_storage = 'cmd:all()'
class evennia.contrib.tutorial_examples.cmdset_red_button.DefaultCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.cmdset.CmdSet

The default cmdset always sits on the button object and whereas other command sets may be added/merge onto it and hide it, removing them will always bring it back. It’s added to the object using obj.cmdset.add_default().

key = 'RedButtonDefault'
mergetype = 'Union'
at_cmdset_creation()[source]

Init the cmdset

path = 'evennia.contrib.tutorial_examples.cmdset_red_button.DefaultCmdSet'
class evennia.contrib.tutorial_examples.cmdset_red_button.LidClosedCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.cmdset.CmdSet

A simple cmdset tied to the redbutton object.

It contains the commands that launches the other command sets, making the red button a self-contained item (i.e. you don’t have to manually add any scripts etc to it when creating it).

key = 'LidClosedCmdSet'
key_mergetype = {'LidOpenCmdSet': 'Replace'}
at_cmdset_creation()[source]

Populates the cmdset when it is instantiated.

path = 'evennia.contrib.tutorial_examples.cmdset_red_button.LidClosedCmdSet'
class evennia.contrib.tutorial_examples.cmdset_red_button.LidOpenCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.cmdset.CmdSet

This is the opposite of the Closed cmdset.

key = 'LidOpenCmdSet'
key_mergetype = {'LidClosedCmdSet': 'Replace'}
at_cmdset_creation()[source]

setup the cmdset (just one command)

path = 'evennia.contrib.tutorial_examples.cmdset_red_button.LidOpenCmdSet'
class evennia.contrib.tutorial_examples.cmdset_red_button.BlindCmdSet(cmdsetobj=None, key=None)[source]

Bases: evennia.commands.cmdset.CmdSet

This is the cmdset added to the account when the button is pushed.

key = 'BlindCmdSet'
mergetype = 'Replace'
no_exits = True
no_objs = True
at_cmdset_creation()[source]

Setup the blind cmdset

path = 'evennia.contrib.tutorial_examples.cmdset_red_button.BlindCmdSet'