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

Function on_goal

src/quest.c:61–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61staticfn void
62on_goal(void)
63{
64 if (Qstat(killed_nemesis)) {
65 return;
66 } else if (!Qstat(made_goal)) {
67 qt_pager("goal_first");
68 Qstat(made_goal) = 1;
69 } else {
70 /*
71 * Some QT_NEXTGOAL messages reference the quest artifact;
72 * find out if it is still present. If not, request an
73 * alternate message (qt_pager() will revert to delivery
74 * of QT_NEXTGOAL if current role doesn't have QT_ALTGOAL).
75 * Note: if hero is already carrying it, it is treated as
76 * being absent from the level for quest message purposes.
77 */
78 unsigned whichobjchains = ((1 << OBJ_FLOOR)
79 | (1 << OBJ_MINVENT)
80 | (1 << OBJ_BURIED));
81 struct obj *qarti = find_quest_artifact(whichobjchains);
82
83 qt_pager(qarti ? "goal_next" : "goal_alt");
84 if (Qstat(made_goal) < 7)
85 Qstat(made_goal)++;
86 }
87}
88
89void
90onquest(void)

Callers 1

onquestFunction · 0.85

Calls 2

qt_pagerFunction · 0.85
find_quest_artifactFunction · 0.85

Tested by

no test coverage detected