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.
Bases:
evennia.commands.command.CommandTry to nudge the button’s lid
- Usage:
nudge lid
This command will have you try to push the lid of the button away.
nudge the lid. Random chance of success to open it.
Bases:
evennia.commands.command.CommandPush the red button
- Usage:
push button
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.
Bases:
evennia.commands.command.Commandsmash glass
- Usage:
smash glass
Try to smash the glass of the button.
The lid won’t open, but there is a small chance of causing the lamp to break.
Bases:
evennia.commands.command.Commandopen lid
- Usage:
open lid
simply call the right function.
Bases:
evennia.commands.command.Commandclose the lid
- Usage:
close lid
Closes the lid of the red button.
Close the lid
Bases:
evennia.commands.command.CommandLooking around in darkness
- Usage:
look <obj>
… not that there’s much to see in the dark.
This replaces all the senses when blinded.
Bases:
evennia.commands.command.CommandHelp function while in the blinded state
- Usage:
help
Give a message.
Bases:
evennia.commands.cmdset.CmdSetThe 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().
Init the cmdset
Bases:
evennia.commands.cmdset.CmdSetA 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).
Populates the cmdset when it is instantiated.
Bases:
evennia.commands.cmdset.CmdSetThis is the opposite of the Closed cmdset.
setup the cmdset (just one command)
Bases:
evennia.commands.cmdset.CmdSetThis is the cmdset added to the account when the button is pushed.
Setup the blind cmdset