#include "object-hook/hook-weapon.h"
#include "object/item-tester-hooker.h"
#include "object/item-use-flags.h"
+#include "object/object-broken.h"
#include "object/object-flags.h"
#include "object/object-info.h"
#include "object/object-kind.h"
msg_print(_("これはあまり良くない気がする。", "You have a bad feeling about this."));
}
+void it_type::display_potion_throw()
+{
+ if (!object_is_potion(this->q_ptr))
+ return;
+
+ if (!this->hit_body && !this->hit_wall && (randint1(100) >= this->corruption_possibility)) {
+ this->corruption_possibility = 0;
+ return;
+ }
+
+ msg_format(_("%sは砕け散った!", "The %s shatters!"), this->o_name);
+ if (!potion_smash_effect(this->creature_ptr, 0, this->y, this->x, this->q_ptr->k_idx)) {
+ this->do_drop = false;
+ return;
+ }
+
+ monster_type *angry_m_ptr = &this->creature_ptr->current_floor_ptr->m_list[this->creature_ptr->current_floor_ptr->grid_array[this->y][this->x].m_idx];
+ if ((this->creature_ptr->current_floor_ptr->grid_array[this->y][this->x].m_idx == 0) || !is_friendly(angry_m_ptr) || monster_invulner_remaining(angry_m_ptr)) {
+ this->do_drop = false;
+ return;
+ }
+
+ GAME_TEXT angry_m_name[MAX_NLEN];
+ monster_desc(this->creature_ptr, angry_m_name, angry_m_ptr, 0);
+ msg_format(_("%sは怒った!", "%^s gets angry!"), angry_m_name);
+ set_hostile(this->creature_ptr, &this->creature_ptr->current_floor_ptr->m_list[this->creature_ptr->current_floor_ptr->grid_array[this->y][this->x].m_idx]);
+ this->do_drop = false;
+}
+
bool it_type::check_what_throw()
{
if (this->shuriken >= 0) {
{
}
-void display_potion_throw(player_type *creature_ptr, it_type *it_ptr)
-{
- if (!object_is_potion(it_ptr->q_ptr))
- return;
-
- if (!it_ptr->hit_body && !it_ptr->hit_wall && (randint1(100) >= it_ptr->corruption_possibility)) {
- it_ptr->corruption_possibility = 0;
- return;
- }
-
- msg_format(_("%sは砕け散った!", "The %s shatters!"), it_ptr->o_name);
- if (!potion_smash_effect(creature_ptr, 0, it_ptr->y, it_ptr->x, it_ptr->q_ptr->k_idx)) {
- it_ptr->do_drop = false;
- return;
- }
-
- monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[it_ptr->y][it_ptr->x].m_idx];
- if ((creature_ptr->current_floor_ptr->grid_array[it_ptr->y][it_ptr->x].m_idx == 0) || !is_friendly(m_ptr) || monster_invulner_remaining(m_ptr)) {
- it_ptr->do_drop = false;
- return;
- }
-
- GAME_TEXT m_name[MAX_NLEN];
- monster_desc(creature_ptr, m_name, m_ptr, 0);
- msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
- set_hostile(creature_ptr, &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[it_ptr->y][it_ptr->x].m_idx]);
- it_ptr->do_drop = false;
-}
-
static void display_boomerang_throw(player_type *creature_ptr, it_type *it_ptr)
{
if ((it_ptr->back_chance > 37) && !creature_ptr->blind && (it_ptr->item >= 0)) {
it_ptr->corruption_possibility = (it_ptr->hit_body ? breakage_chance(this->creature_ptr, it_ptr->q_ptr, this->creature_ptr->pclass == CLASS_ARCHER, 0) : 0);
it_ptr->display_figurine_throw();
- display_potion_throw(this->creature_ptr, it_ptr);
+ it_ptr->display_potion_throw();
check_boomerang_throw(this->creature_ptr, it_ptr);
process_boomerang_back(this->creature_ptr, it_ptr);
drop_thrown_item(this->creature_ptr, it_ptr);