… | |
… | |
1353 | trap->stats.maxsp = 2; |
1353 | trap->stats.maxsp = 2; |
1354 | |
1354 | |
1355 | /* Is this correct? From the docs, it doesn't look like it |
1355 | /* Is this correct? From the docs, it doesn't look like it |
1356 | * should be divided by trap->speed |
1356 | * should be divided by trap->speed |
1357 | */ |
1357 | */ |
1358 | victim->speed_left = -fabs (trap->stats.maxsp * victim->speed / trap->speed); |
1358 | victim->speed_left = -trap->stats.maxsp * victim->speed / trap->speed; |
1359 | |
1359 | |
1360 | /* Just put in some sanity check. I think there is a bug in the |
1360 | /* Just put in some sanity check. I think there is a bug in the |
1361 | * above with some objects have zero speed, and thus the player |
1361 | * above with some objects have zero speed, and thus the player |
1362 | * getting permanently paralyzed. |
1362 | * getting permanently paralyzed. |
1363 | */ |
1363 | */ |
… | |
… | |
1766 | * instead of having their spell stored in stats.sp. These are |
1766 | * instead of having their spell stored in stats.sp. These are |
1767 | * legacy spellbooks |
1767 | * legacy spellbooks |
1768 | */ |
1768 | */ |
1769 | if (tmp->slaying) |
1769 | if (tmp->slaying) |
1770 | { |
1770 | { |
1771 | spell = arch_to_object (find_archetype_by_object_name (tmp->slaying)); |
1771 | spell = find_archetype_by_object_name (tmp->slaying)->instance (); |
|
|
1772 | |
1772 | if (!spell) |
1773 | if (!spell) |
1773 | { |
1774 | { |
1774 | op->failmsg (format ("The book's formula for %s is incomplete.", &tmp->slaying)); |
1775 | op->failmsg (format ("The book's formula for %s is incomplete.", &tmp->slaying)); |
1775 | return; |
1776 | return; |
1776 | } |
1777 | } |
… | |
… | |
3879 | * treasure again for this object |
3880 | * treasure again for this object |
3880 | */ |
3881 | */ |
3881 | invtmp->randomitems = NULL; |
3882 | invtmp->randomitems = NULL; |
3882 | } |
3883 | } |
3883 | } |
3884 | } |
|
|
3885 | |
3884 | /* This is really temporary - the code at the bottom will |
3886 | /* This is really temporary - the code at the bottom will |
3885 | * also set randomitems to null. The problem is there are bunches |
3887 | * also set randomitems to null. The problem is there are bunches |
3886 | * of maps/players already out there with items that have spells |
3888 | * of maps/players already out there with items that have spells |
3887 | * which haven't had the randomitems set to null yet. |
3889 | * which haven't had the randomitems set to null yet. |
3888 | * MSW 2004-05-13 |
3890 | * MSW 2004-05-13 |
… | |
… | |
3892 | * Ryo 2004-08-16 |
3894 | * Ryo 2004-08-16 |
3893 | */ |
3895 | */ |
3894 | if (tmp->type == WAND || tmp->type == ROD || tmp->type == SCROLL |
3896 | if (tmp->type == WAND || tmp->type == ROD || tmp->type == SCROLL |
3895 | || tmp->type == HORN || tmp->type == FIREWALL || tmp->type == POTION || tmp->type == ALTAR || tmp->type == SPELLBOOK) |
3897 | || tmp->type == HORN || tmp->type == FIREWALL || tmp->type == POTION || tmp->type == ALTAR || tmp->type == SPELLBOOK) |
3896 | tmp->randomitems = NULL; |
3898 | tmp->randomitems = NULL; |
3897 | |
|
|
3898 | } |
3899 | } |
3899 | |
3900 | |
3900 | if (QUERY_FLAG (tmp, FLAG_AUTO_APPLY)) |
3901 | if (QUERY_FLAG (tmp, FLAG_AUTO_APPLY)) |
3901 | auto_apply (tmp); |
3902 | auto_apply (tmp); |
3902 | else if ((tmp->type == TREASURE || (tmp->type == CONTAINER)) && tmp->has_random_items ()) |
3903 | else if ((tmp->type == TREASURE || (tmp->type == CONTAINER)) && tmp->has_random_items ()) |
… | |
… | |
3959 | /* bigger morsel of food = longer effect time */ |
3960 | /* bigger morsel of food = longer effect time */ |
3960 | int duration = TIME2TICK (food->stats.food); |
3961 | int duration = TIME2TICK (food->stats.food); |
3961 | |
3962 | |
3962 | if (force = who->force_find (key)) |
3963 | if (force = who->force_find (key)) |
3963 | { |
3964 | { |
3964 | if (duration > abs (force->speed_left / force->speed)) |
3965 | if (duration > fabs (force->speed_left / force->speed)) |
3965 | { |
3966 | { |
3966 | new_draw_info_format (NDI_UNIQUE, 0, who, "More magical force spreads through you. H<The effect will last for about %.10g more seconds.>", TICK2TIME (duration)); |
3967 | new_draw_info_format (NDI_UNIQUE, 0, who, "More magical force spreads through you. H<The effect will last for about %.10g more seconds.>", TICK2TIME (duration)); |
3967 | force->force_set_timer (duration); |
3968 | force->force_set_timer (duration); |
3968 | } |
3969 | } |
3969 | else |
3970 | else |