OSDN Git Service

[Fix] スナイパーの射撃術使用時に効果音SOUND_ZAPを再生する
authorshimitei <shimitei@gmail.com>
Sun, 23 May 2021 11:26:16 +0000 (20:26 +0900)
committershimitei <shimitei@gmail.com>
Mon, 24 May 2021 10:54:21 +0000 (19:54 +0900)
従来の射撃術選択時のSOUND_SHOOT再生はタイミングがおかしいのと、直後の射撃音と重複して不自然に聞こえるため削除する。

src/combat/shoot.cpp
src/mind/mind-sniper.cpp

index b3ae13a..d56027d 100644 (file)
@@ -469,6 +469,9 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
         return;
     }
 
+    if (snipe_type != SP_NONE)
+        sound(SOUND_ZAP);
+
     /* Predict the "target" location */
     tx = shooter_ptr->x + 99 * ddx[dir];
     ty = shooter_ptr->y + 99 * ddy[dir];
index 10fcdf7..8c838e6 100644 (file)
@@ -503,6 +503,7 @@ static bool cast_sniper_spell(player_type *sniper_ptr, int spell)
     /* spell code */
     switch (spell) {
     case 0: /* Concentration */
+        sound(SOUND_ZAP);
         if (!snipe_concentrate(sniper_ptr))
             return FALSE;
         PlayerEnergy(sniper_ptr).set_player_turn_energy(100);
@@ -580,7 +581,6 @@ void do_cmd_snipe(player_type *sniper_ptr)
     if (!get_snipe_power(sniper_ptr, &n, FALSE))
         return;
 
-    sound(SOUND_SHOOT);
     cast = cast_sniper_spell(sniper_ptr, n);
 
     if (!cast)