Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- <script language="JavaScript">
- function calc(f) {
- if (f.tan.value == "") {
- f.tan.value = 0
- }
- var damage = 0;
- var avgdam = 0;
- var protect = 0;
- var melres = 0;
- var bulres = 0;
- var shpres = 0;
- var firres = 0;
- var plares = 0;
- var acires = 0;
- var moda = 0;
- var die = 0
- var dice = 0
- var type = 0
- var bonus = 0
- var i = 0;
- var j = 0;
- if (f.armor.selectedIndex == 0) {
- protect = 1;
- melres = 0;
- bulres = 15;
- shpres = 15;
- firres = 0;
- plares = 0;
- acires = 0;
- moda = 1
- }
- if (f.armor.selectedIndex == 1) {
- protect = 2
- melres = 0;
- bulres = 0;
- shpres = 0;
- firres = 0;
- plares = 20;
- acires = 0;
- moda = 1
- }
- if (f.armor.selectedIndex == 2) {
- protect = 4
- melres = 0;
- bulres = 0;
- shpres = 0;
- firres = 25
- plares = 0
- acires = 0;
- moda = 1
- }
- if (f.armor.selectedIndex == 3) {
- protect = 1
- melres = 50
- bulres = 50
- shpres = 50
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 4) {
- protect = 2
- melres = 50
- bulres = 50
- shpres = 50
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 5) {
- protect = 1
- melres = 0
- bulres = 80
- shpres = 0
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 6) {
- protect = 2
- melres = 20
- bulres = 20
- shpres = 20
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 7) {
- protect = 1
- melres = 0
- bulres = 0
- shpres = 0
- firres = 50
- plares = 50
- acires = 50
- moda = 1
- }
- if (f.armor.selectedIndex == 8) {
- protect = 7
- melres = 50
- bulres = 50
- shpres = 50
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 9) {
- protect = 2
- melres = 30
- bulres = 30
- shpres = 30
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 10) {
- protect = 2
- melres = 0
- bulres = 0
- shpres = 0
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 11) {
- protect = 7
- melres = 50
- bulres = 50
- shpres = 50
- firres = 0
- plares = 0
- acires = 0
- moda = 1
- }
- if (f.armor.selectedIndex == 12) {
- protect = 3
- melres = 0
- bulres = 0
- shpres = 0
- firres = 30
- plares = 30
- acires = 30
- moda = 0
- }
- if (f.armor.selectedIndex == 13) {
- protect = 4
- melres = 0
- bulres = 0
- shpres = 0
- firres = 75
- plares = 50
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 14) {
- protect = 4
- melres = 0
- bulres = 0
- shpres = 0
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 15) {
- protect = 6
- melres = 0
- bulres = 0
- shpres = 0
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 16) {
- protect = 2
- melres = 90
- bulres = 90
- shpres = 90
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 17) {
- protect = 4
- melres = 50
- bulres = 50
- shpres = 50
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 18) {
- protect = 12
- melres = 0
- bulres = 0
- shpres = 0
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 19) {
- protect = 4
- melres = 0
- bulres = 0
- shpres = 0
- firres = 95
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 20) {
- protect = 0
- melres = 95
- bulres = 95
- shpres = 95
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 21) {
- protect = 0
- melres = 0
- bulres = 0
- shpres = 0
- firres = 80
- plares = 80
- acires = 80
- moda = 0
- }
- if (f.armor.selectedIndex == 22) {
- protect = 0
- melres = 0
- bulres = 0
- shpres = 0
- firres = 0
- plares = 95
- acires = 0
- moda = 0
- }
- if (f.armor.selectedIndex == 23) {
- protect = 7
- melres = 50
- bulres = 50
- shpres = 50
- firres = 0
- plares = 0
- acires = 0
- moda = 0
- }
- if (moda == 1) {
- if (f.assembly[0].checked) {}
- if (f.assembly[1].checked) {
- melres = melres + 30
- bulres = bulres + 30
- shpres = shpres + 30
- firres = firres - 30
- }
- if (f.assembly[2].checked) {
- melres = melres - 30
- firres = firres + 30
- }
- if (f.assembly[3].checked) {
- protect = Math.floor(protect / 2)
- melres = Math.floor(melres / 2)
- bulres = Math.floor(bulres / 2)
- shpres = Math.floor(shpres / 2)
- firres = Math.floor(firres / 2)
- plares = Math.floor(plares / 2)
- acires = Math.floor(acires / 2)
- }
- if (f.assembly[4].checked) {
- if ((f.armor.selectedIndex == 0) || (f.armor.selectedIndex == 1) || (f.armor.selectedIndex == 2)) {
- protect = protect + 1
- melres = 25 + melres * 2
- bulres = bulres * 2
- shpres = shpres * 2
- firres = firres * 2
- plares = plares * 2
- acires = acires * 2
- }
- }
- if (f.assembly[5].checked) {
- melres = melres + 25
- bulres = bulres + 25
- shpres = shpres + 25
- firres = firres + 25
- plares = plares + 25
- acires = acires + 25
- }
- if (f.assembly[6].checked) {
- protect = protect + 4
- }
- if (f.assembly[7].checked) {
- protect = 0
- firres = 70
- plares = 50
- acires = 70
- }
- }
- if (f.ber.checked) {
- melres = melres + 60
- bulres = bulres + 60
- shpres = shpres + 60
- firres = firres + 60
- plares = plares + 60
- acires = acires + 60
- }
- if (f.env.checked) {
- firres = firres + 25
- acires = acires + 25
- }
- if (melres > 95) {
- melres = 95
- }
- if (bulres > 95) {
- bulres = 95
- }
- if (shpres > 95) {
- shpres = 95
- }
- if (firres > 95) {
- firres = 95
- }
- if (plares > 95) {
- plares = 95
- }
- if (acires > 95) {
- acires = 95
- }
- if ((f.pmod.checked)&&(moda==1)) {
- protect = protect + 2
- }
- protect = protect + parseInt(f.tan.value);
- bonus = 0
- if (f.monster.selectedIndex == 0) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = -1
- }
- if (f.atktype[1].checked) {
- type = 1
- die = 2
- dice = 4
- }
- }
- if (f.monster.selectedIndex == 1) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 2
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 2
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 2) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = -1
- }
- if (f.atktype[1].checked) {
- type = 2
- die = 8
- dice = 3
- }
- }
- if (f.monster.selectedIndex == 3) {
- type = 0
- die = 1
- dice = 3
- bonus = 5
- }
- if (f.monster.selectedIndex == 4) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- }
- if (f.atktype[1].checked) {
- type = 1
- die = 1
- dice = 6
- }
- }
- if (f.monster.selectedIndex == 5) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.monster.selectedIndex == 6) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 6
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 2
- dice = 6
- }
- }
- if (f.monster.selectedIndex == 7) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 2
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 1
- dice = 7
- }
- }
- if (f.monster.selectedIndex == 8) {
- type = 0
- die = 1
- dice = 3
- bonus = 6
- }
- if (f.monster.selectedIndex == 9) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 8
- }
- if (f.atktype[1].checked) {
- type = 5
- die = 4
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 10) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 2
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 1
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 11) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 6
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 5
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 12) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 8
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 4
- dice = 6
- }
- }
- if (f.monster.selectedIndex == 13) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 6
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 20
- dice = 1
- }
- }
- if (f.monster.selectedIndex == 14) {
- type = 0
- die = 1
- dice = 3
- bonus = 10
- }
- if (f.monster.selectedIndex == 15) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 8
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 2
- dice = 7
- }
- }
- if (f.monster.selectedIndex == 16) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 3
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 1
- dice = 6
- }
- }
- if (f.monster.selectedIndex == 17) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 8
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 25
- dice = 1
- }
- }
- if (f.monster.selectedIndex == 18) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.atktype[1].checked) {
- type = 1
- die = 3
- dice = 3
- }
- }
- if (f.monster.selectedIndex == 19) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.atktype[1].checked) {
- type = 2
- die = 7
- dice = 3
- }
- }
- if (f.monster.selectedIndex == 20) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 7
- dice = 3
- }
- }
- if (f.monster.selectedIndex == 21) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.atktype[1].checked) {
- type = 2
- die = 8
- dice = 4
- }
- }
- if (f.monster.selectedIndex == 22) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 1
- dice = 7
- }
- }
- if (f.monster.selectedIndex == 23) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 1
- }
- if (f.atktype[1].checked) {
- type = 1
- die = 1
- dice = 8
- }
- }
- if (f.monster.selectedIndex == 24) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 3
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 6
- dice = 6
- }
- }
- if (f.monster.selectedIndex == 25) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 3
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 7
- dice = 7
- }
- }
- if (f.monster.selectedIndex == 26) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 3
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 4
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 27) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 8
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 4
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 28) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 8
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 5
- dice = 4
- }
- }
- if (f.monster.selectedIndex == 29) {
- type = 0
- die = 1
- dice = 3
- bonus = 15
- }
- if (f.monster.selectedIndex == 30) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 6
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 10
- dice = 1
- }
- }
- if (f.monster.selectedIndex == 31) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 15
- }
- if (f.atktype[1].checked) {
- type = 3
- die = 6
- dice = 6
- }
- }
- if (f.monster.selectedIndex == 32) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 3
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 3
- dice = 5
- }
- }
- if (f.monster.selectedIndex == 33) {
- if (f.atktype[0].checked) {
- type = 0
- die = 1
- dice = 3
- bonus = 18
- }
- if (f.atktype[1].checked) {
- type = 4
- die = 40
- dice = 1
- }
- }
- var count = 1000;
- for (j = 0; j < count; j++) {
- damage = 0;
- for (i = 1; i <= die; i++) {
- damage = damage + Math.floor(1 + (dice * Math.random()));
- }
- damage = damage + bonus;
- if (type == 0) {
- damage = damage * (1 - 0.01 * melres)
- damage = damage - parseInt(protect);
- }
- if (type == 1) {
- damage = damage * (1 - 0.01 * bulres)
- damage = damage - parseInt(protect);
- }
- if (type == 2) {
- damage = damage * (1 - 0.01 * shpres)
- damage = damage - 2 * parseInt(protect);
- }
- if (type == 3) {
- damage = damage * (1 - 0.01 * firres)
- damage = damage - parseInt(protect);
- }
- if (type == 4) {
- damage = damage * (1 - 0.01 * plares)
- damage = damage - Math.floor(parseInt(protect) / 2);
- }
- if (type == 5) {
- damage = damage * (1 - 0.01 * acires)
- damage = damage - parseInt(protect);
- }
- damage = Math.floor(damage);
- if (damage <= 1) {
- damage = 1;
- }
- avgdam = avgdam + damage;
- }
- avgdam = avgdam / count;
- restext = "Total protection : "
- restext += protect
- restext += "<br>Resistance : "
- restext += "Melee "
- restext += melres
- restext += "% Bullet "
- restext += bulres
- restext += "% Sharpnel "
- restext += shpres
- restext += "% Fire "
- restext += firres
- restext += "% Plasma "
- restext += plares
- restext += "% Acid "
- restext += acires
- restext += "%"
- restext += "<br><br>Average damage taken : "
- restext += avgdam
- Result.innerHTML = restext
- }
- </script>
- <form>
- <br>
- <select name="armor">
- <option>Green armor</option>
- <option>Blue armor</option>
- <option>Red armor</option>
- <option>Ballistic vest</option>
- <option>Duelist armor</option>
- <option>Bullet-proof vest</option>
- <option>Medical armor</option>
- <option>Energy-shielded vest</option>
- <option>Gothic armor</option>
- <option>Phaseshift armor</option>
- <option>Onyx armor</option>
- <option>Cybernetic Armor</option>
- <option>Malek's Armor</option>
- <option>Lava Armor</option>
- <option>Medical Powerarmor</option>
- <option>Necroarmor</option>
- <option>Shielded Armor</option>
- <option>Berserker Armor</option>
- <option>Tower shield</option>
- <option>Fireshield</option>
- <option>Ballistic shield</option>
- <option>Energy shield</option>
- <option>Plasma shield</option>
- <option>Angelic Armor</option>
- </select>
-
- <br>TaN (or additional protection) :
- <input type="text" name="tan" maxlength="2" size="2"><br> Power mod :
- <input type="checkbox" name="pmod"> Berserk :
- <input type="checkbox" name="ber"> Envirosuit :
- <input type="checkbox" name="env">
- <br>
- <br>
- <br>Assembly :
- <br>
- <input type="radio" id="plain" name="assembly" checked>Plain
- <input type="radio" id="bal" name="assembly">Ballistic
- <input type="radio" id="fir" name="assembly">Fireproof
- <input type="radio" id="nfib" name="assembly">Nanofiber
- <br>
- <input type="radio" id="pwd" name="assembly">Powered
- <input type="radio" id="nfibskin" name="assembly">Nanoskin
- <input type="radio" id="cyb" name="assembly">Cybernano
- <input type="radio" id="cerb" name="assembly">Cerberus
- <br>
- <br>
- <br>Enemy Attack :
- <select name="monster">
- <option>Former human</option>
- <option>Imp</option>
- <option>Former sergeant</option>
- <option>Demon</option>
- <option>Former captain (4 shots)</option>
- <option>Lost soul</option>
- <option>Hell knight/Cacodemon/Nightmare imp</option>
- <option>Former commando</option>
- <option>Pain elemental/Agony elemental</option>
- <option>Baron of hell/Bruiser brother</option>
- <option>Arachnotron (5 shots)</option>
- <option>Revenant</option>
- <option>Mancubus (3 shots)</option>
- <option>Arch-vile</option>
- <option>Nightmare demon</option>
- <option>Nightmare cacodemon</option>
- <option>Nightmare arachnotron (6 shots)</option>
- <option>Nightmare arch-vile</option>
- <option>Elite former human</option>
- <option>Elite former sergeant (assault shotgun)</option>
- <option>Elite former sergeant (plasma shotgun)</option>
- <option>Elite former sergeant (super shotgun, 2 shots)</option>
- <option>Elite former captain (laser rifle, 5 shots)</option>
- <option>Elite former captain (minigun, 8 shots)</option>
- <option>Elite former commando (missile launcher)</option>
- <option>Elite former commando (napalm launcher)</option>
- <option>Elite former commando (tristar blaster, 3 shots)</option>
- <option>Shambler</option>
- <option>Lava elemental</option>
- <option>Angel of Death</option>
- <option>Arena Master</option>
- <option>Cyberdemon/John Carmack</option>
- <option>Spider Mastermind (4 shots)</option>
- <option>Apostle</option>
- </select>
- <br>
- <input type="radio" id="melee" name="atktype" checked>Melee
- <input type="radio" id="ranged" name="atktype">Ranged
- <br>
- <br>
- <input type="button" value="Calculate" onclick="calc(this.form);">
- <br>
- <br>
- <div id="Result"></div>
- </form>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement