MCPcopy Index your code
hub / github.com/NetHack/NetHack / b_trapped

Function b_trapped

src/trap.c:6693–6707  ·  view source on GitHub ↗

used for doors (also tins). can be used for anything else that opens. */

Source from the content-addressed store, hash-verified

6691
6692/* used for doors (also tins). can be used for anything else that opens. */
6693void
6694b_trapped(const char *item, int bodypart)
6695{
6696 int lvl = level_difficulty(),
6697 dmg = rnd(5 + (lvl < 5 ? lvl : 2 + lvl / 2));
6698
6699 Soundeffect(se_kaboom, 80);
6700 pline("KABOOM!! %s was booby-trapped!", The(item));
6701 wake_nearby(FALSE);
6702 losehp(Maybe_Half_Phys(dmg), "explosion", KILLED_BY_AN);
6703 exercise(A_STR, FALSE);
6704 if (bodypart != NO_PART)
6705 exercise(A_CON, FALSE);
6706 make_stunned((HStun & TIMEOUT) + (long) dmg, TRUE);
6707}
6708
6709/* Monster is hit by trap. */
6710staticfn boolean

Callers 9

openoneFunction · 0.85
still_chewingFunction · 0.85
digFunction · 0.85
picklockFunction · 0.85
doopen_indirFunction · 0.85
consume_tinFunction · 0.85
untrapFunction · 0.85
kick_doorFunction · 0.85
kick_nondoorFunction · 0.85

Calls 8

level_difficultyFunction · 0.85
rndFunction · 0.85
TheFunction · 0.85
wake_nearbyFunction · 0.85
losehpFunction · 0.85
exerciseFunction · 0.85
make_stunnedFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected