/* Extract the flags */
object_flags(o_ptr, flgs);
+ torch_flags(o_ptr, flgs); /* torches has secret flags */
if (!thrown)
{
case TV_POLEARM:
case TV_SWORD:
case TV_DIGGING:
+ case TV_LITE:
{
/* Slay Animal */
if ((have_flag(flgs, TR_SLAY_ANIMAL)) &&
int i, j, y, x, ty, tx, prev_y, prev_x;
int ny[19], nx[19];
int chance, tdam, tdis;
- int mul, div;
+ int mul, div, dd, ds;
int cur_dis, visible;
object_type forge;
/* Extract the thrown object's flags. */
object_flags(q_ptr, flgs);
+ torch_flags(q_ptr, flgs);
/* Distribute the charges of rods/wands between the stacks */
distribute_charges(o_ptr, q_ptr, 1);
}
/* Hack -- Base damage from thrown object */
- tdam = damroll(q_ptr->dd, q_ptr->ds);
+ dd = q_ptr->dd;
+ ds = q_ptr->ds;
+ torch_dice(q_ptr, &dd, &ds); /* throwing a torch */
+ tdam = damroll(dd, ds);
/* Apply special damage XXX XXX XXX */
tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0, TRUE);
tdam = critical_shot(q_ptr->weight, q_ptr->to_h, tdam);
}
}
+ /* decrease toach's fuel */
+ if (hit_body) torch_lost_fuel(q_ptr);
+
/* Chance of breakage (during attacks) */
j = (hit_body ? breakage_chance(q_ptr) : 0);
extern object_type *choose_warning_item(void);
extern bool process_warning(int xx, int yy);
extern void do_cmd_kaji(bool only_browse);
+extern void torch_flags(object_type *o_ptr, u32b *flgs);
+extern void torch_dice(object_type *o_ptr, int *dd, int *ds);
+extern void torch_lost_fuel(object_type *o_ptr);
/* racial.c */
extern bool gain_magic(void);
case 5: add_essence(10);break;
}
}
+
+
+/*
+ * Torches have special abilities when they are flaming.
+ */
+void torch_flags(object_type *o_ptr, u32b *flgs)
+{
+ if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
+ {
+ if (o_ptr->xtra4 > 0)
+ {
+ add_flag(flgs, TR_BRAND_FIRE);
+ add_flag(flgs, TR_KILL_UNDEAD);
+ add_flag(flgs, TR_THROW);
+ }
+ }
+}
+
+void torch_dice(object_type *o_ptr, int *dd, int *ds)
+{
+ if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
+ {
+ if (o_ptr->xtra4 > 0)
+ {
+ (*dd) = 2;
+ (*ds) = 4;
+ }
+ }
+}
+
+void torch_lost_fuel(object_type *o_ptr)
+{
+ if ((o_ptr->tval == TV_LITE) && (o_ptr->sval == SV_LITE_TORCH))
+ {
+ o_ptr->xtra4 -= (FUEL_TORCH / 25);
+ if (o_ptr->xtra4 < 0) o_ptr->xtra4;
+ }
+}