you feel {a,an unexpected} draft
Move the message given when a monster digs through a closed door or a secret corridor into a separate routine. In theory, nethack should determine whether there is a path between the new opening and the hero's location in order to decide whether a draft can be felt. (I don't think anyone is likely to implement that--I'm certainly not. Checking whether the hero is in a room with no breaches in its walls could at least catch being inside a vault.) While at it, add some USA-centric puns about feeling the prospect of imminent military conscription instead of air current if it happens while hallucinating.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 extern.h $NHDT-Date: 1429755449 2015/04/23 02:17:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.477 $ */
|
/* NetHack 3.6 extern.h $NHDT-Date: 1431998729 2015/05/19 01:25:29 $ $NHDT-Branch: master $:$NHDT-Revision: 1.492 $ */
|
||||||
/* Copyright (c) Steve Creps, 1988. */
|
/* Copyright (c) Steve Creps, 1988. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -276,6 +276,7 @@ E boolean FDECL(dighole, (BOOLEAN_P,BOOLEAN_P,coord *));
|
|||||||
E int FDECL(use_pick_axe, (struct obj *));
|
E int FDECL(use_pick_axe, (struct obj *));
|
||||||
E int FDECL(use_pick_axe2, (struct obj *));
|
E int FDECL(use_pick_axe2, (struct obj *));
|
||||||
E boolean FDECL(mdig_tunnel, (struct monst *));
|
E boolean FDECL(mdig_tunnel, (struct monst *));
|
||||||
|
E void FDECL(draft_message, (BOOLEAN_P));
|
||||||
E void FDECL(watch_dig, (struct monst *,XCHAR_P,XCHAR_P,BOOLEAN_P));
|
E void FDECL(watch_dig, (struct monst *,XCHAR_P,XCHAR_P,BOOLEAN_P));
|
||||||
E void NDECL(zap_dig);
|
E void NDECL(zap_dig);
|
||||||
E struct obj *FDECL(bury_an_obj, (struct obj *, boolean *));
|
E struct obj *FDECL(bury_an_obj, (struct obj *, boolean *));
|
||||||
|
|||||||
54
src/dig.c
54
src/dig.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 dig.c $NHDT-Date: 1431563241 2015/05/14 00:27:21 $ $NHDT-Branch: master $:$NHDT-Revision: 1.91 $ */
|
/* NetHack 3.6 dig.c $NHDT-Date: 1431998736 2015/05/19 01:25:36 $ $NHDT-Branch: master $:$NHDT-Revision: 1.92 $ */
|
||||||
/* NetHack 3.6 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */
|
/* NetHack 3.6 dig.c $Date: 2012/02/16 03:01:37 $ $Revision: 1.67 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1267,7 +1267,7 @@ register struct monst *mtmp;
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!rn2(3) && flags.verbose) /* not too often.. */
|
if (!rn2(3) && flags.verbose) /* not too often.. */
|
||||||
You_feel("an unexpected draft.");
|
draft_message(TRUE); /* "You feel an unexpected draft." */
|
||||||
here->doormask = D_BROKEN;
|
here->doormask = D_BROKEN;
|
||||||
}
|
}
|
||||||
newsym(mtmp->mx, mtmp->my);
|
newsym(mtmp->mx, mtmp->my);
|
||||||
@@ -1276,7 +1276,7 @@ register struct monst *mtmp;
|
|||||||
here->typ = CORR;
|
here->typ = CORR;
|
||||||
unblock_point(mtmp->mx, mtmp->my);
|
unblock_point(mtmp->mx, mtmp->my);
|
||||||
newsym(mtmp->mx, mtmp->my);
|
newsym(mtmp->mx, mtmp->my);
|
||||||
You_feel("a draft.");
|
draft_message(FALSE); /* "You feel a draft." */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else if (!IS_ROCK(here->typ) && !IS_TREE(here->typ)) /* no dig */
|
} else if (!IS_ROCK(here->typ) && !IS_TREE(here->typ)) /* no dig */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1322,6 +1322,54 @@ register struct monst *mtmp;
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define STRIDENT 4 /* from pray.c */
|
||||||
|
|
||||||
|
/* draft refers to air currents, but can be a pun on "draft" as conscription
|
||||||
|
for military service (probably not a good pun if it has to be explained) */
|
||||||
|
void
|
||||||
|
draft_message(unexpected)
|
||||||
|
boolean unexpected;
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* [Bug or TODO? Have caller pass coordinates and use the travel
|
||||||
|
* mechanism to determine whether there is a path between
|
||||||
|
* destroyed door (or exposed secret corridor) and hero's location.
|
||||||
|
* When there is no such path, no draft should be felt.]
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (unexpected) {
|
||||||
|
if (!Hallucination)
|
||||||
|
You_feel("an unexpected draft.");
|
||||||
|
else
|
||||||
|
/* U.S. classification system uses 1-A for eligible to serve
|
||||||
|
and 4-F for ineligible due to physical or mental defect;
|
||||||
|
some intermediate values exist but are rarely seen */
|
||||||
|
You_feel("like you are %s.",
|
||||||
|
(ACURR(A_STR) < 6 || ACURR(A_DEX) < 6
|
||||||
|
|| ACURR(A_CON) < 6 || ACURR(A_CHA) < 6
|
||||||
|
|| ACURR(A_INT) < 6 || ACURR(A_WIS) < 6) ? "4-F"
|
||||||
|
: "1-A");
|
||||||
|
} else {
|
||||||
|
if (!Hallucination) {
|
||||||
|
You_feel("a draft.");
|
||||||
|
} else {
|
||||||
|
/* "marching" is deliberately ambiguous; it might mean drills
|
||||||
|
after entering military service or mean engaging in protests */
|
||||||
|
static const char *draft_reaction[] = {
|
||||||
|
"enlisting", "marching", "protesting", "fleeing",
|
||||||
|
};
|
||||||
|
int dridx;
|
||||||
|
|
||||||
|
/* Lawful: 0..1, Neutral: 1..2, Chaotic: 2..3 */
|
||||||
|
dridx = rn1(2, 1 - sgn(u.ualign.type));
|
||||||
|
if (u.ualign.record < STRIDENT)
|
||||||
|
/* L: +(0..2), N: +(-1..1), C: +(-2..0); all: 0..3 */
|
||||||
|
dridx += rn1(3, sgn(u.ualign.type) - 1);
|
||||||
|
You_feel("like %s.", draft_reaction[dridx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* digging via wand zap or spell cast */
|
/* digging via wand zap or spell cast */
|
||||||
void
|
void
|
||||||
zap_dig()
|
zap_dig()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 zap.c $NHDT-Date: 1431192757 2015/05/09 17:32:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.222 $ */
|
/* NetHack 3.6 zap.c $NHDT-Date: 1431998738 2015/05/19 01:25:38 $ $NHDT-Branch: master $:$NHDT-Revision: 1.223 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -4318,7 +4318,7 @@ short exploding_wand_typ;
|
|||||||
pline("%s %s reveals a secret door.", yourzap ? "Your" : "The",
|
pline("%s %s reveals a secret door.", yourzap ? "Your" : "The",
|
||||||
zapverb);
|
zapverb);
|
||||||
else if (Is_rogue_level(&u.uz))
|
else if (Is_rogue_level(&u.uz))
|
||||||
You_feel("a draft."); /* new open doorway */
|
draft_message(FALSE); /* "You feel a draft." (open doorway) */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* regular door absorbs remaining zap range, possibly gets destroyed */
|
/* regular door absorbs remaining zap range, possibly gets destroyed */
|
||||||
|
|||||||
Reference in New Issue
Block a user