OsmondDeschaine

Untitled

Mar 4th, 2013
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. And this is the left arm function that calls the GUI:
  2.  
  3. function create_left_arm_green()
  4. move_man_y = 550
  5. move_man_x = 1200
  6.  
  7. createGauge("oppleftarm", 0, 0, 0, 0, "", "green")
  8. moveGauge("oppleftarm", move_man_x-18,move_man_y+47)
  9. resizeGauge("oppleftarm", 16,50)
  10. setGaugeStyleSheet("oppleftarm", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #00ff00, stop: 0.1 #00ff00, stop: 0.49 #00ff00, stop: 0.5 #00ff00, stop: 1 #00ff00);
  11. border-top: 1px black solid;
  12. border-left: 1px black solid;
  13. border-bottom: 1px black solid;
  14. border-radius: 7;
  15. padding: 3px;]],
  16. [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
  17. border-width: 1px;
  18. border-color: black;
  19. border-style: solid;
  20. border-radius: 7;
  21. padding: 3px;]])
  22.  
  23. createLabel("oppparryla",50,50,10,10,0);
  24. setTextFormat("oppparryla", 25,25,25, 255,255,255, 0,0,0 )
  25. setBackgroundColor("oppparryla",0,0,0,0)
  26. echoUserWindow("oppparryla", "<center><font color=\"black\">LA</font></center>")
  27. moveWindow("oppparryla", move_man_x-18,move_man_y+47)
  28. resizeWindow("oppparryla",17,50)
  29.  
  30. end
  31.  
  32. function create_left_arm_yellow()
  33. move_man_y = 550
  34. move_man_x = 1200
  35.  
  36. createGauge("oppleftarm", 0, 0, 0, 0, "", "green")
  37. moveGauge("oppleftarm", move_man_x-18,move_man_y+47)
  38. resizeGauge("oppleftarm", 16,50)
  39. setGaugeStyleSheet("oppleftarm", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ffff00, stop: 0.1 #ffff00, stop: 0.49 #ffff00, stop: 0.5 #ffff00, stop: 1 #ffff00);
  40. border-top: 1px black solid;
  41. border-left: 1px black solid;
  42. border-bottom: 1px black solid;
  43. border-radius: 7;
  44. padding: 3px;]],
  45. [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
  46. border-width: 1px;
  47. border-color: black;
  48. border-style: solid;
  49. border-radius: 7;
  50. padding: 3px;]])
  51.  
  52. createLabel("oppparryla",50,50,10,10,0);
  53. setTextFormat("oppparryla", 25,25,25, 255,255,255, 0,0,0 )
  54. setBackgroundColor("oppparryla",0,0,0,0)
  55. echoUserWindow("oppparryla", "<center><font color=\"black\">LA</font></center>")
  56. moveWindow("oppparryla", move_man_x-18,move_man_y+47)
  57. resizeWindow("oppparryla",17,50)
  58.  
  59. end
  60.  
  61. function create_left_arm_orange()
  62. move_man_y = 550
  63. move_man_x = 1200
  64.  
  65. createGauge("oppleftarm", 0, 0, 0, 0, "", "green")
  66. moveGauge("oppleftarm", move_man_x-18,move_man_y+47)
  67. resizeGauge("oppleftarm", 16,50)
  68. setGaugeStyleSheet("oppleftarm", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ff6600, stop: 0.1 #ff6600, stop: 0.49 #ff6600, stop: 0.5 #ff6600, stop: 1 #ff6600);
  69. border-top: 1px black solid;
  70. border-left: 1px black solid;
  71. border-bottom: 1px black solid;
  72. border-radius: 7;
  73. padding: 3px;]],
  74. [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
  75. border-width: 1px;
  76. border-color: black;
  77. border-style: solid;
  78. border-radius: 7;
  79. padding: 3px;]])
  80.  
  81. createLabel("oppparryla",50,50,10,10,0);
  82. setTextFormat("oppparryla", 25,25,25, 255,255,255, 0,0,0 )
  83. setBackgroundColor("oppparryla",0,0,0,0)
  84. echoUserWindow("oppparryla", "<center><font color=\"black\">LA</font></center>")
  85. moveWindow("oppparryla", move_man_x-18,move_man_y+47)
  86. resizeWindow("oppparryla",17,50)
  87.  
  88. end
  89.  
  90. function create_left_arm_red()
  91. move_man_y = 550
  92. move_man_x = 1200
  93.  
  94. createGauge("oppleftarm", 0, 0, 0, 0, "", "green")
  95. moveGauge("oppleftarm", move_man_x-18,move_man_y+47)
  96. resizeGauge("oppleftarm", 16,50)
  97. setGaugeStyleSheet("oppleftarm", [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ff0000, stop: 0.1 #ff0000, stop: 0.49 #ff0000, stop: 0.5 #ff0000, stop: 1 #ff0000);
  98. border-top: 1px black solid;
  99. border-left: 1px black solid;
  100. border-bottom: 1px black solid;
  101. border-radius: 7;
  102. padding: 3px;]],
  103. [[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #bd3333, stop: 0.1 #bd2020, stop: 0.49 #990000, stop: 0.5 #700000, stop: 1 #990000);
  104. border-width: 1px;
  105. border-color: black;
  106. border-style: solid;
  107. border-radius: 7;
  108. padding: 3px;]])
  109.  
  110. createLabel("oppparryla",50,50,10,10,0);
  111. setTextFormat("oppparryla", 25,25,25, 255,255,255, 0,0,0 )
  112. setBackgroundColor("oppparryla",0,0,0,0)
  113. echoUserWindow("oppparryla", "<center><font color=\"black\">LA</font></center>")
  114. moveWindow("oppparryla", move_man_x-18,move_man_y+47)
  115. resizeWindow("oppparryla",17,50)
  116.  
  117. end
  118.  
  119. Scripts:
  120. ---------
  121.  
  122. Function to actually set variables depending on severity of limb damage:
  123.  
  124. function addDamage(limb, severity)
  125. if severity == light then
  126. if limb == head then
  127. osmosis.limbdamage.head = osmosis.limbdamage.head + 1
  128. elseif limb == torso then
  129. osmosis.limbdamage.torso = osmosis.limbdamage.torso + 1
  130. elseif limb == "left arm" then
  131. osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm + 1
  132. elseif limb == "right arm" then
  133. osmosis.limbdamage.rightarm = osmosis.limbdamage.rightarm + 1
  134. elseif limb == "left leg" then
  135. osmosis.limbdamage.leftleg = osmosis.limbdamage.leftleg + 1
  136. elseif limb == "right leg" then
  137. osmosis.limbdamage.rightleg = osmosis.limbdamage.rightleg + 1
  138. end
  139. elseif severity == moderate then
  140. if limb == head then
  141. osmosis.limbdamage.head = osmosis.limbdamage.head + 2
  142. elseif limb == torso then
  143. osmosis.limbdamage.torso = osmosis.limbdamage.torso + 2
  144. elseif limb == "left arm" then
  145. osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm + 2
  146. elseif limb == "right arm" then
  147. osmosis.limbdamage.rightarm = osmosis.limbdamage.rightarm + 2
  148. elseif limb == "left leg" then
  149. osmosis.limbdamage.leftleg = osmosis.limbdamage.leftleg + 2
  150. elseif limb == "right leg" then
  151. osmosis.limbdamage.rightleg = osmosis.limbdamage.rightleg + 2
  152. end
  153. elseif severity == critical then
  154. if limb == head then
  155. osmosis.limbdamage.head = osmosis.limbdamage.head + 3
  156. elseif limb == torso then
  157. osmosis.limbdamage.torso = osmosis.limbdamage.torso + 3
  158. elseif limb == "left arm" then
  159. osmosis.limbdamage.leftarm = osmosis.limbdamage.leftarm + 3
  160. elseif limb == "right arm" then
  161. osmosis.limbdamage.rightarm = osmosis.limbdamage.rightarm + 3
  162. elseif limb == "left leg" then
  163. osmosis.limbdamage.leftleg = osmosis.limbdamage.leftleg + 3
  164. elseif limb == "right leg" then
  165. osmosis.limbdamage.rightleg = osmosis.limbdamage.rightleg + 3
  166. end
  167. end
  168. end
  169.  
  170. Function to check for damage to the left arm (adding in the rest of the limbs once I get this one going)
  171.  
  172. function check_limb_damage()
  173.  
  174. if osmosis.limbdamage.leftarm == 1 then
  175. create_left_arm_yellow()
  176. elseif osmosis.limbdamage.leftarm == 2 then
  177. create_left_arm_orange()
  178. elseif osmosis.limbdamage.leftarm == 3 then
  179. create_left_arm_red()
  180. else
  181. create_left_arm_green()
  182. end
  183. end
  184.  
  185.  
  186. Triggers:
  187. ---------
  188.  
  189. Trigger that picks up the actual slam:
  190.  
  191. ^Your strikes cause (\w+) bruising on (\w+)'s (.+).$
  192.  
  193. addDamage(matches[4], matches[2])
  194. check_limb_damage()
RAW Paste Data