diff --git src/monster/melee2.c src/monster/melee2.c index e5a82ed..b25fa33 100644 --- src/monster/melee2.c +++ src/monster/melee2.c @@ -2799,6 +2799,8 @@ static void process_monster(struct cave *c, int m_idx) monster_type *m_ptr = cave_monster(cave, m_idx); monster_race *r_ptr = &r_info[m_ptr->r_idx]; monster_lore *l_ptr = &l_list[m_ptr->r_idx]; + monster_type *m_nb_ptr; + monster_lore *l_nb_ptr; int i, d, oy, ox, ny, nx; @@ -3015,6 +3017,33 @@ static void process_monster(struct cave *c, int m_idx) } } + /* Try to wake up neighboring monsters in 50% probability */ +#if 1 + if (!rf_has(r_ptr->flags, RF_STUPID) && randint0(2)) + { + int k, y, x, wakeup; + for (k = 0, y = oy - 1; y <= oy + 1; y++) + for (x = ox - 1; x <= ox + 1; x++) + { + if (y == oy && x == ox) continue; + if (cave->m_idx[y][x] > 0) + { + m_nb_ptr = cave_monster(cave, cave->m_idx[y][x]); + l_nb_ptr = &l_list[m_nb_ptr->r_idx]; + if ((wakeup = m_nb_ptr->m_timed[MON_TMD_SLEEP]) > 1) + { + wakeup -= 1; + /* Cap at 200 */ + if (wakeup > 200) { wakeup = 200; } + mon_dec_timed(m_nb_ptr, MON_TMD_SLEEP, wakeup , MON_TMD_FLG_NOMESSAGE, FALSE); + k++; + } + } + } + if (k) return; + } +#endif + /* Normal movement */ if (!stagger) /* Logical moves, may do nothing */