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

Function dynamic_multi_reason

src/uhitm.c:103–123  ·  view source on GitHub ↗

multi_reason is usually a literal string; here we generate one that has the causing monster's type included */

Source from the content-addressed store, hash-verified

101/* multi_reason is usually a literal string; here we generate one that
102 has the causing monster's type included */
103void
104dynamic_multi_reason(struct monst *mon, const char *verb, boolean by_gaze)
105{
106 /* combination of noname_monnam() and m_monnam(), more or less;
107 accurate regardless of visibility or hallucination (only seen
108 if game ends) and without personal name (M2_PNAME excepted) */
109 char *who = x_monnam(mon, ARTICLE_A, (char *) 0,
110 (SUPPRESS_IT | SUPPRESS_INVISIBLE
111 | SUPPRESS_HALLUCINATION | SUPPRESS_SADDLE
112 | SUPPRESS_NAME),
113 FALSE),
114 *p = gm.multireasonbuf;
115
116 /* prefix info for done_in_by() */
117 Sprintf(p, "%u:", mon->m_id);
118 p = eos(p);
119 Sprintf(p, "%s by %s%s", verb,
120 !by_gaze ? who : s_suffix(who),
121 !by_gaze ? "" : " gaze");
122 gm.multi_reason = p;
123}
124
125void
126erode_armor(struct monst *mdef, int hurt)

Callers 2

mhitm_ad_plysFunction · 0.85
passiveFunction · 0.85

Calls 2

eosFunction · 0.85
s_suffixFunction · 0.85

Tested by

no test coverage detected