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

Function cures_sliming

src/muse.c:3245–3261  ·  view source on GitHub ↗

decide whether obj can be used to cure green slime */

Source from the content-addressed store, hash-verified

3243
3244/* decide whether obj can be used to cure green slime */
3245staticfn int
3246cures_sliming(struct monst *mon, struct obj *obj)
3247{
3248 /* scroll of fire */
3249 if (obj->otyp == SCR_FIRE)
3250 return (haseyes(mon->data) && mon->mcansee && !nohands(mon->data));
3251
3252 /* potion of oil; will be set burning if not already */
3253 if (obj->otyp == POT_OIL)
3254 return !nohands(mon->data);
3255
3256 /* non-empty wand or horn of fire;
3257 hero doesn't need hands or even limbs to zap, so mon doesn't either */
3258 return ((obj->otyp == WAN_FIRE
3259 || (obj->otyp == FIRE_HORN && can_blow(mon)))
3260 && obj->spe > 0);
3261}
3262
3263/* TRUE if monster appears to be green; we go by the display color.
3264 The alternative was to just pick things that

Callers 1

munslimeFunction · 0.85

Calls 1

can_blowFunction · 0.85

Tested by

no test coverage detected