… | |
… | |
70 | } |
70 | } |
71 | if (!(random_roll (0, 3, op, PREFER_HIGH))) |
71 | if (!(random_roll (0, 3, op, PREFER_HIGH))) |
72 | { |
72 | { |
73 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s vibrates violently, then explodes!", query_name (wand)); |
73 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s vibrates violently, then explodes!", query_name (wand)); |
74 | op->play_sound (sound_find ("ob_explode")); |
74 | op->play_sound (sound_find ("ob_explode")); |
75 | wand->destroy (true); |
75 | wand->destroy (); |
76 | tmp = get_archetype ("fireball"); |
76 | tmp = get_archetype ("fireball"); |
77 | tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust (caster, spell_ob)) / 10; |
77 | tmp->stats.dam = (spell_ob->stats.dam + SP_level_dam_adjust (caster, spell_ob)) / 10; |
78 | |
78 | |
79 | if (!tmp->stats.dam) |
79 | if (!tmp->stats.dam) |
80 | tmp->stats.dam = 1; |
80 | tmp->stats.dam = 1; |
… | |
… | |
156 | if (!strcasecmp (al->item->name, stringarg)) |
156 | if (!strcasecmp (al->item->name, stringarg)) |
157 | break; |
157 | break; |
158 | |
158 | |
159 | if (!al) |
159 | if (!al) |
160 | { |
160 | { |
161 | missile->destroy (true); |
161 | missile->destroy (); |
162 | new_draw_info_format (NDI_UNIQUE, 0, op, "No such object %ss of %s", missile_name, stringarg); |
162 | new_draw_info_format (NDI_UNIQUE, 0, op, "No such object %ss of %s", missile_name, stringarg); |
163 | return 0; |
163 | return 0; |
164 | } |
164 | } |
165 | |
165 | |
166 | if (al->item->slaying) |
166 | if (al->item->slaying) |
167 | { |
167 | { |
168 | missile->destroy (true); |
168 | missile->destroy (); |
169 | new_draw_info_format (NDI_UNIQUE, 0, op, "You are not allowed to create %ss of %s", missile_name, stringarg); |
169 | new_draw_info_format (NDI_UNIQUE, 0, op, "You are not allowed to create %ss of %s", missile_name, stringarg); |
170 | return 0; |
170 | return 0; |
171 | } |
171 | } |
172 | |
172 | |
173 | give_artifact_abilities (missile, al->item); |
173 | give_artifact_abilities (missile, al->item); |
… | |
… | |
469 | new_draw_info (NDI_UNIQUE, 0, pl, "You feel something fizzle inside you."); |
469 | new_draw_info (NDI_UNIQUE, 0, pl, "You feel something fizzle inside you."); |
470 | else |
470 | else |
471 | pl->player_goto (op->slaying, op->stats.hp, op->stats.sp); |
471 | pl->player_goto (op->slaying, op->stats.hp, op->stats.sp); |
472 | } |
472 | } |
473 | |
473 | |
474 | op->destroy (true); |
474 | op->destroy (); |
475 | } |
475 | } |
476 | |
476 | |
477 | /* Word of recall causes the player to return 'home'. |
477 | /* Word of recall causes the player to return 'home'. |
478 | * we put a force into the player object, so that there is a |
478 | * we put a force into the player object, so that there is a |
479 | * time delay effect. |
479 | * time delay effect. |
… | |
… | |
1314 | if (obj->value > 0 && rndm (0, 29)) |
1314 | if (obj->value > 0 && rndm (0, 29)) |
1315 | total_value += value; |
1315 | total_value += value; |
1316 | |
1316 | |
1317 | total_weight += obj->total_weight (); |
1317 | total_weight += obj->total_weight (); |
1318 | |
1318 | |
1319 | obj->destroy (true); |
1319 | obj->destroy (); |
1320 | } |
1320 | } |
1321 | |
1321 | |
1322 | int |
1322 | int |
1323 | alchemy (object *op, object *caster, object *spell_ob) |
1323 | alchemy (object *op, object *caster, object *spell_ob) |
1324 | { |
1324 | { |
… | |
… | |
1874 | |
1874 | |
1875 | if (head->attacktype & AT_MAGIC |
1875 | if (head->attacktype & AT_MAGIC |
1876 | && !(head->attacktype & AT_COUNTERSPELL) |
1876 | && !(head->attacktype & AT_COUNTERSPELL) |
1877 | && !QUERY_FLAG (head, FLAG_MONSTER) |
1877 | && !QUERY_FLAG (head, FLAG_MONSTER) |
1878 | && (op->level > head->level)) |
1878 | && (op->level > head->level)) |
1879 | head->destroy (true); |
1879 | head->destroy (); |
1880 | else |
1880 | else |
1881 | switch (head->type) |
1881 | switch (head->type) |
1882 | { |
1882 | { |
1883 | case SPELL_EFFECT: |
1883 | case SPELL_EFFECT: |
1884 | // XXX: Don't affect floor spelleffects. See also XXX comment |
1884 | // XXX: Don't affect floor spelleffects. See also XXX comment |
1885 | // about sanctuary in spell_util.C |
1885 | // about sanctuary in spell_util.C |
1886 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
1886 | if (QUERY_FLAG (tmp, FLAG_IS_FLOOR)) |
1887 | continue; |
1887 | continue; |
1888 | |
1888 | |
1889 | if (op->level > head->level) |
1889 | if (op->level > head->level) |
1890 | head->destroy (true); |
1890 | head->destroy (); |
1891 | |
1891 | |
1892 | break; |
1892 | break; |
1893 | |
1893 | |
1894 | /* I really don't get this rune code that much - that |
1894 | /* I really don't get this rune code that much - that |
1895 | * random chance seems really low. |
1895 | * random chance seems really low. |
… | |
… | |
1897 | case RUNE: |
1897 | case RUNE: |
1898 | if (rndm (0, 149) == 0) |
1898 | if (rndm (0, 149) == 0) |
1899 | { |
1899 | { |
1900 | head->stats.hp--; /* weaken the rune */ |
1900 | head->stats.hp--; /* weaken the rune */ |
1901 | if (!head->stats.hp) |
1901 | if (!head->stats.hp) |
1902 | head->destroy (true); |
1902 | head->destroy (); |
1903 | } |
1903 | } |
1904 | break; |
1904 | break; |
1905 | } |
1905 | } |
1906 | } |
1906 | } |
1907 | } |
1907 | } |
… | |
… | |
2226 | aura->remove (); |
2226 | aura->remove (); |
2227 | |
2227 | |
2228 | /* exit if we're out of gas */ |
2228 | /* exit if we're out of gas */ |
2229 | if (aura->duration-- < 0) |
2229 | if (aura->duration-- < 0) |
2230 | { |
2230 | { |
2231 | aura->destroy (true); |
2231 | aura->destroy (); |
2232 | return; |
2232 | return; |
2233 | } |
2233 | } |
2234 | |
2234 | |
2235 | /* auras only exist in inventories */ |
2235 | /* auras only exist in inventories */ |
2236 | if (!env || !env->map) |
2236 | if (!env || !env->map) |
2237 | { |
2237 | { |
2238 | aura->destroy (true); |
2238 | aura->destroy (); |
2239 | return; |
2239 | return; |
2240 | } |
2240 | } |
2241 | |
2241 | |
2242 | /* we need to jump out of the inventory for a bit |
2242 | /* we need to jump out of the inventory for a bit |
2243 | * in order to hit the map conveniently. |
2243 | * in order to hit the map conveniently. |