force-fight iron bars with your weapon? */
| 1993 | |
| 1994 | /* force-fight iron bars with your weapon? */ |
| 1995 | staticfn boolean |
| 1996 | domove_fight_ironbars(coordxy x, coordxy y) |
| 1997 | { |
| 1998 | if (svc.context.forcefight && levl[x][y].typ == IRONBARS && uwep) { |
| 1999 | struct obj *obj = uwep; |
| 2000 | unsigned breakflags = (BRK_BY_HERO | BRK_FROM_INV | BRK_MELEE); |
| 2001 | |
| 2002 | if (breaktest(obj)) { |
| 2003 | if (obj->quan > 1L) |
| 2004 | obj = splitobj(obj, 1L); |
| 2005 | else |
| 2006 | setuwep((struct obj *) 0); |
| 2007 | freeinv(obj); |
| 2008 | breakflags |= BRK_KNOWN2BREAK; |
| 2009 | } else { |
| 2010 | breakflags |= BRK_KNOWN2NOTBREAK; |
| 2011 | } |
| 2012 | |
| 2013 | hit_bars(&obj, u.ux, u.uy, x, y, breakflags); |
| 2014 | return TRUE; |
| 2015 | } |
| 2016 | return FALSE; |
| 2017 | } |
| 2018 | |
| 2019 | /* force-fight a spider web with your weapon */ |
| 2020 | staticfn boolean |