… | |
… | |
1868 | if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED)) |
1868 | if (!QUERY_FLAG (tmp, FLAG_IDENTIFIED)) |
1869 | identify (tmp); |
1869 | identify (tmp); |
1870 | |
1870 | |
1871 | new_draw_info_format (NDI_BLACK, 0, op, "The scroll of %s turns to dust.", &tmp->inv->name); |
1871 | new_draw_info_format (NDI_BLACK, 0, op, "The scroll of %s turns to dust.", &tmp->inv->name); |
1872 | |
1872 | |
1873 | |
|
|
1874 | cast_spell (op, tmp, dir, tmp->inv, NULL); |
1873 | cast_spell (op, tmp, dir, tmp->inv, NULL); |
1875 | decrease_ob (tmp); |
1874 | decrease_ob (tmp); |
1876 | } |
1875 | } |
1877 | |
1876 | |
1878 | /** |
1877 | /** |
… | |
… | |
1881 | * chest. |
1880 | * chest. |
1882 | */ |
1881 | */ |
1883 | static void |
1882 | static void |
1884 | apply_treasure (object *op, object *tmp) |
1883 | apply_treasure (object *op, object *tmp) |
1885 | { |
1884 | { |
1886 | object *treas; |
|
|
1887 | |
|
|
1888 | |
|
|
1889 | /* Nice side effect of new treasure creation method is that the treasure |
1885 | /* Nice side effect of new treasure creation method is that the treasure |
1890 | * for the chest is done when the chest is created, and put into the chest |
1886 | * for the chest is done when the chest is created, and put into the chest |
1891 | * inventory. So that when the chest burns up, the items still exist. Also |
1887 | * inventory. So that when the chest burns up, the items still exist. Also |
1892 | * prevents people fromt moving chests to more difficult maps to get better |
1888 | * prevents people fromt moving chests to more difficult maps to get better |
1893 | * treasure |
1889 | * treasure |
1894 | */ |
1890 | */ |
1895 | |
|
|
1896 | treas = tmp->inv; |
1891 | object *treas = tmp->inv; |
1897 | if (treas == NULL) |
1892 | |
|
|
1893 | if (!treas) |
1898 | { |
1894 | { |
1899 | new_draw_info (NDI_UNIQUE, 0, op, "The chest was empty."); |
1895 | new_draw_info (NDI_UNIQUE, 0, op, "The chest was empty."); |
1900 | decrease_ob (tmp); |
1896 | decrease_ob (tmp); |
1901 | return; |
1897 | return; |
1902 | } |
1898 | } |
|
|
1899 | |
1903 | while (tmp->inv) |
1900 | while (tmp->inv) |
1904 | { |
1901 | { |
1905 | treas = tmp->inv; |
1902 | treas = tmp->inv; |
1906 | |
1903 | |
1907 | treas->remove (); |
1904 | treas->remove (); |
… | |
… | |
3330 | |
3327 | |
3331 | new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a missile weapon before readying this skill"); |
3328 | new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a missile weapon before readying this skill"); |
3332 | return 1; |
3329 | return 1; |
3333 | |
3330 | |
3334 | found_bow:; |
3331 | found_bow:; |
3335 | } |
|
|
3336 | else if (skill_flags [op->subtype] & SF_NEED_ITEM) |
|
|
3337 | { |
|
|
3338 | for (object *item = who->inv; item; item = item->below) |
|
|
3339 | if (item->flag [FLAG_APPLIED] |
|
|
3340 | && (item->type == WAND || item->type == ROD || item->type == HORN)) |
|
|
3341 | { |
|
|
3342 | who->change_weapon (pl->ranged_ob = item); |
|
|
3343 | goto found_item; |
|
|
3344 | } |
|
|
3345 | |
|
|
3346 | new_draw_info (NDI_UNIQUE, 0, who, "You need to apply a magic item before readying this skill"); |
|
|
3347 | return 1; |
|
|
3348 | |
|
|
3349 | found_item:; |
|
|
3350 | } |
3332 | } |
3351 | else |
3333 | else |
3352 | who->change_weapon (pl->ranged_ob = op); |
3334 | who->change_weapon (pl->ranged_ob = op); |
3353 | } |
3335 | } |
3354 | |
3336 | |