Boomerang quest updated.
This commit is contained in:
+2
-3
@@ -432,11 +432,10 @@ void run_game()
|
|||||||
{
|
{
|
||||||
int old_x = x;
|
int old_x = x;
|
||||||
|
|
||||||
// Check if trying to move left/right while in tree (not in mountain)
|
// Check if trying to move left/right while in a tree.
|
||||||
MountainRange@ current_mountain = get_mountain_at(x);
|
|
||||||
Tree@ current_tree = get_tree_at(x);
|
Tree@ current_tree = get_tree_at(x);
|
||||||
int ground_elevation = get_mountain_elevation_at(x);
|
int ground_elevation = get_mountain_elevation_at(x);
|
||||||
if((left_active || right_active) && y > ground_elevation && !jumping && !falling && !rope_climbing && current_mountain is null && current_tree !is null) {
|
if((left_active || right_active) && y > ground_elevation && !jumping && !falling && !rope_climbing && current_tree !is null) {
|
||||||
// Fall out of tree
|
// Fall out of tree
|
||||||
climbing = false;
|
climbing = false;
|
||||||
start_falling();
|
start_falling();
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ int run_catch_the_boomerang() {
|
|||||||
int boomerangY = -2;
|
int boomerangY = -2;
|
||||||
bool returning = false;
|
bool returning = false;
|
||||||
bool resolved = false;
|
bool resolved = false;
|
||||||
|
bool catchWindowPromptPlayed = false;
|
||||||
int stepDelay = random(180, 280);
|
int stepDelay = random(180, 280);
|
||||||
int stepSize = 2;
|
int stepSize = 2;
|
||||||
|
|
||||||
@@ -51,6 +52,11 @@ int run_catch_the_boomerang() {
|
|||||||
|
|
||||||
p.play_2d(boomerangSound, 0.0, 0.0, 0.0, boomerangY, false);
|
p.play_2d(boomerangSound, 0.0, 0.0, 0.0, boomerangY, false);
|
||||||
|
|
||||||
|
if (!catchWindowPromptPlayed && returning && boomerangY > -5) {
|
||||||
|
p.play_stationary("sounds/quests/safe_to_jump.ogg", false);
|
||||||
|
catchWindowPromptPlayed = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (key_pressed(KEY_SPACE)) {
|
if (key_pressed(KEY_SPACE)) {
|
||||||
if (returning && boomerangY > -5) {
|
if (returning && boomerangY > -5) {
|
||||||
int points = 5 + boomerangY;
|
int points = 5 + boomerangY;
|
||||||
@@ -74,7 +80,8 @@ int run_catch_the_boomerang() {
|
|||||||
|
|
||||||
boomerangY += returning ? stepSize : -stepSize;
|
boomerangY += returning ? stepSize : -stepSize;
|
||||||
|
|
||||||
if (boomerangY >= 0) {
|
// Give one centered pass (y == 0) as a final catch window.
|
||||||
|
if (boomerangY > 0) {
|
||||||
string promptSuffix = (turn < turnsTotal - 1) ? " Press Space to throw." : "";
|
string promptSuffix = (turn < turnsTotal - 1) ? " Press Space to throw." : "";
|
||||||
speak_with_history("The boomerang hit you." + promptSuffix, true);
|
speak_with_history("The boomerang hit you." + promptSuffix, true);
|
||||||
quest_boomerang_hit_sound();
|
quest_boomerang_hit_sound();
|
||||||
|
|||||||
Reference in New Issue
Block a user