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

Function shade_aware

src/uhitm.c:1991–2011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1989}
1990
1991staticfn boolean
1992shade_aware(struct obj *obj)
1993{
1994 if (!obj)
1995 return FALSE;
1996 /*
1997 * The things in this list either
1998 * 1) affect shades.
1999 * OR
2000 * 2) are dealt with properly by other routines
2001 * when it comes to shades.
2002 */
2003 if (obj->otyp == BOULDER
2004 || obj->otyp == HEAVY_IRON_BALL
2005 || obj->otyp == IRON_CHAIN /* dmgval handles those first three */
2006 || obj->otyp == MIRROR /* silver in the reflective surface */
2007 || obj->otyp == CLOVE_OF_GARLIC /* causes shades to flee */
2008 || objects[obj->otyp].oc_material == SILVER)
2009 return TRUE;
2010 return FALSE;
2011}
2012
2013/* used for hero vs monster and monster vs monster; also handles
2014 monster vs hero but that won't happen because hero can't be a shade */

Callers 2

hmon_hitmon_do_hitFunction · 0.85
shade_missFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected