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

Function getcad

src/shk.c:5137–5171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5135}
5136
5137staticfn void
5138getcad(
5139 struct monst *shkp, const char *dmgstr, coordxy x, coordxy y,
5140 boolean uinshp, boolean animal, boolean pursue)
5141{
5142 boolean dugwall = (!strcmp(dmgstr, "dig into") /* wand */
5143 || !strcmp(dmgstr, "damage")); /* pick-axe */
5144
5145 if (muteshk(shkp)) {
5146 if (animal && !helpless(shkp))
5147 yelp(shkp);
5148 } else if (pursue || uinshp || !um_dist(x, y, 1)) {
5149 if (!Deaf) {
5150 SetVoice(shkp, 0, 80, 0);
5151 verbalize("How dare you %s my %s?", dmgstr,
5152 dugwall ? "shop" : "door");
5153 } else {
5154 pline("%s is %s that you decided to %s %s %s!",
5155 Shknam(shkp), ROLL_FROM(angrytexts),
5156 dmgstr, noit_mhis(shkp), dugwall ? "shop" : "door");
5157 }
5158 } else {
5159 if (!Deaf) {
5160 pline("%s shouts:", Shknam(shkp));
5161 SetVoice(shkp, 0, 80, 0);
5162 verbalize("Who dared %s my %s?", dmgstr,
5163 dugwall ? "shop" : "door");
5164 } else {
5165 pline("%s is %s that someone decided to %s %s %s!",
5166 Shknam(shkp), ROLL_FROM(angrytexts),
5167 dmgstr, noit_mhis(shkp), dugwall ? "shop" : "door");
5168 }
5169 }
5170 hot_pursuit(shkp);
5171}
5172
5173void
5174pay_for_damage(const char *dmgstr, boolean cant_mollify)

Callers 1

pay_for_damageFunction · 0.85

Calls 6

yelpFunction · 0.85
um_distFunction · 0.85
verbalizeFunction · 0.85
ShknamFunction · 0.85
hot_pursuitFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected