Major refactor part 1.

This commit is contained in:
Storm Dragon
2026-01-23 21:09:54 -05:00
parent 9ded17873d
commit cb8f028d1b
35 changed files with 1070 additions and 1526 deletions
+15 -10
View File
@@ -2,12 +2,20 @@
string[] bat_sounds = {"sounds/quests/bat1.ogg", "sounds/quests/bat2.ogg"};
int run_bat_invasion() {
speak_with_history("Bat Invasion. Bats will fly past from left or right. Press space to throw your spear when the bat is centered. Press enter to continue.", true);
// Wait for enter
while (!key_pressed(KEY_RETURN)) {
wait(5);
}
// Show instructions in text reader
string[] instructions;
instructions.insert_last("=== Bat Invasion ===");
instructions.insert_last("");
instructions.insert_last("Bats are invading! Throw your spear to defend.");
instructions.insert_last("");
instructions.insert_last("How to play:");
instructions.insert_last(" - Listen for bats flying past from left or right");
instructions.insert_last(" - Press SPACE to throw your spear when the bat sounds centered");
instructions.insert_last(" - Accurate throws earn 2 points each");
instructions.insert_last(" - You have 10 attempts");
instructions.insert_last("");
instructions.insert_last("Close this screen to begin.");
text_reader_lines(instructions, "Quest Instructions", true);
speak_with_history("Starting.", true);
wait(500);
@@ -59,10 +67,7 @@ int run_bat_invasion() {
p.play_stationary("sounds/quests/spear_throw.ogg", false);
// Check if bat is centered (within tolerance)
int distance_from_center = current_pos;
if (distance_from_center < 0) distance_from_center = -distance_from_center;
if (distance_from_center <= CENTER_TOLERANCE) {
if (abs(current_pos) <= CENTER_TOLERANCE) {
hit = true;
// Stop bat sound and play hit
if (bat_handle != -1) {
+18 -1
View File
@@ -20,7 +20,24 @@ int get_note_from_key() {
}
void run_practice_mode() {
speak_with_history("Enchanted Melody. Repeat the magical pattern using F D R E or K J I U, from lowest to highest pitch. Practice the notes now, then press enter to begin, or escape to cancel.", true);
// Show instructions in text reader
string[] instructions;
instructions.insert_last("=== Enchanted Melody ===");
instructions.insert_last("");
instructions.insert_last("Repeat the magical pattern to earn favor from the gods.");
instructions.insert_last("");
instructions.insert_last("Controls:");
instructions.insert_last(" F or K - First note (lowest pitch)");
instructions.insert_last(" D or J - Second note");
instructions.insert_last(" R or I - Third note");
instructions.insert_last(" E or U - Fourth note (highest pitch)");
instructions.insert_last("");
instructions.insert_last("After closing this screen, you can practice the notes.");
instructions.insert_last("Press Enter when ready to begin, or Escape to cancel.");
text_reader_lines(instructions, "Quest Instructions", true);
// Practice mode announcement
speak_with_history("Practice mode. Press Enter to begin, Escape to cancel.", true);
while (true) {
wait(5);
+15 -6
View File
@@ -1,11 +1,20 @@
// Escape from Hel quest game
int run_escape_from_hel() {
speak_with_history("Escape from Hel. You are running from the Draugr, good luck. Press space to jump over open graves as you hear them approach. Press enter to continue.", true);
// Wait for enter
while (!key_pressed(KEY_RETURN)) {
wait(5);
}
// Show instructions in text reader
string[] instructions;
instructions.insert_last("=== Escape from Hel ===");
instructions.insert_last("");
instructions.insert_last("You are fleeing from the realm of the dead!");
instructions.insert_last("");
instructions.insert_last("How to play:");
instructions.insert_last(" - You run automatically, speed increases over time");
instructions.insert_last(" - Listen for open graves approaching (growing louder)");
instructions.insert_last(" - Press SPACE to jump over graves");
instructions.insert_last(" - Each successful jump earns 2 points");
instructions.insert_last(" - The run ends when you fall into a grave");
instructions.insert_last("");
instructions.insert_last("Close this screen to begin.");
text_reader_lines(instructions, "Quest Instructions", true);
speak_with_history("Starting.", true);
wait(500);