… | |
… | |
220 | } |
220 | } |
221 | |
221 | |
222 | |
222 | |
223 | void |
223 | void |
224 | move_gate (object *op) |
224 | move_gate (object *op) |
225 | { /* 1 = going down, 0 = goind up */ |
225 | { /* 1 = going down, 0 = going up */ |
226 | object *tmp; |
226 | object *tmp; |
227 | |
227 | |
228 | if (op->stats.wc < 0 || (int) op->stats.wc >= NUM_ANIMATIONS (op)) |
228 | if (op->stats.wc < 0 || (int) op->stats.wc >= NUM_ANIMATIONS (op)) |
229 | { |
229 | { |
230 | LOG (llevError, "Gate error: animation was %d, max=%d\n", op->stats.wc, NUM_ANIMATIONS (op)); |
230 | LOG (llevError, "Gate error: animation was %d, max=%d\n", op->stats.wc, NUM_ANIMATIONS (op)); |
… | |
… | |
302 | */ |
302 | */ |
303 | if ((int) op->stats.wc >= NUM_ANIMATIONS (op) / 2) |
303 | if ((int) op->stats.wc >= NUM_ANIMATIONS (op) / 2) |
304 | { |
304 | { |
305 | /* Halfway or further, check blocks */ |
305 | /* Halfway or further, check blocks */ |
306 | /* First, get the top object on the square. */ |
306 | /* First, get the top object on the square. */ |
307 | for (tmp = op->above; tmp != NULL && tmp->above != NULL; tmp = tmp->above); |
307 | for (tmp = op->above; tmp && tmp->above; tmp = tmp->above) |
|
|
308 | ; |
308 | |
309 | |
309 | if (tmp != NULL) |
310 | if (tmp) |
310 | { |
311 | { |
311 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
312 | if (QUERY_FLAG (tmp, FLAG_ALIVE)) |
312 | { |
313 | { |
313 | hit_player (tmp, random_roll (1, op->stats.dam, tmp, PREFER_LOW), op, AT_PHYSICAL, 1); |
314 | hit_player (tmp, random_roll (0, op->stats.dam, tmp, PREFER_LOW), op, AT_PHYSICAL, 1); |
|
|
315 | |
314 | if (tmp->type == PLAYER) |
316 | if (tmp->type == PLAYER) |
315 | new_draw_info_format (NDI_UNIQUE, 0, tmp, "You are crushed by the %s!", &op->name); |
317 | new_draw_info_format (NDI_UNIQUE, 0, tmp, "You are crushed by the %s!", &op->name); |
316 | } |
318 | } |
317 | else |
319 | else |
318 | /* If the object is not alive, and the object either can |
320 | /* If the object is not alive, and the object either can |