Kakakadafi

XAS Battle Cry

Oct 19th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 11.69 KB | None | 0 0
  1. #==============================================================================
  2. # ■ +++ MOG - XAS Battle Cry (V1.0) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # http://www.atelier-rgss.com
  6. #==============================================================================
  7. # System running multiple voices (sounds) for XAS.
  8. #===============================================================================
  9. module XAS_VOICE
  10.   # Do not modify the parameters below. ----------------------------------------
  11.   ACTOR_SKILL = []
  12.   ACTOR_DAMAGE = []
  13.   ACTOR_DEFEATED = []
  14.   ACTOR_LEADER = []  
  15.   ENEMY_SKILL = []
  16.   ENEMY_DAMAGE = []
  17.   ENEMY_DEFEATED = []
  18.   # ----------------------------------------------------------------------------
  19.   # Definition volume of voice.
  20.   VOLUME = 80
  21.  
  22.   # Example configuration general mode setting is the same for all
  23.   # actions battler.
  24.   #
  25.   # ACTOR_SKILL[ A ] = {  B=>["C","C","C"],
  26.   #
  27.   # A - ID do battler.
  28.   # B - ID da skill. (Caso necessário)
  29.   # C - Nome do arquivo de som.
  30.   #
  31.  
  32.   #----------------------------------------------------------------------------
  33.   # ACTOR ACTION
  34.   #----------------------------------------------------------------------------
  35.   ACTOR_SKILL[1] = {
  36.   1=>["M_Atk1","(None)","(None)", "(None)", "M_Atk3"],
  37.   2=>["M_Atk1","(None)","(None)", "(None)", "M_Atk3"],
  38.   3=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  39.   4=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  40.   5=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  41.   85=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  42.   25=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  43.   26=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  44.   13=>["M_Atk1"],
  45.   15=>["M_Atk1"],
  46.   19=>["V_SPECIAL1"]
  47.   }  
  48.  
  49.   ACTOR_SKILL[3] = {
  50.   6=>["A_ATTACK01","A_ATTACK03","A_ATTACK03"],
  51.   2=>["A_ATTACK01","A_ATTACK03","A_ATTACK03"],
  52.   8=>["A_MISC9","A_SKILL04"],  
  53.   9=>["A_MISC9","A_SKILL04"],  
  54.   10=>["A_MISC9","A_SKILL04"],  
  55.   11=>["M_Atk1","M_Atk1","M_Atk1", "M_Atk1", "M_Atk3"],
  56.   12=>["A_ATTACK01","A_ATTACK03","A_ATTACK04"],
  57.   27=>["A_MISC9","A_SKILL04"],
  58.   28=>["A_MISC9","A_SKILL04"],  
  59.   29=>["A_MISC9","A_SKILL04"],  
  60.   30=>["A_MISC9","A_SKILL04"],  
  61.   31=>["A_MISC2","A_MISC20"],  
  62.   32=>["A_MISC16","A_MISC17","A_SKILL03"],
  63.   33=>["A_MISC2","A_MISC20"],  
  64.   34=>["A_MISC16","A_MISC17"],
  65.   36=>["A_MISC18"],
  66.   38=>["A_MISC19"],
  67.   39=>["A_SKILL01","A_SKILL02","A_SKILL03"],
  68.   40=>["A_SKILL01","A_SKILL02","A_SKILL03"],
  69.   41=>["A_MISC2","A_MISC20"],  
  70.   42=>["A_MISC2","A_MISC20"],  
  71.   43=>["A_MISC2","A_MISC20"],  
  72.   44=>["A_MISC16","A_MISC17"]
  73.   }
  74.  
  75.  
  76.   #----------------------------------------------------------------------------
  77.   # ACTOR DAMAGE
  78.   #----------------------------------------------------------------------------
  79.   ACTOR_DAMAGE[1] = ["A_ATTACK04","A_ATTACK04","A_ATTACK04"]
  80.   ACTOR_DAMAGE[3] = ["SA_Damage2","SA_Damage2","SA_Damage2"]
  81.  
  82.   #----------------------------------------------------------------------------
  83.   # ACTOR DEFEATED
  84.   #----------------------------------------------------------------------------
  85.   ACTOR_DEFEATED[1] = ["SA_Damage1","SA_Damage1"]
  86.   ACTOR_DEFEATED[3] = ["SA_Defeated"]
  87.  
  88.   #----------------------------------------------------------------------------
  89.   # ACTOR LEADER
  90.   #----------------------------------------------------------------------------
  91.   ACTOR_LEADER[1] = ["sleep"]
  92.   ACTOR_LEADER[2] = ["sleep"]
  93.  
  94.   #----------------------------------------------------------------------------
  95.   # ENEMY SKILL
  96.   #----------------------------------------------------------------------------
  97.   ENEMY_SKILL[3] = {}  
  98.  
  99.   #----------------------------------------------------------------------------
  100.   # ENEMY DAMAGE
  101.   #----------------------------------------------------------------------------
  102.   ENEMY_DAMAGE[9] = []
  103.  
  104.   #----------------------------------------------------------------------------
  105.   # ENEMY DEFEATED
  106.   #----------------------------------------------------------------------------
  107.   ENEMY_DEFEATED[4] = ["073-Animal08"]
  108.   ENEMY_DEFEATED[5] = ["078-Small05"]
  109.   ENEMY_DEFEATED[7] = ["080-Monster02"]
  110.  
  111. end
  112.  
  113. #===============================================================================
  114. # ■  XAS_ACTION
  115. #===============================================================================
  116. module XAS_ACTION
  117.  
  118.   #--------------------------------------------------------------------------
  119.   # ● Execute User Effects
  120.   #--------------------------------------------------------------------------  
  121.   alias x_voice_execute_user_effects execute_user_effects
  122.   def execute_user_effects(skill)
  123.       execute_voice_action(skill)
  124.       x_voice_execute_user_effects(skill)
  125.   end
  126.  
  127.   #--------------------------------------------------------------------------
  128.   # ● Execute Voice Action
  129.   #--------------------------------------------------------------------------  
  130.   def execute_voice_action(skill)
  131.       return if self.force_action_times > 0
  132.       if self.battler.is_a?(Game_Enemy)
  133.          voice = XAS_VOICE::ENEMY_SKILL[self.battler.enemy_id]
  134.       else  
  135.          voice = XAS_VOICE::ACTOR_SKILL[self.battler.actor_id]
  136.       end  
  137.       if voice != nil
  138.          voice_list = voice[skill.id]
  139.          return if voice_list == nil
  140.          voice_id = voice_list[rand(voice_list.size)]
  141.           if $game_options
  142.             volume = XAS_VOICE::VOLUME * $game_options.master_volume
  143.             volume *= $game_options.se_volume
  144.           else
  145.             volume = XAS_VOICE::VOLUME
  146.           end
  147. #~           Audio.se_play('Audio/SE/' + @name, volume.to_i, @pitch)
  148.          Audio.se_play("Audio/SE/" + voice_id.to_s,volume.to_i,100) rescue nil
  149. #~          Audio.se_play("Audio/SE/" + voice_id.to_s,XAS_VOICE::VOLUME,100) rescue nil
  150.       end        
  151.   end
  152.  
  153. end  
  154.  
  155. #===============================================================================
  156. # ■ Sprite_Character
  157. #===============================================================================
  158. class Sprite_Character < Sprite_Base
  159.  
  160.   #--------------------------------------------------------------------------
  161.   # ● Execute Damage Pop
  162.   #--------------------------------------------------------------------------              
  163.   alias x_voice_execute_damage_pop execute_damage_pop
  164.   def execute_damage_pop
  165.       execute_voice
  166.       x_voice_execute_damage_pop
  167.   end
  168.  
  169.   #--------------------------------------------------------------------------
  170.   # ● Execute Voice
  171.   #--------------------------------------------------------------------------                
  172.   def execute_voice
  173.       if @character.battler.damage.is_a?(Numeric) and
  174.          @character.battler.damage.to_i > 0
  175.          if @character.battler.is_a?(Game_Enemy)
  176.             voice = XAS_VOICE::ENEMY_DAMAGE[@character.battler.enemy_id]
  177.          else
  178.             voice = XAS_VOICE::ACTOR_DAMAGE[@character.battler.actor_id]
  179.          end        
  180.       end
  181.       if voice != nil
  182.          voice_id = voice[rand(voice.size)]
  183.           if $game_options
  184.             volume = XAS_VOICE::VOLUME * $game_options.master_volume
  185.             volume *= $game_options.se_volume
  186.           else
  187.             volume = XAS_VOICE::VOLUME
  188.           end
  189. #~          Audio.se_play('Audio/SE/' + @name, volume.to_i, @pitch)
  190.          Audio.se_play("Audio/SE/" + voice_id.to_s,volume.to_i,100) rescue nil
  191. #~          Audio.se_play("Audio/SE/" + voice_id.to_s,XAS_VOICE::VOLUME,100) rescue nil
  192.       end      
  193.   end
  194.  
  195. end
  196.  
  197. #===============================================================================
  198. # ■ Game Character
  199. #===============================================================================
  200. class Game_Character < Game_CharacterBase
  201.  
  202.   #--------------------------------------------------------------------------
  203.   # ● Execute Enemy Defeaed Process
  204.   #--------------------------------------------------------------------------        
  205.    alias x_voice_execute_enemy_defeated_process execute_enemy_defeated_process
  206.    def execute_enemy_defeated_process
  207.        execute_enemy_defeated_voice
  208.        x_voice_execute_enemy_defeated_process
  209.    end
  210.    
  211.   #--------------------------------------------------------------------------
  212.   # ● Execute Actor Defeated Process
  213.   #--------------------------------------------------------------------------                
  214.   alias x_voice_execute_actor_defeated_process execute_actor_defeated_process
  215.   def execute_actor_defeated_process
  216.       execute_actor_defeated_voice
  217.       x_voice_execute_actor_defeated_process
  218.   end
  219.  
  220.   #--------------------------------------------------------------------------
  221.   # ● Execute Actor Defeated Voice
  222.   #--------------------------------------------------------------------------
  223.   def execute_actor_defeated_voice
  224.       voice = XAS_VOICE::ACTOR_DEFEATED[self.battler.actor_id]
  225.       if voice != nil
  226.          voice_id = voice[rand(voice.size)]
  227.           if $game_options
  228.             volume = XAS_VOICE::VOLUME * $game_options.master_volume
  229.             volume *= $game_options.se_volume
  230.           else
  231.             volume = XAS_VOICE::VOLUME
  232.           end
  233. #~          Audio.se_play('Audio/SE/' + @name, volume.to_i, @pitch)
  234.          Audio.se_play("Audio/SE/" + voice_id.to_s,volume.to_i,100) rescue nil
  235. #~          Audio.se_play("Audio/SE/" + voice_id.to_s,XAS_VOICE::VOLUME,100) rescue nil
  236.       end          
  237.   end    
  238.  
  239.   #--------------------------------------------------------------------------
  240.   # ● Execute Enemy Defeated Voice
  241.   #--------------------------------------------------------------------------  
  242.   def execute_enemy_defeated_voice
  243.       voice = XAS_VOICE::ENEMY_DEFEATED[self.battler.enemy_id]
  244.       if voice != nil
  245.          voice_id = voice[rand(voice.size)]
  246.           if $game_options
  247.             volume = XAS_VOICE::VOLUME * $game_options.master_volume
  248.             volume *= $game_options.se_volume
  249.           else
  250.             volume = XAS_VOICE::VOLUME
  251.           end
  252. #~          Audio.se_play('Audio/SE/' + @name, volume.to_i, @pitch)
  253.          Audio.se_play("Audio/SE/" + voice_id.to_s,volume.to_i,100) rescue nil
  254. #~          Audio.se_play("Audio/SE/" + voice_id.to_s,XAS_VOICE::VOLUME,100) rescue nil
  255.       end      
  256.   end
  257.  
  258. end
  259.  
  260. #===============================================================================
  261. # ■ Game Player
  262. #===============================================================================
  263. class Game_Player < Game_Character
  264.  
  265.   #--------------------------------------------------------------------------
  266.   # ● Change Leader
  267.   #--------------------------------------------------------------------------                  
  268.   alias x_voice_execute_change_leader_effect execute_change_leader_effect
  269.   def execute_change_leader_effect
  270.       x_voice_execute_change_leader_effect
  271.       execute_change_leader_voice
  272.   end
  273.    
  274.   #--------------------------------------------------------------------------
  275.   # ● Execute Change Leader Voice
  276.   #--------------------------------------------------------------------------                    
  277.   def execute_change_leader_voice
  278.       voice = XAS_VOICE::ACTOR_LEADER[self.battler.actor_id]
  279.       if voice != nil
  280.          voice_id = voice[rand(voice.size)]
  281.           if $game_options
  282.             volume = XAS_VOICE::VOLUME * $game_options.master_volume
  283.             volume *= $game_options.se_volume
  284.           else
  285.             volume = XAS_VOICE::VOLUME
  286.           end
  287. #~          Audio.se_play('Audio/SE/' + @name, volume.to_i, @pitch)
  288.          Audio.se_play("Audio/SE/" + voice_id.to_s,volume.to_i,100) rescue nil
  289. #~          Audio.se_play("Audio/SE/" + voice_id.to_s,XAS_VOICE::VOLUME,100) rescue nil
  290.       end  
  291.   end  
  292. end
  293.  
  294. $mog_rgss3_xas_battle_cry = true
Add Comment
Please, Sign In to add comment