MCPcopy Index your code
hub / github.com/NetHack/NetHack / draft_message

Function draft_message

src/dig.c:1503–1544  ·  view source on GitHub ↗

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) */

Source from the content-addressed store, hash-verified

1501/* draft refers to air currents, but can be a pun on "draft" as conscription
1502 for military service (probably not a good pun if it has to be explained) */
1503void
1504draft_message(boolean unexpected)
1505{
1506 /*
1507 * [Bug or TODO? Have caller pass coordinates and use the travel
1508 * mechanism to determine whether there is a path between
1509 * destroyed door (or exposed secret corridor) and hero's location.
1510 * When there is no such path, no draft should be felt.]
1511 */
1512
1513 if (unexpected) {
1514 if (!Hallucination)
1515 You_feel("an unexpected draft.");
1516 else
1517 /* U.S. classification system uses 1-A for eligible to serve
1518 and 4-F for ineligible due to physical or mental defect;
1519 some intermediate values exist but are rarely seen */
1520 You_feel("like you are %s.",
1521 (ACURR(A_STR) < 6 || ACURR(A_DEX) < 6
1522 || ACURR(A_CON) < 6 || ACURR(A_CHA) < 6
1523 || ACURR(A_INT) < 6 || ACURR(A_WIS) < 6) ? "4-F"
1524 : "1-A");
1525 } else {
1526 if (!Hallucination) {
1527 You_feel("a draft.");
1528 } else {
1529 /* "marching" is deliberately ambiguous; it might mean drills
1530 after entering military service or mean engaging in protests */
1531 static const char *const draft_reaction[] = {
1532 "enlisting", "marching", "protesting", "fleeing",
1533 };
1534 int dridx;
1535
1536 /* Lawful: 0..1, Neutral: 1..2, Chaotic: 2..3 */
1537 dridx = rn1(2, 1 - sgn(u.ualign.type));
1538 if (u.ualign.record < STRIDENT)
1539 /* L: +(0..2), N: +(-1..1), C: +(-2..0); all: 0..3 */
1540 dridx += rn1(3, sgn(u.ualign.type) - 1);
1541 You_feel("like %s.", draft_reaction[dridx]);
1542 }
1543 }
1544}
1545
1546/* digging via wand zap or spell cast */
1547void

Callers 3

mdig_tunnelFunction · 0.85
zap_mapFunction · 0.85
zap_over_floorFunction · 0.85

Calls 2

You_feelFunction · 0.85
sgnFunction · 0.85

Tested by

no test coverage detected