From a68efed023381b84d681076072527be4e19a346f Mon Sep 17 00:00:00 2001
From: James <9213561+Gensokian@users.noreply.github.com>
Date: Thu, 29 Sep 2022 08:22:37 +0200
Subject: [PATCH] started with calculation and added CR
---
index.php | 146 ++++++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 137 insertions(+), 9 deletions(-)
diff --git a/index.php b/index.php
index 1dd635d..0a23200 100644
--- a/index.php
+++ b/index.php
@@ -72,7 +72,13 @@
-
ResourcesHow healthy are your players?
+
Resources
+ How healthy are your players?
+
+
+
+
+
@@ -81,13 +87,28 @@
Skill calculator
-
KnowledgeHave your players played DND before?
+
Knowledge
+ Have your players played DND before?
+
+
+
+
-
AwarenessDo your players use the enviroment for attacks?
+
Awareness
+ Do your players use the enviroment for attacks?
+
+
+
+
-
StrategiesDo your players play any strategy games? (Chess counts)
+
Strategies
+ Do your players play any strategy games? (Chess counts)
+
+
+
+
Special rulesDo you use rules, which assist in adding damage/advantage? (Flanking, Limb rule , Lingering Injuries, Massive Damage, yadayada)
@@ -129,7 +150,19 @@
-
Health kindAre we using Max, Average or rolled HP?
+
Total CR
+ Whats the TOTAL CR Of all the mobs?
+
+
+
+
+
+
+
Health kindAre we using Max, Average or rolled HP?
+
+
+
+
Health RollsHow many Dice are used for the calculation?
@@ -138,8 +171,10 @@
-
Health AveragesWhat's the average HP of the Enemy?
-
+
Health Averages
+ What's the average HP of the Enemy?
+
+
@@ -148,8 +183,11 @@
-
Armor ClassWhat's the average Armorclass?
-
+
Armor Class
+ What's the average Armorclass?
+
+
+
@@ -663,6 +701,96 @@
$("#diff_description").html("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.");
$("#diff_summary").html("#err_notfound");
+ //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_player = 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 = party_meelee_fighters + party_range_fighters + party_magic_fighters + 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_attention * 6.666666666666666666);
+
+
+ var party_final_score = party_skill_strategies_score + party_skill_attention_score + party_skill_knowledge_score + party_health_score
+
+ //Monster Setup
+ //Monster amount
+ var encounter_amount = $("input[name='mob_ammount']:checked").val();
+
+ // A modifier, that applies the ratio of Enemies to players
+ var global_amount_modifier = encounter_amount/party_amount
+
+ // What HP Type is used? 1=average 2=rolled 3=max
+ var encounter_hp_type = $("input[name='mob_hp_type']:checked").val();
+
+ if (encounter_hp_type == 1) {
+ //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
+ var encounter_hp_type_rolls_added_score = 20/(encounter_hp_type_rolls_added / party_amount)
+ } else if (encounter_hp_type == 2) {
+ //IF Using Averages
+ var encounter_hp_type_averages = $("#mob_hp_avg").val();
+ var 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();
+ var encounter_hp_type_max_score = 20/(encounter_hp_type_max / party_amount)
+
+ }
+
+ // 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) / 20
+
+ //This sets the AC Score of the encounter. The AC Percentage defines the "Fair" Ammount of AC per Mob
+ var encounter_ac = $("#mob_ac").val();
+ var encounter_ac_score = (encounter_ac - 2) * global_amount_modifier;
+
+
+
+
+
}