Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tinfoil hats

Adds a new armor type -- the tinfoil hat. This hat blocks psychic
energy, blocking telepathy (both in and out). From an idea posted to
r.g.r.n. by lament

Taken from http://www.cse.unsw.edu.au/~malcolmr/nethack/
  • Loading branch information...
commit 6a9cc3240b1143bef0bb6b5a57987a9c0a238c88 1 parent d84bdee
@wordsonplay wordsonplay authored eatnumber1 committed
View
8 include/youprop.h
@@ -141,9 +141,11 @@
#define HTelepat u.uprops[TELEPAT].intrinsic
#define ETelepat u.uprops[TELEPAT].extrinsic
-#define Blind_telepat (HTelepat || ETelepat || \
- telepathic(youmonst.data))
-#define Unblind_telepat (ETelepat)
+#define BTelepat u.uprops[TELEPAT].blocked
+#define Blind_telepat ((HTelepat || ETelepat || \
+ telepathic(youmonst.data)) \
+ && !BTelepat)
+#define Unblind_telepat (ETelepat & !BTelepat)
#define HWarning u.uprops[WARNING].intrinsic
#define EWarning u.uprops[WARNING].extrinsic
View
2  src/eat.c
@@ -780,7 +780,7 @@ register struct permonst *ptr;
#ifdef DEBUG
debugpline("Trying to give telepathy");
#endif
- if(!(HTelepat & FROMOUTSIDE)) {
+ if(!(HTelepat & FROMOUTSIDE) && !BTelepat) {
You_feel(Hallucination ?
"in touch with the cosmos." :
"a strange mental acuity.");
View
4 src/monmove.c
@@ -412,7 +412,9 @@ register struct monst *mtmp;
if (canseemon(mtmp))
pline("%s concentrates.", Monnam(mtmp));
- if (distu(mtmp->mx, mtmp->my) > BOLT_LIM * BOLT_LIM) {
+ /* MRKR: tinfoil hats block psychic energy */
+ if (uarmh && uarmh->otyp == TINFOIL_HAT ||
+ distu(mtmp->mx, mtmp->my) > BOLT_LIM * BOLT_LIM) {
You("sense a faint wave of psychic energy.");
goto toofar;
}
View
2  src/objects.c
@@ -308,6 +308,8 @@ HELM("dunce cap", "conical hat",
0, 1, 0, 3, 1, 4, 1,10, 0, CLOTH, CLR_BLUE),
HELM("dented pot", (char *)0,
1, 0, 0, 2, 0, 10, 8, 9, 0, IRON, CLR_BLACK),
+HELM("tinfoil hat", (char *)0,
+ 1, 1, 0, 0, 0, 0, 1, 10, 0, METAL, HI_METAL),
/* With shuffled appearances... */
HELM("helmet", "plumed helmet",
0, 0, 0, 10, 1, 30, 10, 9, 0, IRON, HI_METAL),
View
4 src/polyself.c
@@ -1095,6 +1095,10 @@ domindblast()
flags.botl = 1;
You("concentrate.");
+ if (uarmh && uarmh->otyp == TINFOIL_HAT) {
+ pline("A wave of psychic energy pours out, but it is blocked by your tinfoil hat.");
+ return 0;
+ }
pline("A wave of psychic energy pours out.");
for(mtmp=fmon; mtmp; mtmp = nmon) {
int u_sen;
View
3  src/worn.c
@@ -38,7 +38,8 @@ const struct worn {
#define w_blocks(o,m) \
((o->otyp == MUMMY_WRAPPING && ((m) & W_ARMC)) ? INVIS : \
(o->otyp == CORNUTHAUM && ((m) & W_ARMH) && \
- !Role_if(PM_WIZARD)) ? CLAIRVOYANT : 0)
+ !Role_if(PM_WIZARD)) ? CLAIRVOYANT : \
+ (o->otyp == TINFOIL_HAT && ((m) & W_ARMH)) ? TELEPAT : 0)
/* note: monsters don't have clairvoyance, so your role
has no significant effect on their use of w_blocks() */
Please sign in to comment.
Something went wrong with that request. Please try again.