| 1535 | } |
| 1536 | |
| 1537 | void |
| 1538 | level_tele_trap(struct trap *trap, unsigned int trflags) |
| 1539 | { |
| 1540 | char verbbuf[BUFSZ]; |
| 1541 | boolean intentional = FALSE; |
| 1542 | |
| 1543 | if ((trflags & (VIASITTING | FORCETRAP)) != 0) { |
| 1544 | Strcpy(verbbuf, "trigger"); /* follows "You sit down." */ |
| 1545 | intentional = TRUE; |
| 1546 | } else |
| 1547 | Sprintf(verbbuf, "%s onto", u_locomotion("step")); |
| 1548 | You("%s a level teleport trap!", verbbuf); |
| 1549 | |
| 1550 | if (Antimagic && !intentional) { |
| 1551 | shieldeff(u.ux, u.uy); |
| 1552 | } |
| 1553 | if ((Antimagic && !intentional) || In_endgame(&u.uz)) { |
| 1554 | You_feel("a wrenching sensation."); |
| 1555 | return; |
| 1556 | } |
| 1557 | deltrap(trap); |
| 1558 | newsym(u.ux, u.uy); /* get rid of trap symbol */ |
| 1559 | level_tele(); |
| 1560 | |
| 1561 | if (Hallucination || Teleport_control) |
| 1562 | You("briefly feel %s.", Hallucination ? "oriented" : "centered"); |
| 1563 | else |
| 1564 | You_feel("%sdisoriented.", Confusion ? "even more " : ""); |
| 1565 | /* magic portal traversal causes brief Stun; for level teleport, use |
| 1566 | confusion instead, and only when hero lacks control; do this after |
| 1567 | processing the level teleportation attempt because being confused |
| 1568 | can affect the outcome ("Oops" result) */ |
| 1569 | if (!Teleport_control) |
| 1570 | make_confused((HConfusion & TIMEOUT) + 3L, FALSE); |
| 1571 | } |
| 1572 | |
| 1573 | /* check whether monster can arrive at location <x,y> via Tport (or fall) */ |
| 1574 | staticfn boolean |
no test coverage detected