Changed around line 1
+ document.addEventListener('DOMContentLoaded', function() {
+ const dialogueText = document.getElementById('dialogue-text');
+ const choiceButtons = document.querySelectorAll('.choice-btn');
+ const spiritProgress = document.getElementById('spirit');
+ const strengthProgress = document.getElementById('strength');
+ const wisdomProgress = document.getElementById('wisdom');
+
+ const dialogues = {
+ 1: "You meditate under the ancient tree, feeling your spirit grow stronger.",
+ 2: "You train tirelessly, your body becoming a weapon of unmatched strength.",
+ 3: "You explore the mystic realm, gaining wisdom from the ancient spirits."
+ };
+
+ choiceButtons.forEach(button => {
+ button.addEventListener('click', function() {
+ const choice = this.getAttribute('data-choice');
+ dialogueText.textContent = dialogues[choice];
+
+ // Update progress based on choice
+ if (choice === '1') {
+ spiritProgress.value += 10;
+ } else if (choice === '2') {
+ strengthProgress.value += 10;
+ } else if (choice === '3') {
+ wisdomProgress.value += 10;
+ }
+
+ // Ensure progress does not exceed max
+ if (spiritProgress.value > 100) spiritProgress.value = 100;
+ if (strengthProgress.value > 100) strengthProgress.value = 100;
+ if (wisdomProgress.value > 100) wisdomProgress.value = 100;
+ });
+ });
+ });