Magic traps can toggle intrinsic invisibility

Originally from Sporkhack by Derek Ray
This commit is contained in:
Pasi Kallinen
2022-02-06 17:52:40 +02:00
parent 19ff846645
commit 2bd4386956
2 changed files with 23 additions and 3 deletions

View File

@@ -3634,9 +3634,27 @@ domagictrap(void)
} else {
switch (fate) {
case 10:
case 11:
/* sometimes nothing happens */
break;
case 11: /* toggle intrinsic invisibility */
You_hear("a low hum.");
if (!Invis) {
if (!Blind)
self_invis_message();
} else if (!EInvis && !pm_invisible(g.youmonst.data)) {
if (!Blind) {
if (!See_invisible)
You("can see yourself again!");
else
You_cant("see through yourself anymore.");
}
} else {
/* If we're invisible from another source */
You_feel("a little more %s now.", HInvis ? "obvious" : "hidden");
}
HInvis = HInvis ? 0 : HInvis | FROMOUTSIDE;
newsym(u.ux, u.uy);
break;
case 12: /* a flash of fire */
dofiretrap((struct obj *) 0);
break;