Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- # Blizz ABS BattleCry
- # Version: 1.01
- # Author : LiTTleDRAgo
- #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
- module LiTTleDRAgo
- DISABLE_VOICE_SWITCH = 50 # Switch To Disable Actor Voice
- VOLUME_VOICE = 130 # Volume Actor Voice
- #==============================================================================#
- #............................[ACTOR SOUND EFFECTS].............................#
- #==============================================================================#
- # FORMAT: A=>["B","B","B","B"] #
- # #
- # A = SKILL ID #
- # B = Sound Effect played when actor uses that skill #
- #==============================================================================#
- ACTOR_SKILL_VOICE = []
- ACTOR_SKILL_VOICE[1] = {
- 1=>["Z-Healing"],
- 2=>["A_HealWall"],
- 3=>["A_Renew"]
- }
- ACTOR_SKILL_VOICE[2] = {}
- ACTOR_SKILL_VOICE[3] = {}
- ACTOR_SKILL_VOICE[4] = {}
- ACTOR_SKILL_VOICE[8] = {
- 1=>["S-Healing"]
- }
- #==============================================================================#
- # FORMAT: A=>["B","B","B","B"] #
- # #
- # A = ACTOR ID (as listed in the ACTORS tab in the DATABASE) #
- # B = Sound Effect played when actors … #
- #==============================================================================#
- #.... attacks
- ACTOR_ATTACK_VOICE = {
- 1=>["Z-Attack1","Z-Attack2","Z-Attack3"],
- 8=>["S-Attack1","S-Attack2","S-Attack3"]
- }
- #.... injured
- ACTOR_DAMAGE_VOICE = {
- 1=>["Z-Damage1","Z-Damage2","Z-Damage3"],
- 8=>["S-Damage01","S-Damage02","S-Damage03"]
- }
- #.... defeated / death
- ACTOR_DEFEAT_VOICE = {
- 1=>["scream"],
- 8=>["screamF"]
- }
- end
- ($imported ||= {})[:drg_blizz_abs_battlecry] = 1.01
- #==============================================================================#
- #...............................[CONFIG END]...................................#
- #==============================================================================#
- if $BlizzABS && BlizzABS::VERSION >= 2.7
- class Map_Battler
- VOICE_SWITCH = LiTTleDRAgo::DISABLE_VOICE_SWITCH
- DAMAGE_VOICE = LiTTleDRAgo::ACTOR_DAMAGE_VOICE
- DEFEAT_VOICE = LiTTleDRAgo::ACTOR_DEFEAT_VOICE
- ATTACK_VOICE = LiTTleDRAgo::ACTOR_ATTACK_VOICE
- SKILL_VOICE = LiTTleDRAgo::ACTOR_SKILL_VOICE
- alias use_skill_voice_earlier use_skill
- def use_skill(skill,*args)
- result = use_skill_voice_earlier(skill,*args)
- check_voice(skill.id) if result && @battler.is_a?(Game_Actor)
- return result
- end
- alias use_attack_voice_earlier use_attack
- def use_attack(*args)
- result = use_attack_voice_earlier(*args)
- check_voice if result && @battler.is_a?(Game_Actor)
- return result
- end
- alias action_voice_earlier action_effect
- def action_effect(*args)
- action_voice_earlier(*args)
- voice_displayer(*args)
- end
- def voice_displayer(*args)
- if self.damage_done?
- if @battler.is_a?(Game_Actor)
- voice = (actor = @battler).hp > 0 ? DAMAGE_VOICE : DEFEAT_VOICE
- if voice[actor.id] != nil
- file = "#{voice[actor.id][rand(voice[actor.id].size)]}"
- file && play_battlecry(file)
- end
- end
- end
- end
- def check_voice(v = nil)
- if v && (voice = SKILL_VOICE)[(actor = @battler).id][v]
- file = "#{voice[actor.id][v][rand(voice[actor.id][v].size)]}"
- elsif v.nil? && (voice = ATTACK_VOICE)[(actor = @battler).id]
- file = "#{voice[actor.id][rand(voice[actor.id].size)]}"
- end
- file && play_battlecry(file)
- end
- def play_battlecry(filename)
- return if $game_switches[VOICE_SWITCH]
- file = RPG::AudioFile.new(filename,LiTTleDRAgo::VOLUME_VOICE ,100)
- $game_system.se_stop
- $game_system.se_play(file) rescue nil
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement