Advertisement
diamondandplatinum3

Patch: (Actor Voices in Battle | Yanfly's Victory Aftermath)

Jul 26th, 2013
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.91 KB | None | 0 0
  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. # DP3's Actor Voices in Battle Script Patch for Yanfly's Victory Aftermath
  3. # This patch simply makes sure that the same actor who gets a Text Box after
  4. # Battle with the Victory Aftermath is also the Actor who says something in
  5. # the Voices Scripts during Victory.
  6. #
  7. # The Actor Voices script chooses an Actor at Random to speak normally, so this
  8. # patch just sets that random actor to be the same actor as the one with the
  9. # victory speech.
  10. #
  11. # It also allows for voices to be heard when your party receives spoils from
  12. # battle
  13. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. module DiamondandPlatinum3
  15.   module BattleVoices
  16.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  17.     #                                                        -=
  18.     #                 Editable Region        ////            ==
  19.     #                                                        =-
  20.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21.  
  22.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23.     # * Item Drop Voices
  24.     #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25.     ITEM_DROP_VOICES = {  # <= Do Not Touch This Line
  26.      
  27.       # What Actor One Will Say when receiving item drops after battle
  28.       1 => [
  29.              "Received New Items 1", 80, 100, 0,
  30.            ],
  31.  
  32.  
  33.       # What Actor Two Will Say
  34.       2 => [
  35.              "Received New Items 1", 80, 100, 0,
  36.            ],
  37.            
  38.            
  39.            
  40.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  41.     #                                                        -=
  42.     };    # End Of Editable Region           ////            ==
  43.     #                                                        =-
  44.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  45.    
  46.    
  47.     #------------------------------------------------------------------------
  48.     # * New Method: Play "Receieved Spoils" Voice
  49.     #------------------------------------------------------------------------
  50.     def self.play_spoilsreceived_voice(actor_id = 0)
  51.       return true if !allowed_to_play_voice?()
  52.       actor_id = actor_id != 0 ? actor_id : get_battle_actor_id()
  53.       return play_voice(ITEM_DROP_VOICES[actor_id], actor_id)
  54.     end
  55.   end
  56. end
  57.  
  58.  
  59.  
  60.  
  61.  
  62. #==============================================================================
  63. # ** BattleManager
  64. #------------------------------------------------------------------------------
  65. #  This module manages battle progress.
  66. #==============================================================================
  67.  
  68. module BattleManager
  69.   if ($imported ||= {})["YEA-VictoryAftermath"] && ($diamondandplatinum3_scripts ||= {})[:BattleVoices]
  70.     class << self
  71.       #------------------------------------------------------------------------
  72.       # Aliased Method: Set Victory Text
  73.       #------------------------------------------------------------------------
  74.       alias dp3_avib_yanflyvictoryaftermath_2ljas             set_victory_text
  75.       def set_victory_text(*args)
  76.         dp3_play_victory_voice() if args[1] == :win
  77.         DiamondandPlatinum3::BattleVoices::play_spoilsreceived_voice(@victory_actor ? @victory_actor.id : 0) if args[1] == :drops
  78.         dp3_avib_yanflyvictoryaftermath_2ljas(*args)
  79.       end
  80.       #------------------------------------------------------------------------
  81.       # * Overwritten Aliased Method: Victory Processing
  82.       #------------------------------------------------------------------------
  83.       def process_victory
  84.         dp3_battlemanager_processvictory_1s098yu9j()
  85.       end
  86.       #------------------------------------------------------------------------
  87.       # * Overwritten Method: Play Victory Voice
  88.       #------------------------------------------------------------------------
  89.       def dp3_play_victory_voice
  90.         actor_id = @victory_actor ? @victory_actor.id : 0
  91.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92.         # Battle Took Ages?
  93.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  94.         if $game_troop.turn_count >= DiamondandPlatinum3::BattleVoices::BATTLE_TOOK_AGES[:ratio]
  95.           return if DiamondandPlatinum3::BattleVoices::play_very_long_battle_voice(actor_id)
  96.         end
  97.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  98.         # Party Was Badly Injured?
  99.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100.         party_current_hp = 0
  101.         $game_party.battle_members.each {|ally| party_current_hp += ally.hp }
  102.         if party_current_hp < @dp3_party_start_total_hp * (DiamondandPlatinum3::BattleVoices::THAT_WAS_TOUGH[:ratio] * 0.01)
  103.           return if DiamondandPlatinum3::BattleVoices::play_party_was_badly_injured_voice(actor_id)
  104.         end
  105.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106.         # Battle Was Easy?
  107.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108.         if $game_troop.turn_count <= DiamondandPlatinum3::BattleVoices::THAT_WAS_EASY[:ratio]
  109.           return if DiamondandPlatinum3::BattleVoices::play_battle_was_easy_voice(actor_id)
  110.         end
  111.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  112.         # Default Victory Speech
  113.         #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  114.         DiamondandPlatinum3::BattleVoices::play_default_victory_voice(actor_id)
  115.       end      
  116.     end
  117.   else
  118.     msgbox_p("You either do not have the Latest Version of DiamondandPlatinum3's 'Actor Voice in Battle' Script or do not have Yanfly's 'Victory Aftermath installed'.",
  119.              "Please make sure that you have the latest versions of both these scripts and that the Victory Aftermath is located ABOVE the Battle Voices script.",
  120.              "This patch must also be below BOTH of those script in the script editor.")
  121.   end
  122. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement