Advertisement
Xypher2013

Battle Command Help Window 1.2

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