设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 133|回复: 0

[转载发布] Actor Damage Sounds

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-1 16:12:09 | 显示全部楼层 |阅读模式

    Actor Damage Sounds
    by: Rinobi




    Version History


    • 1.00 [12/05/2015] Initial Release
    • 1.10 [12/06/2015] ATB Compatability Update
    • 1.20 [12/08/2015] Fixed occasional crash when enemy attacks.
    • 1.30 [12/09/2015] Fixed crash when unarmored actor is damaged.
    • 1.70 [12/10/2015] Major update. Fixed double sound effect bug.
                      Added sound options for barehanded and unarmored.
                      Shield armor types now have priority while actor is guarding.
                      Sensible default settings for making easy distinctions.
    • 1.80 [01/07/2016] Option to include/exclude weapon SE from skills added.
    • 2.00 [08/10/2016] Note tags added. Screen shake options included.





    Introduction


            This script allows damage sound effects to be assigned for specific weapons and armor types.


            Note tags can also be used to give skills unique damage sound and screen-shake effects.




    Features


    • Weapons and armors can now have their own sound effects.
    • Note tags allow skills to have unique sound and screen shake effects.





    Screenshots

    Spoiler[/url][url=https://forums.rpgmakerweb.com/attachments/ads_01-png.44901/]





    Script

    Spoilermodule RINOBI module ActorSound # DO NOT MODIFY
    #===============================================================================
    #                              Actor Damage Sounds
    #::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    # By: Rinobi
    #------------------------------------------------------------------------------
    #
    # Damage sound effects can now be assigned for specific weapons and armors.
    #
    #==============================================================================
    # # VERSION HISTORY
    #------------------------------------------------------------------------------
    # @ 1.0 [12/05/2015] Completed
    # @ 1.1 [12/06/2015] ATB Compatability Update
    # @ 1.2 [12/08/2015] Fixed occasional crash when enemy attacks.
    # @ 1.3 [12/09/2015] Fixed crash when actor is damaged without equipped armor.
    # @ 1.7 [12/10/2015] Major update. Fixed double sound effect bug.
    #                    Added sound options for barehanded and no armor.
    #                    Shield Armor types have priority while guarding.
    #                    Sensible default settings for making easy distinctions.
    # @ 1.8 [01/07/2016] Option to include/exclude weapon SE from skills added.
    # @ 2.0 [08/10/2016] Note tags added. Screen shake options included.
    #==============================================================================
    # # INSTRUCTIONS
    #------------------------------------------------------------------------------
    # Paste this script below Materials and above Main Process.
    # See 'SETTINGS' for addtional instructions.
    #-
    #------------------------------------------------
    #  <Sound: file_name, volume, pitch>
    #------------------------------------------------
    # Place within the 'Note' textbox of 'Skills'
    #-
    # The sound effect to be played upon dealing
    # damage to the target with said skill.
    #-
    # EX: <Sound: Gun1, 100, 60>
    #------------------------------------------------
    #  <Shake: power, speed, duration>
    #------------------------------------------------
    # Place within the 'Note' textbox of 'Skills'
    #-
    # The screen shake effect to be used used upon
    # dealing damage to the target with said skill.
    #-
    # EX: <Shake: 5, 10, 20>
    #==============================================================================
    # # SETTINGS
    # -----------------------------------------------------------------------------
    # Adjust the below settings to your liking.
    #-

      #======================================================================
      # >> Armor Slot
      # ---------------------------------------------------------------------
      # The slot id for armor. Recommended settins 2 or 3. This controls
      # which equipment slot actor damage sound effects relate to.
      #-
      # Weapon = 0 , Shield = 1 , Head = 2 , Body = 3 , Accessory = 4
      #======================================================================
      ArmorSlot = 3 # Default 3, Ignored if guarding with a shield.

      #======================================================================
      # >> Guard Slot
      # ---------------------------------------------------------------------
      # Allows an alternate sound effect to be played while an actor is
      # guarding. The armor type of the equipment slot below will take
      # priority over the above setting.
      #-
      # Weapon = 0 , Shield = 1 , Head = 2 , Body = 3 , Accessory = 4
      #======================================================================
      GuardSlot = 1 # Default 1, Has priority while guarding with a shield.

      #======================================================================
      # >> Skill SE
      # ---------------------------------------------------------------------
      # Controls whether or skills other than Attack inherit sound effects
      # from weapons. Sound effect note tags will always take priority.
      #-
      # true or false
      #======================================================================
      Use_Attack_SE = false # Skills use Normal Attack SE by default.

      #======================================================================
      # >> Default Screen Shake
      # ---------------------------------------------------------------------
      # Controls the default settings for the screen shake effect. To disable
      # screen shake for actors or enemies, set either of the below values to
      # to nil. If disabled, note tags will still trigger screen shake.
      #-
      # [Power, Speed, Duration]
      #======================================================================
      Enemy_Screen_Shake = nil # When Enemy Recieves Damage.
      Actor_Screen_Shake = [5, 5, 10] # When Actor Recieves Damage.

      #======================================================================
      # >> Armor SE Settings
      # ---------------------------------------------------------------------
      # Sound effect played when an actor recieves damage.
      # Sound effect file names found in (Project_Name)/Audio/SE
      # The below list is ordered by Armor Type IDs, with 0 being the
      # SE used when no armor is equipped. Addtional armor types may be
      # added or removed from the list below.
      #======================================================================
      ActorArmor = { #
      0 => {:File => "Damage3", :Volume => 99,
    itch => 100}, # Naked
      1 => {:File => "Damage3", :Volume => 95,
    itch => 120}, # General Armor
      2 => {:File => "Damage2", :Volume => 90,
    itch => 150}, # Magic Armor
      3 => {:File => "Damage4", :Volume => 85,
    itch => 110}, # Light Armor
      4 => {:File => "Damage1", :Volume => 80,
    itch => 150}, # Heavy Armor
      } # DO NOT MODIFY

      #======================================================================
      # >> Weapon SE Settings
      # ---------------------------------------------------------------------
      # Sound effect played when an enemy recieves damage.
      # Sound effect file names found in (Project_Name)/Audio/SE
      # The below list is ordered by Weapon Type IDs, with 0 being the
      # SE used when no weapon is equipped. Addtional weapon types may be
      # added or removed from the list below.
      #======================================================================
      ActorWeapon = { #
      0  => {:File => "Blow3"  , :Volume => 87,
    itch => 125}, # Barehanded
      1  => {:File => "Slash1" , :Volume => 99,
    itch =>  95}, # Axe
      2  => {:File => "Slash2" , :Volume => 70,
    itch => 150}, # Claw
      3  => {:File => "Slash10", :Volume => 80,
    itch => 130}, # Spear
      4  => {:File => "Sword3" , :Volume => 78,
    itch => 150}, # Sword
      5  => {:File => "Flash2" , :Volume => 85,
    itch => 150}, # Katana
      6  => {:File => "Bow3"   , :Volume => 80,
    itch => 100}, # Bow
      7  => {:File => "Slash1" , :Volume => 65,
    itch => 150}, # Dagger
      8  => {:File => "Blow8"  , :Volume => 99,
    itch =>  90}, # Hammer
      9  => {:File => "Blow3"  , :Volume => 72,
    itch => 125}, # Staff
      10 => {:File => "Gun1"   , :Volume => 90,
    itch => 100}, # Gun
      } # DO NOT MODIFY
    #==============================================================================
    # # COMPATIBILITY
    #------------------------------------------------------------------------------
    # Created for use within RPG Maker VX Ace
    #-
    # Alias Methods:
    #  @ prepare                in Game_Action
    #  @ perform_damage_effect  in Game_Actor
    #  @ perform_damage_effect  in Game_Enemy
    #===============================================================================
    # ** End of Settings
    #-------------------------------------------------------------------------------
    # Editing beyond this line may result in undesirable side-effects.
    #===============================================================================

      #======================================================================
      # >> Regexp Module
      #======================================================================
      module Regexp
        Sound_Override = /<Sound:[ ](.*?),[ ](\d+),[ ](\d+)>/i
        Shake_Override = /<Shake:[ ](\d+),[ ](\d+),[ ](\d+)>/i
      end # Regexp

    end end # DO NOT MODIFY
    #==============================================================================
    # ** IMPORT SCRIPT
    #------------------------------------------------------------------------------
    $imported = {} if $imported.nil?
    $imported[:RIN_ADamageSounds] = true
    #==============================================================================
    # ** Game_Action
    #------------------------------------------------------------------------------
    #  This class handles battle actions. This class is used within the
    # Game_Battler class.
    #==============================================================================
    class Game_Action
      #--------------------------------------------------------------------------
      # * Alias Method: prepare
      #--------------------------------------------------------------------------
      alias :se_prepare
    repare
      def prepare ; se_prepare = $acting = @subject end # prepare
    end # Game_Action
    #==============================================================================
    # ** Game_Actor
    #------------------------------------------------------------------------------
    #  This class handles actors. It is used within the Game_Actors class
    # ($game_actors) and is also referenced from the Game_Party class ($game_party).
    #==============================================================================
    class Game_Actor < Game_Battler
      include RINOBI::ActorSound
      #--------------------------------------------------------------------------
      # * Alias Method: Execute Damage Effect
      #--------------------------------------------------------------------------
      alias :rinse_damage_effect
    erform_damage_effect
      def perform_damage_effect
        return rinse_damage_effect unless $game_party.in_battle
        if guard? && equips[GuardSlot].is_a?(RPG::Armor)
          armor = equips[GuardSlot].atype_id
        elsif equips[ArmorSlot].nil? then armor = 0
        else armor = equips[ArmorSlot].atype_id end #--
        return rinse_damage_effect unless ActorArmor.include?(armor)
        file   = ActorArmor[armor][:File]
        volume = ActorArmor[armor][:Volume]
        pitch  = ActorArmor[armor][
    itch]
        if $acting.current_action.item.note =~ Regexp::Shake_Override
          $game_troop.screen.start_shake($1.to_i, $2.to_i, $3.to_i)
        elsif !Actor_Screen_Shake.nil?
          ess = Actor_Screen_Shake
          $game_troop.screen.start_shake(ess[0], ess[0], ess[0])
        end #--
        @sprite_effect_type = :blink
        RPG::SE.new(file, volume, pitch).play
      end # perform_damage_effect
    end # Game_Actor
    #==============================================================================
    # ** Game_Enemy
    #------------------------------------------------------------------------------
    #  This class handles enemies. It used within the Game_Troop class
    # ($game_troop).
    #==============================================================================
    class Game_Enemy < Game_Battler
      include RINOBI::ActorSound
      #--------------------------------------------------------------------------
      # * Alias Method: Execute Damage Effect
      #--------------------------------------------------------------------------
      alias :rinse_damage_effect
    erform_damage_effect
      def perform_damage_effect
        return rinse_damage_effect unless $acting.is_a?(Game_Actor)
        if $acting.equips[0].nil? then weapon = 0
        else weapon = $acting.equips[0].wtype_id end #--
        if $acting.current_action.item.note =~ Regexp::Sound_Override
          file, volume, pitch = $1, $2.to_i, $3.to_i
        else
          unless $acting.current_action.attack?
            return rinse_damage_effect unless Use_Attack_SE
          end #--
          file   = ActorWeapon[weapon][:File]
          volume = ActorWeapon[weapon][:Volume]
          pitch  = ActorWeapon[weapon][
    itch]
        end #--
        if $acting.current_action.item.note =~ Regexp::Shake_Override
          $game_troop.screen.start_shake($1.to_i, $2.to_i, $3.to_i)
        elsif !Enemy_Screen_Shake.nil?
          ess = Enemy_Screen_Shake
          $game_troop.screen.start_shake(ess[0], ess[0], ess[0])
        end #--
        @sprite_effect_type = :blink
        RPG::SE.new(file, volume, pitch).play
      end # perform_damage_effect
    end # Game_Enemy
    #==============================================================================
    # @@@@@  @   @  @@@@    @@@@@  @@@@@   @@@@@  @@@@@  @@@@   @@@@@  @@@@@  @@@@@
    # @      @@  @  @   @   @   @  @       @      @      @   @    @    @   @    @   
    # @@@@@  @ @ @  @   @   @   @  @@@@    @@@@@  @      @@@@     @    @@@@@    @   
    # @      @  @@  @   @   @   @  @           @  @      @  @     @    @        @   
    # @@@@@  @   @  @@@@    @@@@@  @       @@@@@  @@@@@  @   @  @@@@@  @        @   
    #==============================================================================






            Latest Version: View attachment ActorDamageSounds_20.txt


            Previous Version: ActorDamageSounds_18.txt


    本贴来自国际rpgmaker官方论坛作者:Rinobi处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/actor-damage-sounds.52323/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-18 00:25 , Processed in 0.141707 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表