/* number of turns it takes for vault guard to show up */
#define VAULT_GUARD_TIME 30
+#define SHOP_DOOR_COST 400L /* cost of a destroyed shop door */
+#define SHOP_BARS_COST 300L /* cost of iron bars */
+#define SHOP_HOLE_COST 200L /* cost of making hole/trapdoor */
+#define SHOP_WALL_COST 200L /* cost of destroying a wall */
+#define SHOP_WALL_DMG (10L * ACURRSTR) /* damaging a wall */
+
/* hunger states - see hu_stat in eat.c */
enum hunger_state_types {
SATIATED = 0,
}
} else if (IS_WALL(lev->typ)) {
if (shopedge) {
- add_damage(dpx, dpy, 10L * ACURRSTR);
+ add_damage(dpx, dpy, SHOP_WALL_DMG);
dmgtxt = "damage";
}
if (level.flags.is_maze_lev) {
} else if (closed_door(dpx, dpy)) {
digtxt = "You break through the door.";
if (shopedge) {
- add_damage(dpx, dpy, 400L);
+ add_damage(dpx, dpy, SHOP_DOOR_COST);
dmgtxt = "break";
}
if (!(lev->doormask & D_TRAPPED))
}
} else if (closed_door(zx, zy) || room->typ == SDOOR) {
if (*in_rooms(zx, zy, SHOPBASE)) {
- add_damage(zx, zy, 400L);
+ add_damage(zx, zy, SHOP_DOOR_COST);
shopdoor = TRUE;
}
if (room->typ == SDOOR)
if (IS_WALL(room->typ)) {
if (!(room->wall_info & W_NONDIGGABLE)) {
if (*in_rooms(zx, zy, SHOPBASE)) {
- add_damage(zx, zy, 200L);
+ add_damage(zx, zy, SHOP_WALL_COST);
shopwall = TRUE;
}
room->typ = ROOM;
break;
if (IS_WALL(room->typ) || room->typ == SDOOR) {
if (*in_rooms(zx, zy, SHOPBASE)) {
- add_damage(zx, zy, 200L);
+ add_damage(zx, zy, SHOP_WALL_COST);
shopwall = TRUE;
}
watch_dig((struct monst *) 0, zx, zy, TRUE);
feel_newsym(x, y); /* we know we broke it */
unblock_point(x, y); /* vision */
if (shopdoor) {
- add_damage(x, y, 400L);
+ add_damage(x, y, SHOP_DOOR_COST);
pay_for_damage("break", FALSE);
}
if (in_town(x, y))
} else if (IS_WALL(lev->typ)) {
if (*in_rooms(x, y, SHOPBASE)) {
- add_damage(x, y, 10L * ACURRSTR);
+ add_damage(x, y, SHOP_WALL_DMG);
dmgtxt = "damage";
}
digtxt = "chew a hole in the wall.";
} else if (IS_DOOR(lev->typ)) {
if (*in_rooms(x, y, SHOPBASE)) {
- add_damage(x, y, 400L);
+ add_damage(x, y, SHOP_DOOR_COST);
dmgtxt = "break";
}
if (lev->doormask & D_TRAPPED) {
xlock.door->doormask = D_NODOOR;
unblock_point(u.ux + u.dx, u.uy + u.dy);
if (*in_rooms(u.ux + u.dx, u.uy + u.dy, SHOPBASE))
- add_damage(u.ux + u.dx, u.uy + u.dy, 0L);
+ add_damage(u.ux + u.dx, u.uy + u.dy, SHOP_DOOR_COST);
newsym(u.ux + u.dx, u.uy + u.dy);
} else if (xlock.door->doormask & D_LOCKED)
xlock.door->doormask = D_CLOSED;
b_trapped("door", FINGER);
door->doormask = D_NODOOR;
if (*in_rooms(cc.x, cc.y, SHOPBASE))
- add_damage(cc.x, cc.y, 0L);
+ add_damage(cc.x, cc.y, SHOP_DOOR_COST);
} else
door->doormask = D_ISOPEN;
feel_newsym(cc.x, cc.y); /* the hero knows she opened it */
add_damage(x, y, /* schedule repair */
((IS_DOOR(lev->typ) || IS_WALL(lev->typ))
&& !context.mon_moving)
- ? 200L
+ ? SHOP_HOLE_COST
: 0L);
lev->doormask = 0; /* subsumes altarmask, icedpool... */
if (IS_ROOM(lev->typ)) /* && !IS_AIR(lev->typ) */
if (levl[bhitpos.x][bhitpos.y].doormask == D_BROKEN
&& *in_rooms(bhitpos.x, bhitpos.y, SHOPBASE)) {
shopdoor = TRUE;
- add_damage(bhitpos.x, bhitpos.y, 400L);
+ add_damage(bhitpos.x, bhitpos.y, SHOP_DOOR_COST);
}
}
break;
lev->typ = ROOM;
if (see_it)
newsym(x, y);
- add_damage(x, y, (type >= 0) ? 300L : 0L);
+ add_damage(x, y, (type >= 0) ? SHOP_BARS_COST : 0L);
if (type >= 0)
*shopdamage = TRUE;
} else {
if (new_doormask >= 0) { /* door gets broken */
if (*in_rooms(x, y, SHOPBASE)) {
if (type >= 0) {
- add_damage(x, y, 400L);
+ add_damage(x, y, SHOP_DOOR_COST);
*shopdamage = TRUE;
} else /* caused by monster */
add_damage(x, y, 0L);