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

Function fire_damage_chain

src/trap.c:4549–4572  ·  view source on GitHub ↗

* Apply fire_damage() to an entire chain. * * Return number of objects destroyed. --ALI */

Source from the content-addressed store, hash-verified

4547 * Return number of objects destroyed. --ALI
4548 */
4549int
4550fire_damage_chain(
4551 struct obj *chain,
4552 boolean force,
4553 boolean here,
4554 coordxy x, coordxy y)
4555{
4556 struct obj *obj, *nobj;
4557 int num = 0;
4558
4559 /* erode_obj() relies on bhitpos if target objects aren't carried by
4560 the hero or a monster, to check visibility controlling feedback */
4561 gb.bhitpos.x = x, gb.bhitpos.y = y;
4562
4563 for (obj = chain; obj; obj = nobj) {
4564 nobj = here ? obj->nexthere : obj->nobj;
4565 if (fire_damage(obj, force, x, y))
4566 ++num;
4567 }
4568
4569 if (num && (Blind && !couldsee(x, y)))
4570 You("smell smoke.");
4571 return num;
4572}
4573
4574/* obj has been thrown or dropped into lava; damage is worse than mere fire */
4575boolean

Callers 3

wizterrainwishFunction · 0.85
liquid_flowFunction · 0.85
minliquid_coreFunction · 0.85

Calls 2

fire_damageFunction · 0.85
YouFunction · 0.85

Tested by

no test coverage detected