Update index.php

This commit is contained in:
James 2022-09-26 14:37:57 +02:00
parent 06d0dac404
commit 923d14d5ea

View File

@ -195,6 +195,7 @@
<div class="card-content white-text"> <div class="card-content white-text">
<span class="card-title">Amount</span> <span class="card-title">Amount</span>
<span>How many bad guys?</span> <span>How many bad guys?</span>
<span class="red-text">CHANGING THIS WILL RESET THE HP CALCULATION</span>
<div class="input-field s3"> <div class="input-field s3">
<input placeholder="How many eggs for a cake?" onchange="setMobs()" id="mob_ammount" min="1" type="number" class="white-text validate" /> <input placeholder="How many eggs for a cake?" onchange="setMobs()" id="mob_ammount" min="1" type="number" class="white-text validate" />
</div> </div>
@ -204,8 +205,8 @@
<div class="card-content white-text"> <div class="card-content white-text">
<span class="card-title">Health kind</span> <span class="card-title">Health kind</span>
<span>Are we using Average Health or HP Dice?</span><br /> <span>Are we using Average Health or HP Dice?</span><br />
<label> <input name="mob_hp_type" type="radio" checked onchange="usingHPDice(true)" /> <span>Averages</span> </label> <label> <input id="mob_hp_type_averages" name="mob_hp_type" type="radio" checked onchange="usingHPDice(true)" /> <span>Averages</span> </label>
<label> <input name="mob_hp_type" type="radio" onchange="usingHPDice(false)" /> <span>Hit Dice</span> </label> <label> <input id="mob_hp_type_rolled" name="mob_hp_type" type="radio" onchange="usingHPDice(false)" /> <span>Hit Dice</span> </label>
</div> </div>
</div> </div>
<div class="card black"> <div class="card black">
@ -249,8 +250,8 @@
<div class="card-content white-text"> <div class="card-content white-text">
<span class="card-title">Damage kind</span> <span class="card-title">Damage kind</span>
<span>Are we using Rolled or Average Damage?</span><br /> <span>Are we using Rolled or Average Damage?</span><br />
<label> <input name="mob_dmg_type" type="radio" checked onchange="usingDMGDice(true)" /> <span>Rolled Damage</span> </label> <label> <input id="mob_dmg_type_rolled" name="mob_dmg_type" type="radio" checked onchange="usingDMGDice(true)" /> <span>Rolled Damage</span> </label>
<label> <input name="mob_dmg_type" type="radio" onchange="usingDMGDice(false)" /> <span>Average Damage</span> </label> <label> <input id="mob_dmg_type_averages" name="mob_dmg_type" type="radio" onchange="usingDMGDice(false)" /> <span>Average Damage</span> </label>
</div> </div>
</div> </div>
<div class="card black"> <div class="card black">
@ -942,8 +943,22 @@
function setMobs() { function setMobs() {
$("#mob_multiattack_ammount").attr("placeholder", "X / "+$("#mob_ammount").val()) $("#mob_multiattack_ammount").attr("placeholder", "X / "+$("#mob_ammount").val())
$("#mob_multiattack_ammount").attr("max", $("#mob_ammount").val()) $("#mob_multiattack_ammount").attr("max", $("#mob_ammount").val())
if ($("#mob_ammount").val() < $("#mob_multiattack_ammount").val()) {
if ($("#mob_ammount").val() > 1 {
// FIX HP
usingHPDice(false);
$("#mob_hp_type_rolled").attr("disabled", true);
$("#mob_hp_type_averages").prop("checked", true);
usingDMGDice(false);
$("#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");
} }
} }