OSDN Git Service

Revert "Merge branch 'master' of git.osdn.net:/gitroot/hengband/hengband"
[hengband/hengband.git] / src / melee1.c
index e09de5c..428927a 100644 (file)
 #include "player-damage.h"
 #include "monsterrace-hook.h"
 #include "melee.h"
+#include "projection.h"
 #include "monster.h"
 #include "monster-status.h"
 #include "monster-spell.h"
 #include "avatar.h"
 #include "player-status.h"
 #include "realm-hex.h"
-#include "object-flavor.h"
 #include "object-hook.h"
 #include "grid.h"
 #include "player-move.h"
-#include "floor.h"
-#include "spells.h"
-#include "files.h"
-#include "player-effects.h"
 
 
 
@@ -2554,7 +2550,11 @@ bool make_attack_normal(MONSTER_IDX m_idx)
 #else
                                                msg_format("%sour %s (%c) was stolen!", ((o_ptr->number > 1) ? "One of y" : "Y"), o_name, index_to_label(i));
 #endif
+
                                                chg_virtue(V_SACRIFICE, 1);
+
+
+                                               /* Make an object */
                                                o_idx = o_pop();
 
                                                /* Success */
@@ -3656,192 +3656,3 @@ bool make_attack_normal(MONSTER_IDX m_idx)
        /* Assume we attacked */
        return (TRUE);
 }
-
-
-/*!
- * @brief モンスターが敵モンスターに行う打撃処理 /
- * Hack, based on mon_take_hit... perhaps all monster attacks on other monsters should use this?
- * @param m_idx 目標となるモンスターの参照ID
- * @param dam ダメージ量
- * @param dead 目標となったモンスターの死亡状態を返す参照ポインタ
- * @param fear 目標となったモンスターの恐慌状態を返す参照ポインタ
- * @param note 目標モンスターが死亡した場合の特別メッセージ(NULLならば標準表示を行う)
- * @param who 打撃を行ったモンスターの参照ID
- * @return なし
- */
-void mon_take_hit_mon(MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
-{
-       monster_type *m_ptr = &current_floor_ptr->m_list[m_idx];
-       monster_race *r_ptr = &r_info[m_ptr->r_idx];
-       GAME_TEXT m_name[160];
-       bool seen = is_seen(m_ptr);
-
-       /* Can the player be aware of this attack? */
-       bool known = (m_ptr->cdis <= MAX_SIGHT);
-
-       /* Extract monster name */
-       monster_desc(m_name, m_ptr, 0);
-
-       /* Redraw (later) if needed */
-       if (m_ptr->ml)
-       {
-               if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
-               if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
-       }
-
-       (void)set_monster_csleep(m_idx, 0);
-
-       if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
-
-       if (MON_INVULNER(m_ptr) && randint0(PENETRATE_INVULNERABILITY))
-       {
-               if (seen)
-               {
-                       msg_format(_("%^sはダメージを受けない。", "%^s is unharmed."), m_name);
-               }
-               return;
-       }
-
-       if (r_ptr->flagsr & RFR_RES_ALL)
-       {
-               if (dam > 0)
-               {
-                       dam /= 100;
-                       if ((dam == 0) && one_in_(3)) dam = 1;
-               }
-               if (dam == 0)
-               {
-                       if (seen)
-                       {
-                               msg_format(_("%^sはダメージを受けない。", "%^s is unharmed."), m_name);
-                       }
-                       return;
-               }
-       }
-
-       /* Hurt it */
-       m_ptr->hp -= dam;
-
-       /* It is dead now... or is it? */
-       if (m_ptr->hp < 0)
-       {
-               if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
-                       (r_ptr->flags7 & RF7_NAZGUL)) &&
-                       !p_ptr->inside_battle)
-               {
-                       m_ptr->hp = 1;
-               }
-               else
-               {
-                       /* Make a sound */
-                       if (!monster_living(m_ptr->r_idx))
-                       {
-                               sound(SOUND_N_KILL);
-                       }
-                       else
-                       {
-                               sound(SOUND_KILL);
-                       }
-
-                       *dead = TRUE;
-
-                       if (known)
-                       {
-                               monster_desc(m_name, m_ptr, MD_TRUE_NAME);
-                               /* Unseen death by normal attack */
-                               if (!seen)
-                               {
-                                       mon_fight = TRUE;
-                               }
-                               /* Death by special attack */
-                               else if (note)
-                               {
-                                       msg_format(_("%^s%s", "%^s%s"), m_name, note);
-                               }
-                               /* Death by normal attack -- nonliving monster */
-                               else if (!monster_living(m_ptr->r_idx))
-                               {
-                                       msg_format(_("%^sは破壊された。", "%^s is destroyed."), m_name);
-                               }
-                               /* Death by normal attack -- living monster */
-                               else
-                               {
-                                       msg_format(_("%^sは殺された。", "%^s is killed."), m_name);
-                               }
-                       }
-
-                       monster_gain_exp(who, m_ptr->r_idx);
-                       monster_death(m_idx, FALSE);
-                       delete_monster_idx(m_idx);
-
-                       /* Not afraid */
-                       (*fear) = FALSE;
-
-                       /* Monster is dead */
-                       return;
-               }
-       }
-
-       *dead = FALSE;
-
-#ifdef ALLOW_FEAR
-
-       /* Mega-Hack -- Pain cancels fear */
-       if (MON_MONFEAR(m_ptr) && (dam > 0))
-       {
-               /* Cure fear */
-               if (set_monster_monfear(m_idx, MON_MONFEAR(m_ptr) - randint1(dam / 4)))
-               {
-                       /* No more fear */
-                       (*fear) = FALSE;
-               }
-       }
-
-       /* Sometimes a monster gets scared by damage */
-       if (!MON_MONFEAR(m_ptr) && !(r_ptr->flags3 & RF3_NO_FEAR))
-       {
-               /* Percentage of fully healthy */
-               int percentage = (100L * m_ptr->hp) / m_ptr->maxhp;
-
-               /*
-               * Run (sometimes) if at 10% or less of max hit points,
-               * or (usually) when hit for half its current hit points
-                */
-               if (((percentage <= 10) && (randint0(10) < percentage)) ||
-                       ((dam >= m_ptr->hp) && (randint0(100) < 80)))
-               {
-                       /* Hack -- note fear */
-                       (*fear) = TRUE;
-
-                       /* Hack -- Add some timed fear */
-                       (void)set_monster_monfear(m_idx, (randint1(10) +
-                               (((dam >= m_ptr->hp) && (percentage > 7)) ?
-                                       20 : ((11 - percentage) * 5))));
-               }
-       }
-
-#endif /* ALLOW_FEAR */
-
-       if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr) && (who != m_idx))
-       {
-               if (is_pet(&current_floor_ptr->m_list[who]) && !player_bold(m_ptr->target_y, m_ptr->target_x))
-               {
-                       set_target(m_ptr, current_floor_ptr->m_list[who].fy, current_floor_ptr->m_list[who].fx);
-               }
-       }
-
-       if (p_ptr->riding && (p_ptr->riding == m_idx) && (dam > 0))
-       {
-               /* Extract monster name */
-               monster_desc(m_name, m_ptr, 0);
-
-               if (m_ptr->hp > m_ptr->maxhp / 3) dam = (dam + 1) / 2;
-               if (rakuba((dam > 200) ? 200 : dam, FALSE))
-               {
-                       msg_format(_("%^sに振り落とされた!", "You have thrown off from %s!"), m_name);
-               }
-       }
-
-       /* Not dead yet */
-       return;
-}