… | |
… | |
148 | new_bolt->duration++; |
148 | new_bolt->duration++; |
149 | new_bolt->stats.dam /= 2; /* reduce daughter bolt damage */ |
149 | new_bolt->stats.dam /= 2; /* reduce daughter bolt damage */ |
150 | new_bolt->stats.dam++; |
150 | new_bolt->stats.dam++; |
151 | tmp->stats.dam /= 2; /* reduce father bolt damage */ |
151 | tmp->stats.dam /= 2; /* reduce father bolt damage */ |
152 | tmp->stats.dam++; |
152 | tmp->stats.dam++; |
|
|
153 | |
153 | if ((new_bolt = m->insert (new_bolt, sx, sy, op))) |
154 | if ((new_bolt = m->insert (new_bolt, sx, sy, op))) |
154 | update_turn_face (new_bolt); |
155 | update_turn_face (new_bolt); |
155 | } |
156 | } |
156 | |
157 | |
157 | /* move_bolt: moves bolt 'op'. Basically, it just advances a space, |
158 | /* move_bolt: moves bolt 'op'. Basically, it just advances a space, |
… | |
… | |
1610 | * about. was called move_ball_lightning, but since more than the ball |
1611 | * about. was called move_ball_lightning, but since more than the ball |
1611 | * lightning spell used it, that seemed misnamed. |
1612 | * lightning spell used it, that seemed misnamed. |
1612 | * op is the spell effect. |
1613 | * op is the spell effect. |
1613 | * note that duration is handled by process_object() in time.c |
1614 | * note that duration is handled by process_object() in time.c |
1614 | */ |
1615 | */ |
1615 | |
|
|
1616 | void |
1616 | void |
1617 | move_ball_spell (object *op) |
1617 | move_ball_spell (object *op) |
1618 | { |
1618 | { |
1619 | int i, j, dam_save, dir, mflags; |
1619 | int i, j, dam_save, dir, mflags; |
1620 | sint16 nx, ny, hx, hy; |
1620 | sint16 nx, ny, hx, hy; |
… | |
… | |
1729 | sint16 target_x, target_y, origin_x, origin_y; |
1729 | sint16 target_x, target_y, origin_x, origin_y; |
1730 | int adjustdir; |
1730 | int adjustdir; |
1731 | maptile *m; |
1731 | maptile *m; |
1732 | #endif |
1732 | #endif |
1733 | object *owner = op->env; |
1733 | object *owner = op->env; |
|
|
1734 | |
|
|
1735 | if (!owner) // MUST not happen, remove when true TODO |
|
|
1736 | { |
|
|
1737 | LOG (llevError, "swarm spell found outside inventory: %s\n", op->debug_desc ()); |
|
|
1738 | op->destroy (); |
|
|
1739 | return; |
|
|
1740 | } |
1734 | |
1741 | |
1735 | if (!op->duration || !owner->is_on_map ()) |
1742 | if (!op->duration || !owner->is_on_map ()) |
1736 | { |
1743 | { |
1737 | op->destroy (); |
1744 | op->destroy (); |
1738 | return; |
1745 | return; |
… | |
… | |
1846 | |
1853 | |
1847 | tmp->duration = SP_level_duration_adjust (caster, spell); |
1854 | tmp->duration = SP_level_duration_adjust (caster, spell); |
1848 | for (int i = 0; i < spell->duration; i++) |
1855 | for (int i = 0; i < spell->duration; i++) |
1849 | tmp->duration += die_roll (1, 3, op, PREFER_HIGH); |
1856 | tmp->duration += die_roll (1, 3, op, PREFER_HIGH); |
1850 | |
1857 | |
|
|
1858 | tmp->invisible = 1; |
|
|
1859 | tmp->flag [FLAG_NO_DROP] = 1; // make sure it stays in inv, or else |
1851 | tmp->direction = dir; |
1860 | tmp->direction = dir; |
1852 | tmp->invisible = 1; |
|
|
1853 | tmp->facing = rndm (1, 8); // initial firing direction |
1861 | tmp->facing = rndm (1, 8); // initial firing direction |
1854 | tmp->state = rndm (4) * 2 + 1; // direction increment |
1862 | tmp->state = rndm (4) * 2 + 1; // direction increment |
1855 | |
1863 | |
1856 | op->insert (tmp); |
1864 | op->insert (tmp); |
1857 | |
1865 | |