MCPcopy Create free account
hub / github.com/NetHack/NetHack / level_tele_trap

Function level_tele_trap

src/teleport.c:1537–1571  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1535}
1536
1537void
1538level_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) */
1574staticfn boolean

Callers 2

doteleFunction · 0.85
trapeffect_level_telepFunction · 0.85

Calls 8

u_locomotionFunction · 0.85
YouFunction · 0.85
shieldeffFunction · 0.85
You_feelFunction · 0.85
deltrapFunction · 0.85
newsymFunction · 0.85
level_teleFunction · 0.85
make_confusedFunction · 0.85

Tested by

no test coverage detected