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

Function wipe_engr_at

src/engrave.c:270–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270void
271wipe_engr_at(coordxy x, coordxy y, xint16 cnt, boolean magical)
272{
273 struct engr *ep = engr_at(x, y);
274
275 /* Headstones and some specially marked engravings are indelible */
276 if (ep && ep->engr_type != HEADSTONE && !ep->nowipeout) {
277 debugpline1("asked to erode %d characters", cnt);
278 if (ep->engr_type != BURN || is_ice(x, y) || (magical && !rn2(2))) {
279 if (ep->engr_type != DUST && ep->engr_type != ENGR_BLOOD) {
280 cnt = rn2(1 + 50 / (cnt + 1)) ? 0 : 1;
281 debugpline1("actually eroding %d characters", cnt);
282 }
283 wipeout_text(ep->engr_txt[actual_text], (int) cnt, 0);
284 while (ep->engr_txt[actual_text][0] == ' ')
285 ep->engr_txt[actual_text]++;
286 if (!ep->engr_txt[actual_text][0])
287 del_engr(ep);
288 }
289 }
290}
291
292/*
293 * Returns:

Callers 6

maybe_smudge_engrFunction · 0.85
u_wipe_engrFunction · 0.85
zap_mapFunction · 0.85
mon_spell_hits_spotFunction · 0.85
dochugFunction · 0.85
makenicheFunction · 0.85

Calls 5

engr_atFunction · 0.85
is_iceFunction · 0.85
rn2Function · 0.85
wipeout_textFunction · 0.85
del_engrFunction · 0.85

Tested by

no test coverage detected