Advertisement
TheSixth

Yanfly's Aftermath + Vlue's Randomizer Patch by Sixth

Sep 4th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.20 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # YEA Victory Aftermath + Vlue's W/A Randomizer Compatibility Patch
  4. #
  5. #===============================================================================
  6. #
  7. # This compatibility patch will let you drop and display random items on/with
  8. # Yanfly's aftermath scene.
  9. #
  10. # ------------------------------------------------------------------------------
  11. #
  12. # Put it below YEA Victory Aftermath and Vlue's W/A Randomizer scripts
  13. # but above Main!
  14. #
  15. #===============================================================================
  16. module AM_Random
  17.  
  18.   # You can enable/disable the random drops for each item types here.
  19.   Random_Items = false  # Enable/disable random item drops.
  20.   Random_Weapons = true # Enable/disable random weapon drops.
  21.   Random_Armors = true  # Enable/disable random armor drops.
  22.  
  23. end
  24.  
  25. #==============================================================================
  26. # ¡ BattleManager
  27. #==============================================================================
  28. module BattleManager
  29. #--------------------------------------------------------------------------
  30. # overwrite method: self.skip_aftermath - !!UPDATED!!
  31. #--------------------------------------------------------------------------
  32.   def self.skip_aftermath
  33.     $game_party.all_members.each do |actor|
  34.       actor.gain_exp($game_troop.exp_total)
  35.     end
  36.     $game_party.gain_gold($game_troop.gold_total)
  37.     $game_troop.make_drop_items.each do |item|
  38.       if $imported[:Vlue_WARandom] && RANDOM_ENEMY_DROPS
  39.         if item.is_a?(RPG::Weapon) && AM_Random::Random_Weapons == true
  40.           item = $game_party.add_weapon(item.id, 1)
  41.         elsif item.is_a?(RPG::Armor) && AM_Random::Random_Armors == true
  42.           item = $game_party.add_armor(item.id, 1)
  43.         elsif item.is_a?(RPG::Item) && AM_Random::Random_Items == true
  44.           item = $game_party.add_item(item.id, 1)
  45.         else
  46.           $game_party.gain_item(item, 1)
  47.         end
  48.       else
  49.         $game_party.gain_item(item, 1)
  50.       end
  51.     end
  52.     close_windows
  53.     SceneManager.return
  54.     replay_bgm_and_bgs
  55.     battle_end(0)
  56.   end
  57.   #--------------------------------------------------------------------------
  58.   # overwrite method: self.gain_drop_items - !!UPDATED!!
  59.   #--------------------------------------------------------------------------
  60.   def self.gain_drop_items
  61.     drops = []
  62.     $game_troop.make_drop_items.each do |item|
  63.       if $imported[:Vlue_WARandom] && RANDOM_ENEMY_DROPS
  64.         if item.is_a?(RPG::Weapon) && AM_Random::Random_Weapons == true
  65.           item = $game_party.add_weapon(item.id, 1)
  66.         elsif item.is_a?(RPG::Armor) && AM_Random::Random_Armors == true
  67.           item = $game_party.add_armor(item.id, 1)
  68.         elsif item.is_a?(RPG::Item) && AM_Random::Random_Items == true
  69.           item = $game_party.add_item(item.id, 1)
  70.         else
  71.           $game_party.gain_item(item, 1)
  72.         end
  73.       else
  74.         $game_party.gain_item(item, 1)
  75.       end
  76.       drops.push(item)
  77.     end
  78.     SceneManager.scene.show_victory_spoils($game_troop.gold_total, drops)
  79.     set_victory_text(@victory_actor, :drops)
  80.     wait_for_message
  81.   end
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement