Advertisement
diamondandplatinum3

'FE / D' Weapon System 'Weapon Level Status Command' GTBS

May 21st, 2013
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 5.15 KB | None | 0 0
  1. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. # Fire Emblem / Disgaea Weapon System 'Weapon Level Status Command' Add-on for GubiD's Tactical Battle System
  3. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. class Commands_All < TBS_Win_Actor
  5.  
  6.   # Editable Section
  7.   Weapon_Level_Status    = "Weapon Level Status"                             # Command Title
  8.   Help_WeaponLevelStatus = "Shows the Active Battler's Weapon Skills Status" # Command 'Help' Text
  9.  
  10.  
  11.  
  12.   #----------------------------------------------------------------------------
  13.   # Alias Listings
  14.   #----------------------------------------------------------------------------
  15.   alias dp3_firemblemdisgaeaweaponsystem_gtbs_makecommandlist    make_command_list
  16.   alias dp3_firemblemdisgaeaweaponsystem_gtbs_updatehelp         update_help
  17.   #--------------------------------------------------------------------------
  18.   # * Aliased Method: Create Command List
  19.   #--------------------------------------------------------------------------
  20.   def make_command_list(*args)
  21.     return unless @actor
  22.     dp3_firemblemdisgaeaweaponsystem_gtbs_makecommandlist(*args) # Call Original Method
  23.    
  24.     # Add in Weapon Level Status Command just after Status command
  25.     temp_list = []
  26.     @list.each do |command|
  27.       temp_list.push(command)
  28.       if command[:symbol] == :status
  29.         temp_list.push({:name=>Weapon_Level_Status, :symbol=>:weapon_level_status, :enabled=>true, :ext=>nil})
  30.       end
  31.     end
  32.     @list = temp_list
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # * Aliased Method: Update Help
  36.   #--------------------------------------------------------------------------
  37.   def update_help
  38.     if current_symbol == :weapon_level_status
  39.       @help_window.set_text(Help_WeaponLevelStatus)
  40.     else
  41.       dp3_firemblemdisgaeaweaponsystem_gtbs_updatehelp() # Call Original Method
  42.     end
  43.   end
  44. end
  45.  
  46.  
  47. #=============================================================
  48. # Scene Battle (TBS Mode)
  49. #=============================================================
  50. class Scene_Battle_TBS < Scene_Base
  51.   #----------------------------------------------------------------------------
  52.   # Alias Listings
  53.   #----------------------------------------------------------------------------
  54.   alias dp3_firemblemdisgaeaweaponsystem_gtbs_createwindows      create_windows
  55.   alias dp3_firemblemdisgaeaweaponsystem_gtbs_createcommdwin     create_command_window
  56.   alias dp3_firemblemdisgaeaweaponsystem_gtbs_update             update
  57.   #----------------------------------------------------------------------------
  58.   # Aliased Method: Create Windows
  59.   #----------------------------------------------------------------------------
  60.   def create_windows(*args)
  61.     dp3_firemblemdisgaeaweaponsystem_gtbs_createwindows(*args) # Call Original Method
  62.    
  63.     @windows[:weap_lev_status_win] = Window_WeaponLevelStatus.new($game_actors[1])
  64.     @windows[:weap_lev_status_win].back_opacity = GTBS::CONTROL_OPACITY
  65.     @windows[:weap_lev_status_win].visible = false
  66.     @windows[:weap_lev_status_win].active = false
  67.   end
  68.   #----------------------------------------------------------------------------
  69.   # Aliased Method: Create Command Window
  70.   #----------------------------------------------------------------------------
  71.   def create_command_window(*args)
  72.     dp3_firemblemdisgaeaweaponsystem_gtbs_createcommdwin(*args) # Call Original Method
  73.     @windows[Menu_Actor].set_handler(:weapon_level_status, method(:open_weapon_level_status_window))
  74.   end
  75.   #----------------------------------------------------------------------------
  76.   # Aliased Method: Update Process
  77.   #----------------------------------------------------------------------------
  78.   def update(*args)
  79.     if @windows[:weap_lev_status_win].active
  80.       update_weapon_level_status_window()
  81.       super()
  82.     else
  83.       dp3_firemblemdisgaeaweaponsystem_gtbs_update(*args) # Call Original Method
  84.     end
  85.   end
  86.   #----------------------------------------------------------------------------
  87.   # New Method: Open Weapon Level Status Window for battler
  88.   #----------------------------------------------------------------------------
  89.   def open_weapon_level_status_window()
  90.     Sound.play_decision
  91.     @windows[Menu_Actor].hide()
  92.     @windows[Win_Help].hide()
  93.     @windows[Win_Status].hide()
  94.    
  95.     @windows[:weap_lev_status_win].actor = @active_battler
  96.     @windows[:weap_lev_status_win].refresh()
  97.     @windows[:weap_lev_status_win].activate()
  98.     @windows[:weap_lev_status_win].show()
  99.   end
  100.   #----------------------------------------------------------------------------
  101.   # Update Weapon Level Status Window
  102.   #----------------------------------------------------------------------------
  103.   def update_weapon_level_status_window
  104.     @windows[:weap_lev_status_win].update()
  105.     if Input.trigger?(Input::B)  
  106.       Sound.play_cancel
  107.       @windows[:weap_lev_status_win].deactivate
  108.       @windows[:weap_lev_status_win].hide
  109.       @windows[Menu_Actor].activate()
  110.       @windows[Menu_Actor].show()
  111.       @windows[Win_Help].show()
  112.       @windows[Win_Status].show()
  113.     end
  114.   end
  115. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement