Guest User

Untitled

a guest
Apr 22nd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.68 KB | None | 0 0
  1. function sub_limb(dir, limb)
  2. if dir == "left" then
  3. if limb == "arm" then
  4. lArmD = lArmD - 1
  5. else
  6. lLegD = lLegD - 1
  7. end
  8. elseif dir == "right" then
  9. if limb == "arm" then
  10. rArmD = rArmD - 1
  11. else
  12. rLegD = rLegD - 1
  13. end
  14. elseif dir == "head" then
  15. headD = headD - 1
  16. elseif dir == "torso" then
  17. torsoD = torsoD - 1
  18. end
  19.  
  20. if larmB >= breakpoint - 2 then
  21. setBackgroundColor("larmB",250,150,150,250);
  22. else
  23. setBackgroundColor("larmB",200,200,200,250);
  24. end
  25.  
  26. if lLegD >= breakpoint -2 then
  27. setBackgroundColor("llegB",250,150,150,250);
  28. else
  29. setBackgroundColor("llegB",200,200,200,250);
  30. end
  31.  
  32. if rArmD >= breakpoint -2 then
  33. setBackgroundColor("rarmB",250,150,150,250);
  34. else
  35. setBackgroundColor("rarmB",200,200,200,250);
  36. end
  37.  
  38. if rLegD >= breakpoint -2 then
  39. setBackgroundColor("rlegB",250,150,150,250);
  40. else
  41. setBackgroundColor("rlegB",200,200,200,250);
  42. end
  43.  
  44. if headD >= breakpoint -2 then
  45. setBackgroundColor("headB",250,150,150,250);
  46. else
  47. setBackgroundColor("headB",200,200,200,250);
  48. end
  49.  
  50. if torsoD >= breakpoint -2 then
  51. setBackgroundColor("torsoB",250,150,150,250);
  52. else
  53. setBackgroundColor("torsoB",200,200,200,250);
  54. end
  55.  
  56. if lArmD < 0 then
  57. lArmD = 0
  58. end
  59. if lLegD < 0 then
  60. lArmD = 0
  61. end
  62. if rArmD < 0 then
  63. rArmD = 0
  64. end
  65. if rLegD < 0 then
  66. rLegD = 0
  67. end
  68. if headD < 0 then
  69. headD = 0
  70. end
  71. if torsoD < 0 then
  72. torsoD = 0
  73. end
  74.  
  75. echo("larmB","<center> " .. lArmD .. " </center>")
  76. echo("llegB","<center> " .. lLegD .. " </center>")
  77. echo("rarmB","<center> " .. rArmD .. " </center>")
  78. echo("rlegB","<center> " .. rLegD .. " </center>")
  79. echo("torsoB","<center> " .. torsoD .. " </center>")
  80. echo("headB","<center> " .. headD .. " </center>")
  81. --echo("\nFinished")
  82.  
  83. end
  84.  
  85. -------------------------------------------------
  86. -- Limb Counter Functions --
  87. -------------------------------------------------
  88. breakpoint = 9
  89. function ck_limb( dir, limb )
  90. --echo("\nIn ck_limb " .. dir .. " " .. limb)
  91. if dir == "left" then
  92. if limb == "arm" then
  93. lArmD = lArmD + 1
  94. else
  95. lLegD = lLegD + 1
  96. end
  97. elseif dir == "right" then
  98. if limb == "arm" then
  99. rArmD = rArmD + 1
  100. else
  101. rLegD = rLegD + 1
  102. end
  103. elseif dir == "head" then
  104. headD = headD + 1
  105. elseif dir == "torso" then
  106. torsoD = torsoD + 1
  107. end
  108.  
  109. if leftarmhit >= breakpoint - 2 then
  110. setBackgroundColor("leftarmhit",250,150,150,250);
  111. end
  112. if lLegD >= breakpoint - 2 then
  113. setBackgroundColor("llegB",250,150,150,250);
  114. end
  115. if rLegD >= breakpoint - 2 then
  116. setBackgroundColor("rlegB",250,150,150,250);
  117. end
  118. if rArmD >= breakpoint - 2 then
  119. setBackgroundColor("rarmB",250,150,150,250);
  120. end
  121. if torsoD >= breakpoint - 2 then
  122. setBackgroundColor("torsoB",250,150,150,250);
  123. end
  124. if headD >= breakpoint -2 then
  125. setBackgroundColor("headB",250,150,150,250);
  126. end
  127.  
  128.  
  129. if larmB >= breakpoint then
  130. bg("black")
  131. fg("lawn_green")
  132. echo("\n[[[ LVL 2 BREAK ON LEFT ARM ]]]");
  133. tempTimer(0.3, [[ larmB = 0; echo("larmB","<center> " .. rArmD .. " </center>") ]])
  134. setBackgroundColor("larmB",200,200,200,250);
  135. end
  136. if lLegD >= breakpoint then
  137. bg("black")
  138. fg("lawn_green")
  139. echo("\n[[[ LVL 2 BREAK ON LEFT LEG ]]]");
  140. tempTimer(0.3, [[ lLegD = 0; echo("llegB","<center> " .. rLegD .. " </center>") ]])
  141. setBackgroundColor("llegB",200,200,200,250);
  142. end
  143. if rArmD >= breakpoint then
  144. bg("black")
  145. fg("lawn_green")
  146. echo("\n[[[ LVL 2 BREAK ON RIGHT ARM ]]]");
  147. tempTimer(0.3, [[ rArmD = 0; echo("rarmB","<center> " .. rArmD .. " </center>") ]])
  148. setBackgroundColor("rarmB",200,200,200,250);
  149. end
  150. if rLegD >= breakpoint then
  151. bg("black")
  152. fg("lawn_green")
  153. echo("\n[[[ LVL 2 BREAK ON RIGHT LEG ]]]");
  154. tempTimer(0.3, [[ rLegD = 0; echo("rlegB","<center> " .. rLegD .. " </center>") ]])
  155. setBackgroundColor("rlegB",200,200,200,250);
  156. end
  157. if torsoD >= breakpoint then
  158. bg("black")
  159. fg("lawn_green")
  160. echo("\n[[[ LVL 2 BREAK ON TORSO ]]]");
  161. tempTimer(0.3, [[ torsoD = 0; echo("torsoB","<center> " .. torsoD .. " </center>") ]])
  162. setBackgroundColor("torsoB",200,200,200,250);
  163. end
  164. if headD >= breakpoint then
  165. bg("black")
  166. fg("lawn_green")
  167. echo("\n[[[ LVL 2 BREAK ON HEAD ]]]");
  168. tempTimer(0.3, [[ headD = 0; echo("headB","<center> " .. headD .. " </center>") ]])
  169. setBackgroundColor("headB",200,200,200,250);
  170. end
  171.  
  172. echo("larmB","<center> " .. lArmD .. " </center>")
  173. echo("llegB","<center> " .. lLegD .. " </center>")
  174. echo("rarmB","<center> " .. rArmD .. " </center>")
  175. echo("rlegB","<center> " .. rLegD .. " </center>")
  176. echo("torsoB","<center> " .. torsoD .. " </center>")
  177. echo("headB","<center> " .. headD .. " </center>")
  178. --echo("\nFinished")
  179. end
  180.  
  181. --------------------------------------------
  182. -- Subtract Lim Damage --
  183. --------------------------------------------
  184. function sub_limb(dir, limb)
  185. if dir == "left" then
  186. if limb == "arm" then
  187. lArmD = lArmD - 1
  188. else
  189. lLegD = lLegD - 1
  190. end
  191. elseif dir == "right" then
  192. if limb == "arm" then
  193. rArmD = rArmD - 1
  194. else
  195. rLegD = rLegD - 1
  196. end
  197. elseif dir == "head" then
  198. headD = headD - 1
  199. elseif dir == "torso" then
  200. torsoD = torsoD - 1
  201. end
  202.  
  203. if lArmD >= breakpoint - 2 then
  204. setBackgroundColor("larmB",250,150,150,250);
  205. else
  206. setBackgroundColor("larmB",200,200,200,250);
  207. end
  208.  
  209. if lLegD >= breakpoint -2 then
  210. setBackgroundColor("llegB",250,150,150,250);
  211. else
  212. setBackgroundColor("llegB",200,200,200,250);
  213. end
  214.  
  215. if rArmD >= breakpoint -2 then
  216. setBackgroundColor("rarmB",250,150,150,250);
  217. else
  218. setBackgroundColor("rarmB",200,200,200,250);
  219. end
  220.  
  221. if rLegD >= breakpoint -2 then
  222. setBackgroundColor("rlegB",250,150,150,250);
  223. else
  224. setBackgroundColor("rlegB",200,200,200,250);
  225. end
  226.  
  227. if headD >= breakpoint -2 then
  228. setBackgroundColor("headB",250,150,150,250);
  229. else
  230. setBackgroundColor("headB",200,200,200,250);
  231. end
  232.  
  233. if torsoD >= breakpoint -2 then
  234. setBackgroundColor("torsoB",250,150,150,250);
  235. else
  236. setBackgroundColor("torsoB",200,200,200,250);
  237. end
  238.  
  239. if lArmD < 0 then
  240. lArmD = 0
  241. end
  242. if lLegD < 0 then
  243. lArmD = 0
  244. end
  245. if rArmD < 0 then
  246. rArmD = 0
  247. end
  248. if rLegD < 0 then
  249. rLegD = 0
  250. end
  251. if headD < 0 then
  252. headD = 0
  253. end
  254. if torsoD < 0 then
  255. torsoD = 0
  256. end
  257.  
  258. echo("larmB","<center> " .. lArmD .. " </center>")
  259. echo("llegB","<center> " .. lLegD .. " </center>")
  260. echo("rarmB","<center> " .. rArmD .. " </center>")
  261. echo("rlegB","<center> " .. rLegD .. " </center>")
  262. echo("torsoB","<center> " .. torsoD .. " </center>")
  263. echo("headB","<center> " .. headD .. " </center>")
  264. --echo("\nFinished")
  265.  
  266. end
  267.  
  268.  
  269.  
  270. --------------------------------------------
  271. -- Initialize all Limbs to Zero --
  272. --------------------------------------------
  273. function initLimbs()
  274. headD = 0
  275. lArmD = 0
  276. rArmD = 0
  277. torsoD = 0
  278. lLegD = 0
  279. rLegD = 0
  280. if target ~= last_target then
  281. breakpoint=9
  282. end
  283. end
  284.  
  285. ------------------------------------------
  286. -- Check Max Health to get Breakpoint --
  287. ------------------------------------------
  288. function doAssessCheck( health )
  289. health=tonumber(health)
  290. bg("black")
  291. fg("white")
  292.  
  293. if health < 4000 then
  294. if health > 3000 then
  295. if health >= 3265 then
  296. breakpoint = 11
  297. else
  298. breakpoint = 10
  299. end
  300. else
  301. breakpoint = 7
  302. end
  303. else
  304. if health < 4600 then
  305. breakpoint = 12
  306. else
  307. if health < 5200 then
  308. breakpoint = 14
  309. else
  310. if health > 6000 then
  311. if health > 8000 then
  312. if health > 8500 then
  313. breakpoint = 18
  314. else
  315. breakpoint = 17
  316. end
  317. else
  318. breakpoint = 16
  319. end
  320. else
  321. breakpoint = 14
  322. end
  323. end
  324. end
  325. end
  326. loadDummy()
  327. end
  328.  
  329. function resetLimb( limb )
  330. bg("black")
  331. fg("green_yellow")
  332. echo(" Resetting: " .. limb .. " \n")
  333. if limb == "head" then
  334. headD = 0;
  335. setBackgroundColor("headB",200,200,200,250);
  336. echo("headB","<center> " .. headD .. " </center>");
  337. elseif limb == "torso" then
  338. torsoD = 0;
  339. setBackgroundColor("torsoB",200,200,200,250);
  340. echo("torsoB","<center> " .. torsoD .. " </center>");
  341. elseif limb == "leftarm" then
  342. leftarmhit = 0;
  343. setBackgroundColor("larmB",200,200,200,250);
  344. echo("larmB","<center> " .. lArmD .. " </center>");
  345. elseif limb == "rightarm" then
  346. rightarmhit = 0;
  347. setBackgroundColor("rarmB",200,200,200,250);
  348. echo("rarmB","<center> " .. rArmD .. " </center>");
  349. elseif limb == "leftleg" then
  350. leftleghit = 0;
  351. setBackgroundColor("llegB",200,200,200,250);
  352. echo("llegB","<center> " .. lLegD .. " </center>");
  353. elseif limb == "rightleg" then
  354. rightleghit = 0;
  355. setBackgroundColor("rlegB",200,200,200,250);
  356. echo("rlegB","<center> " .. rLegD .. " </center>");
  357. end
  358. end
Add Comment
Please, Sign In to add comment