… | |
… | |
150 | else |
150 | else |
151 | { |
151 | { |
152 | rune = get_archetype (GENERIC_RUNE); |
152 | rune = get_archetype (GENERIC_RUNE); |
153 | sprintf (buf, "You set off a rune of %s\n", &rune_spell->name); |
153 | sprintf (buf, "You set off a rune of %s\n", &rune_spell->name); |
154 | rune->msg = buf; |
154 | rune->msg = buf; |
155 | tmp = get_object (); |
155 | tmp = object::create (); |
156 | copy_object (rune_spell, tmp); |
156 | rune_spell->copy_to (tmp); |
157 | insert_ob_in_ob (tmp, rune); |
157 | insert_ob_in_ob (tmp, rune); |
158 | if (spell->face != blank_face) |
158 | if (spell->face != blank_face) |
159 | rune->face = spell->face; |
159 | rune->face = spell->face; |
160 | } |
160 | } |
161 | rune->level = caster_level (caster, spell); |
161 | rune->level = caster_level (caster, spell); |
… | |
… | |
230 | if (op->inv && op->inv->type == DISEASE) |
230 | if (op->inv && op->inv->type == DISEASE) |
231 | { |
231 | { |
232 | object *disease = op->inv; |
232 | object *disease = op->inv; |
233 | |
233 | |
234 | infect_object (victim, disease, 1); |
234 | infect_object (victim, disease, 1); |
235 | disease->remove (); |
|
|
236 | disease->destroy (0); |
235 | disease->destroy (); |
237 | } |
236 | } |
238 | } |
237 | } |
239 | else |
238 | else |
240 | hit_map (op, 0, op->attacktype, 1); |
239 | hit_map (op, 0, op->attacktype, 1); |
241 | } |
240 | } |
… | |
… | |
305 | else |
304 | else |
306 | { |
305 | { |
307 | object *spell = arch_to_object (trap->other_arch); |
306 | object *spell = arch_to_object (trap->other_arch); |
308 | |
307 | |
309 | cast_spell (env, trap, trap->direction, spell, NULL); |
308 | cast_spell (env, trap, trap->direction, spell, NULL); |
310 | spell->destroy (0); |
309 | spell->destroy (); |
311 | } |
310 | } |
312 | } |
311 | } |
313 | } |
312 | } |
314 | else |
313 | else |
315 | { |
314 | { |
… | |
… | |
363 | * if you fail, no point on that. I suppose we could do a level |
362 | * if you fail, no point on that. I suppose we could do a level |
364 | * comparison so low level players can't erase high level players runes. |
363 | * comparison so low level players can't erase high level players runes. |
365 | */ |
364 | */ |
366 | if (tmp->type == SIGN && !strcmp (tmp->arch->name, "rune_mark")) |
365 | if (tmp->type == SIGN && !strcmp (tmp->arch->name, "rune_mark")) |
367 | { |
366 | { |
368 | tmp->remove (); |
|
|
369 | tmp->destroy (0); |
367 | tmp->destroy (); |
370 | new_draw_info (NDI_UNIQUE, 0, op, "You wipe out the rune of marking!"); |
368 | new_draw_info (NDI_UNIQUE, 0, op, "You wipe out the rune of marking!"); |
371 | return 1; |
369 | return 1; |
372 | } |
370 | } |
373 | |
371 | |
374 | /* now search tmp's inventory for traps |
372 | /* now search tmp's inventory for traps |
… | |
… | |
444 | sqr (MAX (trap->stats.dam, trap->inv ? trap->inv->level : 1)) / skill->level; |
442 | sqr (MAX (trap->stats.dam, trap->inv ? trap->inv->level : 1)) / skill->level; |
445 | |
443 | |
446 | if (!(random_roll (0, (MAX (2, MIN (20, trap->level - skill->level + 5 - disarmer->stats.Dex / 2)) - 1), disarmer, PREFER_LOW))) |
444 | if (!(random_roll (0, (MAX (2, MIN (20, trap->level - skill->level + 5 - disarmer->stats.Dex / 2)) - 1), disarmer, PREFER_LOW))) |
447 | { |
445 | { |
448 | new_draw_info_format (NDI_UNIQUE, 0, disarmer, "You successfully disarm the %s!", &trap->name); |
446 | new_draw_info_format (NDI_UNIQUE, 0, disarmer, "You successfully disarm the %s!", &trap->name); |
449 | destroy_object (trap); |
447 | trap->destroy (1); |
|
|
448 | |
450 | /* If it is your own trap, (or any players trap), don't you don't |
449 | /* If it is your own trap, (or any players trap), don't you don't |
451 | * get exp for it. |
450 | * get exp for it. |
452 | */ |
451 | */ |
453 | if (trap->owner && trap->owner->type != PLAYER && risk) |
452 | if (trap->owner && trap->owner->type != PLAYER && risk) |
454 | return trapworth; |
453 | return trapworth; |