From 0e164e8b23074133a2cd9d7b8ea46009984dead9 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 19 May 2025 18:01:22 -0500 Subject: [PATCH] Big monsters check all special terrains for moveability --- src/game/boe.monster.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/game/boe.monster.cpp b/src/game/boe.monster.cpp index e849511b..4a665ade 100644 --- a/src/game/boe.monster.cpp +++ b/src/game/boe.monster.cpp @@ -894,8 +894,7 @@ extern std::set no_move_from_west; extern std::set no_move_from_south; extern std::set no_move_from_east; -//mode; // 1 - town 2 - combat -bool monst_check_special_terrain(location where_check,short mode,short which_monst) { +static bool monst_check_one_special_terrain(location where_check,short mode,short which_monst) { ter_num_t ter = 0; short r1,guts = 0; bool can_enter = true,mage = false; @@ -966,6 +965,7 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon } if(univ.town.is_fire_barr(where_check.x,where_check.y)) { if(!which_m->is_friendly() && get_ran(1,1,100) < which_m->mu * 10 + which_m->cl * 4) { + // Monster breaks the barrier // TODO: Are these barrier sounds right? play_sound(60); which_m->spell_note(49); @@ -981,6 +981,7 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon if(univ.town.is_force_barr(where_check.x,where_check.y)) { /// Not in big towns if(!which_m->is_friendly() && get_ran(1,1,100) < which_m->mu * 10 + which_m->cl * 4 && (!univ.town->strong_barriers)) { + // Monster breaks the barrier play_sound(60); which_m->spell_note(49); univ.town.set_force_barr(where_check.x,where_check.y,false); @@ -1077,6 +1078,17 @@ bool monst_check_special_terrain(location where_check,short mode,short which_mon return can_enter; } +//mode; // 1 - town 2 - combat +bool monst_check_special_terrain(location where_check,short mode,short which_monst) { + cCreature* which_m = &univ.town.monst[which_monst]; + for(int x = where_check.x; x < where_check.x + which_m->x_width; ++x){ + for(int y = where_check.y; y < where_check.y + which_m->y_width; ++y){ + if(!monst_check_one_special_terrain({x, y}, mode, which_monst)) return false; + } + } + return true; +} + void record_monst(cCreature* which_m, bool forced) { short r1;