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

Function acid_damage

src/trap.c:4617–4654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4615}
4616
4617void
4618acid_damage(struct obj *obj)
4619{
4620 /* Scrolls but not spellbooks can be erased by acid. */
4621 struct monst *victim;
4622 boolean vismon;
4623
4624 if (!obj)
4625 return;
4626
4627 victim = carried(obj) ? &gy.youmonst : mcarried(obj) ? obj->ocarry : NULL;
4628 vismon = victim && (victim != &gy.youmonst) && canseemon(victim);
4629
4630 if (victim == &gy.youmonst && inventory_resistance_check(AD_ACID))
4631 return;
4632
4633 if (obj->greased) {
4634 grease_protect(obj, (char *) 0, victim);
4635 } else if (obj->oclass == SCROLL_CLASS && obj->otyp != SCR_BLANK_PAPER) {
4636 if (obj->otyp != SCR_BLANK_PAPER
4637#ifdef MAIL_STRUCTURES
4638 && obj->otyp != SCR_MAIL
4639#endif
4640 ) {
4641 if (!Blind) {
4642 if (victim == &gy.youmonst)
4643 Your("%s.", aobjnam(obj, "fade"));
4644 else if (vismon)
4645 pline("%s %s.", s_suffix(Monnam(victim)),
4646 aobjnam(obj, "fade"));
4647 }
4648 }
4649 obj->otyp = SCR_BLANK_PAPER;
4650 obj->spe = 0;
4651 obj->dknown = 0;
4652 } else
4653 erode_obj(obj, (char *) 0, ERODE_CORRODE, EF_GREASE | EF_VERBOSE);
4654}
4655
4656staticfn void
4657pot_acid_damage(

Callers 5

mhitm_ad_acidFunction · 0.85
passivemmFunction · 0.85
zhitmFunction · 0.85
zhituFunction · 0.85
passiveumFunction · 0.85

Calls 9

canseemonFunction · 0.85
grease_protectFunction · 0.85
YourFunction · 0.85
aobjnamFunction · 0.85
s_suffixFunction · 0.85
MonnamFunction · 0.85
erode_objFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected