Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #=======================================================
- # Akea Battle Cry
- # Author: Raizen
- # Comuninity: http://www.centrorpg.com/
- # Compatibility: RMVXAce
- #
- #=======================================================
- # =========================Don't Modify==============================
- $included ||= Hash.new
- $included[:akea_battlecry] = true
- module Akea_BattleCry
- Cry = []
- Actors = []
- Enemies = []
- # =========================Don't Modify==============================
- #==============================================================================
- #------------------------------------------------------------------------------
- # Actors - Here is configured the sound of each actor,
- # The numbers are defined in the cry configuration right below.
- # You can add as many lines as you want for actors and as many
- # cries as you want.
- # The Sound files must be on the folder Audio/SE and the name is put inside []
- # and separated by commas, example [sound1, sound2, sound3]
- #------------------------------------------------------------------------------
- #==============================================================================
- #==============================================================================
- # Actors[1] 1 == Actor's id on database
- #==============================================================================
- Actors[1] = {
- 1 => ['1-Attack1', '1-Attack2'], # Normal Attack
- 2 => ['1-Skill1'], # Skills
- 3 => ['1-Start1'], # Entrance Sound
- 4 => ['1-Hit1'], # Sound when hit
- 5 => ['1-Dead1', '1-Dead2'], # Sound when down
- 6 => ['1-Victory1'], #Victory Sound
- 7 => ['1-Healed1'], # Recovering Life Sound
- }
- #==============================================================================
- # Actors[8] 8 == Actor's id on database
- #==============================================================================
- Actors[8] = {
- 1 => ['8-Attack1', '8-Attack2'], # Normal Attack
- 2 => ['8-Skill1'], # Skills
- 3 => ['8-Start1'], # Entrance Sound
- 4 => ['8-Hit1', '8-Hit2'], # Sound when hit
- 5 => ['8-Dead1'], # Sound when down
- 6 => ['8-Victory1'], #Victory Sound
- 7 => ['8-Healed1'], # Recovering Life Sound
- }
- #==============================================================================
- #------------------------------------------------------------------------------
- # Enemies same as with actors
- #------------------------------------------------------------------------------
- #==============================================================================
- #==============================================================================
- # Enemies[1] 1 == Enemy ID on database
- #==============================================================================
- Enemies[1] = {
- 1 => ['8-Attack1', '8-Attack2'], # Normal Attack
- 2 => ['8-Skill1'], # Skills
- 3 => ['8-Start1'], # Entrance Sound
- 4 => ['8-Hit1', '8-Hit2'], # Sound when hit
- 5 => ['8-Dead1'], # Sound when down
- 6 => ['8-Victory1'], #Victory Sound
- }
- #==============================================================================
- #------------------------------------------------------------------------------
- # Cry - Here is configured the battle cries, you can add them following the
- # default pattern
- # Cry[cry_id] = [
- #sound that will be played, configured above for actors and enemies]
- # To add skill sound, just put on notetags of the database the following,
- # <cry id>, where the id you replace with one of the ids configured below
- # For example <cry 5>
- #------------------------------------------------------------------------------
- #==============================================================================
- Cry[1] = [ # By default it is the Entrance Sound in battle
- 3, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- Cry[2] = [ # Sound when getting hit
- 4, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- Cry[3] = [ # Sound when down
- 5, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- Cry[4] = [ # Victory Sound
- 6, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- Cry[5] = [ # Recovering Life Sound
- 7, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- Cry[6] = [
- 1, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- Cry[7] = [
- 2, # Id Sound that will be played on Actors/Enemies
- 100] # Chance to be played in percentage
- end
- #==============================================================================
- # ** Scene_Battle
- #------------------------------------------------------------------------------
- # Esta classe executa o processamento da tela de batalha.
- #==============================================================================
- class Scene_Battle < Scene_Base
- alias :akea_bcry_process_action :process_action
- alias :akea_bcry_start :start
- alias :akea_bcry_use_item :use_item
- #--------------------------------------------------------------------------
- # * Inicialização do processo
- #--------------------------------------------------------------------------
- def start
- akea_bcry_start
- @random_anim = rand($game_party.battle_members.size) unless @random_anim
- battle_cry($game_party.battle_members[@random_anim] , 1)
- end
- #--------------------------------------------------------------------------
- # * Processamento de ações
- #--------------------------------------------------------------------------
- def process_action
- unless $included[:lune_animated_battle]
- if !@subject || !@subject.current_action
- @subject = BattleManager.next_subject
- end
- if @subject && @subject.current_action
- battle_notes = @subject.current_action.item.note
- for n in 0...battle_notes.size - 3
- if battle_notes[n..n+4] == "<cry "
- y = 0
- y += 1 until battle_notes[n+4+y] == '>'
- battle_cry(@subject, battle_notes[n+4..n+4+y].to_i)
- end
- end
- end
- akea_bcry_process_action
- else
- akea_bcry_process_action
- if @subject && @subject.current_action
- battle_notes = @subject.current_action.item.note
- for n in 0...battle_notes.size - 3
- if battle_notes[n..n+4] == "<cry "
- y = 0
- y += 1 until battle_notes[n+4+y] == '>'
- battle_cry(@subject, battle_notes[n+4..n+4+y].to_i)
- end
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Criar chance de som
- #--------------------------------------------------------------------------
- def make_random_cry(n)
- rand(100) < n ? true : false
- end
- #--------------------------------------------------------------------------
- # * Chamada Principal
- #--------------------------------------------------------------------------
- def battle_cry(n, cry_id)
- if n.actor? && Akea_BattleCry::Actors[n.id] && Akea_BattleCry::Actors[n.id][Akea_BattleCry::Cry[cry_id][0]]
- sound = Akea_BattleCry::Actors[n.id][Akea_BattleCry::Cry[cry_id][0]].shuffle.first
- RPG::SE.new(sound).play if make_random_cry(Akea_BattleCry::Cry[cry_id][1])
- elsif n.enemy? && Akea_BattleCry::Enemies[n.enemy_id] && Akea_BattleCry::Enemies[n.enemy_id][Akea_BattleCry::Cry[cry_id][0]]
- sound = Akea_BattleCry::Enemies[n.enemy_id][Akea_BattleCry::Cry[cry_id][0]].shuffle.first
- RPG::SE.new(sound).play if make_random_cry(Akea_BattleCry::Cry[cry_id][1])
- end
- end
- #--------------------------------------------------------------------------
- # * Usar Item
- #--------------------------------------------------------------------------
- def use_item
- akea_bcry_use_item
- if $game_troop.all_dead?
- if @subject && @subject.actor?
- @random_anim = @subject.index
- else
- @random_anim = rand($game_party.alive_members.size)
- end
- battle_cry($game_party.alive_members[@random_anim] , 4)
- end
- end
- end
- #==============================================================================
- # ** Game_Battler
- #------------------------------------------------------------------------------
- # Esta classe gerencia os battlers. Controla a adição de sprites e ações
- # dos lutadores durante o combate.
- # É usada como a superclasse das classes Game_Enemy e Game_Actor.
- #==============================================================================
- class Game_Battler < Game_BattlerBase
- alias :akea_bcry_execute_damage :execute_damage
- #--------------------------------------------------------------------------
- # * Processamento do dano
- # user : usuário
- #--------------------------------------------------------------------------
- def execute_damage(user)
- akea_bcry_execute_damage(user)
- @result.hp_damage > 0 ? nu = 2 : nu = 5
- nu = 0 if @result.hp_damage == 0
- self.hp == 0 ? n = 3 : n = nu
- if Akea_BattleCry::Cry[n] && self.actor? && Akea_BattleCry::Actors[self.id] && Akea_BattleCry::Actors[self.id][Akea_BattleCry::Cry[n][0]]
- sound = Akea_BattleCry::Actors[self.id][Akea_BattleCry::Cry[n][0]].shuffle.first
- RPG::SE.new(sound).play if make_random_cry(Akea_BattleCry::Cry[n][1])
- elsif Akea_BattleCry::Cry[n] && self.enemy? && Akea_BattleCry::Enemies[self.enemy_id] && Akea_BattleCry::Enemies[self.enemy_id][Akea_BattleCry::Cry[n][0]]
- sound = Akea_BattleCry::Enemies[self.enemy_id][Akea_BattleCry::Cry[n][0]].shuffle.first
- RPG::SE.new(sound).play if make_random_cry(Akea_BattleCry::Cry[n][1])
- end
- end
- #--------------------------------------------------------------------------
- # * Criar chance de som
- #--------------------------------------------------------------------------
- def make_random_cry(n)
- rand(100) < n ? true : false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement