MCPcopy Create free account
hub / github.com/crawl/crawl / seen_monsters_react

Function seen_monsters_react

crawl-ref/source/mon-act.cc:4148–4206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4146}
4147
4148void seen_monsters_react()
4149{
4150 if (you.duration[DUR_TIME_STEP] || crawl_state.game_is_arena())
4151 return;
4152
4153 const int stealth = player_stealth();
4154
4155#ifdef DEBUG_STEALTH
4156 // Too annoying for regular diagnostics.
4157 mprf(MSGCH_DIAGNOSTICS, "stealth: %d", stealth);
4158#endif
4159
4160 for (monster_near_iterator mi(you.pos()); mi; ++mi)
4161 {
4162 if ((mi->asleep() || mi->behaviour == BEH_WANDER)
4163 && check_awaken(*mi, stealth))
4164 {
4165 behaviour_event(*mi, ME_ALERT, &you, you.pos(), false);
4166
4167 // That might have caused a pacified monster to leave the level.
4168 if (!(*mi)->alive())
4169 continue;
4170
4171 if (!vampire_mesmerism_check(**mi))
4172 monster_consider_shouting(**mi);
4173 }
4174
4175 if (!mi->visible_to(&you))
4176 continue;
4177
4178 if (!mi->has_ench(ENCH_FRENZIED) && mi->can_see(you))
4179 {
4180 // Trigger Duvessa & Dowan upgrades
4181 if (mi->props.exists(ELVEN_ENERGIZE_KEY))
4182 {
4183 mi->props.erase(ELVEN_ENERGIZE_KEY);
4184 elven_twin_energize(*mi);
4185 }
4186 else if (mi->type == MONS_BORIS && player_has_orb()
4187 && !mi->props.exists(BORIS_ORB_KEY))
4188 {
4189 mi->props[BORIS_ORB_KEY] = true;
4190 boris_covet_orb(*mi);
4191 }
4192#if TAG_MAJOR_VERSION == 34
4193 else if (mi->props.exists(OLD_DUVESSA_ENERGIZE_KEY))
4194 {
4195 mi->props.erase(OLD_DUVESSA_ENERGIZE_KEY);
4196 elven_twin_energize(*mi);
4197 }
4198 else if (mi->props.exists(OLD_DOWAN_ENERGIZE_KEY))
4199 {
4200 mi->props.erase(OLD_DOWAN_ENERGIZE_KEY);
4201 elven_twin_energize(*mi);
4202 }
4203#endif
4204 }
4205 }

Callers 4

_wizard_go_to_levelFunction · 0.85
wizard_recreate_levelFunction · 0.85
player_reactsFunction · 0.85
l-debug.ccFile · 0.85

Calls 15

player_stealthFunction · 0.85
mprfFunction · 0.85
check_awakenFunction · 0.85
behaviour_eventFunction · 0.85
vampire_mesmerism_checkFunction · 0.85
elven_twin_energizeFunction · 0.85
player_has_orbFunction · 0.85
boris_covet_orbFunction · 0.85
game_is_arenaMethod · 0.80
can_seeMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected