&& ((this->q_ptr->tval == TV_SPIKE) || ((has_flag(this->obj_flags, TR_THROW)) && (this->q_ptr->tval == TV_SWORD)));
}
+void it_type::set_racial_chance()
+{
+ if (has_flag(this->obj_flags, TR_THROW))
+ this->chance = ((this->creature_ptr->skill_tht) + ((this->creature_ptr->to_h_b + this->q_ptr->to_h) * BTH_PLUS_ADJ));
+ else
+ this->chance = (this->creature_ptr->skill_tht + (this->creature_ptr->to_h_b * BTH_PLUS_ADJ));
+
+ if (this->shuriken != 0)
+ this->chance *= 2;
+}
+
bool it_type::check_what_throw()
{
if (this->shuriken >= 0) {
bool calc_throw_grid();
void reflect_inventory_by_throw();
void set_class_specific_throw_params();
+ void set_racial_chance();
private:
player_type *creature_ptr;
{
}
-static void set_racial_chance(player_type *creature_ptr, it_type *it_ptr)
-{
- if (has_flag(it_ptr->obj_flags, TR_THROW))
- it_ptr->chance = ((creature_ptr->skill_tht) + ((creature_ptr->to_h_b + it_ptr->q_ptr->to_h) * BTH_PLUS_ADJ));
- else
- it_ptr->chance = (creature_ptr->skill_tht + (creature_ptr->to_h_b * BTH_PLUS_ADJ));
-
- if (it_ptr->shuriken != 0)
- it_ptr->chance *= 2;
-}
-
static bool check_racial_target_bold(player_type *creature_ptr, it_type *it_ptr)
{
it_ptr->ny[it_ptr->cur_dis] = it_ptr->y;
}
it_ptr->set_class_specific_throw_params();
- set_racial_chance(this->creature_ptr, it_ptr);
+ it_ptr->set_racial_chance();
it_ptr->prev_y = it_ptr->y;
it_ptr->prev_x = it_ptr->x;
exe_throw(this->creature_ptr, it_ptr);