Advertisement
Xypher2013

Battle Command Help Window 1.1

Aug 1st, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.76 KB | None | 0 0
  1. module BATTLE_HELP_WINDOW
  2.  
  3.   #======================================================================================#
  4.   #  Current version: 1.1                                                                #
  5.   #                                                                                      #
  6.   #  Changelog                                                                           #
  7.   #  02/08/2013 1.1 - added a switch to hide the window                                  #
  8.   #  24/07/2013 1.0 - script created                                                     #
  9.   #                                                                                      #
  10.   #  Instructions                                                                        #                    
  11.   #                                                                                      #  
  12.   #  Add new skill type descriptions using the following template                        #
  13.   #  and edit the existing ones                                                          #
  14.   #  Battle_desc[skill type id] = "Description here"                                     #
  15.   #  Skills will automatically use their skill description when                          #
  16.   #  using Yanfly's battle command list script                                           #
  17.   #                                                                                      #
  18.   #  Set the switch in the module to hide the window or set to 0 to                      #
  19.   #  always have the window show                                                         #
  20.   #                                                                                      #
  21.   #======================================================================================#
  22.  
  23.   HIDE_WINDOW_SWITCH = 5
  24.  
  25.   Battle_desc = {} #no touchy
  26.  
  27.  
  28.   # Skill type descriptions
  29.   Battle_desc[1] = "Special skills\nwith swords and shit"
  30.   Battle_desc[2] = "Yer a wizard harry"
  31.  
  32.  
  33.  
  34.   # Default basic commands
  35.   Battle_desc[:item] = "throw \\i[350]s at the enemy or something"
  36.   Battle_desc[:fight] = "engage the enemy in fisticuffs"
  37.   Battle_desc[:escape] = "lets see if you can run faster than\nthe enemies"
  38.  
  39.  
  40.  
  41.   # Yanfly commands
  42.   Battle_desc[:combatlog] = "combatlog?\nthis is madness!"
  43.   Battle_desc[:party] = "open up your list of friends"
  44.   Battle_desc[:autobattle] = "Aloe at butt"
  45.   Battle_desc[:execute] = "etucexe"
  46.   Battle_desc[:equip] = "dammit I got mustard on my axe"
  47.  
  48. end
  49.  
  50.  
  51.  
  52. class Window_ActorCommand < Window_Command
  53.   include BATTLE_HELP_WINDOW
  54.  
  55.   alias actorcommandhelpwindow_initialize initialize
  56.   alias actorcommandhelpwindow_update update
  57.   alias actorcommandhelpwindow_open open
  58.   alias actorcommandhelpwindow_close close
  59.   alias actorcommandhelpwindow_dispose dispose
  60.  
  61.   def initialize( *args )
  62.     actorcommandhelpwindow_initialize( *args )
  63.     @battleactorcommandhelpwindow = Window_Help.new
  64.     @battleactorcommandhelpwindow.visible = false
  65.   end
  66.  
  67.   def update
  68.     actorcommandhelpwindow_update
  69.     @battleactorcommandhelpwindow.y += 25 unless @battleactorcommandhelpwindow.y >= 0
  70.     if @actor
  71.     case current_symbol
  72.     when :skill
  73.       htext = Battle_desc[current_ext]
  74.     when :attack
  75.       htext = $data_skills[@actor.attack_skill_id].description
  76.     when :guard
  77.       htext = $data_skills[@actor.guard_skill_id].description
  78.     when :use_skill
  79.       htext = $data_skills[current_ext].description
  80.     when :use_item
  81.       htext = $data_items[current_ext].description
  82.     else
  83.       htext = Battle_desc[current_symbol]
  84.     end
  85.     @battleactorcommandhelpwindow.set_text( htext )
  86.     if self.visible && self.active
  87.     @battleactorcommandhelpwindow.visible = true unless bhw_hide
  88.   else
  89.     @battleactorcommandhelpwindow.visible = false
  90.     end
  91.     end
  92.   end
  93.  
  94.   def open
  95.     actorcommandhelpwindow_open
  96.     @battleactorcommandhelpwindow.y = -400
  97.     @battleactorcommandhelpwindow.visible = true unless bhw_hide
  98.   end
  99.  
  100.   def close
  101.     actorcommandhelpwindow_close
  102.     @battleactorcommandhelpwindow.visible = false
  103.   end
  104.  
  105.   def dispose
  106.     actorcommandhelpwindow_dispose
  107.     @battleactorcommandhelpwindow.dispose unless @battleactorcommandhelpwindow.disposed?
  108.   end
  109.  
  110. end
  111.  
  112. class Window_PartyCommand < Window_Command
  113.   include BATTLE_HELP_WINDOW
  114.  
  115.   alias partycommandhelpwindow_initialize initialize
  116.   alias partycommandhelpwindow_update update
  117.   alias partycommandhelpwindow_open open
  118.   alias partycommandhelpwindow_close close
  119.   alias partycommandhelpwindow_dispose dispose
  120.  
  121.   def initialize( *args )
  122.     partycommandhelpwindow_initialize( *args )
  123.     @battlepartycommandhelpwindow = Window_Help.new
  124.     @battlepartycommandhelpwindow.visible = false
  125.   end
  126.  
  127.   def update
  128.     partycommandhelpwindow_update
  129.     @battlepartycommandhelpwindow.y += 25 unless @battlepartycommandhelpwindow.y >= 0
  130.     htext = Battle_desc[current_symbol]
  131.     @battlepartycommandhelpwindow.set_text( htext )
  132.     @battlepartycommandhelpwindow.visible = true unless bhw_hide if (!$game_message.visible && self.active)
  133.   end
  134.  
  135.   def open
  136.     partycommandhelpwindow_open
  137.     @battlepartycommandhelpwindow.y = -400
  138.     @battlepartycommandhelpwindow.visible = true unless bhw_hide
  139.   end
  140.  
  141.   def close
  142.     partycommandhelpwindow_close
  143.     @battlepartycommandhelpwindow.visible = false
  144.   end
  145.  
  146.   def dispose
  147.     partycommandhelpwindow_dispose
  148.     @battlepartycommandhelpwindow.dispose unless @battlepartycommandhelpwindow.disposed?
  149.   end
  150.  
  151. end
  152.  
  153.  
  154.  
  155. class Window_ConfirmCommand < Window_Command
  156.   include BATTLE_HELP_WINDOW
  157.    
  158.   alias confirmcommandhelpwindow_initialize initialize
  159.   alias confirmcommandhelpwindow_update update
  160.   alias confirmcommandhelpwindow_open open
  161.   alias confirmcommandhelpwindow_close close
  162.   alias confirmcommandhelpwindow_dispose dispose
  163.  
  164.   def initialize( *args )
  165.     confirmcommandhelpwindow_initialize( *args )
  166.     @confirmhelpwindow = Window_Help.new
  167.     @confirmhelpwindow.visible = false
  168.   end
  169.  
  170.   def update
  171.     confirmcommandhelpwindow_update
  172.     @confirmhelpwindow.y += 25 unless @confirmhelpwindow.y >= 0
  173.       htext = Battle_desc[current_symbol]
  174.     @confirmhelpwindow.set_text( htext )
  175.     @confirmhelpwindow.visible = true unless bhw_hide if self.active
  176.   end
  177.  
  178.   def open
  179.     confirmcommandhelpwindow_open
  180.     @confirmhelpwindow.y = -400
  181.     @confirmhelpwindow.visible = true unless bhw_hide
  182.   end
  183.  
  184.   def close
  185.     confirmcommandhelpwindow_close
  186.     @confirmhelpwindow.visible = false
  187.   end
  188.  
  189.   def dispose
  190.     confirmcommandhelpwindow_dispose
  191.     @confirmhelpwindow.dispose unless @confirmhelpwindow.disposed?
  192.   end
  193.  
  194. end
  195.  
  196.  
  197. class Window_Command
  198.   include BATTLE_HELP_WINDOW
  199.  
  200.   def bhw_hide
  201.     HIDE_WINDOW_SWITCH > 0 && $game_switches[HIDE_WINDOW_SWITCH]
  202.   end
  203.  
  204. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement