From 207adb98cd94c6ddecba32fd1e41749525d68cfe Mon Sep 17 00:00:00 2001 From: shimitei Date: Wed, 26 May 2021 22:00:28 +0900 Subject: [PATCH] =?utf8?q?[Feature]=20=E5=B0=84=E6=92=83=E5=91=BD=E4=B8=AD?= =?utf8?q?=E9=9F=B3=E3=81=AE=E5=8A=B9=E6=9E=9C=E9=9F=B3=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit sound.cfgにshoot_hitを追加。 プレイヤーの射撃の命中時、モンスターの射撃がプレイヤーに命中時に再生する効果音。 --- lib/xtra/sound/sound.cfg | 3 +++ src/combat/shoot.cpp | 1 + src/effect/effect-player-resist-hurt.cpp | 4 ++++ src/main/sound-definitions-table.cpp | 1 + src/main/sound-definitions-table.h | 1 + 5 files changed, 10 insertions(+) diff --git a/lib/xtra/sound/sound.cfg b/lib/xtra/sound/sound.cfg index e30da03a0..d58beacb1 100644 --- a/lib/xtra/sound/sound.cfg +++ b/lib/xtra/sound/sound.cfg @@ -49,6 +49,9 @@ teleport = # 射撃時 shoot = +# 射撃の命中音 +shoot_hit = + # 薬を飲んだ quaff = se_maoudamashii_se_drink01.wav diff --git a/src/combat/shoot.cpp b/src/combat/shoot.cpp index d56027d7b..aad85ae4b 100644 --- a/src/combat/shoot.cpp +++ b/src/combat/shoot.cpp @@ -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]; diff --git a/src/effect/effect-player-resist-hurt.cpp b/src/effect/effect-player-resist-hurt.cpp index 154e7a248..475d4fa0e 100644 --- a/src/effect/effect-player-resist-hurt.cpp +++ b/src/effect/effect-player-resist-hurt.cpp @@ -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); } diff --git a/src/main/sound-definitions-table.cpp b/src/main/sound-definitions-table.cpp index 151ce5856..7192a72b0 100644 --- a/src/main/sound-definitions-table.cpp +++ b/src/main/sound-definitions-table.cpp @@ -16,6 +16,7 @@ const concptr angband_sound_name[SOUND_MAX] = { "study", "teleport", "shoot", + "shoot_hit", "quaff", "zap", "walk", diff --git a/src/main/sound-definitions-table.h b/src/main/sound-definitions-table.h index 3d703b36e..f558da4a0 100644 --- a/src/main/sound-definitions-table.h +++ b/src/main/sound-definitions-table.h @@ -17,6 +17,7 @@ enum sound_type { SOUND_STUDY, SOUND_TELEPORT, SOUND_SHOOT, + SOUND_SHOOT_HIT, SOUND_QUAFF, SOUND_ZAP, SOUND_WALK, /*!< unused */ -- 2.11.0