CRCULATOR/index.php
James 26c9d5efde offsetting!
Revert "offsetting!"

This reverts commit 3be76439e3.

fixed calcs

added party amount

typo

mathnt

Update index.php
2022-10-03 08:31:31 +02:00

1000 lines
87 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>CRCulator</title>
<meta name="description" content="A smol CR Calculator" />
<meta name="author" content="James" />
<meta property="og:title" content="CRCulator" />
<meta property="og:type" content="CRCulator" />
<meta property="og:url" content="https://cr.james-things.com" />
<meta property="og:description" content="A smol CR Calculator" />
<meta property="og:image" content="https://e7.pngegg.com/pngimages/710/403/png-clipart-the-embodiment-of-scarlet-devil-team-shanghai-alice-video-game-banjo-tooie-mario-luigi-partners-in-time-marisa-logo-computer-wallpaper.png" />
<link rel="icon" href="/favicon.ico" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection" />
<link rel="stylesheet" href="css/styles.css" />
</head>
<body>
<div class "container">
<div onclick="calcDiff()" class="fixed-action-btn">
<a class="btn-floating btn-large indigo">
<i class="large material-icons">sync</i>
</a>
</div>
<div class="row">
<div class="col s12 l8">
<div class="blurry">
<div class="card white">
<div class="card-content white-text"> <span class="card-title black-text">James' CR Calculator... or Crculator... whatever</span>
<form action="#">
<!-- START OF CONTENT! -->
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s3"><a href="#Party">Party Setup</a></li>
<li class="tab col s3"><a href="#Mobconfig">Mob Configuration</a></li>
<li class="tab col s3"><a href="#Results">Results</a></li>
<li class="tab col s3"><a href="#Bonus">Bonus Information</a></li>
</ul>
</div>
<div id="Party" class="col s12">
<div class="card green">
<div class="card-content white-text"> <span class="card-title">Party Setup</span>
<div class="row">
<div class="col s12 m6">
<div class="card green darken-4">
<div class="card-content white-text"> <span class="card-title">About the Players...</span>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Meelee count</span> <span>How many Meelee Fighters are in the Party?</span>
<div class="input-field s3"> <input placeholder="Insert Smash Bros. refference..." id="party_meelee" min="0" value="0" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Ranged count</span> <span>How many Ranged fighters are in the Party?</span>
<div class="input-field s3"> <input placeholder="The ones, that DON'T track ammo..." id="party_long_range" min="0" value="0" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Mage count</span> <span>How many Spell Fighters are in the Party?</span>
<div class="input-field s3"> <input placeholder="The ones, who are forced to track ammo..." id="party_magic" min="0" value="0" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Support count</span> <span>How many squishy Supports?</span>
<div class="input-field s3"> <input placeholder="The dicestackers." id="party_support" min="0" value="0" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Level</span> <span>What average level is your party?</span>
<div class="input-field s3"> <input placeholder="How stronk?" id="party_level" min="1" max="20" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Resources</span>
<span>How healthy are your players?</span> <br />
<label> <input name="party_health" value="1" type="radio" checked /> <span>They just had a long rest (full)</span> </label> <br />
<label> <input name="party_health" value="2" type="radio" /> <span>Full after a short rest (missing some health)</span> </label> <br />
<label> <input name="party_health" value="3" type="radio" /> <span>They might be missing some spellslots, ammo... or arms (medium hp, low ammo) </span> </label><br />
<label> <input name="party_health" value="4" type="radio" /> <span>They roleplay a corpse (low Health, no resources)</span> </label>
</div>
</div>
</div>
</div>
</div>
<div class="col s12 m6">
<div class="card green darken-4">
<div class="card-content white-text"> <span class="card-title">Skill calculator</span>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Knowledge</span>
<span>Have your players played DND before?</span> <br />
<label> <input name="party_dndknowledge" value="1" type="radio" /> <span>No, what's a DND?</span> </label>
<label> <input name="party_dndknowledge" value="2" type="radio" checked /> <span>Some have</span> </label> <br />
<label> <input name="party_dndknowledge" value="3" type="radio" /> <span>Yes</span> </label> <br />
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Awareness</span>
<span>Do your players use the enviroment for attacks?</span> <br />
<label> <input value="3" name="party_attention" type="radio" /> <span>Yes, they could use this conventiently placed DEATHLAZOR</span> </label> <br />
<label> <input value="2" name="party_attention" type="radio" /> <span>Yes, but there is nothing around</span> </label> <br />
<label> <input value="1" name="party_attention" type="radio" checked /> <span>No, my players are mindless robots.</span> </label>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Strategies</span>
<span>Do your players play any strategy games? (Chess counts)</span> <br />
<label> <input name="party_strategies" value="1" type="radio" checked /> <span>No</span> </label> <br />
<label> <input name="party_strategies" value="2" type="radio" /> <span>Yes, league</span> </label> <br />
<label> <input name="party_strategies" value="3" type="radio" /> <span>Yes</span> </label> <br />
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Special rules</span>
<span>Do you use rules, which assist in adding damage/advantage? (Flanking, Limb rule , Lingering Injuries, Massive Damage, yadayada)</span> <br />
<label> <input value="3" name="party_special_rules" type="radio" checked /> <span>Yes</span> </label><br />
<label> <input value="2" name="party_special_rules" type="radio" /> <span>Multiple</span> </label><br />
<label> <input value="1" name="party_special_rules" type="radio" /> <span>No</span> </label><br /><br />
<ul class="collapsible">
<li>
<div class="collapsible-header black"><i class="material-icons">info_outline</i>Explanation Flanking</div>
<div class="collapsible-body grey darken-4"> <span> Flanking is an optional rule in DnD 5E, intended to add more tactical depth to combat. The rule itself is straightforward: When a creature and at least one ally are within 5ft of the same enemy on opposite sides, that enemy is flanked. Each of the creatures flanking has advantage on melee attacks against it. </span> </div>
</li>
<li>
<div class="collapsible-header black"><i class="material-icons">info_outline</i>Explanation Limb Rule</div>
<div class="collapsible-body grey darken-4"> <span> Basically like flanking, but instead of standing opposed to the enemy, it's about outnumbering the usable limbs. Basically if there is a normal human, using two swords/shields, they can block 2 People. If there is a third person, they gain advantage, since they cannot block the third attack. </span> </div>
</li>
<li>
<div class="collapsible-header black"><i class="material-icons">info_outline</i>Explanation Lingering Injuries</div>
<div class="collapsible-body grey darken-4"> <span> When a creature takes damage from a single source equal to or greater than half its hit point maximum, it must succeed on a Constitution saving throw with DC 15 or half the damage receive (whichever is higher) or suffer a random effect determined by a roll on the System Shock table. <br /> (Table not included) </span> </div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="Mobconfig" class="col s12">
<div class="card indigo">
<div class="card-content white-text">
<span class="card-title">Mob Setup</span>
<!-- Basics & Hurting Configuration -->
<div class="row">
<div class="col s6">
<div class="card indigo darken-4">
<div class="card-content white-text"> <span class="card-title">Basics</span>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Amount (EXPERIMENTAL)</span> <span>How many bad guys? Anything above 1 will enforce average calculations</span><br> <b class="red-text">Changing this will reset the HP and Damage calculations and deactivate dice rolled HP.</b>
<div class="input-field s3"> <input placeholder="How many eggs for a cake?" value="1" onchange="setMobs()" id="mob_ammount" min="1" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Total CR</span>
<span>Whats the TOTAL CR Of all the mobs?</span>
<div class="input-field s3">
<input placeholder="Basically the enemies Level?" id="mob_CR" value="0" min="1" type="number" class="white-text validate" />
</div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Health kind</span> <span>Are we using Max, Average or rolled HP?</span><br />
<label> <input value="1" id="mob_hp_type_averages" name="mob_hp_type" type="radio" checked onchange="usingHPDice('average')" /> <span>Averages</span> </label>
<label> <input value="2" id="mob_hp_type_rolled" name="mob_hp_type" type="radio" onchange="usingHPDice('dice')" /> <span>Hit Dice</span> </label>
<label> <input value="3" id="mob_hp_type_max" name="mob_hp_type" type="radio" onchange="usingHPDice('max')" /> <span>Max</span> </label>
</div>
</div>
<div class="card black" id="HP_hitdice_card">
<div class="card-content white-text"> <span class="card-title">Health Rolls</span> <span>How many Dice are used for the calculation?</span>
<div class="input-field s1"> <input placeholder="[X]d10" id="mob_hp_dice_ammount" value="0" min="1" type="number" class="white-text validate" /> </div> <span>Which kind of die is used?</span>
<div class="input-field s3"> <input placeholder=" 4d[Y]" id="mob_hp_dice_type" value="0" min="1" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black" id="HP_average_card">
<div class="card-content white-text"> <span class="card-title">Health Averages</span>
<span>What's the average HP of the Enemy?</span>
<div class="input-field s1"> <input placeholder="42" id="mob_hp_avg" value="0" min="1" type="number" class="white-text validate" />
</div>
</div>
</div>
<div class="card black" id="HP_max_card">
<div class="card-content white-text"> <span class="card-title">Health Maxes</span> <span>What's the max rolled HP of all enemies?</span>
<div class="input-field s1"> <input placeholder="42" value="0" id="mob_hp_max" min="1" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Armor Class</span>
<span>What's the average Armorclass?</span>
<div class="input-field s3">
<input placeholder="Should be at least 1" id="mob_ac" value="1" min="1" type="number" class="white-text validate" />
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col s6">
<div class="card indigo darken-4">
<div class="card-content white-text"> <span class="card-title">Hurting the player</span>
<div class="card black">
<div class="card-content white-text">
<span class="card-title">
Damage kind
</span>
<span>Are we using Max, Rolled or Average Damage?</span><br />
<label> <input value="1" id="mob_dmg_type_rolled" name="mob_dmg_type" type="radio" checked onchange="usingDMGDice('dice')" /> <span>Rolled Damage</span> </label>
<label> <input value="2" id="mob_dmg_type_averages" name="mob_dmg_type" type="radio" onchange="usingDMGDice('average')" /> <span>Average Damage</span> </label>
<label> <input value="3" id="mob_dmg_type_max" name="mob_dmg_type" type="radio" onchange="usingDMGDice('max')" /> <span>Max Damage</span> </label>
</div>
</div>
<div id="DMG_hitdice_card" class="card black">
<div class="card-content white-text"> <span class="card-title">Hitdice Damage</span> <span>How many Dice are used for the calculation?</span>
<div class="input-field s1"> <input placeholder="[X]d6" id="mob_dmg_dice_ammount" value="0" min="1" type="number" class="white-text validate" /> </div> <span>Which kind of die is used?</span>
<div class="input-field s3"> <input placeholder=" 4d[Y]" id="mob_dmg_dice_type" value="0" min="1" type="number" class="white-text validate" /> </div>
</div>
</div>
<div id="DMG_average_card" class="card black">
<div class="card-content white-text"> <span class="card-title">Average Damage</span> <span>What's the average damage of the enemy?</span>
<div class="input-field s1"> <input placeholder="The number before the damage dice." id="mob_dmg_avg" value="0" min="1" type="number" class="white-text validate" /> </div>
</div>
</div>
<div id="DMG_max_card" class="card black">
<div class="card-content white-text"> <span class="card-title">Max Damage</span> <span>What's the max ammount of damage the enemy can deal?</span>
<div class="input-field s1"> <input placeholder="x times the hit dieces' sides." id="mob_dmg_max" value="0" min="1" type="number" class="white-text validate" /> </div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title"> Damage Types </span> <span>What damagetype is beeing used?</span><br>
<div class="row">
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_acid" type="checkbox" /> <span>Acid</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_bludgeoning" type="checkbox" /> <span>Bludgeoning</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_cold" type="checkbox" /> <span>Cold</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_fire" type="checkbox" /> <span>Fire</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_force" type="checkbox" /> <span>Force</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_lightning" type="checkbox" /> <span>Lightning</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_necrotic" type="checkbox" /> <span>Necrotic</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_piercing" type="checkbox" /> <span>Piercing</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_poison" type="checkbox" /> <span>Poison</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_psychic" type="checkbox" /> <span>Psychic</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_radiant" type="checkbox" /> <span>Radiant</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_slashing" type="checkbox" /> <span>Slashing</span> </label> </div>
<div class="col s6"> <label> <input Name="dmgtype" id="dmgtype_thunder" type="checkbox" /> <span>Thunder</span> </label> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Ability Configuration -->
<div class="row">
<div class="col s6">
<div class="card indigo darken-4">
<div class="card-content white-text"> <span class="card-title">Abilities</span>
<div class="card black">
<div class="card-content white-text"> <span class="card-title"> One-Hitting </span>
<span>Can this mob one-hit someone? (Above double max HP or any spell like "Power Word: KILL")</span><br>
<label> <input value="0" name="mob_onehits" type="radio" checked /> <span>Nope</span> </label><br />
<label> <input value="20" name="mob_onehits" type="radio" /> <span>Yes :)</span> </label>
</div>
</div>
<div class="card black">
<div class="card-content white-text">
<span class="card-title"> Multiattack </span>
<span>Do your mobs have multiattack?</span><br>
<label> <input value="0" name="mob_multiattack" onchange="setMobMultiattack('hidden')" type="radio" checked /> <span>Nope</span> </label><br />
<label> <input value="10" name="mob_multiattack" onchange="setMobMultiattack('some')" type="radio" /> <span>Some</span> </label><br />
<label> <input value="20" name="mob_multiattack" onchange="setMobMultiattack('all')" type="radio" /> <span>Yes, all of them</span> </label>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Strategy</span>
<span>How many braincells do your enemies have?</span><br>
<label> <input value="1" name="mob_strategy" type="radio" checked /> <span>My mobs are dumb as bread</span> </label> <br />
<label> <input value="2" name="mob_strategy" type="radio" /> <span>My mobs are slightly clever and attack the biggest threat</span> </label><br />
<label> <input value="3" name="mob_strategy" type="radio" /> <span>My mobs are clever, they use custom rules like flanking</span> </label> <br />
<label> <input value="4" name="mob_strategy" type="radio" /> <span>My mobs are working in a pack!</span> </label>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title"> Lair actions </span>
<span>Can this mob use Lair Actions?</span><br>
<label> <input value="0" name="mob_lair_action" type="radio" checked /> <span>Nein</span> </label><br />
<label> <input value="10" name="mob_lair_action" type="radio" /> <span>Yes</span> </label>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Legendary Actions</span>
<span>Can this mob use Legendary Actions?</span><br>
<label> <input value="0" name="mob_legendary_action" type="radio" checked /> <span>Nah dude</span> </label><br />
<label> <input value="10" name="mob_legendary_action" type="radio" /> <span>Hell yeah!</span> </label>
</div>
</div>
</div>
</div>
</div>
<div class="col s12 l6">
<div class="card indigo darken-4">
<div class="card-content white-text">
<span class="card-title"> About the defence </span>
<div class="card black">
<div class="card-content white-text">
<span class="card-title"> Immunities </span>
<span>What immunities does your encounter have?</span>
<div class="row">
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_acid" type="checkbox" /> <span>Acid</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_bludgeoning" type="checkbox" /> <span>Bludgeoning</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_cold" type="checkbox" /> <span>Cold</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_fire" type="checkbox" /> <span>Fire</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_force" type="checkbox" /> <span>Force</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_lightning" type="checkbox" /> <span>Lightning</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_necrotic" type="checkbox" /> <span>Necrotic</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_piercing" type="checkbox" /> <span>Piercing</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_poison" type="checkbox" /> <span>Poison</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_psychic" type="checkbox" /> <span>Psychic</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_radiant" type="checkbox" /> <span>Radiant</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_slashing" type="checkbox" /> <span>Slashing</span> </label> </div>
<div class="col s6"> <label> <input name="mob_immunities" id="immunity_thunder" type="checkbox" /> <span>Thunder</span> </label> </div>
</div>
</div>
</div>
<div class="card black">
<div class="card-content white-text">
<span class="card-title">Resistance</span>
<span>What resistances does your dudes have?</span>
<div class="row">
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_acid" type="checkbox" /> <span>Acid</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_bludgeoning" type="checkbox" /> <span>Bludgeoning</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_cold" type="checkbox" /> <span>Cold</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_fire" type="checkbox" /> <span>Fire</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_force" type="checkbox" /> <span>Force</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_lightning" type="checkbox" /> <span>Lightning</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_necrotic" type="checkbox" /> <span>Necrotic</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_piercing" type="checkbox" /> <span>Piercing</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_poison" type="checkbox" /> <span>Poison</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_psychic" type="checkbox" /> <span>Psychic</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_radiant" type="checkbox" /> <span>Radiant</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_slashing" type="checkbox" /> <span>Slashing</span> </label> </div>
<div class="col s6"> <label> <input name="mob_resitances" id="resistance_thunder" type="checkbox" /> <span>Thunder</span> </label> </div>
</div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title"> Vounerabilities </span> <span>What vounerabilities does your dudes have?</span>
<div class="row">
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_acid" type="checkbox" /> <span>Acid</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_bludgeoning" type="checkbox" /> <span>Bludgeoning</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_cold" type="checkbox" /> <span>Cold</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_fire" type="checkbox" /> <span>Fire</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_force" type="checkbox" /> <span>Force</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_lightning" type="checkbox" /> <span>Lightning</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_necrotic" type="checkbox" /> <span>Necrotic</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_piercing" type="checkbox" /> <span>Piercing</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_poison" type="checkbox" /> <span>Poison</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_psychic" type="checkbox" /> <span>Psychic</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_radiant" type="checkbox" /> <span>Radiant</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_slashing" type="checkbox" /> <span>Slashing</span> </label> </div>
<div class="col s6"> <label> <input name="mob_vounerabilities" id="vounerability_thunder" type="checkbox" /> <span>Thunder</span> </label> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Power Configuration -->
<div class="row">
<div class="col s6">
<div class="card indigo darken-4">
<div class="card-content white-text"> <span class="card-title">Powers</span>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Healing</span>
<span>Can your encounter heal?</span><br>
<label> <input name="mob_healing" value="0" onchange="healingMode(false)" id="mob_healing_noheal" type="checkbox" /> <span>No, my guys cannot heal</span> </label><br />
<label> <input name="mob_healing" value="5" onchange="healingMode(true)" id="mob_healing_self" type="checkbox" /> <span>Yes, some or all of my mobs can heal THEMSELVES</span> </label><br />
<label> <input name="mob_healing" value="10" onchange="healingMode(true)" id="mob_healing_other_touch" type="checkbox" /> <span>Yes, some or all of my mobs can heal OTHERS on TOUCH</span> </label><br />
<label> <input name="mob_healing" value="20" onchange="healingMode(true)" id="mob_healing_other_aoe" type="checkbox" /> <span>Yes, some or all of my mobs can heal OTHERS with AOE</span> </label><br />
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Summoning new Enemies</span>
<span>Can they make more problems?</span><br>
<label><input name="mob_summon" value="0" type="radio" checked /> <span>No, they can't and never will</span></label><br />
<label><input name="mob_summon" value="15" type="radio" /> <span>I am evil. (yes)</span> </label>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Stunning</span>
<span>Can your people stun or slow or otherwise annoy the party?</span><br>
<label> <input name="mob_stun" value="0" type="radio" checked /> <span>No they can't</span> </label><br />
<label> <input name="mob_stun" value="15" type="radio" /> <span>My players should suffer >:) </span> </label>
</div>
</div>
</div>
</div>
</div>
<div class="col s6">
<div class="card indigo darken-4">
<div class="card-content white-text"> <span class="card-title">Conditions</span>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Choose your conditions</span>
<span>What conditions are applied to your (some of your) enemies</span><br>
<div class="row">
<div class="col s6"> <label> <input name="conditions" id="contype_Blinded" type="checkbox" /> <span> Blinded </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Charmed" type="checkbox" /> <span> Charmed </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Deafened" type="checkbox" /> <span> Deafened </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Exhaustion" type="checkbox" /> <span> Exhaustion </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Frightened" type="checkbox" /> <span> Frightened </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Grappled" type="checkbox" /> <span> Grappled </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Incapacitated" type="checkbox" /> <span> Incapacitated </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Invisible" type="checkbox" /> <span> Invisible </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Paralyzed" type="checkbox" /> <span> Paralyzed </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Petrified" type="checkbox" /> <span> Petrified </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Poisoned" type="checkbox" /> <span> Poisoned </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Prone" type="checkbox" /> <span> Prone </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Restrained" type="checkbox" /> <span> Restrained </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Stunned" type="checkbox" /> <span> Stunned </label> </div>
<div class="col s6"> <label> <input name="conditions" id="contype_Unconscious" type="checkbox" /> <span> Unconscious </label> </div>
</div>
</div>
</div>
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Choose applying conditions</span>
<span>What conditions can your players get from this encounter</span><br>
<div class="row">
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Blinded" type="checkbox" /> <span> Blinded </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Charmed" type="checkbox" /> <span> Charmed </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Deafened" type="checkbox" /> <span> Deafened </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Exhaustion" type="checkbox" /> <span> Exhaustion </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Frightened" type="checkbox" /> <span> Frightened </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Grappled" type="checkbox" /> <span> Grappled </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Incapacitated" type="checkbox" /> <span> Incapacitated </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Invisible" type="checkbox" /> <span> Invisible </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Paralyzed" type="checkbox" /> <span> Paralyzed </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Petrified" type="checkbox" /> <span> Petrified </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Poisoned" type="checkbox" /> <span> Poisoned </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Prone" type="checkbox" /> <span> Prone </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Restrained" type="checkbox" /> <span> Restrained </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Stunned" type="checkbox" /> <span> Stunned </label> </div>
<div class="col s6"> <label> <input name="applying_conditions" id="contype_apply_Unconscious" type="checkbox" /> <span> Unconscious </label> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="Results" class="col s12">
<div class="row">
<div class="col s12">
<div class="card black">
<div class="card-content white-text"> <span class="card-title">Results</span>
<div class="row">
</div>
<div class="row">
<div class="col s12">
<div class="card horizontal grey darken-4">
<div class="card-image"> <a href="https://www.deviantart.com/velger96/art/Marisa-level-chart-208761786"> <img id="diff_image" src="img/notfound.jpg" height="206" /> </a> </div>
<div class="card-stacked">
<div class="card-content">
<p id="diff_description">I was unable to find a calculation with those parameters.... or any programming at all... give me some time, i'm still working on this app, after all.</p>
</div>
<div class="card-action">
<p id="diff_summary">Error 404 - Calculation not found</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="Bonus" class="col s12">
<div class="row">
<div class="col s12">
<div class="card black">
<div class="card-content white-text">
<span class="card-title">[DEBUG] Set the current status! [DEBUG]</span> <br />
<label> <input name="debug_diff" type="radio" checked onchange="calcDiff()" /><span>Calculation</span> </label>
<label> <input name="debug_diff" type="radio" onchange="setDiff('easy')" /> <span>Easy</span> </label>
<label> <input name="debug_diff" type="radio" onchange="setDiff('medium')" /> <span>Medium</span> </label>
<label> <input name="debug_diff" type="radio" onchange="setDiff('hard')" /> <span>Hard</span> </label>
<label><input name="debug_diff" type="radio" onchange="setDiff('lunatic')" /> <span>Deadly</span> </label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<div class="card black">
<div class="card-content white-text"> <span class="card-title"> Do you intend to wipe the party?</span> <label> <input name="danger" type="radio" checked /> <span>Yes</span> </label> <br /> <label> <input name="danger" type="radio" /> <span class="red-text"> <b>Yes, but in red</b> </span> </label> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<!-- START COLLECTION! -->
<div class="col s12 l4">
<div class="blurry">
<div class="card white">
<div class="card-content white-text"> <span class="card-title black-text">Your choices</span>
<div class="card black">
<div id="totalscard" class="card-content white-text">
<p> Calculation not performed.. uhoh! </p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
M.updateTextFields();
$('.fixed-action-btn').floatingActionButton();
$(".tabs").tabs();
$(".collapsible").collapsible();
$("#HP_max_card").hide();
$("#HP_hitdice_card").hide();
$("#DMG_max_card").hide();
$("#DMG_average_card").hide();
$("#dmg_hitdice").hide();
});
</script>
<script type="text/javascript">
function healingMode(t) {
if (t) {
if ($("#mob_healing_other_touch").is(':checked') || $("#mob_healing_self").is(':checked') || $("#mob_healing_other_aoe").is(':checked')) {
$("#mob_healing_noheal").prop("checked", false);
}
} else {
if ($("#mob_healing_noheal").is(':checked')) {
$("#mob_healing_other_touch").prop("checked", false);
$("#mob_healing_self").prop("checked", false);
$("#mob_healing_other_aoe").prop("checked", false);
}
}
}
function setMobs() {
if ($("#mob_ammount").val() > 1) {
// FIX HP
usingHPDice("average");
$("#mob_hp_type_rolled").attr("disabled", true);
$("#mob_hp_type_averages").prop("checked", true);
usingDMGDice("average");
$("#mob_dmg_type_rolled").attr("disabled", true);
$("#mob_dmg_type_averages").prop("checked", true);
} else {
$("#mob_hp_type_rolled").removeAttr("disabled");
$("#mob_dmg_type_rolled").removeAttr("disabled");
}
}
function usingHPDice(e) {
switch (e) {
case "dice":
$("#HP_max_card").hide("fast");
$("#HP_average_card").hide("fast");
$("#HP_hitdice_card").show("fast");
$("#mob_hp_avg").val("0");
$("#mob_hp_dice_ammount").val("0");
$("#mob_hp_dice_type").val("0");
$("#mob_hp_max").val("0");
break;
case "average":
$("#HP_max_card").hide("fast");
$("#HP_hitdice_card").hide("fast");
$("#HP_average_card").show("fast");
$("#mob_hp_avg").val("0");
$("#mob_hp_dice_ammount").val("0");
$("#mob_hp_dice_type").val("0");
$("#mob_hp_max").val("0");
break;
case "max":
$("#HP_max_card").show("fast");
$("#HP_hitdice_card").hide("fast");
$("#HP_average_card").hide("fast");
$("#mob_hp_avg").val("0");
$("#mob_hp_dice_ammount").val("0");
$("#mob_hp_dice_type").val("0");
$("#mob_hp_max").val("0");
break;
}
}
function usingDMGDice(e) {
switch (e) {
case "dice":
$("#DMG_hitdice_card").show("fast");
$("#DMG_average_card").hide("fast");
$("#DMG_max_card").hide("fast");
$("#mob_dmg_avg").val("0");
$("#mob_dmg_dice_ammount").val("0");
$("#mob_dmg_dice_type").val("0");
$("#mob_dmg_max").val("0");
break;
case "average":
$("#DMG_max_card").hide("fast");
$("#DMG_hitdice_card").hide("fast");
$("#DMG_average_card").show("fast");
$("#mob_dmg_avg").val("0");
$("#mob_dmg_dice_ammount").val("0");
$("#mob_dmg_dice_type").val("0");
$("#mob_dmg_max").val("0");
break;
case "max":
$("#DMG_max_card").show("fast");
$("#DMG_hitdice_card").hide("fast");
$("#DMG_average_card").hide("fast");
$("#mob_dmg_avg").val("0");
$("#mob_dmg_dice_ammount").val("0");
$("#mob_dmg_dice_type").val("0");
$("#mob_dmg_max").val("0");
break;
}
}
function calcDiff() {
$("#diff_image").attr("src", "img/error.png");
$("#diff_description").html("I was unable to calculate the difficulty.");
$("#diff_summary").html("Error 812 - Drunk calculation");
//MODIFIERS
//These are to influence how STRONK the weighting of the different
// thins are.... yes that helps...
//Set the Mob Modifier
modifier_encounter = 1;
modifier_party = 1;
//All Player Stats
//The Party itself, each variable can range form 1 to infinity
var party_meelee_fighters = $("#party_meelee").val();
var party_range_fighters = $("#party_long_range").val();
var party_magic_fighters = $("#party_magic").val();
var party_support_fighters = $("#party_support").val();
//This counts the amount of Party Members for convenience
var party_amount = parseInt(party_meelee_fighters) + parseInt(party_range_fighters) + parseInt(party_magic_fighters) + parseInt(party_support_fighters);
//Party Weighting
//Too Lazy. I could add something like when the difference
//between two categories is a certain amount, they automatically
//get weightet with more power or something. Somethingsomething
//balance.
//Party Levels (1-20)
var party_level = $("#party_level").val();
//Party Health (1-4) 1=healthy 4=almost dead
var party_health = $("input[name='party_health']:checked").val();
var party_health_score = party_health * 5;
//Party Skill
var party_skill_knowledge = $("input[name='party_dndknowledge']:checked").val();
var party_skill_knowledge_score = Math.round(party_skill_knowledge * 6.666666666666666666);
var party_skill_attention = $("input[name='party_attention']:checked").val();
var party_skill_attention_score = Math.round(party_skill_attention * 6.666666666666666666);
var party_skill_strategies = $("input[name='party_strategies']:checked").val();
var party_skill_strategies_score = Math.round(party_skill_strategies * 6.666666666666666666);
var party_skill_rules = $("input[name='party_special_rules']:checked").val();
var party_skill_rules_score = Math.round(party_skill_rules * 6.666666666666666666);
var party_final_score = party_skill_strategies_score + party_skill_rules_score + party_skill_attention_score + party_skill_knowledge_score + party_health_score;
//Monster Setup
//Monster amount
var encounter_amount = $("#mob_ammount").val();
// A modifier, that applies the ratio of Enemies to players
var global_amount_modifier = encounter_amount / party_amount * 100;
// What HP Type is used? 1=average 2=rolled 3=max
var encounter_hp_type = $("input[name='mob_hp_type']:checked").val();
//reset scores
var encounter_hp_type_rolls_added_score = 0;
var encounter_hp_type_averages_score = 0;
var encounter_hp_type_max_score = 0;
if (encounter_hp_type == 2) {
//IF Using Health Rolls
var encounter_hp_type_rolls_amount = $("#mob_hp_dice_ammount").val();
var encounter_hp_type_rolls_dice = $("#mob_hp_dice_type").val();
//Evaluate by adding the two scores.
//I Debated multiplying the points but that would just be the max HP value.
//In the end, it's always hard to give a fair result.
var encounter_hp_type_rolls_added = encounter_hp_type_rolls_amount + encounter_hp_type_rolls_dice;
encounter_hp_type_rolls_added_score = 20 / (encounter_hp_type_rolls_added / party_amount);
} else if (encounter_hp_type == 1) {
//IF Using Averages
var encounter_hp_type_averages = $("#mob_hp_avg").val();
encounter_hp_type_averages_score = 20 / (encounter_hp_type_averages / party_amount);
} else if (encounter_hp_type == 3) {
//IF Using Averages
var encounter_hp_type_max = $("#mob_hp_max").val();
encounter_hp_type_max_score = 20 / (encounter_hp_type_max / party_amount);
}
var encounter_hp_score = encounter_hp_type_rolls_added_score + encounter_hp_type_averages_score + encounter_hp_type_max_score;
// CR Calculation
var encounter_cr = $("#mob_CR").val();
var encounter_cr_per_player = encounter_cr / party_amount;
var encounter_cr_score = (encounter_cr_per_player / (party_level*party_amount)) / 20;
//This sets the AC Score of the encounter.
var encounter_ac = $("#mob_ac").val();
var encounter_ac_score = (encounter_ac - 2) * global_amount_modifier;
// What Damage Type is used? 1=average 2=rolled 3=max
var encounter_dmg_type = $("input[name='mob_dmg_type']:checked").val();
//reset scores
var encounter_dmg_type_rolls_added_score = 0;
var encounter_dmg_type_averages_score = 0;
var encounter_dmg_type_max_score = 0;
if (encounter_dmg_type == 1) {
//IF Using Health Rolls
var encounter_dmg_type_rolls_amount = $("#mob_dmg_dice_ammount").val();
var encounter_dmg_type_rolls_dice = $("#mob_dmg_dice_type").val();
//Evaluate by adding the two scores.
//I Debated multiplying the points but that would just be the max dmg value.
//In the end, it's always hard to give a fair result.
var encounter_dmg_type_rolls_added = encounter_dmg_type_rolls_amount + encounter_dmg_type_rolls_dice;
encounter_dmg_type_rolls_added_score = 20 / (encounter_dmg_type_rolls_added / party_amount);
} else if (encounter_dmg_type == 2) {
//IF Using Averages
var encounter_dmg_type_averages = $("#mob_dmg_avg").val();
encounter_dmg_type_averages_score = 20 / (encounter_dmg_type_averages / party_amount);
} else if (encounter_dmg_type == 3) {
//IF Using Averages
var encounter_dmg_type_max = $("#mob_dmg_max").val();
encounter_dmg_type_max_score = 20 / (encounter_dmg_type_max / party_amount);
}
var encounter_dmg_score = encounter_dmg_type_rolls_added_score + encounter_dmg_type_averages_score + encounter_dmg_type_max_score;
var encounter_dmgtype_possibilities = 0;
var encounter_dmgtype_points = 0;
$.each($("input[name='dmgtype']:checked"), function() {
encounter_dmgtype_points++;
console.log("dmgtype_points = " + encounter_dmgtype_points);
//selected_dmgtypes.push($(this).val());
});
$.each($("input[name='dmgtype']"), function() {
encounter_dmgtype_possibilities++;
console.log("encounter_dmgtype_possibilities = " + encounter_dmgtype_possibilities);
});
var encounter_dmgtype_score = 20 - encounter_dmgtype_possibilities - encounter_dmgtype_points * global_amount_modifier;
console.log(encounter_dmgtype_score);
var encounter_onehit_score = $("input[name='mob_onehits']:checked").val();
var encounter_multiattack_score = $("input[name='mob_multiattack']:checked").val() * global_amount_modifier;
var encounter_strategy = $("input[name='mob_strategy']:checked").val();
var encounter_strategy_score = Math.round(encounter_strategy * 5);
var encounter_lair_action_score = $("input[name='mob_lair_action']:checked").val();
var encounter_legendairy_action_score = $("input[name='mob_legendary_action']:checked").val();
// Immunity Resistances and Vounerabilities
var encounter_immunities = 0;
var encounter_resistances = 0;
var encounter_vounerabilities = 0;
$.each($("input[name='mob_immunities']:checked"), function() {
encounter_resistances++;
//selected_dmgtypes.push($(this).val());
});
$.each($("input[name='mob_resitances']:checked"), function() {
encounter_immunities++;
//selected_dmgtypes.push($(this).val());
});
$.each($("input[name='mob_vounerabilities']:checked"), function() {
encounter_vounerabilities++;
//selected_dmgtypes.push($(this).val());
});
var encounter_status_score = global_amount_modifier * (encounter_resistances + (encounter_immunities * 2)) - encounter_vounerabilities;
var encounter_healing_score = 0;
$.each($("input[name='mob_healing']:checked"), function() {
encounter_healing_score = encounter_healing_score + $(this).val();
});
var encounter_stunning_score = $("input[name='mob_stun']:checked").val();
var encounter_conditions = 0;
var encounter_apply_conditions = 0;
$.each($("input[name='mob_resitances']:checked"), function() {
encounter_conditions++;
//selected_dmgtypes.push($(this).val());
});
$.each($("input[name='applying_conditions']:checked"), function() {
encounter_apply_conditions++;
//selected_dmgtypes.push($(this).val());
});
var encounter_condition_score = encounter_apply_conditions * 5 - encounter_conditions * 3;
//Clamp the score
if (encounter_condition_score > 20) {
encounter_condition_score = 20;
} else if (encounter_condition_score < -20) {
encounter_condition_score = -20;
}
encounter_final_score = encounter_hp_score + encounter_cr_score + encounter_ac_score + encounter_dmg_score + encounter_dmgtype_score + encounter_onehit_score + encounter_multiattack_score + encounter_strategy_score + encounter_lair_action_score + encounter_legendairy_action_score + encounter_status_score + encounter_healing_score + encounter_stunning_score + encounter_condition_score;
//FINAL CALCULATION
//Party Points:
var final_score = (encounter_final_score * modifier_encounter) - (party_final_score * modifier_party);
//Fill the tables
$("#totalscard").html('<table class="responsive-table"><thead><tr><th>Variable</th><th>Pts</th></tr></thead><tbody id="totalsdata"></tbody></table>');
filltable("party_meelee_fighters", party_meelee_fighters)
filltable("party_range_fighters", party_range_fighters)
filltable("party_magic_fighters", party_magic_fighters)
filltable("party_support_fighters", party_support_fighters)
filltable("party_amount", party_amount)
filltable("party_health", party_health)
filltable("party_health_score", party_health_score)
filltable("party_skill_knowledge", party_skill_knowledge)
filltable("party_skill_knowledge_score", party_skill_knowledge_score)
filltable("party_skill_attention", party_skill_attention)
filltable("party_skill_attention_score", party_skill_attention_score)
filltable("party_skill_strategies", party_skill_strategies)
filltable("party_skill_strategies_score", party_skill_strategies_score)
filltable("party_skill_rules", party_skill_rules)
filltable("party_skill_rules_score", party_skill_rules_score)
filltable("party_final_score", party_final_score)
filltable("encounter_amount", encounter_amount)
filltable("global_amount_modifier", global_amount_modifier)
filltable("encounter_hp_type", encounter_hp_type)
filltable("encounter_hp_type_rolls_added_score", encounter_hp_type_rolls_added_score)
filltable("encounter_hp_type_averages_score", encounter_hp_type_averages_score)
filltable("encounter_hp_type_max_score", encounter_hp_type_max_score)
filltable("encounter_hp_type_rolls_amount", encounter_hp_type_rolls_amount)
filltable("encounter_hp_type_rolls_dice", encounter_hp_type_rolls_dice)
filltable("encounter_hp_type_rolls_added", encounter_hp_type_rolls_added)
filltable("encounter_hp_type_averages", encounter_hp_type_averages)
filltable("encounter_hp_type_max", encounter_hp_type_max)
filltable("encounter_hp_score", encounter_hp_score)
filltable("encounter_cr", encounter_cr)
filltable("encounter_cr_per_player", encounter_cr_per_player)
filltable("encounter_cr_score", encounter_cr_score)
filltable("encounter_ac", encounter_ac)
filltable("encounter_ac_score", encounter_ac_score)
filltable("encounter_dmg_type", encounter_dmg_type)
filltable("encounter_dmg_type_rolls_added_score", encounter_dmg_type_rolls_added_score)
filltable("encounter_dmg_type_averages_score", encounter_dmg_type_averages_score)
filltable("encounter_dmg_type_max_score", encounter_dmg_type_max_score)
filltable("encounter_dmg_type_rolls_amount", encounter_dmg_type_rolls_amount)
filltable("encounter_dmg_type_rolls_dice", encounter_dmg_type_rolls_dice)
filltable("encounter_dmg_type_rolls_added", encounter_dmg_type_rolls_added)
filltable("encounter_dmg_type_averages", encounter_dmg_type_averages)
filltable("encounter_dmg_type_max", encounter_dmg_type_max)
filltable("encounter_dmg_score", encounter_dmg_score)
filltable("encounter_dmgtype_possibilities", encounter_dmgtype_possibilities)
filltable("encounter_dmgtype_points", encounter_dmgtype_points)
filltable("encounter_dmgtype_score", encounter_dmgtype_score)
filltable("encounter_onehit_score", encounter_onehit_score)
filltable("encounter_multiattack_score", encounter_multiattack_score)
filltable("encounter_strategy", encounter_strategy)
filltable("encounter_strategy_score", encounter_strategy_score)
filltable("encounter_lair_action_score", encounter_lair_action_score)
filltable("encounter_legendairy_action_score", encounter_legendairy_action_score)
filltable("encounter_immunities", encounter_immunities)
filltable("encounter_resistances", encounter_resistances)
filltable("encounter_vounerabilities", encounter_vounerabilities)
filltable("encounter_status_score", encounter_status_score)
filltable("encounter_healing_score", encounter_healing_score)
filltable("encounter_stunning_score", encounter_stunning_score)
filltable("encounter_conditions", encounter_conditions)
filltable("encounter_apply_conditions", encounter_apply_conditions)
filltable("encounter_condition_score", encounter_condition_score)
filltable("final_score", final_score, true)
/* This used to be the old code for the Tablevariables
var party_variables = [party_skill_strategies_score,party_skill_attention_score,party_skill_knowledge_score,party_skill_rules_score,party_health_score];
var party_variables_name = ["party_skill_strategies_score","party_skill_attention_score","party_skill_knowledge_score","party_skill_rules_score","party_health_score"];
var encounter_variables = [encounter_hp_score,encounter_cr_score,encounter_ac_score,encounter_dmg_score,encounter_dmgtype_score,encounter_onehit_score,encounter_multiattack_score,encounter_strategy_score,encounter_lair_action_score,encounter_legendairy_action_score,encounter_status_score,encounter_healing_score,encounter_stunning_score,encounter_condition_score];
var encounter_variables_name = ["encounter_hp_score","encounter_cr_score","encounter_ac_score","encounter_dmg_score","encounter_dmgtype_score","encounter_onehit_score","encounter_multiattack_score","encounter_strategy_score","encounter_lair_action_score","encounter_legendairy_action_score","encounter_status_score","encounter_healing_score","encounter_stunning_score","encounter_condition_score"];
party_variables.forEach((element, i) => filltable(party_variables_name, element[i]));
encounter_variables.forEach((element, i) => filltable(encounter_variables_name, element[i]));
//encounter_variables.forEach((element, i) => document.getElementById("totalscard").innerHTML += "<tr>" + encounter_variables_name[i] + "</tr>" + "<tr>" + element + "</tr>");
*/
}
function filltable(variablename, element, istotal) {
if (istotal) {
$("#totalsdata").append("<tr class='totalrow'><td><b>" + variablename + "</b></td><td><b>" + element + "</b></td></tr>");
} else {
$("#totalsdata").append("<tr><td>" + variablename + "</td><td>" + element + "</td></tr>");
}
}
function setDiff(difficulty) {
$("#diff_image").attr("src", "img/diff_" + difficulty.substring(3, 0) + ".jpg");
switch (difficulty) {
case "easy":
$("#diff_description").html("This fight should be an easy pick for your players. Maybe a scratch wound or two are the most, they take out of this.");
$("#diff_summary").html("A simple fight");
break;
case "medium":
$("#diff_description").html("Noone <i> should </i> die, but if your party willingly positions themselves in front of the raging barbarian, that's on them.");
$("#diff_summary").html("A slightly challenging fight.");
break;
case "hard":
$("#diff_description").html("Quite a fight. Could lead to a death. If you want, that your party uses items, go ahead and throw this fight at them.");
$("#diff_summary").html("Item usage to prevent death is advised.");
break;
case "lunatic":
$("#diff_description").html("This is the real deal. You will suffer losses. Maybe your party will die... or enslaved.. or enslaved and then killed... However, there is hope! <b> Okay no, I lied.your Party is dead.");
$("#diff_summary").html("");
}
};
console.log("Done!");
</script>
</body>
</html>