| 1560 | } |
| 1561 | |
| 1562 | staticfn int |
| 1563 | trapeffect_slp_gas_trap( |
| 1564 | struct monst *mtmp, |
| 1565 | struct trap *trap, |
| 1566 | unsigned int trflags UNUSED) |
| 1567 | { |
| 1568 | if (mtmp == &gy.youmonst) { |
| 1569 | seetrap(trap); |
| 1570 | if (Sleep_resistance || breathless(gy.youmonst.data)) { |
| 1571 | You("are enveloped in a cloud of gas!"); |
| 1572 | monstseesu(M_SEEN_SLEEP); |
| 1573 | } else { |
| 1574 | pline("A cloud of gas puts you to sleep!"); |
| 1575 | fall_asleep(-rnd(25), TRUE); |
| 1576 | monstunseesu(M_SEEN_SLEEP); |
| 1577 | } |
| 1578 | (void) steedintrap(trap, (struct obj *) 0); |
| 1579 | } else { |
| 1580 | boolean in_sight = canseemon(mtmp) || (mtmp == u.usteed); |
| 1581 | |
| 1582 | if (!resists_sleep(mtmp) && !breathless(mtmp->data) |
| 1583 | && !helpless(mtmp)) { |
| 1584 | if (sleep_monst(mtmp, rnd(25), -1) && in_sight) { |
| 1585 | pline_mon(mtmp, |
| 1586 | "%s suddenly falls asleep!", Monnam(mtmp)); |
| 1587 | seetrap(trap); |
| 1588 | } |
| 1589 | } |
| 1590 | } |
| 1591 | return Trap_Effect_Finished; |
| 1592 | } |
| 1593 | |
| 1594 | staticfn int |
| 1595 | trapeffect_rust_trap( |
no test coverage detected