fixed EVERYTHING... i didnt but lol

This commit is contained in:
James 2022-09-30 12:21:04 +02:00
parent 9abaede948
commit 1ba5ba98fa
2 changed files with 87 additions and 13 deletions

View File

@ -82,3 +82,7 @@ pre code {
.pinned { .pinned {
position: fixed !important; position: fixed !important;
} }
.totalrow {
border-top: 5px solid;
border-bottom: 10px double;
}

View File

@ -719,8 +719,6 @@
// A modifier, that applies the ratio of Enemies to players // A modifier, that applies the ratio of Enemies to players
console.log("encounter_amount = " + encounter_amount);
console.log("party_amount = " + party_amount);
var global_amount_modifier = encounter_amount / party_amount; var global_amount_modifier = encounter_amount / party_amount;
// What HP Type is used? 1=average 2=rolled 3=max // What HP Type is used? 1=average 2=rolled 3=max
@ -811,7 +809,7 @@
var encounter_dmgtype_score = 20 - encounter_dmgtype_possibilities + encounter_dmgtype_points * global_amount_modifier; var encounter_dmgtype_score = 20 - encounter_dmgtype_possibilities - encounter_dmgtype_points * global_amount_modifier;
console.log(encounter_dmgtype_score); console.log(encounter_dmgtype_score);
var encounter_onehit_score = $("input[name='mob_onehits']:checked").val(); var encounter_onehit_score = $("input[name='mob_onehits']:checked").val();
@ -865,7 +863,9 @@
//selected_dmgtypes.push($(this).val()); //selected_dmgtypes.push($(this).val());
}); });
encounter_condition_score = encounter_apply_conditions * 5 - encounter_conditions * 3; var encounter_condition_score = encounter_apply_conditions * 5 - encounter_conditions * 3;
//Clamp the score //Clamp the score
if (encounter_condition_score > 20) { if (encounter_condition_score > 20) {
@ -876,27 +876,97 @@
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; 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 //FINAL CALCULATION
//Party Points: //Party Points:
var final_score = (encounter_final_score * modifier_encounter) - (party_final_score * modifier_party); 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("final_score", party_meelee_fighters)
filltable("final_score", party_range_fighters)
filltable("final_score", party_magic_fighters)
filltable("final_score", party_support_fighters)
filltable("final_score", party_health)
filltable("final_score", party_health_score)
filltable("final_score", party_skill_knowledge)
filltable("final_score", party_skill_knowledge_score)
filltable("final_score", party_skill_attention)
filltable("final_score", party_skill_attention_score)
filltable("final_score", party_skill_strategies)
filltable("final_score", party_skill_strategies_score)
filltable("final_score", party_skill_rules)
filltable("final_score", party_skill_rules_score)
filltable("final_score", party_final_score)
filltable("final_score", encounter_amount)
filltable("final_score", global_amount_modifier)
filltable("final_score", encounter_hp_type)
filltable("final_score", encounter_hp_type_rolls_added_score)
filltable("final_score", encounter_hp_type_averages_score)
filltable("final_score", encounter_hp_type_max_score)
filltable("final_score", encounter_hp_type_rolls_amount)
filltable("final_score", encounter_hp_type_rolls_dice)
filltable("final_score", encounter_hp_type_rolls_added)
filltable("final_score", encounter_hp_type_averages)
filltable("final_score", encounter_hp_type_max)
filltable("final_score", encounter_hp_score)
filltable("final_score", encounter_cr)
filltable("final_score", encounter_cr_per_player)
filltable("final_score", encounter_cr_score)
filltable("final_score", encounter_ac)
filltable("final_score", encounter_ac_score)
filltable("final_score", encounter_dmg_type)
filltable("final_score", encounter_dmg_type_rolls_added_score)
filltable("final_score", encounter_dmg_type_averages_score)
filltable("final_score", encounter_dmg_type_max_score)
filltable("final_score", encounter_dmg_type_rolls_amount)
filltable("final_score", encounter_dmg_type_rolls_dice)
filltable("final_score", encounter_dmg_type_rolls_added)
filltable("final_score", encounter_dmg_type_averages)
filltable("final_score", encounter_dmg_type_max)
filltable("final_score", encounter_dmg_score)
filltable("final_score", encounter_dmgtype_possibilities)
filltable("final_score", encounter_dmgtype_points)
filltable("final_score", encounter_dmgtype_score)
filltable("final_score", encounter_onehit_score)
filltable("final_score", encounter_multiattack_score)
filltable("final_score", encounter_strategy)
filltable("final_score", encounter_strategy_score)
filltable("final_score", encounter_lair_action_score)
filltable("final_score", encounter_legendairy_action_score)
filltable("final_score", encounter_immunities)
filltable("final_score", encounter_resistances)
filltable("final_score", encounter_vounerabilities)
filltable("final_score", encounter_status_score)
filltable("final_score", encounter_healing_score)
filltable("final_score", encounter_stunning_score)
filltable("final_score", encounter_conditions)
filltable("final_score", encounter_apply_conditions)
filltable("final_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 = [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 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 = [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"]; 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]));
//Fill the tables encounter_variables.forEach((element, i) => filltable(encounter_variables_name, element[i]));
$("#totalscard").html('<table><thead><tr><th>Variable</th><th>Pts</th></tr></thead><tbody id="totalsdata"></tbody></table>');
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>"); //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 filltable(namespace, element, i) {
$("#totalsdata").append("<tr><td>" + namespace[i] + "</td><td>" + element + "</td></tr>");
} }
function setDiff(difficulty) { function setDiff(difficulty) {