Further reworking, naming the library folder 'evennia' instead of lib or src.
This commit is contained in:
parent
829e7493b1
commit
c7325a5032
241 changed files with 464 additions and 294 deletions
|
|
@ -1,121 +0,0 @@
|
|||
"""
|
||||
Example command set template module.
|
||||
|
||||
To create new commands to populate the cmdset, see
|
||||
examples/command.py.
|
||||
|
||||
To extend the character command set:
|
||||
- copy this file up one level to gamesrc/commands and name it
|
||||
something fitting.
|
||||
- change settings.CMDSET_CHARACTER to point to the new module's
|
||||
CharacterCmdSet class
|
||||
- import/add commands at the end of CharacterCmdSet's add() method.
|
||||
|
||||
To extend Player cmdset:
|
||||
- like character set, but point settings.PLAYER on your new cmdset.
|
||||
|
||||
To extend Unloggedin cmdset:
|
||||
- like default set, but point settings.CMDSET_UNLOGGEDIN on your new cmdset.
|
||||
|
||||
To add a wholly new command set:
|
||||
- copy this file up one level to gamesrc/commands and name it
|
||||
something fitting.
|
||||
- add a new cmdset class
|
||||
- add it to objects e.g. with obj.cmdset.add(path.to.the.module.and.class)
|
||||
|
||||
"""
|
||||
|
||||
from ev import CmdSet, Command
|
||||
from ev import default_cmds
|
||||
|
||||
#from contrib import menusystem, lineeditor
|
||||
#from contrib import misc_commands
|
||||
#from contrib import chargen
|
||||
|
||||
|
||||
class ExampleCmdSet(CmdSet):
|
||||
"""
|
||||
Implements an empty, example cmdset.
|
||||
"""
|
||||
|
||||
key = "ExampleSet"
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
"""
|
||||
This is the only method defined in a cmdset, called during
|
||||
its creation. It should populate the set with command instances.
|
||||
|
||||
As and example we just add the empty base Command object.
|
||||
It prints some info.
|
||||
"""
|
||||
self.add(Command())
|
||||
|
||||
|
||||
class CharacterCmdSet(default_cmds.CharacterCmdSet):
|
||||
"""
|
||||
This is an example of how to overload the default command
|
||||
set defined in src/commands/default/cmdset_character.py.
|
||||
|
||||
Here we copy everything by calling the parent, but you can
|
||||
copy&paste any combination of the default command to customize
|
||||
your default set. Next you change settings.CMDSET_CHARACTER to point
|
||||
to this class.
|
||||
"""
|
||||
key = "DefaultCharacter"
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
"""
|
||||
Populates the cmdset
|
||||
"""
|
||||
# calling setup in src.commands.default.cmdset_character
|
||||
super(CharacterCmdSet, self).at_cmdset_creation()
|
||||
|
||||
#
|
||||
# any commands you add below will overload the default ones.
|
||||
#
|
||||
#self.add(menusystem.CmdMenuTest())
|
||||
#self.add(lineeditor.CmdEditor())
|
||||
#self.add(misc_commands.CmdQuell())
|
||||
|
||||
|
||||
class UnloggedinCmdSet(default_cmds.UnloggedinCmdSet):
|
||||
"""
|
||||
This is an example of how to overload the command set of the
|
||||
unloggedin commands, defined in
|
||||
src/commands/default/cmdset_unloggedin.py.
|
||||
|
||||
Here we copy everything by calling the parent, but you can
|
||||
copy&paste any combination of the default command to customize
|
||||
your default set. Next you change settings.CMDSET_UNLOGGEDIN to
|
||||
point to this class.
|
||||
"""
|
||||
key = "DefaultUnloggedin"
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
"""
|
||||
Populates the cmdset
|
||||
"""
|
||||
# calling setup in src.commands.default.cmdset_unloggedin
|
||||
super(UnloggedinCmdSet, self).at_cmdset_creation()
|
||||
|
||||
#
|
||||
# any commands you add below will overload the default ones.
|
||||
#
|
||||
|
||||
|
||||
class PlayerCmdSet(default_cmds.PlayerCmdSet):
|
||||
"""
|
||||
This is set is available to the player when they have no
|
||||
character connected to them (i.e. they are out-of-character, ooc).
|
||||
"""
|
||||
key = "DefaultPlayer"
|
||||
|
||||
def at_cmdset_creation(self):
|
||||
"""
|
||||
Populates the cmdset
|
||||
"""
|
||||
# calling setup in src.commands.default.cmdset_ooc
|
||||
super(PlayerCmdSet, self).at_cmdset_creation()
|
||||
#
|
||||
# any commands you add below will overload the default ones.
|
||||
#
|
||||
|
|
@ -8,9 +8,9 @@ examples/cmdset.py)
|
|||
|
||||
"""
|
||||
|
||||
from ev import Command as BaseCommand
|
||||
from ev import default_cmds
|
||||
from ev import utils
|
||||
from evennia import Command as BaseCommand
|
||||
from evennia import default_cmds
|
||||
from evennia import utils
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ this change, you have to convert them manually e.g. with the
|
|||
@typeclass command.
|
||||
|
||||
"""
|
||||
from ev import Character as DefaultCharacter
|
||||
from evennia import DefaultCharacter
|
||||
|
||||
|
||||
class Character(DefaultCharacter):
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ this change, you have to convert them manually e.g. with the
|
|||
@typeclass command.
|
||||
|
||||
"""
|
||||
from ev import Exit as DefaultExit
|
||||
from evennia import DefaultExit
|
||||
|
||||
|
||||
class Exit(DefaultExit):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ this change, you have to convert them manually e.g. with the
|
|||
@typeclass command.
|
||||
|
||||
"""
|
||||
from ev import Object as DefaultObject
|
||||
from evennia import DefaultObject
|
||||
|
||||
|
||||
class Object(DefaultObject):
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ this change, you have to convert them manually e.g. with the
|
|||
@typeclass command.
|
||||
|
||||
"""
|
||||
from ev import Player as DefaultPlayer
|
||||
from evennia import DefaultPlayer
|
||||
|
||||
|
||||
class Player(DefaultPlayer):
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ this change, you have to convert them manually e.g. with the
|
|||
|
||||
"""
|
||||
|
||||
from ev import Room as DefaultRoom
|
||||
from evennia import DefaultRoom
|
||||
|
||||
|
||||
class Room(DefaultRoom):
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ dropped connections etc.
|
|||
|
||||
"""
|
||||
|
||||
from ev import Script as BaseScript
|
||||
from evennia import Script
|
||||
|
||||
|
||||
class ExampleScript(BaseScript):
|
||||
class ExampleScript(Script):
|
||||
"""
|
||||
A script type is customized by redefining some or all of its hook
|
||||
methods and variables.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue