From 86213531057454c7910a24db8ae4626cf39bf8bd Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Sun, 30 Jun 2024 12:01:34 +0100 Subject: [PATCH] fix ability check function bug --- app/functions/roll_ability_check.py | 4 +- web/ability_check.html | 65 +++++++++++++++++++++++++++++ web/index.html | 11 ++++- 3 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 web/ability_check.html diff --git a/app/functions/roll_ability_check.py b/app/functions/roll_ability_check.py index fe4595f..e1be450 100644 --- a/app/functions/roll_ability_check.py +++ b/app/functions/roll_ability_check.py @@ -5,6 +5,6 @@ def roll_ability_check(score, multiplier): threshold = score * multiplier rolled = roll_dices(1, 100, False).get('result') if rolled < threshold: - return {'threshold': threshold, 'rolled': rolled, 'success': True}, 200 + return {'threshold': threshold, 'rolled': rolled, 'success': True} else: - return {'threshold': threshold, 'rolled': rolled, 'success': False}, 200 + return {'threshold': threshold, 'rolled': rolled, 'success': False} diff --git a/web/ability_check.html b/web/ability_check.html new file mode 100644 index 0000000..fe33dcc --- /dev/null +++ b/web/ability_check.html @@ -0,0 +1,65 @@ + + + + + + Ability Checks + + + +

Will You Succeed?

+ + +
+
+
+
+ + +
+
+ + +
+
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/web/index.html b/web/index.html index 5db7527..955100a 100644 --- a/web/index.html +++ b/web/index.html @@ -15,11 +15,14 @@ -
- +
+ + +
+
@@ -31,6 +34,10 @@ document.addEventListener('DOMContentLoaded', function () { loadContent("intro.html"); + document.getElementById("tables").addEventListener("click", function () { + loadContent("ability_check.html?t=" + new Date().getTime()); + }); + document.getElementById("tables").addEventListener("click", function () { loadContent("display_tables.html?t=" + new Date().getTime()); });