Advertisement
Guest User

DoomRL Boots Calculator

a guest
Oct 9th, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.18 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
  3. <html>
  4.  
  5. <head>
  6. <meta charset="utf-8">
  7. </head>
  8.  
  9. <script language="JavaScript">
  10. function calc(f) {
  11.  
  12.  
  13. var aciddamage = 0;
  14. var lavadamage = 0;
  15.  
  16. var protect = 0;
  17. var firres = 0;
  18. var acires = 0;
  19. var moda = 0;
  20.  
  21.  
  22. if (f.armor.selectedIndex == 0) {
  23. protect = 1;
  24. firres = 0;
  25. acires = 0;
  26. moda = 1
  27. }
  28. if (f.armor.selectedIndex == 1) {
  29. protect = 2
  30. firres = 0;
  31. acires = 25
  32. moda = 1
  33. }
  34. if (f.armor.selectedIndex == 2) {
  35. protect = 2
  36. firres = 25
  37. acires = 50
  38. moda = 1
  39. }
  40. if (f.armor.selectedIndex == 3) {
  41. protect = 0
  42. firres = 0
  43. acires = 100
  44. moda = 1
  45. }
  46. if (f.armor.selectedIndex == 4) {
  47. protect = 10
  48. firres = 0
  49. acires = 0
  50. moda = 1
  51. }
  52. if (f.armor.selectedIndex == 5) {
  53. protect = 4
  54. firres = 0
  55. acires = 0
  56. moda = 1
  57. }
  58. if (f.armor.selectedIndex == 6) {
  59. protect = 0
  60. firres = 100
  61. acires = 100
  62. moda = 0
  63. }
  64. if (f.armor.selectedIndex == 7) {
  65. protect = 6
  66. firres = 30
  67. acires = 30
  68. moda = 0
  69. }
  70.  
  71. if (moda == 1) {
  72.  
  73. if (f.assembly[0].checked) {}
  74. if (f.assembly[1].checked) {
  75. firres = firres + 30
  76. }
  77. if (f.assembly[2].checked) {
  78. protect = protect + 1
  79. }
  80. if (f.assembly[3].checked) {
  81. firres = 100
  82. }
  83. if (f.assembly[4].checked) {
  84. firres = Math.min(firres + 75, 90)
  85. acires = Math.min(acires + 75, 90)
  86. }
  87. if (f.assembly[5].checked) {
  88. firres = 100
  89. acires = 100
  90. }
  91. }
  92.  
  93. if (f.ber.checked) {
  94. if (firres < 100) {
  95. firres = Math.min(firres + 60, 90)
  96. }
  97. if (acires < 100) {
  98. acires = Math.min(acires + 60, 90)
  99. }
  100. }
  101.  
  102. if ((f.pmod.checked) && (moda == 1)) {
  103. protect = protect * 2
  104. }
  105.  
  106. aciddamage = Math.max(Math.floor((6 * (1 - 0.01 * acires)) - protect), 1)
  107. firedamage = Math.max(Math.floor((12 * (1 - 0.01 * firres)) - protect), 1)
  108.  
  109. if (acires == 100) {
  110. aciddamage = 0
  111. }
  112. if (firres == 100) {
  113. firedamage = 0
  114. }
  115.  
  116. restext = "<br>Damage taken : Acid "
  117. restext += aciddamage
  118. restext += ", Fire "
  119. restext += firedamage
  120.  
  121. Result.innerHTML = restext
  122.  
  123.  
  124.  
  125. }
  126. </script>
  127.  
  128. <form>
  129.  
  130. <br>
  131.  
  132. <select name="armor">
  133. <option>Steel boots</option>
  134. <option>Protective boots</option>
  135. <option>Plasteel boots</option>
  136. <option>Acid-proof boots</option>
  137. <option>Gothic boots</option>
  138. <option>Phaseshift boots</option>
  139. <option>Enviroboots</option>
  140. <option>Nyarlaptotep's Boots</option>
  141.  
  142. </select>
  143.  
  144.  
  145. &nbsp;&nbsp;
  146. <br> Power mod :
  147. <input type="checkbox" name="pmod">&nbsp;&nbsp; Berserk :
  148. <input type="checkbox" name="ber">
  149. <br>
  150. <br>Assembly :
  151. <br>
  152. <input type="radio" id="plain" name="assembly" checked>Plain &nbsp;&nbsp;
  153. <input type="radio" id="fir" name="assembly">Fireproof &nbsp;&nbsp;
  154. <input type="radio" id="grap" name="assembly">Grappling
  155. <br>
  156. <input type="radio" id="lava" name="assembly">Lava&nbsp;&nbsp;
  157. <input type="radio" id="env" name="assembly">Environmental &nbsp;&nbsp;
  158. <input type="radio" id="cerb" name="assembly">Cerberus &nbsp;&nbsp;
  159. <br>
  160. <br>
  161. <input type="button" value="Calculate" onclick="calc(this.form);">
  162. <br>
  163.  
  164.  
  165. <div id="Result"></div>
  166.  
  167.  
  168. </form>
  169.  
  170. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement