| 2290 | } |
| 2291 | |
| 2292 | staticfn int |
| 2293 | trapeffect_magic_trap( |
| 2294 | struct monst *mtmp, |
| 2295 | struct trap *trap, |
| 2296 | unsigned int trflags) |
| 2297 | { |
| 2298 | if (mtmp == &gy.youmonst) { |
| 2299 | seetrap(trap); |
| 2300 | if (!rn2(30)) { |
| 2301 | deltrap(trap); |
| 2302 | newsym(u.ux, u.uy); /* update position */ |
| 2303 | You("are caught in a magical explosion!"); |
| 2304 | losehp(rnd(10), "magical explosion", KILLED_BY_AN); |
| 2305 | Your("body absorbs some of the magical energy!"); |
| 2306 | u.uen = (u.uenmax += 2); |
| 2307 | if (u.uenmax > u.uenpeak) |
| 2308 | u.uenpeak = u.uenmax; |
| 2309 | return Trap_Effect_Finished; |
| 2310 | } else { |
| 2311 | domagictrap(); |
| 2312 | } |
| 2313 | (void) steedintrap(trap, (struct obj *) 0); |
| 2314 | } else { |
| 2315 | /* A magic trap. Monsters usually immune. */ |
| 2316 | if (!rn2(21)) |
| 2317 | return trapeffect_fire_trap(mtmp, trap, trflags); |
| 2318 | } |
| 2319 | return Trap_Effect_Finished; |
| 2320 | } |
| 2321 | |
| 2322 | staticfn int |
| 2323 | trapeffect_anti_magic( |
no test coverage detected