annotate plugins/xxheroinit.py @ 212:13054be69834 beta

Traipse Beta 'OpenRPG' {100428-00} Traipse is a distribution of OpenRPG that is designed to be easy to setup and go. Traipse also makes it easy for developers to work on code without fear of sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the productivity of the user. Update Summary (Patch-2) New Features: New Namespace method with two new syntaxes New Namespace Internal is context sensitive, always! New Namespace External is 'as narrow as you make it' New Namespace FutureCheck helps ensure you don't receive an incorrect node New PluginDB access for URL2Link plugin New to Forms, they now show their content in Design Mode New to Update Manager, checks Repo for updates on software start Fixes: Fix to Server GUI startup errors Fix to Server GUI Rooms tab updating Fix to Chat and Settings if non existant die roller is picked Fix to Dieroller and .open() used with .vs(). Successes are correctly calculated Fix to Alias Lib's Export to Tree, Open, Save features Fix to alias node, now works properly Fix to Splitter node, minor GUI cleanup Fix to Backgrounds not loading through remote loader Fix to Node name errors Fix to rolling dice in chat Whispers Fix to Splitters Sizing issues Fix to URL2Link plugin, modified regex compilation should remove memory leak Fix to mapy.py, a roll back due to zoomed grid issues Fix to whiteboard_handler, Circles work by you clicking the center of the circle Fix to Servers parse_incoming_dom which was outdated and did not respect XML Fix to a broken link in the server welcome message Fix to InterParse and logger requiring traceback Fix to Update Manager Status Bar Fix to failed image and erroneous pop up
author sirebral
date Wed, 28 Apr 2010 08:08:09 -0500
parents ff48c2741fe7
children
rev   line source
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
1 import os
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
2 import orpg.pluginhandler
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
3
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
4 class Plugin(orpg.pluginhandler.PluginHandler):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
5 # Initialization subroutine.
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
6 #
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
7 # !self : instance of self
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
8 # !openrpg : instance of the the base openrpg control
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
9 def __init__(self, plugindb, parent):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
10 orpg.pluginhandler.PluginHandler.__init__(self, plugindb, parent)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
11
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
12 # The Following code should be edited to contain the proper information
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
13 self.name = 'Hero Turn Tool'
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
14 self.author = 'Heroman, based on xxxinit.py\n'
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
15 self.author = 'debugged for Traipse by Prof. Ebral'
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
16 self.help = """This is the Hero Games turn tool. It is a bit more complex than other games."""
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
17
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
18
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
19 def plugin_enabled(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
20 self.plugin_addcommand('/hinit', self.on_hinit, '- Toggle Init Recording on or off')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
21 self.plugin_addcommand('/hhelp', self.on_hhelp, '- List all of the Hero Init Commands')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
22 self.plugin_addcommand('/hstart', self.on_hstart, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
23 self.plugin_addcommand('/hact', self.on_hact, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
24 self.plugin_addcommand('/hseg', self.on_hseg, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
25 self.plugin_addcommand('/hdex', self.on_hdex, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
26 self.plugin_addcommand('/hclear', self.on_hclear, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
27 self.plugin_addcommand('/hadd', self.on_hadd, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
28 self.plugin_addcommand('/hdel', self.on_hdel, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
29 self.plugin_addcommand('/hown', self.on_hown, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
30 self.plugin_addcommand('/hlist', self.on_hlist, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
31 self.plugin_addcommand('/hsort', self.on_hsort, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
32 self.plugin_addcommand('/hrun', self.on_hrun, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
33 self.plugin_addcommand('/hchange', self.on_hchange, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
34 self.plugin_addcommand('/hset', self.on_hset, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
35 self.plugin_addcommand('/hchange', self.on_hchange, '- Start the Hero Init Tool', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
36
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
37 #If you want your plugin to have more then one way to call the same function you can
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
38 #use self.plugin_commandalias(alias name, command name)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
39 #You can also make shortcut commands like the following
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
40 self.plugin_commandalias('/hlow', '/hsort low', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
41 self.plugin_commandalias('/hsortlow', '/hsort low', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
42 self.plugin_commandalias('/hhigh', '/hsort high', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
43 self.plugin_commandalias('/hsorthigh', '/hsort high', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
44 self.plugin_commandalias('/hreverse', '/hsort high', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
45 self.plugin_commandalias('/hgo', '/hrun', False)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
46
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
47 #This is where you set any variables that need to be initalized when your plugin starts
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
48 self.toggle = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
49 self.init_list = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
50 self.backup_list = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
51 self.dexterity = 99
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
52 self.segment = 12
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
53 self.state_strings = ["0 Phase",
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
54 "1/2 Phase",
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
55 "Full Phase",
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
56 "Stunned",
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
57 "Not Gone",
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
58 "Held Full", "Held Half", "Abort"]
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
59
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
60 def plugin_disabled(self):
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
61 self.plugin_removecmd('/hinit')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
62 self.plugin_removecmd('/hhelp')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
63 self.plugin_removecmd('/hstart')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
64 self.plugin_removecmd('/hact')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
65 self.plugin_removecmd('/hseg')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
66 self.plugin_removecmd('/hdex')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
67 self.plugin_removecmd('/hclear')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
68 self.plugin_removecmd('/hadd')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
69 self.plugin_removecmd('/hdel')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
70 self.plugin_removecmd('/hown')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
71 self.plugin_removecmd('/hlist')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
72 self.plugin_removecmd('/hsort')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
73 self.plugin_removecmd('/hrun')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
74 self.plugin_removecmd('/hchange')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
75 self.plugin_removecmd('/hset')
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
76 self.plugin_removecmd('/hchange')
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
77
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
78 try: self.frame.Destroy()
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
79 except: pass
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
80
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
81 def plugin_incoming_msg(self, text, type, name, player):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
82
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
83 if self.toggle:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
84 if text.lower().find("heroinit") != -1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
85 command = text[text.rfind("(")+1:text.rfind(")")]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
86 self.process_user(command, player)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
87 return text, type, name
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
88
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
89 #Chat Commands
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
90 def on_hinit(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
91 self.toggle = not self.toggle
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
92 if self.toggle: self.chat.SystemPost("Init recording on. Enter your info")
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
93 else: self.chat.SystemPost("Init recording off")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
94
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
95 def on_hhelp(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
96 self.chat.InfoPost("Commands:<br>/hclear : Clears out list<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
97 "/hstart : Sets you to segment 12, highest dex<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
98 "/hgo : Proceed to the next DEX/segment<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
99 "/hact <i>#</i> (full|half|abort|stunned)<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
100 "/hseg SEGNO : Set segment to SEGNO<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
101 "/hdex DEXNO : Set dex to DEXNO<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
102 "/hadd DEX SPD NAME : Adds to the list<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
103 "/hdel # : Delete character #<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
104 "/hown # playerid : Change ownership of PC # to playerid<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
105 "/hclear : Clears out player list<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
106 "/hchange # NEWDEX NEWSPD : Change PC # to have Dex NEWDEX and SPD NEWSPD<br>" +
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
107 "/hset list_# state : Change player's state (state:" + self.statelist() + ")")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
108
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
109 def on_hstart(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
110 self.dexterity = self.highestdex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
111 self.segment = 12
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
112
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
113 for player in self.init_list:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
114 player[3] = 4
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
115 if player[0] == self.dexterity:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
116 player[3] == 2
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
117
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
118 self.chat.Post("Combat Starting. ")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
119 self.call_time()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
120
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
121 def on_hact(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
122 cmds = cmdargs.split(None)
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
123 if len(cmds) == 1: msg = self.do_action(-1, -1, cmds[0])
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
124 elif len(cmds) == 2: msg = self.do_action(-1, int(cmds[0]), cmds[1])
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
125 else: msg = "Error in command. See format with hero init"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
126 self.chat.InfoPost(msg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
127
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
128 def on_hseg(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
129 cmds = cmdargs.split(None, 3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
130
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
131 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
132 new_seg = int(cmds[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
133 self.segment = new_seg
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
134 self.call_time()
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
135 except: self.chat.SystemPost("Invalid format. correct command is: /hseg SEGMENT#")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
136
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
137 def on_hdex(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
138 cmds = cmdargs.split(None, 3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
139
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
140 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
141 new_dex = int(cmds[0])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
142 self.dexterity = new_dex
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
143 self.call_time()
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
144 except: self.chat.SystemPost("Invalid format. correct command is: /hdex DEX#")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
145
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
146 def on_hclear(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
147 self.init_list = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
148 self.backup_list = []
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
149 self.dexterity = 99
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
150 self.segment = 12
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
151 self.chat.Post("<hr><font color='#ff0000'>New Initiative</font><br><font color='#0000ff'>Set new Initiatives</font>", True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
152
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
153 def on_hadd(self, cmdargs):
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
154 print cmdargs
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
155 cmds = cmdargs.split(None, 3)
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
156 print cmds, len(cmds)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
157 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
158 if len(cmds) == 3:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
159 new_dex = int(cmds[0])
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
160 new_spd = int(cmds[1])
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
161 self.init_list.append([new_dex, new_spd, cmds[2], 0, -1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
162 self.backup_list.append([new_dex, new_spd, cmds[2], 0, -1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
163 self.list_inits()
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
164 else: self.chat.SystemPost("Invalid format. correct command is: /hadd dex spd description (" + str(len(cmds)) + " arguments give)")
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
165
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
166 except Exception, e:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
167 print e
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
168 self.chat.SystemPost("Invalid format. correct command is: /hadd dex spd description")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
169
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
170 def on_hdel(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
171 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
172 cmds = cmdargs.split(None, 1)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
173 self.init_list.remove(int(cmds[0]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
174 self.backup_list.remove(int(cmds[0]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
175 self.list_inits()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
176 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
177 self.chat.SystemPost("Invalid format. correct command is: /del list_number")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
178
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
179 def on_hown(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
180 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
181 cmds = cmdargs.split(None)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
182 player = self.init_list[int(cmds[0])]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
183 player[4] = int(cmds[1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
184 self.chat.InfoPost("Character " + player[2] + "(" + int(cmds[0]) + ") is now owned by ID " + int(cmds[1]))
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
185 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
186 self.chat.SystemPost("Invalid format. correct command is: /hown # playerid")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
187
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
188 def on_hlist(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
189 self.list_inits()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
190
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
191 def on_hsort(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
192 self.init_list.sort()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
193 self.backup_list.sort()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
194
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
195 if cmdargs == "high":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
196 self.init_list.reverse()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
197 self.backup_list.reverse()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
198 self.list_inits()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
199
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
200 def on_hrun(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
201 advance = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
202 nextlowest = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
203 heldactions = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
204 for player in self.init_list:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
205 if self.actson(player[1], self.segment):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
206 if player[3] == 5 or player[3] == 6: heltactions = True
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
207 continue
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
208 if player[3] == 1 or player[3] == 2:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
209 self.chat.InfoPost("Hero " + player[2] + " needs to act before we advance DEX")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
210 advance = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
211 elif player[3] == 3 or player[3] == 4 or player[3] == 7:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
212 if player[0] > nextlowest: nextlowest = player[0]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
213 elif player[3] == 5 or player[3] == 6: heltactions = True
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
214 if not advance:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
215 return
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
216
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
217 advanceseg = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
218
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
219 if nextlowest == 0 and self.dexterity != 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
220 if heldactions or self.segment == 12:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
221 msg = "End of Segment " + str(self.segment) + "."
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
222 if heldactions: msg += " There are held actions."
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
223 msg += " Issue command again to advance to next segment."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
224 self.chat.InfoPost(msg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
225 self.dexterity = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
226 return
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
227 else: advanceseg = True
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
228 elif nextlowest == 0 and self.dexterity == 0:
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
229 advanceseg = True
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
230
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
231 if advanceseg:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
232 self.dexterity = nextlowest
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
233 for player in self.init_list:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
234 if player[0] == self.dexterity:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
235 if player[3] == 3 or player[3] == 7: player[3] = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
236 elif player[3] == 4: player[3] = 2
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
237 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
238 nextsegment = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
239 while nextsegment == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
240 self.segment += 1
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
241 if self.segment == 13: self.segment = 1
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
242 elif self.segment == 12:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
243 nextsegment = 12
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
244 break
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
245
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
246 for player in self.init_list:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
247 if self.actson(player[1], self.segment):
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
248 if player[3] == 0 or player[3] == 3 or player[3] == 7: nextsegment = self.segment
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
249 if player[3] == 5 or player[3] == 6: nextsegment = self.segment
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
250
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
251 self.dexterity = self.highestdex()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
252 for player in self.init_list:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
253 heldactions = False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
254 if self.actson(player[1], self.segment):
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
255 if player[3] != 3 and player[3] != 7: player[3] = 4
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
256 if player[0] == self.dexterity:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
257 if player[3] == 3:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
258 self.chat.InfoPost(player[2] + " unstuns.")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
259 player[3] = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
260 elif player[3] == 7:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
261 self.chat.InfoPost(player[2] + " recovers from the abort")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
262 player[3] = 0
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
263 else: player[3] = 2
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
264 if player[3] == 5 or player[3] == 6 and self.dexterity == 0:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
265 self.chat.InfoPost("There are held actions. Issue command again to advance to next segment.")
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
266 self.call_time()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
267
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
268 def on_hchange(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
269 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
270 cmds = cmdargs.split()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
271 self.init_list[int(cmds[0])][0] = cmds[1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
272 self.init_list[int(cmds[0])][1] = cmds[2]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
273 self.backup_list[int(cmds[0])][0] = cmds[1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
274 self.backup_list[int(cmds[0])][1] = cmds[2]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
275 self.list_inits()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
276 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
277 self.chat.SystemPost('Invalid format. correct command is: /hchange list_# new_dex new_spd (example: /hchange 1 18 4)')
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
278
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
279 def on_hset(self, cmdargs):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
280 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
281 cmds = cmdargs.split()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
282 self.init_list[int(cmds[0])][3] = cmds[1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
283 self.backup_list[int(cmds[0])][3] = cmds[1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
284 self.list_inits()
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
285 except:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
286 msg = "Invalid format. correct command is: /hset list_# state (state:" + self.statelist() + ")"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
287 self.chat.InfoPost(msg)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
288
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
289 #Other Methods
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
290 def statelist(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
291 msg = ""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
292 stateindex = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
293 for state in self.state_strings:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
294 if stateindex != 0: msg += ", "
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
295 msg += str(stateindex) + "=" + state
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
296 stateindex += 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
297 return msg
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
298
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
299 def is_index(self, value):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
300 try:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
301 if value[:1] == "+": offset = 1
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
302 return True
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
303 except: return False
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
304
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
305 def actson(self, spd, segment):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
306 speeds=[[0,0,0,0,0,0,0,0,0,0,0,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
307 [0,0,0,0,0,1,0,0,0,0,0,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
308 [0,0,0,1,0,0,0,1,0,0,0,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
309 [0,0,1,0,0,1,0,0,1,0,0,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
310 [0,0,1,0,1,0,0,1,0,1,0,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
311 [0,1,0,1,0,1,0,1,0,1,0,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
312 [0,1,0,1,0,1,1,0,1,0,1,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
313 [0,1,1,0,1,1,0,1,1,0,1,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
314 [0,1,1,1,0,1,1,1,0,1,1,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
315 [0,1,1,1,1,1,0,1,1,1,1,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
316 [0,1,1,1,1,1,1,1,1,1,1,1],
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
317 [1,1,1,1,1,1,1,1,1,1,1,1]]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
318
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
319 if spd < 1 or spd > 12: return False
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
320 if speeds[spd-1][segment-1] == 1: return True
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
321 return False
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
322
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
323 def highestdex(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
324 dex = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
325 for player in self.init_list:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
326 if self.actson(player[1], self.segment) and player[0] > dex: dex = player[0]
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
327 return dex
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
328
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
329 def do_action(self, playerid, index, action):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
330 if index == -1:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
331 count = 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
332 for player in self.init_list:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
333 if player[4] == playerid: index = count
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
334 count += 1
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
335 if index == -1: return "You do not have any players in the combat list"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
336 index -= 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
337 player = self.init_list[index]
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
338 if playerid != -1 and playerid != player[4]: return "You do not own that player."
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
339
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
340 # You can only perform a full action if you have a full or held full
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
341 if action == "full":
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
342 if player[3] != 2 and player[3] != 5: msg = player[2] + " cannot perform a full action."
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
343 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
344 player[3] = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
345 msg = player[2] + " performs a full action."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
346 elif action == "half":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
347 if player[3] != 1 and player[3] != 2 and player[3] != 5 and player[3] != 6:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
348 msg = player[2] + " cannot perform a half action."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
349 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
350 if player[3] == 1 or player[3] == 6:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
351 player[3] = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
352 msg = player[2] + " performs a half action."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
353 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
354 player[3] = 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
355 msg = player[2] + " performs a half action (half remaining)"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
356 elif action == "hold":
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
357 if player[3] != 1 and player[3] != 2: msg = player[2] + " cannot hold an action."
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
358 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
359 if player[3] == 2:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
360 player[3] = 5
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
361 msg = player[2] + " holding a full action."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
362 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
363 player[3] = 6
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
364 msg = player[2] + " holding a half action."
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
365 elif action == "stunned":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
366 player[3] = 3
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
367 msg = player[2] + " stunned!"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
368 elif action == "abort":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
369 # abort if full/half/not gone/held. Those just lose this seg action
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
370 if player[3] == 1 or player[3] == 2 or player[3] == 4 or player[3] == 5 or player[3] == 6:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
371 player[3] = 0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
372 msg = player[2] + " aborts!"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
373 # if you have 0 remaining and did not act this seg, regular abort
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
374 elif player[3] == 0 and not self.actson(player[1], self.segment):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
375 player[3] = 7
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
376 msg = player[2] + " aborts!"
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
377 else: msg = player[2] + " cannot abort yet."
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
378 else: msg = "Unknown command."
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
379 return msg
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
380
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
381 def list_inits(self, player=0, send=False):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
382 msg = "Combat Turn:<br>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
383 msg += "<table border=1 cellspacing=1 cellpadding=1><tr><th><th></th></th><th></th><th></th><th></th><th></th><th colspan=12>Segments</th></tr>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
384 msg += "<tr><th>#</th><th>Owner</th><th>Name</th><th>Spd</th><th>Dex</th><th>State</th>"
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
385 for x in xrange(1,13): msg += "<th>" + str(x) + "</th>"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
386 msg += "</tr>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
387 count=1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
388 for m in self.init_list:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
389 msg += "<tr><td align=center>"+str(count)+"</td>"
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
390 if m[4]==-1: msg += "<td><font color=red>GM</font></td>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
391 else: msg += "<td>" + m[4] + "</td>"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
392 msg += "<td><font color='#0000ff'>" + m[2] + "</font></td>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
393 msg += "<td align=center><font color='#0000ff'>" + str(m[1]) + "</font></td>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
394 msg += "<td align=center><font color='#0000ff'>" + str(m[0]) + "</font></td>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
395 msg +="<td>" + self.state_strings[m[3]] + "</td>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
396
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
397 for segment in xrange(1,13):
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
398 if self.actson(m[1],segment): msg += "<td align=center>" + str(m[0]) + "</td>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
399 else: msg += "<td></td>"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
400 msg += "</tr>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
401 count += 1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
402 msg += "</table><br>"
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
403 msg += "It is currently Segment " + str(self.segment) + ", DEX " + str(self.dexterity) + "<br>"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
404
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
405 if send and player != 0: chat.whisper_to_players(msg, [player])
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
406 else: self.chat.InfoPost(msg)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
407
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
408 def call_time(self):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
409 plist = ""
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
410 msg = "Segment is now " + str(self.segment) + ", DEX " + str(self.dexterity)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
411 for player in self.init_list:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
412 if player[3] == 1 or player[3] == 2 or player[3] == 5 or player[3] == 6:
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
413 if plist != "": plist += ", "
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
414 plist += player[2] + "(" + self.state_strings[player[3]] + ")"
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
415 if plist != "": msg += ": " + plist
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
416 self.chat.Post(msg, True)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
417
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
418 def process_user(self, command, player):
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
419 if command == "hadd":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
420 txt = command.split(None, 3)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
421 try:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
422 if len(txt) == 4:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
423 new_dex = int(txt[1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
424 new_spd = int(txt[2])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
425 self.init_list.append([new_dex, new_spd, txt[3], 0, player[2]])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
426 self.backup_list.append([new_dex, new_spd, txt[3], 0, player[2]])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
427 msg = "Character " + txt[3] + " added to initiative."
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
428 else: msg = "Error in command. See format with heroinit"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
429 except: msg = "Error in command. See format with heroinit"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
430 self.chat.whisper_to_players(msg, [player[2]])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
431
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
432 elif command == "hact":
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
433 txt = command.split(None)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
434 if len(txt) == 2:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
435 index = -1
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
436 action = txt[1]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
437 msg = self.do_action(player[2], index, action)
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
438 elif len(txt) == 3:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
439 index = int(txt[1])
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
440 action = txt[2]
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
441 msg = self.do_action(player[2], index, action)
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
442 else: msg = "Error in command. See format with heroinit"
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
443 self.chat.whisper_to_players(msg, [player[2]])
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents: 66
diff changeset
444 elif command == "hlist": self.list_inits(player[2], True)
0
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
445 else:
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
446 msg = "Commands:<br>heroinit (hadd DEX SPEED CHARACTERNAME) : add character CHARACTERNAME with dex DEX and speed SPD to initiative list<br>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
447 msg += " Example: heroinit (hadd 18 4 Joey)<br>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
448 msg += "heroinit (hact # (full|half|hold|stunned|abort) : Have character # perform an action. # is the number from hlist. If ommited, uses first owned character<br>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
449 msg += " Example: heroinit (hact 1 full) : Make character index 1 perform a full action.<br>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
450 msg += " Example: heroinit (hact full) : Have your first owned character perform a full action<br>"
4385a7d0efd1 Deleted and repushed it with the 'grumpy-goblin' branch. I forgot a y
sirebral
parents:
diff changeset
451
66
c54768cffbd4 Traipse Dev 'OpenRPG' {090818-00}
sirebral
parents: 0
diff changeset
452 self.chat.whisper_to_players(msg, [player[2]])