OSDN Git Service

[Feature] 射撃命中音の効果音対応
authorshimitei <shimitei@gmail.com>
Wed, 26 May 2021 13:00:28 +0000 (22:00 +0900)
committershimitei <shimitei@gmail.com>
Thu, 27 May 2021 12:09:59 +0000 (21:09 +0900)
sound.cfgにshoot_hitを追加。
プレイヤーの射撃の命中時、モンスターの射撃がプレイヤーに命中時に再生する効果音。

lib/xtra/sound/sound.cfg
src/combat/shoot.cpp
src/effect/effect-player-resist-hurt.cpp
src/main/sound-definitions-table.cpp
src/main/sound-definitions-table.h

index e30da03..d58beac 100644 (file)
@@ -49,6 +49,9 @@ teleport =
 # 射撃時
 shoot = 
 
+# 射撃の命中音
+shoot_hit = 
+
 # 薬を飲んだ
 quaff = se_maoudamashii_se_drink01.wav
 
index d56027d..aad85ae 100644 (file)
@@ -617,6 +617,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
 
             /* Monster here, Try to hit it */
             if (shooter_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+                sound(SOUND_SHOOT_HIT);
                 grid_type *c_mon_ptr = &shooter_ptr->current_floor_ptr->grid_array[y][x];
 
                 monster_type *m_ptr = &shooter_ptr->current_floor_ptr->m_list[c_mon_ptr->m_idx];
index 154e7a2..475d4fa 100644 (file)
@@ -8,6 +8,8 @@
 #include "hpmp/hp-mp-processor.h"
 #include "inventory/inventory-damage.h"
 #include "inventory/inventory-slot-types.h"
+#include "main/sound-definitions-table.h"
+#include "main/sound-of-music.h"
 #include "mind/mind-mirror-master.h"
 #include "monster-race/race-indice-types.h"
 #include "mutation/mutation-investor-remover.h"
@@ -116,6 +118,7 @@ void effect_player_hell_fire(player_type *target_ptr, effect_player_type *ep_ptr
 void effect_player_arrow(player_type *target_ptr, effect_player_type *ep_ptr)
 {
     if (target_ptr->blind) {
+        sound(SOUND_SHOOT_HIT);
         msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
         ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer);
         return;
@@ -126,6 +129,7 @@ void effect_player_arrow(player_type *target_ptr, effect_player_type *ep_ptr)
         return;
     }
 
+    sound(SOUND_SHOOT_HIT);
     ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer);
 }
 
index 151ce58..7192a72 100644 (file)
@@ -16,6 +16,7 @@ const concptr angband_sound_name[SOUND_MAX] = {
     "study",
     "teleport",
     "shoot",
+    "shoot_hit",
     "quaff",
     "zap",
     "walk",
index 3d703b3..f558da4 100644 (file)
@@ -17,6 +17,7 @@ enum sound_type {
     SOUND_STUDY,
     SOUND_TELEPORT,
     SOUND_SHOOT,
+    SOUND_SHOOT_HIT,
     SOUND_QUAFF,
     SOUND_ZAP,
     SOUND_WALK, /*!< unused */