Advertisement
Xypher2013

Battle Command Help Window

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