Fixed Fylgja bug with the edge of the map.
This commit is contained in:
@@ -166,12 +166,25 @@ void run_fylgja_menu() {
|
|||||||
|
|
||||||
bool activate_fylgja(int fylgjaIndex) {
|
bool activate_fylgja(int fylgjaIndex) {
|
||||||
if (fylgjaIndex == FYLGJA_UNICORN) {
|
if (fylgjaIndex == FYLGJA_UNICORN) {
|
||||||
|
if (!can_start_unicorn_fylgja_charge()) {
|
||||||
|
speak_with_history("You need open ground in front of you to charge.", true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
start_unicorn_fylgja_charge();
|
start_unicorn_fylgja_charge();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool can_start_unicorn_fylgja_charge() {
|
||||||
|
if (x <= BASE_END) return false;
|
||||||
|
int step = (facing == 1) ? 1 : -1;
|
||||||
|
int targetX = x + step;
|
||||||
|
if (targetX < 0 || targetX >= MAP_SIZE) return false;
|
||||||
|
if (should_stop_charge_for_climb_up(x, targetX)) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void start_unicorn_fylgja_charge() {
|
void start_unicorn_fylgja_charge() {
|
||||||
reset_fishing_session();
|
reset_fishing_session();
|
||||||
|
|
||||||
@@ -261,7 +274,7 @@ void update_fylgja_charge() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x <= BASE_END || x <= 0 || x >= MAP_SIZE - 1) {
|
if (x <= BASE_END) {
|
||||||
stop_fylgja_charge();
|
stop_fylgja_charge();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -297,7 +310,7 @@ void update_fylgja_charge() {
|
|||||||
check_snare_collision(x);
|
check_snare_collision(x);
|
||||||
apply_fylgja_trample_damage(x);
|
apply_fylgja_trample_damage(x);
|
||||||
|
|
||||||
if (x <= BASE_END || x <= 0 || x >= MAP_SIZE - 1) {
|
if (x <= BASE_END) {
|
||||||
stop_fylgja_charge();
|
stop_fylgja_charge();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user