Advertisement
vindaca510

V's Random Battle Skills v0.2

Sep 5th, 2013
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 7.07 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                           V's Random Battle Skills                           #
  4. #                                 Version  0.2                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                        Last Edited: September 7, 2013                        #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                                                                              #
  11. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  12.  
  13.  
  14. #==============================================================================#
  15. #------------------------------------------------------------------------------#
  16. # ** Disclaimer                                                                #
  17. #------------------------------------------------------------------------------#
  18. #                                                                              #
  19. # This script was intended for Non-commercial use only, if you wish to use     #
  20. # this script in a commercial game please PM me at which ever site you found   #
  21. # this script. Either way please give me credit in your game script as the     #
  22. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  23. #                                                                              #
  24. #------------------------------------------------------------------------------#
  25. # ** How To Use                                                                #
  26. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  27. #                                                                              #
  28. # * This script is pretty much plug-and-play. Just set the                     #
  29. # Number_Of_Random_Skills for each palyer, in the module and once the player   #
  30. # has learned that many skills they will start to become randomized.           #
  31. #                                                                              #
  32. #------------------------------------------------------------------------------#
  33. # ** Description                                                               #
  34. #------------------------------------------------------------------------------#
  35. #                                                                              #
  36. #  v0.1                                                                        #
  37. # ~=~=~=~                                                                      #
  38. #  * This script allows you randomize the battle skills so that each battle    #
  39. #  every actor will recieve a new set of skills.                               #
  40. #                                                                              #
  41. #  v0.2                                                                        #
  42. # ~=~=~=~                                                                      #
  43. #  * It is now set up to give every battle member a set number of random skills#
  44. # at the start of every new battle.                                            #
  45. #                                                                              #
  46. #------------------------------------------------------------------------------#
  47. #==============================================================================#
  48. module V_Random_Battle_Skills
  49.   module Specs
  50. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  51. #                                                                              #
  52. #                           Start Customizable Area.                           #
  53. #                                                                              #
  54. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  55. #                                                                              #
  56. #                      ONLY EDIT AFTER THE EQUALS SYMBOL.                      #
  57. #                                                                              #
  58. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  59.    
  60.    
  61.   #============================================================================
  62.   #  Menu Command Options
  63.   #============================================================================
  64.    
  65.     Number_Of_Random_Skills = 7
  66.    
  67.    
  68.    
  69.    
  70.    
  71. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  72. #                                                                              #
  73. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  74. #                                                                              #
  75. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  76.    
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. end
  112. end
  113. module BattleManager
  114.   class<<self; alias bs546543213 battle_start; end
  115.   def self.battle_start
  116.     bs546543213()
  117.     $game_party.battle_members.each do |i|
  118.       i.tp = 100
  119.     end
  120.     $game_system.ib = true
  121.   end
  122.   class<<self; alias be321321654654321 battle_end; end
  123.   def self.battle_end(result)
  124.     be321321654654321(result)
  125.     $game_system.rbs.clear
  126.     $game_system.ib = false
  127.     $game_party.members.each { |i| i.srs = true }
  128.   end
  129. end
  130. class Game_Actor < Game_Battler
  131.   include V_Random_Battle_Skills::Specs
  132.   attr_accessor :trs
  133.   attr_accessor :srs
  134.   alias :old_init27201045070504 :initialize
  135.   def initialize(actor_id)
  136.     super()
  137.     @trs = Number_Of_Random_Skills
  138.     @srs = true
  139.     old_init27201045070504(actor_id)
  140.   end
  141. end
  142. class Window_SkillList < Window_Selectable
  143.   alias :mil050575041041041 :make_item_list
  144.   def make_item_list
  145.     if $game_system.ib == true
  146.       if @actor.srs == false
  147.         @data = $game_system.rbs[@actor]
  148.       else
  149.         temp = @actor.skills unless @actor.skills.size > @actor.trs
  150.         temp = @actor.skills.shuffle[0, @actor.trs] if @actor.skills.size > @actor.trs
  151.         $game_system.rbs[@actor] = temp
  152.         @data = $game_system.rbs[@actor]
  153.         @actor.srs = false
  154.       end
  155.     else
  156.       mil050575041041041()
  157.     end
  158.   end
  159. end
  160. class Window_ActorCommand < Window_Command
  161.   def make_command_list
  162.     return unless @actor
  163.     add_skill_commands
  164.     add_item_command
  165.   end
  166.   def add_skill_commands
  167.     if $game_system.ib == false
  168.       @actor.added_skill_types.sort.each do |stype_id|
  169.         name = $data_system.skill_types[stype_id]
  170.         add_command(name, :skill, true, stype_id)
  171.       end
  172.     else
  173.       add_command("Action", :skill, true)
  174.     end
  175.   end
  176. end
  177.   class Game_System
  178.   attr_accessor :ib
  179.   attr_accessor :rbs
  180.   alias :old_init3213546461321 :initialize
  181.   def initialize
  182.     @ib = false
  183.     @rbs = {}
  184.     old_init3213546461321()
  185.   end
  186. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement