annotate orpg/dieroller/rollers/runequest.py @ 217:c719a07cd28d beta

Traipse Beta 'OpenRPG' {100430-01} 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 New to Mini Lin node, change title in design mode 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 Fix to Mini Lib node that was preventing use Fix to plugins that parce dice but did not call InterParse Fix to nodes for name changing by double click Fix to Game Tree, node ordering on drag and drop corrected Daily-01: Again forgot the version number Files affect in last update: Currently selected branch: beta Author: sirebral Files Modified (in update): orpg/chat/commands.py orpg/gametree/gametree.py orpg/gametree/nodehandlers/containers.py orpg/gametree/nodehandlers/minilib.py orpg/pluginhandler.py plugins/xxhiddendice.py plugins/xxsimpleinit.py
author sirebral
date Fri, 30 Apr 2010 05:44:05 -0500
parents dcae32e219f1
children
rev   line source
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
1 # (at your option) any later version.
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
2 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
3 # This program is distributed in the hope that it will be useful,
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
4 # but WITHOUT ANY WARRANTY; without even the implied warranty of
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
5 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
6 # GNU General Public License for more details.
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
7 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
8 # You should have received a copy of the GNU General Public License
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
9 # along with this program; if not, write to the Free Software
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
10 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
11 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
12 #-------------------------------------------------------------------------
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
13 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
14 # Usage:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
15 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
16 # Die Roller: /dieroller rq
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
17 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
18 # Skill Roll: [1d100.skill(50,0,0)] # ( skill%, modifer, MA% )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
19 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
20 # Parry Roll: [1d100.parry(50,0,0,12)] # ( skill%, modifer, MA%, Weapon/Shield AP )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
21 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
22 # Dodge Roll: [1d100.parry(50,0,0)] # ( skill%, modifer, MA% )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
23 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
24 # Attack Roll: [1d100.attack(50,0,0,2,9,3,0)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
25 # ( skill%, modifer, MA%, min weap dam, max weap dam, dam bonus, truesword )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
26 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
27 # Sorcery Roll: [1d100.sorcery(90, 0, 3, 6, 1, 1, 1)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
28 # (sk, mod, pow, cer, int, acc, mlt)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
29 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
30 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
31 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
32 # Skill Training Unlimited Roll: [1d100.trainskill(30,75)] # (starting skill%, desired skill%)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
33 # Skill Training Cost Limited: [1d100.trainskillcost(1000, 50) # (payment, starting skill%)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
34 # Skill Training Time Limited: [1d100.trainskilltime(150, 50) # (time, strting skill%)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
35 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
36 #-------------------------------------------------------------------------
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
37 # --
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
38 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
39 # File: rq.py
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
40 # Version:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
41 # $Id: rq.py,v .1 pelwer
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
42 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
43 # Description: Runequest die roller originally based on Heroman's Hero Dieroller
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
44 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
45 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
46 # v.1 - pelwer - 2/5/2005
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
47 # o Original release
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
48 # v.2 - pelwer - 10/30/2006
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
49 # o Ported to openrpg+ by removing dependance on whrandom
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
50 # o Fixed Riposte spelling
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
51 # o Deleted sorcalc - never used
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
52 # o Added Sorcery Fumble table to sorcery spell roller
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
53 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
54
184
dcae32e219f1 Traipse Beta 'OpenRPG' {100117-00}
sirebral
parents: 171
diff changeset
55 __version__ = "$Id: runequest.py,v Traipse 'Ornery-Orc' prof.ebral Exp $"
171
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
56
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
57 from time import time, clock
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
58 import random
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
59 from math import floor
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
60
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
61 from std import std
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
62 from orpg.dieroller.base import *
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
63
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
64 # rq stands for "Runequest"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
65
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
66 class runequest(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
67 name = "runequest"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
68 def __init__(self,source=[]):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
69 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
70
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
71 def skill(self,sk,mod,ma):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
72 return rqskill(self,sk,mod,ma)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
73
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
74 def parry(self,sk,mod,ma,AP):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
75 return rqparry(self,sk,mod,ma,AP)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
76
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
77 def dodge(self,sk,mod,ma):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
78 return rqdodge(self,sk,mod,ma)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
79
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
80 def attack(self,sk,mod,ma,mindam,maxdam,bondam,trueswd):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
81 return rqattack(self,sk,mod,ma,mindam,maxdam,bondam,trueswd)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
82
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
83 def sorcery(self,sk,mod,pow,cer,int,acc,mlt):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
84 return rqsorcery(self,sk,mod,pow,cer,int,acc,mlt)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
85
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
86 def trainskill(self,initial,final):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
87 return rqtrainskill(self,initial,final)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
88
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
89 def trainskillcost(self,cost,sk):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
90 return rqtrainskillcost(self,cost,sk)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
91
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
92 def trainskilltime(self,time,sk):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
93 return rqtrainskilltime(self,time,sk)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
94
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
95 die_rollers.register(runequest)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
96
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
97 # RQ Skill Training Cost/Time unlimited
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
98 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
99 # [1d100.trainskill(10,20)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
100 # initial skill%, final skill%
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
101 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
102 # sk = skill %
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
103 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
104 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
105 class rqtrainskill(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
106 def __init__(self,source=[],initial=11,final=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
107 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
108 self.s = initial
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
109 self.f = final
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
110
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
111 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
112 myStr = "Unrestricted Training"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
113 if self.s == 0:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
114 myStr = "Initial training completed for Cost(50) Time(20) Skill(1 + modifier)"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
115 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
116 cost = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
117 time = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
118 myStr = "Training: "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
119 while self.s < self.f and self.s < 75:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
120 cost += self.s * 5
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
121 time += self.s * 1
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
122 self.s += random.uniform(1,4) + 1
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
123 myStr = "Training completed:\n"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
124 myStr += "\tCost(" + str(int(cost)) + ")\n"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
125 myStr += "\tTime(" + str(int(time)) + ")\n"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
126 myStr += "\tSkill(" + str(int(self.s)) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
127 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
128
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
129
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
130 # RQ Skill Training Cost Limited
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
131 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
132 # [1d100.trainskillcost(50,0)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
133 # cost, skill%
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
134 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
135 # cost = cash for training
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
136 # sk = skill %
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
137 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
138 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
139 class rqtrainskillcost(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
140 def __init__(self,source=[],cost=11,sk=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
141 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
142 self.cost = cost
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
143 self.sk = sk
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
144
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
145 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
146 myStr = ""
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
147 if self.sk == 0 and self.cost >= 50:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
148 myStr = "Initial training completed for Cost(50), Time(50), Skill(1 + modifier)"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
149 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
150 cost = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
151 time = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
152 icost = self.sk * 5
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
153 myStr = "Training: "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
154 while (cost + icost) < self.cost:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
155 if self.sk >= 75:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
156 break
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
157 cost += icost
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
158 time += self.sk * 1
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
159 self.sk += random.uniform(1,4) + 1
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
160 icost = self.sk * 5
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
161 myStr = "Training completed: "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
162 myStr += "Cost(" + str(int(cost)) + ") "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
163 myStr += "Time(" + str(int(time)) + ") "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
164 myStr += "Skill(" + str(int(self.sk)) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
165 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
166
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
167
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
168 # RQ Skill Training Time Limited
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
169 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
170 # [1d100.trainskilltime(50,0)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
171 # time, skill%
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
172 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
173 # time = time for training
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
174 # sk = skill %
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
175 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
176 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
177 class rqtrainskilltime(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
178 def __init__(self,source=[],time=11,sk=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
179 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
180 self.time = time
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
181 self.sk = sk
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
182
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
183 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
184 myStr = ""
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
185 if self.sk == 0 and self.time >= 20:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
186 myStr = "Initial training completed for Cost(50), Time(50), Skill(1 + modifier)"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
187 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
188 cost = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
189 time = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
190 itime = self.sk * 1
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
191 myStr = "Trainingsss: "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
192 while (time + itime) < self.time:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
193 if self.sk >= 75:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
194 break
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
195 cost += self.sk * 5
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
196 time += itime
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
197 self.sk += random.uniform(1,4) + 1
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
198 itime = self.sk * 5
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
199 myStr = "Training completed: "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
200 myStr += "Cost(" + str(int(cost)) + ") "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
201 myStr += "Time(" + str(int(time)) + ") "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
202 myStr += "Skill(" + str(int(self.sk)) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
203 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
204
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
205 # RQ Skill Roll
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
206 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
207 # [1d100.skill(50,0,0)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
208 # skill%, modifer, ma%
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
209 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
210 # sk = skill %
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
211 # mod = modifier %
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
212 # ma = martial arts %
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
213 # skill = sk + mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
214 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
215 # success roll <= skill
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
216 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
217 # failure roll > skill
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
218 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
219 # crit
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
220 # push( @{$::Cre{Weapons}{$weap_cnt}}, POSIX::floor( skill/20 ) );
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
221 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
222 # special
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
223 # push( @{$::Cre{Weapons}{$weap_cnt}}, POSIX::floor( $skill/5 ) );
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
224 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
225 # fumble: if ( $skill > 100 ) { $fum = 0; } else { $fum = 100 - $skill; }
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
226 # $fum = 100 - POSIX::floor( $fum/20 );
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
227 # if ( $fum == 100 ) { $fum = '00'; };
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
228 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
229 class rqskill(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
230 def __init__(self,source=[],sk=11,mod=0,ma=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
231 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
232 self.sk = sk
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
233 self.mod = mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
234 self.ma = ma
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
235
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
236 def is_success(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
237 return (((self.sum() <= (self.sk + self.mod)) or (self.sum() <= 5)) and (self.sum() <= 95))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
238
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
239 def is_ma(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
240 return (self.sum() <= self.ma)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
241
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
242 def is_special(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
243 return (self.sum() <= int(floor((self.sk + self.mod)/5)))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
244
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
245 def is_critical(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
246 return (self.sum() <= int(floor((self.sk + self.mod) / 20)))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
247
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
248 def is_fumble(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
249 if ( self.sk >= 100 ):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
250 fum = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
251 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
252 fum = (100 - self.sk )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
253 final_fum = ( 100 - int( floor( fum/20 ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
254 return ( self.sum() >= final_fum )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
255
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
256 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
257 strAdd="+"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
258 swapmod= self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
259 if self.mod < 0:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
260 strAdd= "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
261 swapmod= -self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
262 modSum = self.sum()
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
263 # build output string
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
264 myStr = " (" + str(modSum) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
265 myStr += " vs [" + str(self.sk) + strAdd + str(swapmod) + "]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
266 if self.is_fumble():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
267 myStr += " <b><font color=red>Fumble!</font></b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
268 elif self.is_critical():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
269 myStr += " <b><font color=green>Critical!</font></b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
270 elif self.is_special():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
271 myStr += " <i><font color=green>Special!</font></i>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
272 elif self.is_success() and self.is_ma():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
273 myStr += " <i><font color=green>Special!</font></i>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
274 elif self.is_success():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
275 myStr += " <font color=blue>Success!</font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
276 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
277 myStr += " <font color=red>Failure!</font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
278 Diff = self.sk - modSum
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
279 myStr += " </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
280 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
281
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
282 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
283 # RQ Parry Roll
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
284 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
285 # same as skill but with fumble dice and armor points
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
286 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
287 # [1d100.parry(50,0,0,12)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
288 # skill%, modifer, ma%, Weapon AP
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
289 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
290
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
291 class rqparry(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
292 def __init__(self,source=[],sk=11,mod=0,ma=0,AP=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
293 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
294 self.sk = sk
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
295 self.mod = mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
296 self.ma = ma
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
297 self.AP = AP
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
298
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
299 def is_success(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
300 return (((self.sum() <= (self.sk + self.mod)) or (self.sum() <= 5)) and (self.sum() <= 95))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
301
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
302 def is_special(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
303 return (self.sum() <= int(floor((self.sk + self.mod) / 5)))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
304
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
305 def is_ma(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
306 return (self.sum() <= self.ma)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
307
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
308 def is_riposte(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
309 return (self.sum() <= (self.ma / 5))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
310
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
311 def is_critical(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
312 return ( ( self.sum() <= int( floor( ( self.sk + self.mod )/20 ) ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
313
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
314 def is_fumble(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
315 if ( self.sk >= 100 ):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
316 fum = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
317 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
318 fum = (100 - self.sk )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
319 final_fum = ( 100 - int( floor( fum/20 ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
320 return ( self.sum() >= final_fum )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
321
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
322 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
323 # get fumble roll result in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
324 fum_roll = random.randint(1,100)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
325
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
326 # get special AP
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
327 spec_AP = int( floor ( self.AP * 1.5 ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
328
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
329 # figure out +/- for modifer
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
330 strAdd="+"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
331 swapmod= self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
332 if self.mod < 0:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
333 strAdd= "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
334 swapmod= -self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
335 modSum = self.sum()
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
336
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
337 # build output string
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
338 myStr = " (" + str(modSum) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
339 myStr += " vs [" + str(self.sk) + strAdd + str(swapmod) + "]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
340 if self.is_fumble():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
341 myStr += " <b><font color=red>Fumble!</font> See Fumble Chart [" + str(fum_roll) + "]</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
342 elif self.is_critical() and self.is_riposte():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
343 myStr += " <b><font color=green>Critical!</font> All damage blocked!</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
344 myStr += " Riposte next SR"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
345 elif self.is_critical():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
346 myStr += " <b><font color=green>Critical!</font> All damage blocked!</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
347 elif self.is_special and self.is_riposte():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
348 myStr += " <i><font color=green>Special!</font> Weapon/Shield AP [" + str(spec_AP) + "]</i>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
349 myStr += " Riposte next SR"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
350 elif self.is_special():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
351 myStr += " <i><font color=green>Special!</font> Weapon/Shield AP [" + str(spec_AP) + "]</i>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
352 elif self.is_success() and self.is_ma():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
353 myStr += " <i><font color=green>Special!</font> Weapon/Shield AP [" + str(spec_AP) + "]</i>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
354 elif self.is_success():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
355 myStr += " <font color=blue>Success!</font> Weapon/Shield AP [" + str(self.AP) + "]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
356 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
357 myStr += " <font color=red>Failure!</font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
358 Diff = self.sk - modSum
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
359 myStr += " </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
360 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
361
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
362 # RQ Dodge Roll
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
363 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
364 # same as skill but with fumble dice and armor points
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
365 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
366 # [1d100.parry(50,0,0)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
367 # skill%, modifer, ma%
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
368 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
369
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
370 class rqdodge(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
371 def __init__(self,source=[],sk=11,mod=0,ma=0,AP=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
372 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
373 self.sk = sk
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
374 self.mod = mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
375 self.ma = ma
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
376 self.AP = AP
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
377
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
378 def is_success(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
379 return (((self.sum() <= (self.sk + self.mod)) or (self.sum() <= 5)) and (self.sum() <= 95))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
380
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
381 def is_special(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
382 return (self.sum() <= int(floor((self.sk + self.mod) / 5)))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
383
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
384 def is_ma(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
385 return (self.sum() <= self.ma)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
386
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
387 def is_riposte(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
388 return (self.sum() <= (self.ma / 5))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
389
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
390 def is_critical(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
391 return ( ( self.sum() <= int( floor( ( self.sk + self.mod )/20 ) ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
392
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
393 def is_fumble(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
394 if ( self.sk >= 100 ):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
395 fum = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
396 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
397 fum = (100 - self.sk )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
398 final_fum = ( 100 - int( floor( fum/20 ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
399 return ( self.sum() >= final_fum )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
400
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
401 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
402 # get fumble roll result in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
403 fum_roll = random.randint(1,100)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
404
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
405 # get special AP
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
406 spec_AP = int( floor ( self.AP * 1.5 ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
407
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
408 # figure out +/- for modifer
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
409 strAdd="+"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
410 swapmod= self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
411 if self.mod < 0:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
412 strAdd= "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
413 swapmod= -self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
414 modSum = self.sum()
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
415
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
416 # build output string
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
417 myStr = " (" + str(modSum) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
418 myStr += " vs [" + str(self.sk) + strAdd + str(swapmod) + "]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
419 if self.is_fumble():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
420 myStr += " <b><font color=red>Fumble!</font> See Fumble Chart [" + str(fum_roll) + "]</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
421 elif self.is_critical() and self.is_riposte():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
422 myStr += " <b><font color=green>Critical!</font> All damage dodged!</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
423 myStr += " Riposte on next SR"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
424 elif self.is_critical():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
425 myStr += " <b><font color=green>Critical!</font> All damage dodged!</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
426 elif self.is_special and self.is_riposte():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
427 myStr += " <i><font color=green>Special!</font> Damage dodged</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
428 myStr += " Riposte on next SR"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
429 elif self.is_special():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
430 myStr += " <i><font color=green>Special!</font> Damage dodged</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
431 elif self.is_success() and self.is_ma():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
432 myStr += " <i><font color=green>Special!</font> Damage dodged</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
433 elif self.is_success():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
434 myStr += " <font color=blue>Success!</font> Damage dodged</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
435 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
436 myStr += " <font color=red>Failure!</font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
437 Diff = self.sk - modSum
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
438 myStr += " </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
439 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
440
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
441
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
442 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
443 # RQ Attack Roll
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
444 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
445 # same as skill but with fumble dice and armor points
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
446 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
447 # [1d100.attack(50,0,0,2,9,3,1)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
448 # skill%, modifer, ma%, min weap dam, max weap dam, dam bonus, truesword_enabled
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
449 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
450 class rqattack(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
451 def __init__(self,source=[],sk=11,mod=0,ma=0,mindam=0,maxdam=0,bondam=0,trueswd=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
452 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
453 self.sk = sk
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
454 self.mod = mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
455 self.ma = ma
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
456 self.mindam = mindam
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
457 self.maxdam = maxdam
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
458 self.bondam = bondam
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
459 self.trueswd = trueswd
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
460
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
461 def is_success(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
462 return (((self.sum() <= (self.sk + self.mod)) or (self.sum() <= 5)) and (self.sum() <= 95))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
463
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
464 def is_ma(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
465 return (self.sum() <= self.ma)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
466
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
467 def is_special(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
468 return (self.sum() <= int(floor((self.sk + self.mod) / 5)))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
469
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
470 def is_critical(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
471 return ((self.sum() <= int(floor((self.sk + self.mod) / 20))))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
472
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
473 def is_supercritical(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
474 return (self.sum() == 1)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
475
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
476 def is_fumble(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
477 if ( self.sk >= 100 ):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
478 fum = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
479 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
480 fum = (100 - self.sk )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
481 final_fum = ( 100 - int( floor( fum/20 ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
482 return ( self.sum() >= final_fum )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
483
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
484 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
485
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
486 # get fumble roll result in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
487 fum_roll = random.randint(1,100)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
488
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
489 # get hit location roll result in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
490 location = random.randint(1,20)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
491 myStr = " to the ["+ str(location) + "] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
492 if location < 5:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
493 myStr += "<B>Right Leg</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
494 elif location < 9:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
495 myStr += "<B>Left Leg</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
496 elif location < 12:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
497 myStr += "<B>Abdomen</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
498 elif location < 13:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
499 myStr += "<B>Chest</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
500 elif location < 16:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
501 myStr += "<B>Right Arm</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
502 elif location < 19:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
503 myStr += "<B>Left Arm</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
504 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
505 myStr += "<B>Head</B>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
506 hit_loc = myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
507
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
508 # get normal damage in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
509 norm_damage = random.randint(self.mindam*(self.trueswd+1),self.maxdam*(self.trueswd+1)) + self.bondam
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
510 norm_damage_string = "{" + str( self.mindam*(self.trueswd+1) ) + "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
511 norm_damage_string += str(self.maxdam*(self.trueswd+1)) + "+" + str(self.bondam)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
512 norm_damage_string += "}[" + str(norm_damage) + "] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
513
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
514 # get special/critical damage in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
515 crit_damage = random.randint( self.mindam*(self.trueswd+2), self.maxdam*(self.trueswd+2) ) + self.bondam
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
516 crit_damage_string = "{" + str( self.mindam*(self.trueswd+2) ) + "-" + str(self.maxdam*(self.trueswd+2)) + "+" + str(self.bondam) + "}[" + str(crit_damage) + "] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
517
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
518 # get supercritical damage in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
519 super_damage = norm_damage + self.maxdam
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
520 super_damage_string = "{" + str( self.mindam*(self.trueswd+1) ) + "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
521 super_damage_string += str(self.maxdam*(self.trueswd+1)) + "+" + str(self.maxdam)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
522 super_damage_string += "+" + str(self.bondam) + "}[" + str(super_damage) + "] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
523
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
524 # figure out +/- for modifer
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
525 strAdd="+"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
526 swapmod= self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
527 if self.mod < 0:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
528 strAdd= "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
529 swapmod= -self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
530 modSum = self.sum()
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
531
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
532 # build output string
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
533 myStr = " (" + str(modSum) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
534 myStr += " vs [" + str(self.sk) + strAdd + str(swapmod) + "]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
535 if self.is_fumble():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
536 myStr += " <b><font color=red>Fumble!</font> See Fumble Chart [" + str(fum_roll) + "]</b>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
537 elif (self.is_supercritical() and self.is_success()):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
538 myStr += " <b><font color=green>Super Critical!</font></b> Damage: " + str(super_damage_string) + "<u>No Armor Stops</u>" + str(hit_loc)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
539 elif (self.is_critical() and self.is_success()):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
540 myStr += " <b><font color=green>Critical!</font></b> Damage: " + str(crit_damage_string) + "<u>No Armor Stops</u>" + str(hit_loc)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
541 elif ( self.is_special() and self.is_success() ):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
542 myStr += " <i><font color=green>Special!</font></i> Damage: " + str(crit_damage_string) + str(hit_loc)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
543 elif (self.is_success() and self.is_ma()):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
544 myStr += " <i><font color=green>Special!</font></i> Damage: " + str(crit_damage_string) + str(hit_loc)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
545 elif self.is_success():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
546 myStr += " <font color=blue>Success!</font> Damage: " + str(norm_damage_string) + str(hit_loc)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
547 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
548 myStr += " <font color=red>Failure!</font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
549 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
550
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
551 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
552 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
553 # Sorcery Roll: [1d100.sorcery(90, 10, 5, 4, 3, 2, 1)]
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
554 # (sk, mod, pow, cer, int, acc, mlt)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
555 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
556 # Ceremony: (+1d6% per strike rank spent on ceremony)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
557 # Intensity: (-3% per point of Intensity)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
558 # Duration: (-4% per point of Duration)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
559 # Range: (-5% per point of Range)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
560 # Multispell: (-10% per each spell over 1)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
561 # Acceleration: (-5% per point of Acceleration)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
562 # Hold: (-2% per point in spell Held)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
563 #
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
564 class rqsorcery(std):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
565 def __init__(self,source=[],sk=11,mod=0,pow=0,cer=0,int=0,acc=0,mlt=0):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
566 std.__init__(self,source)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
567 self.sk = sk # sorcery skill
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
568 self.mod = mod # additional modifier ( from duration, range, etc )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
569 self.pow = pow # boost pow and additional pow ( from duration, range, etc )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
570 self.cer = cer # ceremony d6
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
571 self.int = int # intensity ( -3% )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
572 self.acc = acc # accelerate ( -5% )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
573 self.mlt = mlt # multispell ( -10% )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
574
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
575 def is_success(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
576 return (((self.sum() <= (self.sk + self.mod)) or (self.sum() <= 5)) and (self.sum() <= 95))
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
577
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
578 def is_special(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
579 return ( ( self.sum() <= int( floor( ( self.sk + self.mod )/5 ) ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
580
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
581 def is_critical(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
582 return ( ( self.sum() <= int( floor( ( self.sk + self.mod )/20 ) ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
583
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
584 def is_fumble(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
585 if ( self.sk >= 100 ):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
586 fum = 0
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
587 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
588 fum = (100 - self.sk )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
589 final_fum = ( 100 - int( floor( fum/20 ) ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
590 return ( self.sum() >= final_fum )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
591
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
592 def __str__(self):
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
593
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
594 # get fumble roll result in case needed
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
595 fum_roll = random.randint(2,12)
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
596 if fum_roll == 12 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
597 fum_string = "<br /><font color=purple>Caster temporarily forgets spell. Make an INTx5 roll each day to remember.</font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
598 if fum_roll == 11 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
599 fum_string = "<br /><font color=purple>Caster temporarily forgets spell. Make an INTx5 roll each hour to remember. </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
600 if fum_roll == 10 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
601 fum_string = "<br /><font color=purple>Spell produces reverse of the intended effect. </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
602 if fum_roll == 9 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
603 fum_string = "<br /><font color=purple>Caster is Stunned. Roll INTx3 to recover at SR 10 each round. </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
604 if fum_roll == 8 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
605 fum_string = "<br /><font color=purple>Caster takes 2D6 Damage to THP </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
606 if fum_roll == 7 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
607 fum_string = "<br /><font color=purple>Spell produces reverse of the intended effect at 2x Intensity. </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
608 if fum_roll == 6 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
609 fum_string = "<br /><font color=purple>Spell is cast on companions (if harmful) or on random nearby foes (if beneficial) </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
610 if fum_roll == 5 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
611 fum_string = "<br /><font color=purple>Caster takes 1d6 Damage to Head </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
612 if fum_roll == 4 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
613 fum_string = "<br /><font color=purple>Spell is cast on caster (if harmful) or on random nearby foe (if beneficial) </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
614 if fum_roll == 3 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
615 fum_string = "<br /><font color=purple>Caster takes 1d6 Damage to THP </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
616 if fum_roll == 2 :
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
617 fum_string = "<br /><font color=purple>Caster takes 1 point of Damage to Head </font>"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
618
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
619 # roll ceremony
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
620 ceremony_roll = random.randint( self.cer, (self.cer*6) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
621
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
622 # subtract manipulations
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
623 extra_mod = self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
624 self.mod += ceremony_roll - self.int*3 - self.acc*5 - self.mlt*10
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
625
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
626 # add up power cost
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
627 extra_pow = self.pow
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
628 self.pow += self.int + self.mlt + self.acc
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
629 special_pow = int( floor( ( self.pow )/2 ) )
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
630
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
631 # figure out +/- for modifer
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
632 strAdd="+"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
633 swapmod= self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
634 if self.mod < 0:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
635 strAdd= "-"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
636 swapmod= -self.mod
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
637 modSum = self.sum()
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
638
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
639 # build output string
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
640 myStr = " (" + str(modSum) + ")"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
641 myStr += " vs [" + str(self.sk) + strAdd + str(swapmod) + "]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
642
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
643 if self.is_fumble():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
644 myStr += " <b><font color=red>Fumble!</font> POW Cost: [" + str(self.pow) + "],</b> " + fum_string
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
645 elif self.is_critical():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
646 myStr += " <b><font color=green>Critical!</font></b> POW Cost: [1] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
647 elif self.is_special():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
648 myStr += " <i><font color=green>Special!</font></i> POW Cost: [" + str(special_pow) + "] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
649 elif self.is_success():
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
650 myStr += " <font color=blue>Success!</font> POW Cost: [" + str(self.pow) + "] "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
651 else:
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
652 myStr += " <font color=red>Failure!</font> POW Cost: [1]"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
653
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
654 # print spell details
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
655 myStr += "<br /> --- Other Modifiers:[" + str( extra_mod ) + "], "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
656 myStr += "Extra POW:[" + str( extra_pow ) + "], "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
657 myStr += "Ceremony:[+" + str( ceremony_roll ) + "%], "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
658 myStr += "Intensity(-3):[" + str( self.int ) + "], "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
659 myStr += "Accelerate(-5):[" + str( self.acc ) + "], "
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
660 myStr += "Multispell(-10):[" + str( self.mlt ) + "] ---"
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
661 return myStr
ff48c2741fe7 Traipse Beta 'OpenRPG' {091210-00}
sirebral
parents:
diff changeset
662