evennia.contrib.tutorials.evadventure.commands¶
EvAdventure commands and cmdsets. We don’t need that many stand-alone new commands since a lot of functionality is managed in menus. These commands are in additional to normal Evennia commands and should be added to the CharacterCmdSet
- New commands:
attack/hit <target>[,…] inventory wield/wear <item> unwield/remove <item> give <item or coin> to <character> talk <npc>
To install, add the EvAdventureCmdSet from this module to the default character cmdset:
# in mygame/commands/default_cmds.py
from evennia.contrib.tutorials.evadventure.commands import EvAdventureCmdSet # <---
# ...
class CharacterCmdSet(CmdSet):
def at_cmdset_creation(self):
# ...
self.add(EvAdventureCmdSet) # <-----
-
class
evennia.contrib.tutorials.evadventure.commands.
EvAdventureCommand
(**kwargs)[source]¶ Bases:
evennia.commands.command.Command
Base EvAdventure command. This is on the form
command <args>
where whitespace around the argument(s) are stripped.
-
parse
()[source]¶ Once the cmdhandler has identified this as the command we want, this function is run. If many of your commands have a similar syntax (for example ‘cmd arg1 = arg2’) you should simply define this once and just let other commands of the same form inherit from this. See the docstring of this module for which object properties are available to use (notably self.args).
-
aliases
= []¶
-
help_category
= 'general'¶
-
key
= 'command'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': '', 'category': 'general', 'key': 'command', 'no_prefix': ' ', 'tags': '', 'text': '\n Base EvAdventure command. This is on the form\n\n command <args>\n\n where whitespace around the argument(s) are stripped.\n\n '}¶
-
-
class
evennia.contrib.tutorials.evadventure.commands.
CmdAttackTurnBased
(**kwargs)[source]¶ Bases:
evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand
Attack a target or join an existing combat.
- Usage:
attack <target> attack <target>, <target>, …
If the target is involved in combat already, you’ll join combat with the first target you specify. Attacking multiple will draw them all into combat.
This will start/join turn-based, combat, where you have a limited time to decide on your next action from a menu of options.
-
key
= 'attack'¶
-
aliases
= ['hit']¶
-
parse
()[source]¶ Once the cmdhandler has identified this as the command we want, this function is run. If many of your commands have a similar syntax (for example ‘cmd arg1 = arg2’) you should simply define this once and just let other commands of the same form inherit from this. See the docstring of this module for which object properties are available to use (notably self.args).
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': 'hit', 'category': 'general', 'key': 'attack', 'no_prefix': ' hit', 'tags': '', 'text': "\n Attack a target or join an existing combat.\n\n Usage:\n attack <target>\n attack <target>, <target>, ...\n\n If the target is involved in combat already, you'll join combat with\n the first target you specify. Attacking multiple will draw them all into\n combat.\n\n This will start/join turn-based, combat, where you have a limited\n time to decide on your next action from a menu of options.\n\n "}¶
-
class
evennia.contrib.tutorials.evadventure.commands.
CmdInventory
(**kwargs)[source]¶ Bases:
evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand
View your inventory
- Usage:
inventory
-
key
= 'inventory'¶
-
aliases
= ['inv', 'i']¶
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'no_prefix': ' inv i', 'tags': '', 'text': '\n View your inventory\n\n Usage:\n inventory\n\n '}¶
-
class
evennia.contrib.tutorials.evadventure.commands.
CmdWieldOrWear
(**kwargs)[source]¶ Bases:
evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand
Wield a weapon/shield, or wear a piece of armor or a helmet.
- Usage:
wield <item> wear <item>
The item will automatically end up in the suitable spot, replacing whatever was there previously.
-
key
= 'wield'¶
-
aliases
= ['wear']¶
-
out_txts
= {<WieldLocation.BACKPACK: 'backpack'>: 'You shuffle the position of {key} around in your backpack.', <WieldLocation.TWO_HANDS: 'two_handed_weapons'>: 'You hold {key} with both hands.', <WieldLocation.WEAPON_HAND: 'weapon_hand'>: 'You hold {key} in your strongest hand, ready for action.', <WieldLocation.SHIELD_HAND: 'shield_hand'>: 'You hold {key} in your off hand, ready to protect you.', <WieldLocation.BODY: 'body'>: 'You strap {key} on yourself.', <WieldLocation.HEAD: 'head'>: 'You put {key} on your head.'}¶
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': 'wear', 'category': 'general', 'key': 'wield', 'no_prefix': ' wear', 'tags': '', 'text': '\n Wield a weapon/shield, or wear a piece of armor or a helmet.\n\n Usage:\n wield <item>\n wear <item>\n\n The item will automatically end up in the suitable spot, replacing whatever\n was there previously.\n\n '}¶
-
class
evennia.contrib.tutorials.evadventure.commands.
CmdRemove
(**kwargs)[source]¶ Bases:
evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand
Remove a remove a weapon/shield, armor or helmet.
- Usage:
remove <item> unwield <item> unwear <item>
To remove an item from the backpack, use |wdrop|n instead.
-
key
= 'remove'¶
-
aliases
= ['unwield', 'unwear']¶
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': 'unwield unwear', 'category': 'general', 'key': 'remove', 'no_prefix': ' unwield unwear', 'tags': '', 'text': '\n Remove a remove a weapon/shield, armor or helmet.\n\n Usage:\n remove <item>\n unwield <item>\n unwear <item>\n\n To remove an item from the backpack, use |wdrop|n instead.\n\n '}¶
-
evennia.contrib.tutorials.evadventure.commands.
node_give
(caller, raw_string, **kwargs)[source]¶ This will show to the giver until receiver accepts/declines. It allows them to rescind their offer.
The caller here is the one giving the item. We also make sure to feed the ‘item’ and ‘receiver’ into the Evmenu.
-
evennia.contrib.tutorials.evadventure.commands.
node_receive
(caller, raw_string, **kwargs)[source]¶ Will show to the receiver and allow them to accept/decline the offer for as long as the giver didn’t rescind it.
The caller here is the one receiving the item. We also make sure to feed the ‘item’ and ‘giver’ into the EvMenu.
-
class
evennia.contrib.tutorials.evadventure.commands.
CmdGive
(**kwargs)[source]¶ Bases:
evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand
Give item or money to another person. Items need to be accepted before they change hands. Money changes hands immediately with no wait.
- Usage:
give <item> to <receiver> give <number of coins> [coins] to receiver
If item name includes ‘ to ‘, surround it in quotes.
Examples
give apple to ranger give “road to happiness” to sad ranger give 10 coins to ranger give 12 to ranger
-
key
= 'give'¶
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
aliases
= []¶
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': '', 'category': 'general', 'key': 'give', 'no_prefix': ' ', 'tags': '', 'text': '\n Give item or money to another person. Items need to be accepted before\n they change hands. Money changes hands immediately with no wait.\n\n Usage:\n give <item> to <receiver>\n give <number of coins> [coins] to receiver\n\n If item name includes \' to \', surround it in quotes.\n\n Examples:\n give apple to ranger\n give "road to happiness" to sad ranger\n give 10 coins to ranger\n give 12 to ranger\n\n '}¶
-
class
evennia.contrib.tutorials.evadventure.commands.
CmdTalk
(**kwargs)[source]¶ Bases:
evennia.contrib.tutorials.evadventure.commands.EvAdventureCommand
Start a conversations with shop keepers and other NPCs in the world.
- Parameters
<npc> (talk) –
-
key
= 'talk'¶
-
func
()[source]¶ This is the actual executing part of the command. It is called directly after self.parse(). See the docstring of this module for which object properties are available (beyond those set in self.parse())
-
aliases
= []¶
-
help_category
= 'general'¶
-
lock_storage
= 'cmd:all();'¶
-
search_index_entry
= {'aliases': '', 'category': 'general', 'key': 'talk', 'no_prefix': ' ', 'tags': '', 'text': '\n Start a conversations with shop keepers and other NPCs in the world.\n\n Args:\n talk <npc>\n\n '}¶
-
class
evennia.contrib.tutorials.evadventure.commands.
EvAdventureCmdSet
(cmdsetobj=None, key=None)[source]¶ Bases:
evennia.commands.cmdset.CmdSet
Groups all commands in one cmdset which can be added in one go to the DefaultCharacter cmdset.
-
key
= 'evadventure'¶
-
at_cmdset_creation
()[source]¶ Hook method - this should be overloaded in the inheriting class, and should take care of populating the cmdset by use of self.add().
-
path
= 'evennia.contrib.tutorials.evadventure.commands.EvAdventureCmdSet'¶
-