… | |
… | |
216 | void |
216 | void |
217 | rune_attack (object *op, object *victim) |
217 | rune_attack (object *op, object *victim) |
218 | { |
218 | { |
219 | if (victim) |
219 | if (victim) |
220 | { |
220 | { |
221 | tag_t tag = victim->count; |
|
|
222 | |
|
|
223 | hit_player (victim, op->stats.dam, op, op->attacktype, 1); |
221 | hit_player (victim, op->stats.dam, op, op->attacktype, 1); |
224 | if (was_destroyed (victim, tag)) |
222 | |
|
|
223 | if (victim->destroyed ()) |
225 | return; |
224 | return; |
|
|
225 | |
226 | /* if there's a disease in the needle, put it in the player */ |
226 | /* if there's a disease in the needle, put it in the player */ |
227 | if (HAS_RANDOM_ITEMS (op)) |
227 | if (HAS_RANDOM_ITEMS (op)) |
228 | create_treasure (op->randomitems, op, 0, (victim->map ? victim->map->difficulty : 1), 0); |
228 | create_treasure (op->randomitems, op, 0, (victim->map ? victim->map->difficulty : 1), 0); |
|
|
229 | |
229 | if (op->inv && op->inv->type == DISEASE) |
230 | if (op->inv && op->inv->type == DISEASE) |
230 | { |
231 | { |
231 | object *disease = op->inv; |
232 | object *disease = op->inv; |
232 | |
233 | |
233 | infect_object (victim, disease, 1); |
234 | infect_object (victim, disease, 1); |
… | |
… | |
245 | */ |
246 | */ |
246 | void |
247 | void |
247 | spring_trap (object *trap, object *victim) |
248 | spring_trap (object *trap, object *victim) |
248 | { |
249 | { |
249 | object *env; |
250 | object *env; |
250 | tag_t trap_tag = trap->count; |
|
|
251 | rv_vector rv; |
251 | rv_vector rv; |
252 | int i; |
252 | int i; |
253 | |
253 | |
254 | /* Prevent recursion */ |
254 | /* Prevent recursion */ |
255 | if (trap->stats.hp <= 0) |
255 | if (trap->stats.hp <= 0) |
… | |
… | |
287 | |
287 | |
288 | /* Only if it is a spell do we proceed here */ |
288 | /* Only if it is a spell do we proceed here */ |
289 | if ((trap->inv && trap->inv->type == SPELL) || (trap->other_arch && trap->other_arch->clone.type == SPELL)) |
289 | if ((trap->inv && trap->inv->type == SPELL) || (trap->other_arch && trap->other_arch->clone.type == SPELL)) |
290 | { |
290 | { |
291 | |
291 | |
292 | if (was_destroyed (trap, trap_tag)) |
292 | if (trap->destroyed ()) |
293 | return; |
293 | return; |
294 | |
294 | |
295 | // breaks summon golem spells, which, for inexplicable reasons, |
295 | // breaks summon golem spells, which, for inexplicable reasons, |
296 | // do not work like summon golem spells at all but still require |
296 | // do not work like summon golem spells at all but still require |
297 | // direction "0" to work at all. |
297 | // direction "0" to work at all. |
… | |
… | |
312 | } |
312 | } |
313 | } |
313 | } |
314 | else |
314 | else |
315 | { |
315 | { |
316 | rune_attack (trap, victim); |
316 | rune_attack (trap, victim); |
317 | if (was_destroyed (trap, trap_tag)) |
317 | if (trap->destroyed ()) |
318 | return; |
318 | return; |
319 | } |
319 | } |
320 | |
320 | |
321 | if (trap->stats.hp <= 0) |
321 | if (trap->stats.hp <= 0) |
322 | { |
322 | { |