vindaca510

V's Live H.U.D. Menu System v0.2

Jan 2nd, 2014
626
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 52.22 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                          V's  Live Hud Menu System                           #
  4. #                                 Version  0.2                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                         Last Edited: January 6, 2014                         #
  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 has a customizable area below.                                 #
  29. #                                                                              #
  30. #------------------------------------------------------------------------------#
  31. # ** Description                                                               #
  32. #------------------------------------------------------------------------------#
  33. #                                                                              #
  34. #  v0.1                                                                        #
  35. # ~=~=~=~                                                                      #
  36. #  * This script allows for a live hud style menu. Right now it only supports  #
  37. #    a one party member team but I will be updating to support all.            #
  38. #                                                                              #
  39. #  v0.2                                                                        #
  40. # ~=~=~=~                                                                      #
  41. #  * This script can now be used with V's VGW v3.0+                            #
  42. #                                                                              #
  43. #------------------------------------------------------------------------------#
  44. #==============================================================================#
  45. $imported = {} if $imported.nil?
  46. $imported["Vs_Live_HUD_Menu"] = true
  47. #==============================================================================
  48. # ** Window_SkillList
  49. #------------------------------------------------------------------------------
  50. #  This window is for displaying a list of available skills on the skill window.
  51. #==============================================================================
  52.  
  53. class Window_SkillList < Window_Selectable
  54.  
  55.   #--------------------------------------------------------------------------
  56.   # * Draw Sizeable Text
  57.   #--------------------------------------------------------------------------
  58.   def draw_sizeable_text(x, y, w, h, text, alignment, size)
  59.     contents.font.size = size
  60.     contents.draw_text(x, y, w, h, text, alignment)
  61.     reset_font_settings
  62.   end
  63.  
  64.   #--------------------------------------------------------------------------
  65.   # * Draw Sizeable Text
  66.   #--------------------------------------------------------------------------
  67.   def draw_sizeable_rect_text(rect, text, alignment, size)
  68.     contents.font.size = size
  69.     contents.draw_text(rect, text, alignment)
  70.     reset_font_settings
  71.   end
  72.  
  73.   #--------------------------------------------------------------------------
  74.   # * Draw Item Name
  75.   #     enabled : Enabled flag. When false, draw semi-transparently.
  76.   #--------------------------------------------------------------------------
  77.   def draw_item_name(item, x, y, enabled = true, width = 172)
  78.     return unless item
  79.     draw_icon(item.icon_index, x, y, enabled)
  80.     change_color(normal_color, enabled)
  81.     draw_sizeable_text(x + 24, y, width, line_height, item.name, 0, 13)
  82.   end
  83.  
  84.   #--------------------------------------------------------------------------
  85.   # * Draw Skill Use Cost
  86.   #--------------------------------------------------------------------------
  87.   def draw_skill_cost(rect, skill)
  88.     if @actor.skill_tp_cost(skill) > 0
  89.       change_color(tp_cost_color, enable?(skill))
  90.       draw_sizeable_rect_text(rect, @actor.skill_tp_cost(skill), 2, 14)
  91.     elsif @actor.skill_mp_cost(skill) > 0
  92.       change_color(mp_cost_color, enable?(skill))
  93.       draw_sizeable_rect_text(rect, @actor.skill_mp_cost(skill), 2, 14)
  94.     end
  95.   end
  96.  
  97. end
  98.  
  99.  
  100. #==============================================================================
  101. # ** Window_SkillCommand
  102. #------------------------------------------------------------------------------
  103. #  This window is for selecting commands (special attacks, magic, etc.) on the
  104. # skill screen.
  105. #==============================================================================
  106.  
  107. class Window_SkillCommand < Window_Command
  108.  
  109.   #--------------------------------------------------------------------------
  110.   # * Get Window Width
  111.   #--------------------------------------------------------------------------
  112.   def window_width
  113.     return Graphics.width
  114.   end
  115.  
  116.   #--------------------------------------------------------------------------
  117.   # * Get Alignment
  118.   #--------------------------------------------------------------------------
  119.   def alignment
  120.     return 1
  121.   end
  122.  
  123.   #--------------------------------------------------------------------------
  124.   # * Get Number of Lines to Show
  125.   #--------------------------------------------------------------------------
  126.   def visible_line_number
  127.     return 1
  128.   end
  129.  
  130.   #--------------------------------------------------------------------------
  131.   # * Get Digit Count
  132.   #--------------------------------------------------------------------------
  133.   def col_max
  134.     return item_max unless item_max == 0
  135.     return 1 if item_max == 0
  136.   end
  137.  
  138.   #--------------------------------------------------------------------------
  139.   # * Calculate Height of Window Contents
  140.   #--------------------------------------------------------------------------
  141.   def contents_height
  142.     item_height
  143.   end
  144.  
  145. end
  146.  
  147.  
  148. #==============================================================================
  149. # ** Window_EquipStatus
  150. #------------------------------------------------------------------------------
  151. #  This window displays actor parameter changes on the equipment screen.
  152. #==============================================================================
  153.  
  154. class Window_EquipStatus < Window_Base
  155.  
  156.   #--------------------------------------------------------------------------
  157.   # * Object Initialization
  158.   #--------------------------------------------------------------------------
  159.   def initialize(x, y, h)
  160.     super(x, y, window_width, h)
  161.     @height = h
  162.     @actor = nil
  163.     @temp_actor = nil
  164.     refresh
  165.   end
  166.  
  167.   #--------------------------------------------------------------------------
  168.   # * Refresh
  169.   #--------------------------------------------------------------------------
  170.   def refresh
  171.     contents.clear
  172.     8.times {|i| draw_item(0, ((line_height - 6) * i), i) }
  173.   end
  174.  
  175.   #--------------------------------------------------------------------------
  176.   # * Draw Sizeable Text
  177.   #--------------------------------------------------------------------------
  178.   def draw_sizeable_rect_text(x, y, w, h, text, alignment, size)
  179.     contents.font.size = size
  180.     contents.draw_text(x, y, w, h, text, alignment)
  181.     reset_font_settings
  182.   end
  183.  
  184.   #--------------------------------------------------------------------------
  185.   # * Get Window Height
  186.   #--------------------------------------------------------------------------
  187.   def window_height
  188.     @height
  189.   end
  190.  
  191.   #--------------------------------------------------------------------------
  192.   # * Get Line Height
  193.   #--------------------------------------------------------------------------
  194.   def line_height
  195.     return 20
  196.   end
  197.  
  198.   #--------------------------------------------------------------------------
  199.   # * Draw Parameter Name
  200.   #--------------------------------------------------------------------------
  201.   def draw_param_name(x, y, param_id)
  202.     change_color(system_color)
  203.     draw_sizeable_rect_text(x, y, 80, line_height, Vocab::param(param_id), 0, 14)
  204.   end
  205.  
  206.   #--------------------------------------------------------------------------
  207.   # * Draw Current Parameter
  208.   #--------------------------------------------------------------------------
  209.   def draw_current_param(x, y, param_id)
  210.     change_color(normal_color)
  211.     draw_sizeable_rect_text(x, y, 32, line_height, @actor.param(param_id), 2, 14)
  212.   end
  213.  
  214.   #--------------------------------------------------------------------------
  215.   # * Draw Right Arrow
  216.   #--------------------------------------------------------------------------
  217.   def draw_right_arrow(x, y)
  218.     change_color(system_color)
  219.     draw_sizeable_rect_text(x, y, 22, line_height, "→", 1, 14)
  220.   end
  221.  
  222.   #--------------------------------------------------------------------------
  223.   # * Draw Post-Equipment Change Parameter
  224.   #--------------------------------------------------------------------------
  225.   def draw_new_param(x, y, param_id)
  226.     new_value = @temp_actor.param(param_id)
  227.     change_color(param_change_color(new_value - @actor.param(param_id)))
  228.     draw_sizeable_rect_text(x, y, 32, line_height, new_value, 2, 14)
  229.   end
  230.  
  231. end
  232.  
  233.  
  234. #==============================================================================
  235. # ** Window_EquipItem
  236. #------------------------------------------------------------------------------
  237. #  This window displays choices when opting to change equipment on the
  238. # equipment screen.
  239. #==============================================================================
  240.  
  241. class Window_EquipItem < Window_ItemList
  242.  
  243.   #--------------------------------------------------------------------------
  244.   # * Update Help Text
  245.   #--------------------------------------------------------------------------
  246.   def update_temp_actor
  247.     if @actor && @status_window
  248.       temp_actor = Marshal.load(Marshal.dump(@actor))
  249.       temp_actor.force_change_equip(@slot_id, item)
  250.       @status_window.set_temp_actor(temp_actor)
  251.     end
  252.   end
  253.  
  254. end
  255.  
  256.  
  257. #==============================================================================
  258. # ** Window_ItemList
  259. #------------------------------------------------------------------------------
  260. #  This window displays a list of party items on the item screen.
  261. #==============================================================================
  262.  
  263. class Window_ItemList < Window_Selectable
  264.  
  265.   #--------------------------------------------------------------------------
  266.   # * Draw Sizeable Text
  267.   #--------------------------------------------------------------------------
  268.   def draw_sizeable_rect_text(rect, text, alignment, size)
  269.     reset_font_settings
  270.     contents.font.size = size
  271.     contents.draw_text(rect, text, alignment)
  272.     reset_font_settings
  273.   end
  274.  
  275.   #--------------------------------------------------------------------------
  276.   # * Draw Sizeable Text
  277.   #--------------------------------------------------------------------------
  278.   def draw_sizeable_text(x, y, w, h, text, alignment, size)
  279.     reset_font_settings
  280.     contents.font.size = size
  281.     contents.draw_text(x, y, w, h, text, alignment)
  282.     reset_font_settings
  283.   end
  284.  
  285.   #--------------------------------------------------------------------------
  286.   # * Draw Number of Items
  287.   #--------------------------------------------------------------------------
  288.   def draw_item_number(rect, item)
  289.     draw_sizeable_rect_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2, 14)
  290.   end
  291.  
  292.   #--------------------------------------------------------------------------
  293.   # * Draw Item Name
  294.   #     enabled : Enabled flag. When false, draw semi-transparently.
  295.   #--------------------------------------------------------------------------
  296.   def draw_item_name(item, x, y, enabled = true, width = 172)
  297.     return unless item
  298.     draw_icon(item.icon_index, x, y, enabled)
  299.     change_color(normal_color, enabled)
  300.     draw_sizeable_text(x + 24, y, width, line_height, item.name, 0, 14)
  301.   end
  302.  
  303. end
  304.  
  305.  
  306. #==============================================================================
  307. # ** Window_GameEnd
  308. #------------------------------------------------------------------------------
  309. #  This window is for selecting Go to Title/Shut Down on the game over screen.
  310. #==============================================================================
  311.  
  312. class Window_GameEnd < Window_Command
  313.  
  314.   #--------------------------------------------------------------------------
  315.   # * Get Alignment
  316.   #--------------------------------------------------------------------------
  317.   def alignment
  318.     return 1
  319.   end
  320.  
  321.   #--------------------------------------------------------------------------
  322.   # * Aliasing Method: Make Command List
  323.   #--------------------------------------------------------------------------
  324.   alias :wgemcl857453453 :make_command_list
  325.  
  326.   #--------------------------------------------------------------------------
  327.   # * Make Command List
  328.   #--------------------------------------------------------------------------
  329.   def make_command_list
  330.     add_command(Vocab.save,   :save)
  331.     add_command("Load",   :load)
  332.     wgemcl857453453()
  333.   end
  334.  
  335. end
  336.  
  337.  
  338. #==============================================================================
  339. # ** Window_Status
  340. #------------------------------------------------------------------------------
  341. #  This window displays full status specs on the status screen.
  342. #==============================================================================
  343.  
  344. class Window_Menu_Status < Window_Base
  345.  
  346.   #--------------------------------------------------------------------------
  347.   # * Object Initialization
  348.   #--------------------------------------------------------------------------
  349.   def initialize(actor)
  350.     super((Graphics.width / 5), (Graphics.height / 5), (Graphics.width / 5) * 3, (Graphics.height / 5) * 3)
  351.     self.openness = 0
  352.     @actor = actor
  353.     @playtime = $game_system.playtime_s
  354.     refresh
  355.   end
  356.  
  357.   #--------------------------------------------------------------------------
  358.   # * Refresh Processing
  359.   #--------------------------------------------------------------------------
  360.   def refresh
  361.     contents.clear
  362.     @playtime = $game_system.playtime_s
  363.     draw_actor_face(@actor, 5, 5)
  364.     draw_actor_graphic(@actor, 95, 110)
  365.     draw_sizeable_text(115, -15, (Graphics.width / 5) * 3, 50, "Name: ", 0, 14, normal_color)
  366.     draw_sizeable_text(120, 2, (Graphics.width / 5) * 3, 50, @actor.name, 0, 25, normal_color)
  367.     draw_sizeable_text(115, 20, (Graphics.width / 5) * 3, 50, "Class: ", 0, 14, normal_color)
  368.     draw_sizeable_text(120, 37, (Graphics.width / 5) * 3, 50, $data_classes[@actor.class_id].name, 0, 25, normal_color)
  369.     dfs = Font.default_size
  370.     Font.default_size = 14
  371.     draw_text_ex(5, 115, @actor.description)
  372.     Font.default_size = dfs
  373.     y = 162
  374.     x = 15
  375.     8.times {|i|
  376.       draw_actor_param(@actor, x - 5, y + line_height * i, i) if i < 4
  377.       draw_actor_param(@actor, x + 65, y + line_height * (i - 4), i) if i > 3
  378.     }
  379.     draw_sizeable_text(-25, 190, (Graphics.width / 5) * 3, 50, "Playtime:  " + playtime, 2, 14, normal_color)
  380.   end
  381.  
  382.   #--------------------------------------------------------------------------
  383.   # * Returns Playtime
  384.   #--------------------------------------------------------------------------
  385.   def playtime
  386.     return @playtime
  387.   end
  388.  
  389.   #--------------------------------------------------------------------------
  390.   # * Draw Parameters
  391.   #--------------------------------------------------------------------------
  392.   def draw_actor_param(actor, x, y, param_id)
  393.     change_color(system_color)
  394.     draw_text(x, y, 120, line_height, Vocab::param(param_id))
  395.     change_color(normal_color)
  396.     draw_text(x + 25, y, 36, line_height, actor.param(param_id), 2)
  397.   end
  398.  
  399.   #--------------------------------------------------------------------------
  400.   # * Line Height
  401.   #--------------------------------------------------------------------------
  402.   def line_height
  403.     return 15
  404.   end
  405.  
  406.   #--------------------------------------------------------------------------
  407.   # * Draw Sizeable Text
  408.   #--------------------------------------------------------------------------
  409.   def draw_sizeable_text(x, y, w, h, text, alignment, size, color)
  410.     reset_font_settings
  411.     contents.font.size = size
  412.     change_color(color)
  413.     contents.draw_text(x, y, w, h, text, alignment)
  414.     reset_font_settings
  415.   end
  416.  
  417. end
  418.  
  419.  
  420. #==============================================================================
  421. # ** Window_Base
  422. #------------------------------------------------------------------------------
  423. #  This is a super class of all windows within the game.
  424. #==============================================================================
  425.  
  426. class Window_Hud < Window_Command
  427.  
  428.   #--------------------------------------------------------------------------
  429.   # * Object Initialization
  430.   #--------------------------------------------------------------------------
  431.   def initialize
  432.     @command_icons = [13,160,14,261]
  433.     @option_icon = 117
  434.     super(0, 0)
  435.     self.opacity = 0
  436.     @cindex = nil
  437.     @hp = $game_party.battle_members[0].hp
  438.     @mp = $game_party.battle_members[0].mp
  439.     @exp = $game_party.battle_members[0].exp
  440.     @gold = $game_party.gold
  441.     @states = $game_party.battle_members[0].states
  442.     @map_name = $game_map.display_name
  443.     refresh
  444.   end
  445.  
  446.   #--------------------------------------------------------------------------
  447.   # * Refresh Processing
  448.   #--------------------------------------------------------------------------
  449.   def refresh
  450.     super
  451.     draw_cursor_text if @cindex != nil
  452.     draw_map_name
  453.     draw_actor_name($game_party.battle_members[0], 58, 5)
  454.     draw_actor_face($game_party.battle_members[0], 5, 5, true)
  455.     draw_actor_states($game_party.battle_members[0], 155, 35)
  456.     draw_actor_hp($game_party.battle_members[0], 72, 17, 75)
  457.     draw_actor_mp($game_party.battle_members[0], 72, 30, 75)
  458.     draw_actor_xp($game_party.battle_members[0], 15, 362, Graphics.width - 50)
  459.     draw_currency_value(value, currency_unit, 4, 30, contents.width - 8)
  460.   end
  461.  
  462.   #--------------------------------------------------------------------------
  463.   # * Draw Icon
  464.   #     enabled : Enabled flag. When false, draw semi-transparently.
  465.   #--------------------------------------------------------------------------
  466.   def draw_small_icon(icon_index, x, y)
  467.     bitmap = Cache.system("Iconset")
  468.     rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
  469.     new_rect = Rect.new(x, y, 16, 16)
  470.     contents.stretch_blt(new_rect, bitmap, rect)
  471.   end
  472.  
  473.   #--------------------------------------------------------------------------
  474.   # * Draw Cursor Text
  475.   #--------------------------------------------------------------------------
  476.   def draw_cursor_text
  477.     x = item_rect_for_text(@cindex).x
  478.     y = item_rect_for_text(@cindex).y
  479.     w = item_rect_for_text(@cindex).width
  480.     h = item_rect_for_text(@cindex).height
  481.     draw_sizeable_text(x, y, w, h, command_name(@cindex), 2, 18, normal_color)
  482.   end
  483.  
  484.   #--------------------------------------------------------------------------
  485.   # * Deactivate
  486.   #--------------------------------------------------------------------------
  487.   def change_text_cursor(index)
  488.     @cindex = index
  489.     refresh
  490.   end
  491.  
  492.   #--------------------------------------------------------------------------
  493.   # * Draw Map Name
  494.   #--------------------------------------------------------------------------
  495.   def need_refresh?
  496.     need_refresh = false
  497.     if @map_name != $game_map.display_name
  498.       @map_name = $game_map.display_name
  499.       need_refresh = true
  500.     end
  501.     if @gold != $game_party.gold
  502.       @gold = $game_party.gold
  503.       need_refresh = true
  504.     end
  505.     if @hp != $game_party.battle_members[0].hp
  506.       @hp = $game_party.battle_members[0].hp
  507.       need_refresh = true
  508.     end
  509.     if @mp != $game_party.battle_members[0].mp
  510.       @mp = $game_party.battle_members[0].mp
  511.       need_refresh = true
  512.     end
  513.     if @exp != $game_party.battle_members[0].exp
  514.       @exp = $game_party.battle_members[0].exp
  515.       need_refresh = true
  516.     end
  517.     if @states != $game_party.battle_members[0].states
  518.       @states = $game_party.battle_members[0].states
  519.       need_refresh = true
  520.     end
  521.     return need_refresh
  522.   end
  523.  
  524.   #--------------------------------------------------------------------------
  525.   # * Make Command List
  526.   #--------------------------------------------------------------------------
  527.   def make_command_list
  528.     add_command("Status", :status)
  529.     add_command("Equipment", :equipment)
  530.     add_command("Skills", :skills)
  531.     add_command("Items", :items)
  532.     add_original_command
  533.     add_command("Options", :options)
  534.   end
  535.  
  536.   #--------------------------------------------------------------------------
  537.   # * Add Original Commands
  538.   #--------------------------------------------------------------------------
  539.   def add_original_command
  540.   end
  541.  
  542.   #--------------------------------------------------------------------------
  543.   # * Draw Item
  544.   #--------------------------------------------------------------------------
  545.   def draw_item(index)
  546.     y = 60
  547.     height = 35
  548.     @command_icons.size.times { |i|
  549.       draw_icon(@command_icons[i], 5, y + (height * i))
  550.     }
  551.     draw_original_icons(y)
  552.     draw_icon(@option_icon, 5, y + (height * @command_icons.size))
  553.   end
  554.  
  555.   #--------------------------------------------------------------------------
  556.   # * Draw Original Icons
  557.   #--------------------------------------------------------------------------
  558.   def draw_original_icons(y)
  559.   end
  560.  
  561.   #--------------------------------------------------------------------------
  562.   # * Get Rectangle for Drawing Items
  563.   #--------------------------------------------------------------------------
  564.   def item_rect(index)
  565.     rect = Rect.new
  566.     rect.width = item_width - 425
  567.     rect.height = item_height + 5
  568.     rect.x = index % col_max * (item_width + spacing) + 2
  569.     rect.y = index / col_max * item_height + 59 + (spacing * index)
  570.     rect
  571.   end
  572.  
  573.   #--------------------------------------------------------------------------
  574.   # * Get Spacing for Items Arranged Side by Side
  575.   #--------------------------------------------------------------------------
  576.   def spacing
  577.     return 11
  578.   end
  579.  
  580.   #--------------------------------------------------------------------------
  581.   # * Draw Map Name
  582.   #--------------------------------------------------------------------------
  583.   def draw_map_name
  584.     draw_sizeable_text(-10, 0, Graphics.width, line_height, $game_map.display_name, 1, 18, normal_color)
  585.   end
  586.  
  587.   #--------------------------------------------------------------------------
  588.   # * Draw Name
  589.   #--------------------------------------------------------------------------
  590.   def draw_actor_hp(actor, x, y)
  591.     draw_sizeable_text(x - 280, y + 8, Graphics.width, line_height, actor.name, 1, 14, normal_color)
  592.   end
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # * Draw State Icons
  596.   #--------------------------------------------------------------------------
  597.   def draw_actor_states(actor, x, y)
  598.     actor.states.each_index { |i|
  599.       icon_x = x + (i * 22)
  600.       icon = $data_states[actor.states[i].id].icon_index
  601.       draw_small_icon(icon, icon_x, y)
  602.     }
  603.   end
  604.  
  605.   #--------------------------------------------------------------------------
  606.   # * Draw HP
  607.   #--------------------------------------------------------------------------
  608.   def draw_actor_hp(actor, x, y, width = 124)
  609.     draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
  610.     change_color(system_color)
  611.     draw_sizeable_text(x - 280, y + 8, Graphics.width, line_height, Vocab::hp_a, 1, 14, normal_color)
  612.   end
  613.  
  614.   #--------------------------------------------------------------------------
  615.   # * Draw MP
  616.   #--------------------------------------------------------------------------
  617.   def draw_actor_mp(actor, x, y, width = 124)
  618.     draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
  619.     change_color(system_color)
  620.     draw_sizeable_text(x - 280, y + 8, Graphics.width, line_height, Vocab::mp_a, 1, 14, normal_color)
  621.   end
  622.  
  623.   #--------------------------------------------------------------------------
  624.   # * Get Party Gold
  625.   #--------------------------------------------------------------------------
  626.   def value
  627.     $game_party.gold
  628.   end
  629.  
  630.   #--------------------------------------------------------------------------
  631.   # Get Currency Unit
  632.   #--------------------------------------------------------------------------
  633.   def currency_unit
  634.     Vocab::currency_unit
  635.   end
  636.  
  637.   #--------------------------------------------------------------------------
  638.   # * Window Width
  639.   #--------------------------------------------------------------------------
  640.   def window_width
  641.     return Graphics.width
  642.   end
  643.  
  644.   #--------------------------------------------------------------------------
  645.   # * Window Height
  646.   #--------------------------------------------------------------------------
  647.   def window_height
  648.     return Graphics.height
  649.   end
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # * Draw Face Graphic
  653.   #     enabled : Enabled flag. When false, draw semi-transparently.
  654.   #--------------------------------------------------------------------------
  655.   def draw_face(face_name, face_index, x, y, enabled = true)
  656.     bitmap = Cache.face(face_name)
  657.     cw = 96
  658.     ch = 96
  659.     src_rect = Rect.new(x, y, (cw / 2), (ch / 2))
  660.     actor = Rect.new(face_index % 4 * cw, face_index / 4 * ch, cw, ch)
  661.     contents.stretch_blt(src_rect, bitmap, actor)    
  662.     bitmap.dispose
  663.   end
  664.  
  665.   #--------------------------------------------------------------------------
  666.   # * Draw Sizeable Text
  667.   #--------------------------------------------------------------------------
  668.   def draw_sizeable_text(x, y, w, h, text, alignment, size, color)
  669.     reset_font_settings
  670.     contents.font.size = size
  671.     change_color(color)
  672.     contents.draw_text(x, y, w, h, text, alignment)
  673.     reset_font_settings
  674.   end
  675.  
  676.   #--------------------------------------------------------------------------
  677.   # * Draw XP
  678.   #--------------------------------------------------------------------------
  679.   def draw_actor_xp(actor, x, y, width = 124)
  680.     exp_rate = actor.exp.to_f / actor.next_level_exp
  681.     draw_gauge(x, y, width, exp_rate, tp_gauge_color1, tp_gauge_color2)
  682.     draw_sizeable_text(x + 200, y, 100, line_height, "XP: %" + (exp_rate * 100).to_i.to_s, 1, 16, system_color)
  683.   end
  684.  
  685. end
  686.  
  687.  
  688. #==============================================================================
  689. # ** Scene_Map
  690. #------------------------------------------------------------------------------
  691. #  This class performs the map screen processing.
  692. #==============================================================================
  693.  
  694. class Scene_Map < Scene_Base
  695.  
  696.   #--------------------------------------------------------------------------
  697.   # * Aliasing Method: Initializing Processing
  698.   #--------------------------------------------------------------------------
  699.   alias :smi5453245343 :initialize
  700.  
  701.   #--------------------------------------------------------------------------
  702.   # * Initializing Processing
  703.   #--------------------------------------------------------------------------
  704.   def initialize
  705.     smi5453245343()
  706.     @menu_index = 0
  707.     @actor = $game_party.members[0]
  708.   end
  709.  
  710.   #--------------------------------------------------------------------------
  711.   # * Aliasing Method: Create All Windows
  712.   #--------------------------------------------------------------------------
  713.   alias :smcaw4524 :create_all_windows
  714.  
  715.   #--------------------------------------------------------------------------
  716.   # * Create All Windows
  717.   #--------------------------------------------------------------------------
  718.   def create_all_windows
  719.     smcaw4524()
  720.     create_hud_window
  721.     create_stat_window
  722.     create_equipment_command_window
  723.     create_slot_window
  724.     create_equipment_status_window
  725.     create_equipment_item_window
  726.     create_skill_command_window
  727.     create_skill_item_window
  728.     create_category_window
  729.     create_item_window
  730.     create_options_window
  731.   end
  732.  
  733.   #--------------------------------------------------------------------------
  734.   # * Create Options Window
  735.   #--------------------------------------------------------------------------
  736.   def create_options_window
  737.     @options_window = Window_GameEnd.new
  738.     @options_window.set_handler(:to_title, method(:command_to_title))
  739.     @options_window.set_handler(:shutdown, method(:command_shutdown))
  740.     @options_window.set_handler(:save, method(:command_save))
  741.     @options_window.set_handler(:load, method(:command_load))
  742.     @options_window.set_handler(:cancel, method(:command_options_cancel))
  743.     @options_window.close
  744.     @options_window.unselect
  745.     @options_window.deactivate
  746.   end
  747.  
  748.   #--------------------------------------------------------------------------
  749.   # * Create Category Window
  750.   #--------------------------------------------------------------------------
  751.   def create_category_window
  752.     @category_window = Window_ItemCategory.new
  753.     @category_window.openness = 0
  754.     @category_window.height = 50
  755.     @category_window.y = (Graphics.height / 2) - 50
  756.     @category_window.z = 200
  757.     @category_window.set_handler(:ok,     method(:on_category_ok))
  758.     @category_window.set_handler(:cancel, method(:on_category_cancel))
  759.     @category_window.unselect
  760.     @category_window.deactivate
  761.   end
  762.  
  763.   #--------------------------------------------------------------------------
  764.   # * Create Item Window
  765.   #--------------------------------------------------------------------------
  766.   def create_item_window
  767.     wy = (Graphics.height / 5)
  768.     wh = (Graphics.height / 5) * 3
  769.     wx = (Graphics.width / 5)
  770.     ww = (Graphics.width  / 5) * 3
  771.     @item_window = Window_ItemList.new(wx, wy, ww, wh)
  772.     @item_window.openness = 0
  773.     @item_window.set_handler(:ok,     method(:on_item_ok))
  774.     @item_window.set_handler(:cancel, method(:on_item_cancel))
  775.     @item_window.deactivate
  776.     @category_window.item_window = @item_window
  777.   end
  778.  
  779.   #--------------------------------------------------------------------------
  780.   # * Create Command Window
  781.   #--------------------------------------------------------------------------
  782.   def create_skill_command_window
  783.     @skill_command_window = Window_SkillCommand.new(0, (Graphics.height / 2) - 50)
  784.     @skill_command_window.z = 200
  785.     @skill_command_window.actor = @actor
  786.     @skill_command_window.set_handler(:skill,    method(:command_skill))
  787.     @skill_command_window.set_handler(:cancel,   method(:command_skill_cancel))
  788.     @skill_command_window.openness = 0
  789.     @skill_command_window.unselect
  790.     @skill_command_window.deactivate
  791.   end
  792.  
  793.   #--------------------------------------------------------------------------
  794.   # * Create Item Window
  795.   #--------------------------------------------------------------------------
  796.   def create_skill_item_window
  797.     wx = (Graphics.width / 5)
  798.     wy = (Graphics.height / 5)
  799.     ww = (Graphics.width / 5) * 3
  800.     wh = (Graphics.height / 5) * 3
  801.     @skill_item_window = Window_SkillList.new(wx, wy, ww, wh)
  802.     @skill_item_window.openness = 0
  803.     @skill_item_window.actor = @actor
  804.     @skill_item_window.set_handler(:ok,     method(:on_skill_item_ok))
  805.     @skill_item_window.set_handler(:cancel, method(:on_skill_item_cancel))
  806.     @skill_command_window.skill_window = @skill_item_window
  807.     @skill_item_window.unselect
  808.     @skill_item_window.deactivate
  809.   end
  810.  
  811.   #--------------------------------------------------------------------------
  812.   # * Create Status Window
  813.   #--------------------------------------------------------------------------
  814.   def create_equipment_status_window
  815.     @equipment_status_window = Window_EquipStatus.new(0, (@slot_window.y + @slot_window.height), 141)
  816.     @equipment_status_window.actor = @actor
  817.     @equipment_status_window.set_temp_actor($game_party.members[0])
  818.     @equipment_status_window.z = 200
  819.     @equipment_status_window.openness = 0
  820.   end
  821.  
  822.   #--------------------------------------------------------------------------
  823.   # * Create Command Window
  824.   #--------------------------------------------------------------------------
  825.   def create_equipment_command_window
  826.     wx = (Graphics.width / 5)
  827.     wy = (Graphics.height / 5)
  828.     ww = Graphics.width - (wx * 2)
  829.     @equipment_command_window = Window_EquipCommand.new(wx, wy, ww)
  830.     @equipment_command_window.set_handler(:equip,    method(:command_equip))
  831.     @equipment_command_window.set_handler(:optimize, method(:command_optimize))
  832.     @equipment_command_window.set_handler(:clear,    method(:command_clear))
  833.     @equipment_command_window.set_handler(:cancel,   method(:command_equipment_cancel))
  834.     @equipment_command_window.openness = 0
  835.     @equipment_command_window.unselect
  836.     @equipment_command_window.deactivate
  837.   end
  838.  
  839.   #--------------------------------------------------------------------------
  840.   # * Create Slot Window
  841.   #--------------------------------------------------------------------------
  842.   def create_slot_window
  843.     wx = (Graphics.width / 5)
  844.     wy = (Graphics.height / 5) + @equipment_command_window.height
  845.     ww = Graphics.width - (wx * 2)
  846.     @slot_window = Window_EquipSlot.new(wx, wy, ww)
  847.     @slot_window.status_window = @equipment_status_window
  848.     @slot_window.actor = @actor
  849.     @slot_window.set_handler(:ok,       method(:on_slot_ok))
  850.     @slot_window.set_handler(:cancel,   method(:on_slot_cancel))
  851.     @slot_window.openness = 0
  852.     @slot_window.unselect
  853.     @slot_window.deactivate
  854.   end
  855.  
  856.   #--------------------------------------------------------------------------
  857.   # * Create Item Window
  858.   #--------------------------------------------------------------------------
  859.   def create_equipment_item_window
  860.     wx = @equipment_status_window.width
  861.     wy = @slot_window.y + @slot_window.height
  862.     ww = Graphics.width - wx
  863.     wh = Graphics.height - wy
  864.     @equipment_item_window = Window_EquipItem.new(wx, wy, ww, wh)
  865.     @equipment_item_window.status_window = @equipment_status_window
  866.     @equipment_item_window.actor = @actor
  867.     @equipment_item_window.set_handler(:ok,     method(:on_equipment_item_ok))
  868.     @equipment_item_window.set_handler(:cancel, method(:on_equipment_item_cancel))
  869.     @equipment_item_window.openness = 0
  870.     @slot_window.item_window = @equipment_item_window
  871.   end
  872.   #--------------------------------------------------------------------------
  873.   # * Create Status Window
  874.   #--------------------------------------------------------------------------
  875.   def create_stat_window
  876.     @stat_window = Window_Menu_Status.new($game_party.members[0])
  877.   end
  878.  
  879.   #--------------------------------------------------------------------------
  880.   # * Create Hud Window
  881.   #--------------------------------------------------------------------------
  882.   def create_hud_window
  883.     @hud_window = Window_Hud.new
  884.     @hud_window.set_handler(:status, method(:command_status_select))
  885.     @hud_window.set_handler(:equipment, method(:command_equipment_select))
  886.     @hud_window.set_handler(:skills, method(:command_skill_select))
  887.     @hud_window.set_handler(:items, method(:command_item_select))
  888.     @hud_window.set_handler(:options, method(:command_options_select))
  889.     @hud_window.unselect
  890.     @hud_window.deactivate
  891.   end
  892.  
  893.   #--------------------------------------------------------------------------
  894.   # * Empty Method: Command Menu Select
  895.   #--------------------------------------------------------------------------
  896.   def command_menu_select
  897.  
  898.   end
  899.  
  900.   #--------------------------------------------------------------------------
  901.   # * [Save] Command
  902.   #--------------------------------------------------------------------------
  903.   def command_save
  904.     @menu_index = 0
  905.     SceneManager.call(Scene_Save)
  906.   end
  907.  
  908.   #--------------------------------------------------------------------------
  909.   # * [Load] Command
  910.   #--------------------------------------------------------------------------
  911.   def command_load
  912.     @menu_index = 0
  913.     SceneManager.call(Scene_Load)
  914.   end
  915.  
  916.   #--------------------------------------------------------------------------
  917.   # * [Go to Title] Command
  918.   #--------------------------------------------------------------------------
  919.   def command_to_title
  920.     SceneManager.goto(Scene_Title)
  921.   end
  922.  
  923.   #--------------------------------------------------------------------------
  924.   # * [Shut Down] Command
  925.   #--------------------------------------------------------------------------
  926.   def command_shutdown
  927.     fadeout_all
  928.     SceneManager.exit
  929.   end
  930.  
  931.   #--------------------------------------------------------------------------
  932.   # * [To Title] Command
  933.   #--------------------------------------------------------------------------
  934.   def command_options_cancel
  935.     @menu_index -= 7
  936.     @options_window.close
  937.     Sound.play_cancel
  938.     @hud_window.select(4)
  939.     @hud_window.activate
  940.     @hud_window.change_text_cursor(4)
  941.   end
  942.  
  943.   #--------------------------------------------------------------------------
  944.   # * [Options Select] Command
  945.   #--------------------------------------------------------------------------
  946.   def command_options_select
  947.     @menu_index += 7
  948.     @options_window.refresh
  949.     @options_window.open
  950.     @options_window.select(0)
  951.     @options_window.activate
  952.     @hud_window.deactivate
  953.   end
  954.  
  955.   #--------------------------------------------------------------------------
  956.   # * Category [OK]
  957.   #--------------------------------------------------------------------------
  958.   def on_category_ok
  959.     @category_window.close
  960.     @item_window.refresh
  961.     @item_window.open
  962.     @item_window.activate
  963.     @item_window.select_last
  964.   end
  965.  
  966.   #--------------------------------------------------------------------------
  967.   # * Category [Cancel]
  968.   #--------------------------------------------------------------------------
  969.   def on_category_cancel
  970.     @menu_index -= 3
  971.     @category_window.unselect
  972.     @category_window.close
  973.     Sound.play_cancel
  974.     @hud_window.select(3)
  975.     @hud_window.activate
  976.     @hud_window.change_text_cursor(3)
  977.   end
  978.  
  979.   #--------------------------------------------------------------------------
  980.   # * Item [OK]
  981.   #--------------------------------------------------------------------------
  982.   def on_item_ok
  983.     $game_party.last_item.object = item
  984.     determine_item
  985.   end
  986.  
  987.   #--------------------------------------------------------------------------
  988.   # * Item [Cancel]
  989.   #--------------------------------------------------------------------------
  990.   def on_item_cancel
  991.     @item_window.unselect
  992.     @item_window.close
  993.     @category_window.open
  994.     @category_window.activate
  995.   end
  996.  
  997.   #--------------------------------------------------------------------------
  998.   # * [Item Select] Command
  999.   #--------------------------------------------------------------------------
  1000.   def command_item_select
  1001.     @menu_index += 3
  1002.     @hud_window.deactivate
  1003.     @category_window.select(0)
  1004.     @category_window.activate
  1005.     @category_window.open
  1006.   end
  1007.  
  1008.   #--------------------------------------------------------------------------
  1009.   # * [Skill] Command
  1010.   #--------------------------------------------------------------------------
  1011.   def command_skill
  1012.     @skill_command_window.close
  1013.     @skill_command_window.deactivate
  1014.     @skill_item_window.activate
  1015.     @skill_item_window.select_last
  1016.     @skill_item_window.open
  1017.   end
  1018.  
  1019.   #--------------------------------------------------------------------------
  1020.   # * Item [OK]
  1021.   #--------------------------------------------------------------------------
  1022.   def on_skill_item_ok
  1023.     @actor.last_skill.object = skill_item
  1024.     determine_skill_item
  1025.   end
  1026.  
  1027.   #--------------------------------------------------------------------------
  1028.   # * Item [Cancel]
  1029.   #--------------------------------------------------------------------------
  1030.   def on_skill_item_cancel
  1031.     @skill_item_window.unselect
  1032.     @skill_item_window.deactivate
  1033.     @skill_item_window.close
  1034.     @skill_command_window.activate
  1035.     @skill_command_window.open
  1036.   end
  1037.  
  1038.   #--------------------------------------------------------------------------
  1039.   # * [Status Select] Command
  1040.   #--------------------------------------------------------------------------
  1041.   def command_skill_select
  1042.     @menu_index += 3
  1043.     @skill_command_window.select(0)
  1044.     @skill_command_window.activate
  1045.     @skill_command_window.open
  1046.     @hud_window.deactivate
  1047.   end
  1048.  
  1049.   #--------------------------------------------------------------------------
  1050.   # * [Status Select] Command
  1051.   #--------------------------------------------------------------------------
  1052.   def command_skill_cancel
  1053.     @menu_index -= 3
  1054.     @skill_command_window.unselect
  1055.     @skill_command_window.deactivate
  1056.     @skill_command_window.close
  1057.     @hud_window.activate
  1058.   end
  1059.  
  1060.   #--------------------------------------------------------------------------
  1061.   # * [Change Equipment] Command
  1062.   #--------------------------------------------------------------------------
  1063.   def command_equip
  1064.     @slot_window.activate
  1065.     @slot_window.select(0)
  1066.   end
  1067.  
  1068.   #--------------------------------------------------------------------------
  1069.   # * [Ultimate Equipment] Command
  1070.   #--------------------------------------------------------------------------
  1071.   def command_optimize
  1072.     Sound.play_equip
  1073.     @actor.optimize_equipments
  1074.     @equipment_status_window.refresh
  1075.     @slot_window.refresh
  1076.     @equipment_command_window.activate
  1077.   end
  1078.  
  1079.   #--------------------------------------------------------------------------
  1080.   # * [Remove All] Command
  1081.   #--------------------------------------------------------------------------
  1082.   def command_clear
  1083.     Sound.play_equip
  1084.     @actor.clear_equipments
  1085.     @equipment_status_window.refresh
  1086.     @slot_window.refresh
  1087.     @equipment_command_window.activate
  1088.   end
  1089.  
  1090.   #--------------------------------------------------------------------------
  1091.   # * Slot [OK]
  1092.   #--------------------------------------------------------------------------
  1093.   def on_slot_ok
  1094.     @equipment_status_window.open
  1095.     @equipment_item_window.open
  1096.     @equipment_item_window.activate
  1097.     @equipment_item_window.select(0)
  1098.     @equipment_item_window.update_temp_actor
  1099.   end
  1100.  
  1101.   #--------------------------------------------------------------------------
  1102.   # * Slot [Cancel]
  1103.   #--------------------------------------------------------------------------
  1104.   def on_slot_cancel
  1105.     @slot_window.unselect
  1106.     @equipment_command_window.activate
  1107.   end
  1108.  
  1109.   #--------------------------------------------------------------------------
  1110.   # * Item [OK]
  1111.   #--------------------------------------------------------------------------
  1112.   def on_equipment_item_ok
  1113.     Sound.play_equip
  1114.     @actor.change_equip(@slot_window.index, @equipment_item_window.item)
  1115.     @slot_window.activate
  1116.     @slot_window.refresh
  1117.     @equipment_status_window.refresh
  1118.     @equipment_item_window.unselect
  1119.     @equipment_item_window.deactivate
  1120.     @equipment_item_window.close
  1121.     @equipment_item_window.refresh
  1122.     @equipment_status_window.close
  1123.   end
  1124.  
  1125.   #--------------------------------------------------------------------------
  1126.   # * Item [Cancel]
  1127.   #--------------------------------------------------------------------------
  1128.   def on_equipment_item_cancel
  1129.     @slot_window.activate
  1130.     @equipment_item_window.unselect
  1131.     @equipment_item_window.deactivate
  1132.     @equipment_item_window.close
  1133.     @equipment_status_window.close
  1134.   end
  1135.  
  1136.   #--------------------------------------------------------------------------
  1137.   # * [Equipment Cancel] Command
  1138.   #--------------------------------------------------------------------------
  1139.   def command_equipment_cancel
  1140.     @menu_index -= 2
  1141.     @equipment_command_window.close
  1142.     @equipment_command_window.unselect
  1143.     @equipment_command_window.deactivate
  1144.     @slot_window.close
  1145.     Sound.play_cancel
  1146.     @hud_window.select(1)
  1147.     @hud_window.activate
  1148.     @hud_window.change_text_cursor(1)
  1149.   end
  1150.  
  1151.   #--------------------------------------------------------------------------
  1152.   # * [Equipment Select] Command
  1153.   #--------------------------------------------------------------------------
  1154.   def command_equipment_select
  1155.     @menu_index += 2
  1156.     @hud_window.deactivate
  1157.     @equipment_command_window.open
  1158.     @equipment_command_window.select(0)
  1159.     @equipment_command_window.activate
  1160.     @slot_window.open
  1161.   end
  1162.  
  1163.   #--------------------------------------------------------------------------
  1164.   # * [Status Select] Command
  1165.   #--------------------------------------------------------------------------
  1166.   def command_status_select
  1167.     @menu_index += 1
  1168.     @stat_window.refresh
  1169.     @stat_window.open
  1170.     @hud_window.deactivate
  1171.   end
  1172.  
  1173.   #--------------------------------------------------------------------------
  1174.   # * Confirm Item
  1175.   #--------------------------------------------------------------------------
  1176.   def determine_skill_item
  1177.     use_skill_item
  1178.     @skill_item_window.refresh
  1179.     @skill_item_window.activate
  1180.   end
  1181.  
  1182.   #--------------------------------------------------------------------------
  1183.   # * Use Item
  1184.   #--------------------------------------------------------------------------
  1185.   def use_skill_item
  1186.     Sound.play_use_item
  1187.     user.use_item(skill_item)
  1188.     use_skill_item_to_actors
  1189.     check_common_event
  1190.     check_gameover
  1191.   end
  1192.  
  1193.   #--------------------------------------------------------------------------
  1194.   # * Get Currently Selected Item
  1195.   #--------------------------------------------------------------------------
  1196.   def skill_item
  1197.     @skill_item_window.item
  1198.   end
  1199.  
  1200.   #--------------------------------------------------------------------------
  1201.   # * Get Array of Actors Targeted by Item Use
  1202.   #--------------------------------------------------------------------------
  1203.   def skill_item_target_actors
  1204.     return [$game_party.members[0]]
  1205.   end
  1206.  
  1207.   #--------------------------------------------------------------------------
  1208.   # * Determine if Item is Usable
  1209.   #--------------------------------------------------------------------------
  1210.   def skill_item_usable?
  1211.     user.usable?(skill_item) && skill_item_effects_valid?
  1212.   end
  1213.  
  1214.   #--------------------------------------------------------------------------
  1215.   # * Determine if Item Is Effective
  1216.   #--------------------------------------------------------------------------
  1217.   def skill_item_effects_valid?
  1218.     skill_item_target_actors.any? do |target|
  1219.       target.item_test(user, skill_item)
  1220.     end
  1221.   end
  1222.  
  1223.   #--------------------------------------------------------------------------
  1224.   # * Use Item on Actor
  1225.   #--------------------------------------------------------------------------
  1226.   def use_skill_item_to_actors
  1227.     skill_item_target_actors.each do |target|
  1228.       skill_item.repeats.times { target.item_apply(user, skill_item) }
  1229.     end
  1230.   end
  1231.  
  1232.   #--------------------------------------------------------------------------
  1233.   # * Get Currently Selected Item
  1234.   #--------------------------------------------------------------------------
  1235.   def item
  1236.     @item_window.item
  1237.   end
  1238.  
  1239.   #--------------------------------------------------------------------------
  1240.   # * Get Item's User
  1241.   #--------------------------------------------------------------------------
  1242.   def user
  1243.     $game_party.members[0]
  1244.   end
  1245.  
  1246.   #--------------------------------------------------------------------------
  1247.   # * Use Item
  1248.   #--------------------------------------------------------------------------
  1249.   def use_item
  1250.     Sound.play_use_item
  1251.     user.use_item(item)
  1252.     use_item_to_actors
  1253.     check_common_event
  1254.     check_gameover
  1255.     @item_window.redraw_current_item
  1256.   end
  1257.  
  1258.   #--------------------------------------------------------------------------
  1259.   # * Get Array of Actors Targeted by Item Use
  1260.   #--------------------------------------------------------------------------
  1261.   def item_target_actors
  1262.     [$game_party.members[0]]
  1263.   end
  1264.  
  1265.   #--------------------------------------------------------------------------
  1266.   # * Use Item on Actor
  1267.   #--------------------------------------------------------------------------
  1268.   def use_item_to_actors
  1269.     item_target_actors.each do |target|
  1270.       item.repeats.times { target.item_apply(user, item) }
  1271.     end
  1272.   end
  1273.  
  1274.   #--------------------------------------------------------------------------
  1275.   # * Confirm Item
  1276.   #--------------------------------------------------------------------------
  1277.   def determine_item
  1278.     use_item
  1279.     @item_window.refresh
  1280.     @item_window.select(0)
  1281.     @item_window.activate
  1282.   end
  1283.  
  1284.   #--------------------------------------------------------------------------
  1285.   # * Determine if Common Event Is Reserved
  1286.   #    Transition to the map screen if the event call is reserved.
  1287.   #--------------------------------------------------------------------------
  1288.   def check_common_event
  1289.     if $game_temp.common_event_reserved?
  1290.       on_item_cancel
  1291.       on_category_cancel
  1292.       @hud_window.select(0)
  1293.       @hud_window.change_text_cursor(0)
  1294.       @hud_window.deactivate
  1295.     end
  1296.   end
  1297.  
  1298.   #--------------------------------------------------------------------------
  1299.   # * Update Scene Transition
  1300.   #--------------------------------------------------------------------------
  1301.   def update_scene
  1302.     check_gameover
  1303.     update_transfer_player unless scene_changing?
  1304.     update_encounter unless scene_changing?
  1305.     update_call_debug unless scene_changing?
  1306.   end
  1307.  
  1308.   #--------------------------------------------------------------------------
  1309.   # * Aliasing Method: Create All Windows
  1310.   #--------------------------------------------------------------------------
  1311.   alias :smu4554636316338 :update
  1312.  
  1313.   #--------------------------------------------------------------------------
  1314.   # * Frame Update
  1315.   #--------------------------------------------------------------------------
  1316.   def update
  1317.     super
  1318.     @hud_window.refresh if @hud_window.need_refresh?
  1319.     $game_map.update(true)
  1320.     $game_timer.update
  1321.     @spriteset.update
  1322.     update_scene if scene_change_ok?
  1323.     case @menu_index
  1324.     when 0
  1325.       $game_player.update
  1326.     when 1
  1327.       @hud_window.change_text_cursor(@hud_window.index) if Input.trigger?(:UP) || Input.trigger?(:DOWN)
  1328.     when 2
  1329.       @stat_window.refresh if @stat_window.playtime != $game_system.playtime_s
  1330.     when 3
  1331.       case
  1332.       when Input.trigger?(:UP)
  1333.         @equipment_item_window.update_temp_actor
  1334.       when Input.trigger?(:DOWN)
  1335.         @equipment_item_window.update_temp_actor
  1336.       when Input.trigger?(:LEFT)
  1337.         @equipment_item_window.update_temp_actor
  1338.       when Input.trigger?(:RIGHT)
  1339.         @equipment_item_window.update_temp_actor
  1340.       end
  1341.     end
  1342.     if Input.trigger?(:B)
  1343.       case @menu_index
  1344.       when 0
  1345.         @menu_index += 1
  1346.         Sound.play_ok
  1347.         @hud_window.select(0)
  1348.         @hud_window.activate
  1349.         @hud_window.change_text_cursor(0)
  1350.       when 1
  1351.         @menu_index -= 1
  1352.         Sound.play_cancel
  1353.         @hud_window.unselect
  1354.         @hud_window.deactivate
  1355.         @hud_window.change_text_cursor(nil)
  1356.       when 2
  1357.         @menu_index -= 1
  1358.         @stat_window.close
  1359.         Sound.play_cancel
  1360.         @hud_window.select(0)
  1361.         @hud_window.activate
  1362.         @hud_window.change_text_cursor(0)
  1363.       end
  1364.     end
  1365.   end
  1366.  
  1367. end
Add Comment
Please, Sign In to add comment