Advertisement
chainsol

Untitled

Jul 18th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.84 KB | None | 0 0
  1. """
  2. Command sets
  3.  
  4. All commands in the game must be grouped in a cmdset.    A given command
  5. can be part of any number of cmdsets and cmdsets can be added/removed
  6. and merged onto entities at runtime.
  7.  
  8. To create new commands to populate the cmdset, see
  9. `commands/command.py`.
  10.  
  11. This module wraps the default command sets of Evennia; overloads them
  12. to add/remove commands from the default lineup. You can create your
  13. own cmdsets by inheriting from them or directly from `evennia.CmdSet`.
  14.  
  15. """
  16. from evennia import default_cmds
  17. from commands.teleport import CmdTeleportExample
  18. from commands.scry import CmdScryExample
  19. from commands.command import Kill
  20. from commands.command import Heal
  21. from commands.spiritdesc import SpiritDesc
  22. from commands.find import CmdFind
  23. from typeclasses.exits import CmdFaster
  24. from typeclasses.exits import CmdSlower
  25. from evennia.contrib.slow_exit import CmdSetSpeed
  26. from commands.combat import CmdAttack
  27. from commands.command import FooBar
  28. from commands.command import Sheet
  29. from commands.command import Image
  30. from commands.command import Wield
  31. from commands.command import OverLook
  32. from commands.command import OverInventory
  33. from commands.command import OverSay
  34. from commands.command import OverGet
  35. from commands.command import OverGive
  36. from commands.command import OverDrop
  37. from commands.command import OverPose
  38. from commands.command import OverWhisper
  39. from commands.spells import CmdSpell
  40. from commands.cast import CmdCast
  41. from commands.forensic import CmdLastBreath
  42. from commands.sight import CmdSight
  43. from commands.touch import CmdReach
  44. from commands.general import CmdGet
  45. from commands.exorcise import CmdExorcise
  46. from commands.summon import CmdSummon
  47. from commands.inflict import CmdInflict
  48. from commands.invis import CmdInvis
  49. from commands.bless import CmdBless
  50. from commands.hex import CmdHex
  51. from commands.curse import CmdCurse
  52. from commands.enchant import CmdEnchant
  53. from commands.use import CmdUse
  54. from commands.fate import CmdFate
  55. from commands.astro import CmdAstro
  56. from commands.death import CmdDeathTouch
  57. from commands.drain import CmdDrain
  58. from commands.intimidate import CmdIntimidate
  59. from commands.kinetic import CmdKinetic
  60. from commands.ban import CmdBan
  61. from commands.push import CmdPush
  62. from commands.race import CmdRace
  63. from commands.strike import CmdStrike
  64. from commands.stop import CmdStop
  65. from commands.influence import CmdCommand
  66. from commands.project import CmdProject
  67. from commands.bug import CmdBug
  68. from commands.send import CmdSend
  69. from commands.illusion import CmdIllusion
  70. from commands.peek import CmdPeek
  71. from commands.take import CmdTake
  72. from commands.source import CmdSource
  73. from commands.portal import CmdPortal
  74. from commands.jump import CmdJump
  75. from commands.where import CmdWhere
  76.        
  77.  
  78.  
  79. class CharacterCmdSet(default_cmds.CharacterCmdSet):
  80.         """
  81.        The `CharacterCmdSet` contains general in-game commands like `look`,
  82.        `get`, etc available on in-game Character objects. It is merged with
  83.        the `PlayerCmdSet` when a Player puppets a Character.
  84.        """
  85.         key = "DefaultCharacter"
  86.  
  87.         def at_cmdset_creation(self):
  88.                 """
  89.                Populates the cmdset
  90.                """
  91.                 super(CharacterCmdSet, self).at_cmdset_creation()
  92.                 #
  93.                 # any commands you add below will overload the default ones.
  94.                 #
  95.                 self.add(CmdSetSpeed())
  96.                 self.add(OverLook())
  97.                 self.add(OverInventory())
  98.                 self.add(OverSay())
  99.                 self.add(OverDrop())
  100.                 self.add(OverGet())
  101.                 self.add(OverGive())
  102.                 self.add(OverPose())
  103.                 self.add(OverWhisper())
  104.                 self.add(CmdGet())
  105.                 self.add(CmdTeleportExample())
  106.                 self.add(CmdScryExample())
  107.                 self.add(Kill())
  108.                 self.add(Heal())
  109.                 self.add(SpiritDesc())
  110.                 self.add(CmdFind())
  111.                 self.add(CmdFaster())
  112.                 self.add(CmdSlower())
  113.                 self.add(CmdSetSpeed())
  114.                 self.add(CmdAttack())
  115.                 self.add(FooBar())
  116.                 self.add(Sheet())
  117.                 self.add(Image())
  118.                 self.add(Wield())
  119.                 self.add(OverLook())
  120.                 self.add(OverInventory())
  121.                 self.add(OverSay())
  122.                 self.add(OverGet())
  123.                 self.add(OverDrop())
  124.                 self.add(OverGive())
  125.                 self.add(OverPose())
  126.                 self.add(OverWhisper())
  127.                 self.add(CmdSpell())
  128.                 self.add(CmdCast())
  129.                 self.add(CmdLastBreath())
  130.                 self.add(CmdSight())
  131.                 self.add(CmdReach())
  132.                 self.add(CmdExorcise())
  133.                 self.add(CmdSummon())
  134.                 self.add(CmdInflict())
  135.                 self.add(CmdInvis())
  136.                 self.add(CmdBless())
  137.                 self.add(CmdHex())
  138.                 self.add(CmdCurse())
  139.                 self.add(CmdEnchant())
  140.                 self.add(CmdUse())
  141.                 self.add(CmdFate())
  142.                 self.add(CmdAstro())
  143.                 self.add(CmdDeathTouch())
  144.                 self.add(CmdDrain())
  145.                 self.add(CmdIntimidate())
  146.                 self.add(CmdBan())
  147.                 self.add(CmdKinetic())
  148.                 self.add(CmdPush())
  149.                 self.add(CmdRace())
  150.                 self.add(CmdStrike())
  151.                 self.add(CmdStop())
  152.                 self.add(CmdCommand())
  153.                 self.add(CmdProject())
  154.                 self.add(CmdBug())
  155.                 self.add(CmdSend())
  156.                 self.add(CmdIllusion())
  157.                 self.add(CmdPeek())
  158.                 self.add(CmdTake())
  159.                 self.add(CmdPortal())
  160.                 self.add(CmdSource())
  161.                 self.add(CmdJump())
  162.                 self.add(CmdWhere())
  163.  
  164.  
  165. class PlayerCmdSet(default_cmds.PlayerCmdSet):
  166.         """
  167.        This is the cmdset available to the Player at all times. It is
  168.        combined with the `CharacterCmdSet` when the Player puppets a
  169.        Character. It holds game-account-specific commands, channel
  170.        commands, etc.
  171.        """
  172.         key = "DefaultPlayer"
  173.  
  174.         def at_cmdset_creation(self):
  175.                 """
  176.                Populates the cmdset
  177.                """
  178.                 super(PlayerCmdSet, self).at_cmdset_creation()
  179.                 #
  180.                 # any commands you add below will overload the default ones.
  181.                 #
  182.  
  183.  
  184. class UnloggedinCmdSet(default_cmds.UnloggedinCmdSet):
  185.         """
  186.        Command set available to the Session before being logged in.    This
  187.        holds commands like creating a new account, logging in, etc.
  188.        """
  189.         key = "DefaultUnloggedin"
  190.  
  191.         def at_cmdset_creation(self):
  192.                 """
  193.                Populates the cmdset
  194.                """
  195.                 super(UnloggedinCmdSet, self).at_cmdset_creation()
  196.                 #
  197.                 # any commands you add below will overload the default ones.
  198.                 #
  199.  
  200.  
  201. class SessionCmdSet(default_cmds.SessionCmdSet):
  202.         """
  203.        This cmdset is made available on Session level once logged in. It
  204.        is empty by default.
  205.        """
  206.         key = "DefaultSession"
  207.  
  208.         def at_cmdset_creation(self):
  209.                 """
  210.                This is the only method defined in a cmdset, called during
  211.                its creation. It should populate the set with command instances.
  212.  
  213.                As and example we just add the empty base `Command` object.
  214.                It prints some info.
  215.                """
  216.                 super(SessionCmdSet, self).at_cmdset_creation()
  217.                 #
  218.                 # any commands you add below will overload the default ones.
  219.                 #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement