diff --git a/index.php b/index.php index 4d9d99f..6c8c6ef 100644 --- a/index.php +++ b/index.php @@ -205,8 +205,8 @@
Health kind Are we using Max, Average or rolled HP?
- - + +
@@ -987,7 +987,8 @@ } function usingHPDice(e) { - if (e) { + switch (e) { + case "dice": $("#HP_max_card").hide("fast"); $("#HP_average_card").hide("fast"); $("#HP_hitdice_card").show("fast"); @@ -996,8 +997,8 @@ $("#mob_hp_dice_ammount").val(""); $("#mob_hp_dice_type").val(""); $("#mob_hp_max").val(""); - - } else if (e == false) { + break; + case "averages": $("#HP_max_card").hide("fast"); $("#HP_hitdice_card").hide("fast"); $("#HP_average_card").show("fast"); @@ -1007,17 +1008,32 @@ $("#mob_hp_dice_type").val(""); $("#mob_hp_max").val(""); - } else if (e == "max") { + break; + case "averages": + $("#HP_max_card").hide("fast"); + $("#HP_hitdice_card").hide("fast"); + $("#HP_average_card").show("fast"); - $("#HP_max_card").show("fast"); - $("#HP_hitdice_card").hide("fast"); - $("#HP_average_card").hide("fast"); + $("#mob_hp_avg").val(""); + $("#mob_hp_dice_ammount").val(""); + $("#mob_hp_dice_type").val(""); + $("#mob_hp_max").val(""); - $("#mob_hp_avg").val(""); - $("#mob_hp_dice_ammount").val(""); - $("#mob_hp_dice_type").val(""); - $("#mob_hp_max").val(""); - } + break; + case "max": + + + $("#HP_max_card").show("fast"); + $("#HP_hitdice_card").hide("fast"); + $("#HP_average_card").hide("fast"); + + $("#mob_hp_avg").val(""); + $("#mob_hp_dice_ammount").val(""); + $("#mob_hp_dice_type").val(""); + $("#mob_hp_max").val(""); + break; + + } calcDiff(); }