case TV_ARROW:
case TV_BOLT:
{
- exe_fire(item, &inventory[INVEN_BOW]);
+ exe_fire(item, &inventory[INVEN_BOW], SP_NONE);
break;
}
* @brief 射撃処理のメインルーチン
* @return なし
*/
-void do_cmd_fire(void)
+void do_cmd_fire(SPELL_IDX snipe_type)
{
OBJECT_IDX item;
object_type *j_ptr, *ammo_ptr;
}
/* Fire the item */
- exe_fire(item, j_ptr);
+ exe_fire(item, j_ptr, snipe_type);
if (!is_fired || p_ptr->pclass != CLASS_SNIPER) return;
if (hit_body) torch_lost_fuel(q_ptr);
/* Chance of breakage (during attacks) */
- j = (hit_body ? breakage_chance(q_ptr) : 0);
+ j = (hit_body ? breakage_chance(q_ptr, 0) : 0);
/* Figurines transform */
if ((q_ptr->tval == TV_FIGURINE) && !(p_ptr->inside_arena))
/* Fire an item */
case 'f':
{
- do_cmd_fire();
+ do_cmd_fire(SP_NONE);
break;
}
extern void do_cmd_stay(bool pickup);
extern void do_cmd_run(void);
extern void do_cmd_rest(void);
-extern void do_cmd_fire(void);
-extern void exe_fire(INVENTORY_IDX item, object_type *j_ptr);
+extern void do_cmd_fire(SPELL_IDX snipe_type);
+extern void exe_fire(INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type);
extern bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken);
#ifdef TRAVEL
extern void do_cmd_travel(void);
extern bool can_get_item(void);
extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode);
extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option);
-PERCENTAGE breakage_chance(object_type *o_ptr);
+PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type);
/* object2.c */
extern void excise_object_idx(OBJECT_IDX o_idx);
#endif
/* variable.c (for snipers) */
-extern int snipe_type;
extern bool reset_concent; /* Concentration reset flag */
extern bool is_fired;
/* snipe.c */
extern void reset_concentration(bool msg);
extern void display_snipe_list(void);
-extern MULTIPLY tot_dam_aux_snipe (MULTIPLY mult, monster_type *m_ptr);
+extern MULTIPLY tot_dam_aux_snipe (MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type);
extern void do_cmd_snipe(void);
extern void do_cmd_snipe_browse(void);
extern int boost_concentration_damage(int tdam);
* @details
* Note that artifacts never break, see the "drop_near()" function.
*/
-PERCENTAGE breakage_chance(object_type *o_ptr)
+PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type)
{
PERCENTAGE archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (PERCENTAGE)(p_ptr->lev - 1) / 7 + 4 : 0);
* @param m_ptr 目標モンスターの構造体参照ポインタ
* @return スレイ倍率をかけたダメージ量
*/
-static MULTIPLY tot_dam_aux_shot(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr)
+static MULTIPLY tot_dam_aux_shot(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, SPELL_IDX snipe_type)
{
MULTIPLY mult = 10;
}
/* Sniper */
- if (snipe_type) mult = tot_dam_aux_snipe(mult, m_ptr);
+ if (snipe_type) mult = tot_dam_aux_snipe(mult, m_ptr, snipe_type);
/* Return the total damage */
return (tdam * mult / 10);
* Note that Bows of "Extra Shots" give an extra shot.
* </pre>
*/
-void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
+void exe_fire(INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type)
{
DIRECTION dir;
int i;
else
{
/* Apply special damage */
- tdam = tot_dam_aux_shot(q_ptr, tdam, m_ptr);
+ tdam = tot_dam_aux_shot(q_ptr, tdam, m_ptr, snipe_type);
tdam = critical_shot(q_ptr->weight, q_ptr->to_h, j_ptr->to_h, tdam);
/* No negative damage */
}
/* Chance of breakage (during attacks) */
- j = (hit_body ? breakage_chance(q_ptr) : 0);
+ j = (hit_body ? breakage_chance(q_ptr, snipe_type) : 0);
if (stick_to)
{
* @param m_ptr 目標となるモンスターの構造体参照ポインタ
* @return スレイの倍率(/10倍)
*/
-MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr)
+MULTIPLY tot_dam_aux_snipe(MULTIPLY mult, monster_type *m_ptr, SPELL_IDX snipe_type)
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool seen = is_seen(m_ptr);
static bool cast_sniper_spell(int spell)
{
object_type *o_ptr = &inventory[INVEN_BOW];
+ SPELL_IDX snipe_type = SP_NONE;
if (o_ptr->tval != TV_BOW)
{
}
command_cmd = 'f';
- do_cmd_fire();
- snipe_type = 0;
+ do_cmd_fire(snipe_type);
return (is_fired);
}
#endif
/* for snipers */
-int snipe_type = SP_NONE;
bool reset_concent = FALSE; /* Concentration reset flag */
bool is_fired = FALSE;