daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Apr 20th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #===============================================================================
  2. #
  3. # Yanfly Engine Zealous - Status Command Menu
  4. # Last Date Updated: 2009.12.29
  5. # Level: Normal, Hard, Lunatic
  6. #
  7. # The status menu in RPG Maker games don't get used much. That's mostly because
  8. # a lot of the information it displays can be seen elsewhere with a lot more
  9. # functionality at those other locations. This script rewrites the status scene
  10. # to not only display even more information, but to also function as a bridge
  11. # to many other scenes.
  12. #
  13. #===============================================================================
  14. # Updates
  15. # -----------------------------------------------------------------------------
  16. # o 2009.12.29 - Stable command window oy switching.
  17. # o 2009.12.27 - Weapon Mastery Skills Compatibility.
  18. # o 2009.12.20 - Parameter window now lines up stats through all actors.
  19. #                More efficient import command searching method.
  20. # o 2009.12.16 - Class Stat: LUK Compatibility
  21. # o 2009.12.14 - Formation Macros Compatibility
  22. # o 2009.12.12 - Finished Script.
  23. # o 2009.12.11 - Started Script.
  24. #===============================================================================
  25. # Instructions
  26. # -----------------------------------------------------------------------------
  27. # To install this script, open up your script editor and copy/paste this script
  28. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  29. #
  30. #===============================================================================
  31. # Compatibility
  32. # -----------------------------------------------------------------------------
  33. # - Works With: YEZ Battler Stat DEX, Battler Stat RES, Class Stat DUR
  34. #               YEZ Formation Macros
  35. # - Overwrites: The entire Status Menu scene.
  36. # -----------------------------------------------------------------------------
  37. # Note: This script may not work with former Yanfly Engine ReDux scripts.
  38. #       Use Yanfly Engine Zealous scripts to work with this if available.
  39. #===============================================================================
  40.  
  41. $imported = {} if $imported == nil
  42. $imported["StatusCommandMenu"] = true
  43.  
  44. module YEZ
  45.   module STATUS
  46.    
  47.     #===========================================================================
  48.     # Command Window Options
  49.     # -------------------------------------------------------------------------
  50.     # The status scene's command window now offers a selection of items to view
  51.     # different data and the ability to venture to different menus. However,
  52.     # there may be some menu items that not every user wants or would like to
  53.     # add. Adjust the COMMANDS constant to modify the command menu order.
  54.     #      :parameters  - Basic stats such as ATK, DEF, SPI, and AGI.
  55.     #      :affinities  - Elemental and Status resistances.
  56.     #      :skills      - Actor's battle skill list.
  57.     #      :equips      - Actor's worn equipment.
  58.     #      :formations  - Requires BEZ Formation Macros.
  59.     #      :mastery     - Requires YEZ Weapon Mastery Skills
  60.     #      :biography   - A biography of the actor.
  61.     #===========================================================================
  62.     COMMANDS =[
  63.       :biography,   # A biography of the actor.
  64.       :parameters,  # Basic stats such as ATK, DEF, SPI, and AGI.
  65.       :affinities,  # Elemental and Status resistances.
  66.     # :skills,      # Actor's battle skill list.
  67.     # :equips,      # Actor's worn equipment.
  68.     #  :formations,  # Requires BEZ Formation Macros.
  69.     # :mastery,     # Requires YEZ Weapon Mastery Skills
  70.     ] # Do not remove this.
  71.    
  72.     # Do you want your commands to use icons? If you do, set this to true and
  73.     # adjust the settings below to use the appropiate icons for your menu.
  74.     USE_ICONS = false
  75.    
  76.     # This determines the colour of the EXP bars used for the actor's exp
  77.     # gauge in the status menu.
  78.     EXP_TEXT    = "EXP"      # Text used for EXP
  79.     PERCENT_EXP = "%1.2f%%"  # Text format used for EXP percentage
  80.     EXP_GAUGE_1 = 28         # Colour 1 for the EXP Gauge
  81.     EXP_GAUGE_2 = 29         # Colour 2 for the EXP Gauge
  82.    
  83.     # The following will determine whether or not your Status Menu will use a
  84.     # background image instead of the typical window skin. Place the BG Image
  85.     # in the Graphics\System folder if you plan to use it.
  86.     USE_BG_IMAGE = true
  87.     BG_FILE_NAME = "MenuBack"
  88.    
  89.     # Parameters Status Mini Window. This window displays the primary stats of
  90.     # the actor being viewed. If KGC Parameter Distribution is installed, this
  91.     # command will also take the player to the stat distribution scene.
  92.     PARAMETERS ={
  93.       :title => "Statistiche",
  94.       :icon  => 103,
  95.       # The following adjusts the stats shown in each column. Adjust the array
  96.       # for each column to list what order you'd like for the stats to appear.
  97.       # :hp, :mp, :blank, :atk, :def, :spi, :res, :dex, :agi
  98.       # :hit, :eva, :cri, :dur, :luk, :odds
  99.       :page_title    => "Parametri Base",
  100.       :column1_stats => [:atk, :def, :spi, :res, :agi, :dex],
  101.       :column2_stats => [],
  102.     } # Do not remove this.
  103.    
  104.     # Affinities Mini Window. This window will display the actor's elemental
  105.     # and status resistances.
  106.     AFFINITIES ={
  107.       :title => "Resistenze",
  108.       :icon  => 100,
  109.       # The following adjusts what elements and states are shown. Adjust the
  110.       # array to meet the state and element ID's. And since elements don't have
  111.       # an innate icon associated with them, use the following below to adjust
  112.       # the elements used for the elements.
  113.       :states_shown   => [1..8],
  114.       :states_title   => "Stati",
  115.       :column1_elements => [4, 5, 6, 7, 8, 9],
  116.       :column2_elements => [10, 11, 12, 13, 14, 15],
  117.       :elements_shown => [4..15],
  118.       :elements_title => "Elementi",
  119.       :element_icons  => {
  120.         4 => 8704,
  121.         5 => 8526,
  122.         6 => 8664,
  123.         7 => 8648,
  124.         8 => 8692,
  125.         9 => 8721,
  126.         10 => 8823,
  127.         11 => 8818,
  128.         12 => 8822,
  129.         13 => 8825,
  130.         14 => 11145,
  131.         15 => 8820,
  132.       }, # Do not remove this.
  133.       # The rank colour adjusts the different colours used for each milestone
  134.       # percentile achieved by the actor. Values below are text colours.
  135.       :rank_colour => {
  136.         :srank => 18,
  137.         :arank => 2,
  138.         :brank => 14,
  139.         :crank => 6,
  140.         :drank => 3,
  141.         :erank => 4,
  142.         :frank => 5,
  143.       }, # Do not remove this.
  144.       :rank_size => 16,  # This adjusts the font size used for ranks.
  145.       :absorb    => "*", # This adjusts symbol used for absorbed elements.
  146.     } # Do not remove this.
  147.    
  148.     # Skills Mini Window.This will display a short list of the actor's skills.
  149.     # If :battle_only is set to true, the skills will be highlightened and lit
  150.     # up like they are usable in battle and don't have the disabled colour.
  151.     SKILLS ={
  152.       :title => "Skills",
  153.       :icon  => 159,
  154.       :battle_only => true,  
  155.     } # Do not remove this.
  156.    
  157.     # Equips Mini Window. This mini window will show the actor's equipment
  158.     # and the total stat boost accumulated from the equipment. Stat list:
  159.     # :hp, :mp, :blank, :atk, :def, :spi, :res, :dex, :agi
  160.     # :hit, :eva, :cri, :dur, :luk, :odds
  161.     EQUIPS ={
  162.       :title => "Equipaggiamento",
  163.       :icon  => 44,
  164.       :page_title => "Equipaggiamento",
  165.       :param => [:hp, :mp, :atk, :def, :spi, :agi, :res, :dex]
  166.     } # Do not remove this.
  167.    
  168.     # Biography Mini Window. The following will allow you to adjust biographies
  169.     # for actors and classes. If an actor does not have a personal biography,
  170.     # then the description of the character's class will be displayed instead.
  171.     # If the character's class does not have a description, then this option
  172.     # will not appear at all in the status menu.
  173.     BIOGRAPHY ={
  174.       :title => "Biografia",
  175.       :icon  => 141,
  176.       :font_size => 18,
  177.       :actor_bio => "%s's Biography",
  178.       :class_des => "%s Description",
  179.     } # Do not remove this.
  180.    
  181.       # BIRTHDAY = "Birthday: "
  182.       # AGE      = "Age: "
  183.       # ORIGIN   = "Origin: "
  184.       # GENDER   = "Gender: "
  185.       # HEIGHT   = "Height: "
  186.       # WEIGHT   = "Weight: "
  187.    
  188.     # When typing out biographies and descriptions, use \\N[x] to write out
  189.     # the actor's name if the game allows renaming. For line splits, use |
  190.     # at the each position you would want the description to start a new line.
  191.     ACTOR_BIOS ={ # If an actor ID is not listed here, then refer to class bio.
  192.     # ID => Bio
  193.        1 => 'Son of a renowned Marshal of the Empire. At the|' +
  194.             'academy had very exceptional grades, but contrary|' +
  195.             'to expectations he rejected all officer positions|' +
  196.             'to join an elite squad undertaking many dangerous|' +
  197.             'assignments. Does not think much of the higher ranks,|' +
  198.             'only officer he really respects is his captain.',
  199.        2 => 'Born to a worker family in Gaea he overcame many|' +
  200.             'difficulties to enlist in the academy, but did not|' +
  201.             'like all the bureocratic methods. He wanted to test|' +
  202.             'himself in the front lines, so he left it to join|' +
  203.             'the DUST Squad around the same time Edward did.|' +
  204.             'They have been friends ever since.',
  205.        3 => 'The first girl to ever enlist and be accepted in the|' +
  206.             'Squad. Has a peculiar personality and is very confident|' +
  207.             'of her own abilities, even intimidating most of the|' +
  208.             'men of the Squad, causing varied effects in them.|' +
  209.             'Nobody knows where she was born except the captain,|' +
  210.             'and she never talks about her childhood to anyone.',
  211.     } # Do not remove this.
  212.    
  213.     # Just like the actor biographies, use \\N[x] to write out a changeable
  214.     # actor's name and \\V[x] to write out variables. Use | to enforce a
  215.     # line break. If a class bio is not listed, it will not be shown.
  216.     CLASS_BIOS ={ # If a class does not have a bio, it becomes unlisted.
  217.     # ID => Bio
  218.        1 => 'Knights are quick and powerful characters|' +
  219.             'that excel in both melee and magic.',
  220.        2 => 'Warriors are very dedicated to close ranged|' +
  221.             'physical combat.',
  222.        3 => 'Priests focus on healing and aiding their|' +
  223.             "party members. Don't let \\N[3] fool you.",
  224.        4 => 'Magicians excel in the magical arts and also|' +
  225.             'excel at blasting their enemies to bits.',
  226.        5 => 'Magicians excel in the magical arts and also|' +
  227.             'excel at blasting their enemies to bits.',
  228.        6 => 'Magicians excel in the magical arts and also|' +
  229.             'excel at blasting their enemies to bits.',
  230.        7 => 'Magicians excel in the magical arts and also|' +
  231.             'excel at blasting their enemies to bits.',
  232.        8 => 'Magicians excel in the magical arts and also|' +
  233.             'excel at blasting their enemies to bits.',
  234.     } # Do not remove this.
  235.    
  236.   end # STATUS
  237. end # YEZ
  238.  
  239. #===============================================================================
  240. # Status Command Menu - Lunatic Mode - Scene Linking
  241. # ----------------------------------------------------------------------------
  242. # For the Lunatics who would love to add in their own categories and/or windows
  243. # without worrying about breaking the script, the following hash will give you
  244. # a simplified way of doing just that.
  245. #===============================================================================
  246.  
  247. module YEZ
  248.   module STATUS
  249.    
  250.     # The following hash governs the imported data used. Adjust the data
  251.     # properly to meet the demands of the hash.
  252.     #   method - This is the key used to place at the top.
  253.     #   switch - If it uses a switch, place the ID. If it doesn't set to nil.
  254.     #    title - The title used for the command window.
  255.     #     icon - The icon used for the command window.
  256.     #   window - Window name used. Type it out fully.
  257.     #    scene - The scene's class name.
  258.     IMPORTED_COMMANDS ={
  259.     # :method => [Switch, "Title", Icon, Window, Scene's Name]
  260.     #:class    => [    67, "Class",  131,    nil, "Scene_Class_Change"],
  261.     #:learn    => [    68, "Learn",  133,    nil, "Scene_Learn_Skill"],
  262.     #:slots    => [    69, "Slots",  103,    nil, "Scene_Equip_Skill"],
  263.     } # Do not remove this.
  264.    
  265.   end # STATUS
  266. end # YEZ
  267.  
  268. #===============================================================================
  269. # Editting anything past this point may potentially result in causing computer
  270. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  271. # Therefore, edit at your own risk.
  272. #===============================================================================
  273.  
  274. module YEZ::STATUS
  275.   module_function
  276.   #--------------------------------------------------------------------------
  277.   # convert_integer_array
  278.   #--------------------------------------------------------------------------
  279.   def convert_integer_array(array)
  280.     result = []
  281.     array.each { |i|
  282.       case i
  283.       when Range; result |= i.to_a
  284.       when Integer; result |= [i]
  285.       end }
  286.     return result
  287.   end
  288.   #--------------------------------------------------------------------------
  289.   # converted arrays
  290.   #--------------------------------------------------------------------------
  291.   AFFINITIES[:states_shown] = convert_integer_array(AFFINITIES[:states_shown])
  292.   AFFINITIES[:elements_shown] = convert_integer_array(AFFINITIES[:elements_shown])
  293. end # YEZ::STATUS
  294.  
  295. module Vocab
  296.   def self.hit; return "8634"; end
  297.   def self.eva; return "8635"; end
  298.   def self.cri; return "8636"; end
  299.   def self.odds;return "AGR"; end
  300.    
  301. #~   def self.hit_text; return "Hit"; end
  302. #~   def self.eva_text; return "Eva"; end
  303. #~   def self.cri_text; return "Crit"; end
  304.   def self.dex_text; return "Destrezza"; end
  305.   def self.res_text; return "Res.Magica"; end
  306. end # Vocab
  307.  
  308. #===============================================================================
  309. # Scene_Status
  310. #===============================================================================
  311.  
  312. class Scene_Status < Scene_Base
  313.  
  314.   #--------------------------------------------------------------------------
  315.   # overwrite method: start
  316.   #--------------------------------------------------------------------------
  317.   def start
  318.     super
  319.     $game_temp.status_index = 0 if $game_temp.status_index == nil
  320.     @actor = $game_party.members[@actor_index]
  321.     @command_window = Window_Status_Command.new(@actor)
  322.     @actor_window = Window_Status_Actor.new(@actor)
  323.     @dummy_window = Window_Base.new(0, 128, 544, 288)
  324.     create_menu_background
  325.     create_mini_windows
  326.     $game_party.last_actor_index = @actor_index
  327.   end
  328.  
  329.   #--------------------------------------------------------------------------
  330.   # overwrite method: create_menu_background
  331.   #--------------------------------------------------------------------------
  332.   def create_menu_background
  333.     if YEZ::STATUS::USE_BG_IMAGE
  334.     @menuback_sprite.dispose if @menuback_sprite != nil
  335.     @menuback_sprite2.dispose if @menuback_sprite2 != nil
  336.     @menuback_sprite = Sprite.new
  337.     @menuback_sprite.bitmap = Cache.system("MenuBack_status_a")
  338.     @menuback_sprite2 = Sprite.new
  339.     @menuback_sprite2.bitmap = Cache.system("MenuBack_status_" + @actor.name)
  340.     @menuback_sprite2.z -= 2
  341.       @command_window.opacity = 0
  342.       @actor_window.opacity = 0
  343.       @dummy_window.opacity = 0
  344.       update_menu_background
  345.     else
  346.       super
  347.     end
  348.   end
  349.  
  350.   #--------------------------------------------------------------------------
  351.   # overwrite method: terminate
  352.   #--------------------------------------------------------------------------
  353.   def terminate
  354.     super
  355.     dispose_menu_background
  356.     dispose_mini_windows
  357.     @command_window.dispose
  358.     @actor_window.dispose
  359.     @dummy_window.dispose
  360.   end
  361.  
  362.   #--------------------------------------------------------------------------
  363.   # alias method: return_scene
  364.   #--------------------------------------------------------------------------
  365.   alias return_scene_status_scm return_scene unless $@
  366.   def return_scene
  367.     $game_temp.status_oy = nil
  368.     $game_temp.status_index = nil
  369.     $game_temp.status_calc_width = nil
  370.     return_scene_status_scm
  371.   end
  372.  
  373.   #--------------------------------------------------------------------------
  374.   # overwrite method: update
  375.   #--------------------------------------------------------------------------
  376.   def update
  377.     update_menu_background
  378.     update_mini_windows if $game_temp.status_index != @command_window.index
  379.     @command_window.update
  380.     if Input.trigger?(Input::C)
  381.       determine_scene_change
  382.     elsif Input.trigger?(Input::B)
  383.       Sound.play_cancel
  384.       return_scene
  385.     elsif Input.repeat?(Input::RIGHT)
  386.       Sound.play_cursor
  387.       $game_temp.status_oy = @command_window.oy
  388.       next_actor
  389.     elsif Input.repeat?(Input::LEFT)
  390.       Sound.play_cursor
  391.       $game_temp.status_oy = @command_window.oy
  392.       prev_actor
  393.     end
  394.     super
  395.   end
  396.  
  397.   #--------------------------------------------------------------------------
  398.   # new method: create_mini_windows
  399.   #--------------------------------------------------------------------------
  400.   def create_mini_windows
  401.     @mini_windows = {}; n = 0
  402.     for command in YEZ::STATUS::COMMANDS
  403.       case command
  404.       #--- Defaults ---  
  405.       when :parameters
  406.         @parameter_window = Window_Status_Parameter.new(@actor)
  407.         @mini_windows[n] = @parameter_window
  408.       when :affinities
  409.         @affinity_window = Window_Status_Affinity.new(@actor)
  410.         @mini_windows[n] = @affinity_window
  411.       when :skills
  412.         @skill_window = Window_Status_Skill.new(@actor)
  413.         @mini_windows[n] = @skill_window
  414.       when :equips
  415.         @equip_window = Window_Status_Equips.new(@actor)
  416.         @mini_windows[n] = @equip_window
  417.       when :biography
  418.         @biography_window = Window_Status_Biography.new(@actor)
  419.         @mini_windows[n] = @biography_window
  420.       #--- Imports ---  
  421.       when :formations
  422.         next unless $imported["FormationMacros"]
  423.         next unless $game_switches[YEZ::MACRO::ENABLE_SWITCH]
  424.         @formation_window = Window_Formation.new(@actor)
  425.         @formation_window.opacity = 0
  426.         @mini_windows[n] = @formation_window
  427.       when :mastery
  428.         next unless $imported["WeaponMasterySkills"]
  429.         @mastery_window = Window_Mastery.new(0, 128, @actor, true)
  430.         @mastery_window.opacity = 0
  431.         @mini_windows[n] = @mastery_window
  432.        
  433.       else
  434.         return_check = true
  435.         for key in YEZ::STATUS::IMPORTED_COMMANDS
  436.           if key[0] == command
  437.             return_check = false
  438.             found_key = key[0]
  439.           end
  440.         end
  441.         next if return_check
  442.         command_array = YEZ::STATUS::IMPORTED_COMMANDS[found_key]
  443.         if command_array[0] != nil
  444.           next unless $game_switches[command_array[0]]
  445.         end
  446.         if command_array[3] != nil
  447.           window = eval(command_array[3])
  448.           window.x = 0
  449.           window.y = 128
  450.           window.width = 544
  451.           window.height = 288
  452.           window.create_contents
  453.           window.refresh
  454.         else
  455.           window = Window_Base.new(0, 128, 544, 288)
  456.          
  457.         end
  458.         window.opacity = 0
  459.         @mini_windows[n] = window
  460.        
  461.       end
  462.       n += 1
  463.     end
  464.     update_mini_windows
  465.   end
  466.  
  467.   #--------------------------------------------------------------------------
  468.   # new method: update_mini_windows
  469.   #--------------------------------------------------------------------------
  470.   def update_mini_windows
  471.     $game_temp.status_index = @command_window.index
  472.     for i in 0..(@mini_windows.size-1)
  473.       @mini_windows[i].visible = false
  474.     end
  475.     return unless @mini_windows.include?($game_temp.status_index)
  476.     @mini_windows[$game_temp.status_index].visible = true
  477.   end
  478.  
  479.   #--------------------------------------------------------------------------
  480.   # new method: dispose_mini_windows
  481.   #--------------------------------------------------------------------------
  482.   def dispose_mini_windows
  483.     for i in 0..(@mini_windows.size-1)
  484.       @mini_windows[i].dispose
  485.       @mini_windows[i] = nil
  486.     end
  487.   end
  488.  
  489.   #--------------------------------------------------------------------------
  490.   # new method: determine_scene_change
  491.   #--------------------------------------------------------------------------
  492.   def determine_scene_change
  493.     case @command_window.item
  494.     when :parameters
  495.       return unless $imported["DistributeParameter"]
  496.       Sound.play_decision
  497.       $scene = Scene_DistributeParameter.new(@actor.index)
  498.     when :skills
  499.       Sound.play_decision
  500.       $scene = Scene_Skill.new(@actor.index)
  501.     when :equips
  502.       Sound.play_decision
  503.       $scene = Scene_Equip.new(@actor.index)
  504.     when :formations
  505.       return unless $imported["FormationMacros"]
  506.       return unless $game_switches[YEZ::MACRO::ENABLE_SWITCH]
  507.       Sound.play_decision
  508.       $scene = Scene_Formation.new(@actor.index)
  509.     when :mastery
  510.       return unless $imported["WeaponMasterySkills"]
  511.       Sound.play_decision
  512.       $scene = Scene_Mastery.new(@actor.index)
  513.      
  514.     else
  515.       return unless YEZ::STATUS::IMPORTED_COMMANDS.include?(@command_window.item)
  516.       command_array = YEZ::STATUS::IMPORTED_COMMANDS[@command_window.item]
  517.       if command_array[4] != nil
  518.         Sound.play_decision
  519.         $scene = eval(command_array[4] + ".new(@actor_index)")
  520.       end
  521.      
  522.     end
  523.   end
  524.  
  525. end # Scene_Status
  526.  
  527. #===============================================================================
  528. # Scene_Skill
  529. #===============================================================================
  530.  
  531. class Scene_Skill < Scene_Base
  532.  
  533.   #--------------------------------------------------------------------------
  534.   # alias method: return_scene
  535.   #--------------------------------------------------------------------------
  536.   alias return_scene_skill_scm return_scene unless $@
  537.   def return_scene
  538.     if $game_temp.status_index != nil
  539.       $scene = Scene_Status.new(@actor_index)
  540.     else
  541.       return_scene_skill_scm
  542.     end
  543.   end
  544.  
  545. end # Scene_Skill
  546.  
  547. #===============================================================================
  548. # Scene_Equip
  549. #===============================================================================
  550.  
  551. class Scene_Equip < Scene_Base
  552.  
  553.   #--------------------------------------------------------------------------
  554.   # alias method: return_scene
  555.   #--------------------------------------------------------------------------
  556.   alias return_scene_equip_scm return_scene unless $@
  557.   def return_scene
  558.     if $game_temp.status_index != nil
  559.       $scene = Scene_Status.new(@actor_index)
  560.     else
  561.       return_scene_equip_scm
  562.     end
  563.   end
  564.  
  565. end # Scene_Skill
  566.  
  567. #===============================================================================
  568. # Game_Temp
  569. #===============================================================================
  570.  
  571. class Game_Temp
  572.  
  573.   #--------------------------------------------------------------------------
  574.   # public instance variables
  575.   #--------------------------------------------------------------------------
  576.   attr_accessor :status_index
  577.   attr_accessor :status_oy
  578.   attr_accessor :status_calc_width
  579.   attr_accessor :status_ele_width
  580.   attr_accessor :status_st_width
  581.  
  582. end # Game_Temp
  583.  
  584. #===============================================================================
  585. # Game_Actor
  586. #===============================================================================
  587.  
  588. class Game_Actor < Game_Battler
  589.  
  590.   #--------------------------------------------------------------------------
  591.   # new method: now_exp
  592.   #--------------------------------------------------------------------------
  593.   def now_exp
  594.     return @exp - @exp_list[@level]
  595.   end
  596.  
  597.   #--------------------------------------------------------------------------
  598.   # new method: next_exp
  599.   #--------------------------------------------------------------------------
  600.   def next_exp
  601.     return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
  602.   end
  603.  
  604. end # Game_Actor
  605.  
  606. #===============================================================================
  607. # Window_Status_Actor
  608. #===============================================================================
  609.  
  610. class Window_Status_Actor < Window_Base
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # initialize
  614.   #--------------------------------------------------------------------------
  615.   def initialize(actor)
  616.     super(160, 0, 384, 128)
  617.     @actor = actor
  618.     refresh
  619.   end
  620.  
  621.   #--------------------------------------------------------------------------
  622.   # refresh
  623.   #--------------------------------------------------------------------------
  624.   def refresh
  625.     self.contents.clear
  626.     #draw_actor_face(@actor, 0, 0, size = 96)
  627.     x = 0
  628.     y = 0
  629.    
  630.     self.contents.font.color = text_color(8)
  631.     self.contents.draw_text(x, y, 42, WLH, "Nome:")
  632.     self.contents.draw_text(x+224, y, 48, WLH, "Stato:")
  633.     draw_actor_state(@actor, x+294, 0, 96)
  634.     self.contents.font.color = normal_color
  635.     x = 48
  636.     case @actor.name
  637.     when "Yoshi"
  638.       self.contents.draw_text(x, y, 178, WLH, "Yoshi Feng")
  639.     when "Kenta"
  640.       self.contents.draw_text(x, y, 178, WLH, "Kenta Nashima")
  641.     when "Eiko"
  642.       self.contents.draw_text(x, y, 178, WLH, "Eiko Kunai")
  643.     when "Kazumi"
  644.       self.contents.draw_text(x, y, 178, WLH, "Kazumi Nobiri")
  645.     when "Nekomi"
  646.       self.contents.draw_text(x, y, 178, WLH, "Nekomi")
  647.     when "Kage"
  648.       self.contents.draw_text(x, y, 178, WLH, "Kage")
  649.     end
  650.     x = 0
  651.     draw_actor_level(@actor, x, y + WLH * 1)
  652.     draw_actor_class(@actor, x + 72, y + WLH)
  653.     draw_stun_indicator(x, y + WLH * 3, @actor) if $imported["ClassStatDUR"]
  654.     x = 104
  655.     draw_actor_hp(@actor, x + 120, y + WLH * 1, 120)
  656.     draw_actor_mp(@actor, x + 120, y + WLH * 2, 120)
  657.     draw_actor_exp(@actor, x + 120, y + WLH * 3, 120)
  658.   end
  659.  
  660.   #--------------------------------------------------------------------------
  661.   # draw_actor_exp
  662.   #--------------------------------------------------------------------------
  663.   def draw_actor_exp(actor, x, y, size = 120)
  664.     if actor.next_exp != 0
  665.       gw = size * actor.now_exp
  666.       gw /= actor.next_exp
  667.     else
  668.       gw = size
  669.     end
  670.     gc1 = text_color(YEZ::STATUS::EXP_GAUGE_1)
  671.     gc2 = text_color(YEZ::STATUS::EXP_GAUGE_2)
  672.     self.contents.fill_rect(x, y + WLH - 8, size, 6, gauge_back_color)
  673.     self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  674.     self.contents.font.color = system_color
  675.     self.contents.font.size = 17
  676.     self.contents.draw_text(x+2, y+2, 40, WLH, YEZ::STATUS::EXP_TEXT)
  677.     self.contents.font.size = 21
  678.     self.contents.font.color = normal_color
  679.     if actor.next_exp != 0
  680.       expercent = actor.now_exp * 100.000
  681.       expercent /= actor.next_exp
  682.     else
  683.       expercent = 100.000
  684.     end
  685.     expercent = 100.000 if expercent > 100.000
  686.     text = sprintf(YEZ::STATUS::PERCENT_EXP, expercent)
  687.     self.contents.draw_text(x, y, size, WLH, text, 2)
  688.   end
  689.  
  690. end # Window_Status_Actor
  691.  
  692. #===============================================================================
  693. # Window_Status_Parameter
  694. #===============================================================================
  695.  
  696. class Window_Status_Parameter < Window_Base
  697.  
  698.   #--------------------------------------------------------------------------
  699.   # initialize
  700.   #--------------------------------------------------------------------------
  701.   def initialize(actor)
  702.     super(0, 128, 544, 288)
  703.     self.opacity = 0
  704.     @actor = actor
  705.     refresh
  706.   end
  707.  
  708.   #--------------------------------------------------------------------------
  709.   # refresh
  710.   #--------------------------------------------------------------------------
  711.   def refresh
  712.     self.contents.clear
  713.     sw = self.width - 32
  714.     self.contents.font.color = system_color
  715.     text = YEZ::STATUS::PARAMETERS[:page_title]
  716.     self.contents.draw_text(48, 0, sw/2-48, WLH, text, 0)
  717.     draw_exp_info(sw/2+24, 0)
  718.     dx = 0; dy = WLH
  719.     array = YEZ::STATUS::PARAMETERS[:column1_stats]
  720.     draw_column(dx, dy, array)
  721.     dx = (self.width - 32) / 2
  722.     array = YEZ::STATUS::PARAMETERS[:column2_stats]
  723.     draw_column(dx-24, dy*4, array)
  724.   end
  725.  
  726.   #--------------------------------------------------------------------------
  727.   # draw_exp_info
  728.   #--------------------------------------------------------------------------
  729.   def draw_exp_info(x, y)
  730.     s1 = @actor.exp_s
  731.     s2 = @actor.next_rest_exp_s
  732.     s_next = sprintf(Vocab::ExpNext, Vocab::level)
  733.     self.contents.font.color = system_color
  734.     self.contents.draw_text(x+2, y + 2 + WLH * 0, 180, WLH, Vocab::ExpTotal)
  735.     self.contents.draw_text(x, y + WLH * 2, 180, WLH, s_next)
  736.     self.contents.font.color = normal_color
  737.     self.contents.draw_text(x, y + WLH * 1, 180, WLH, s1, 2)
  738.     self.contents.draw_text(x, y + WLH * 3, 180, WLH, s2, 2)
  739.   end
  740.  
  741.   #--------------------------------------------------------------------------
  742.   # draw_column
  743.   #--------------------------------------------------------------------------
  744.   def draw_column(dx, dy, array)
  745.     dx += 48
  746.     stat_width = calc_width(array)
  747.     for item in array
  748.       dw = 60
  749.       text = ""
  750.       stat = ""
  751.       icon = 0
  752.       case item
  753.       when :blank
  754.       when :hp
  755.         text = Vocab.hp
  756.         stat = @actor.maxhp
  757.         icon = $imported["Icons"] ? YEZ::ICONS[:hp] : 8753
  758.       when :mp
  759.         text = Vocab.mp
  760.         stat = @actor.maxmp
  761.         icon = $imported["Icons"] ? YEZ::ICONS[:mp] : 273
  762.       when :atk
  763.         text = Vocab.atk
  764.         text2 = Vocab.atk_text
  765.         stat = @actor.atk
  766.         icon = $imported["Icons"] ? YEZ::ICONS[:atk] : 8630
  767.       when :def
  768.         text = Vocab.def
  769.         text2 = Vocab.def_text
  770.         stat = @actor.def
  771.         icon = $imported["Icons"] ? YEZ::ICONS[:def] : 8631
  772.       when :spi
  773.         text = Vocab.spi
  774.         text2 = Vocab.spi_text
  775.         stat = @actor.spi
  776.         icon = $imported["Icons"] ? YEZ::ICONS[:spi] : 8632
  777.       when :agi
  778.         text = Vocab.agi
  779.         text2 = Vocab.agi_text
  780.         stat = @actor.agi
  781.         icon = $imported["Icons"] ? YEZ::ICONS[:agi] : 8633
  782.       when :dex
  783.         next unless $imported["DEX Stat"]
  784.         text = 8634
  785.         text2 = Vocab.dex_text
  786.         stat = @actor.dex
  787.         icon = $imported["Icons"] ? YEZ::ICONS[:dex] : 8634
  788.       when :res
  789.         next unless $imported["RES Stat"]
  790.         text = 8649
  791.         text2 = Vocab.res_text
  792.         stat = @actor.res
  793.         icon = $imported["Icons"] ? YEZ::ICONS[:res] : 8649
  794.       when :hit
  795.         text = 8634
  796.         text2 = Vocab.hit_text
  797.         icon = $imported["Icons"] ? YEZ::ICONS[:hit] : 0
  798.         stat = sprintf("%d%%",[[@actor.hit, 0].max, 100].min)
  799.       when :eva
  800.         text = 8635
  801.         text2 = Vocab.eva_text
  802.         icon = $imported["Icons"] ? YEZ::ICONS[:eva] : 0
  803.         stat = sprintf("%d%%",[[@actor.eva, 0].max, 99].min)
  804.       when :cri
  805.         text = 8636
  806.         text2 = Vocab.cri_text
  807.         icon = $imported["Icons"] ? YEZ::ICONS[:cri] : 0
  808.         stat = sprintf("%d%%",[[@actor.cri, 0].max, 99].min)
  809.       when :odds
  810.         text = Vocab.odds
  811.         icon = $imported["Icons"] ? YEZ::ICONS[:odds] : 0
  812.         stat = @actor.odds
  813.       when :dur
  814.         next unless $imported["ClassStatDUR"]
  815.         text = Vocab.dur
  816.         stat = @actor.max_dur
  817.         icon = $imported["Icons"] ? YEZ::ICONS[:dur] : 0
  818.       when :luk
  819.         next unless $imported["ClassStatLUK"]
  820.         text = Vocab.luk
  821.         stat = @actor.luk
  822.         icon = $imported["Icons"] ? YEZ::ICONS[:luk] : 0
  823.        
  824.       else; next
  825.       end
  826.       draw_icon(text.to_i, dx, dy)
  827.       self.contents.font.color = system_color
  828.       self.contents.draw_text(dx + 29, dy, dw + 20, WLH, text2, 0)
  829.       self.contents.font.color = normal_color
  830.       self.contents.draw_text(dx + 114, dy, stat_width, WLH, stat, 2)
  831.       dy += WLH
  832.     end
  833.   end
  834.  
  835.   #--------------------------------------------------------------------------
  836.   # calc_width
  837.   #--------------------------------------------------------------------------
  838.   def calc_width(array)
  839.     return $game_temp.status_calc_width if $game_temp.status_calc_width != nil
  840.     n = 0
  841.     for actor in $game_party.members
  842.       for item in array
  843.         text = ""
  844.         case item
  845.         when :hp;   text = actor.maxhp
  846.         when :mp;   text = actor.maxmp
  847.         when :atk;  text = actor.atk
  848.         when :def;  text = actor.def
  849.         when :spi;  text = actor.spi
  850.         when :agi;  text = actor.agi
  851.         when :res;  text = actor.res if $imported["RES Stat"]
  852.         when :dex;  text = actor.dex if $imported["DEX Stat"]
  853.         when :hit;  text = sprintf("%d%%", [[actor.hit, 0].max, 99].min)
  854.         when :eva;  text = sprintf("%d%%", [[actor.eva, 0].max, 99].min)
  855.         when :cri;  text = sprintf("%d%%", [[actor.cri, 0].max, 99].min)
  856.         when :dur;  text = actor.dur if $imported["ClassStatDUR"]
  857.         when :luk;  text = actor.luk if $imported["BattlerStatLUK"]
  858.         when :odds; text = actor.odds
  859.         else; next
  860.         end
  861.         n = [n, contents.text_size(text).width].max
  862.       end
  863.     end
  864.     $game_temp.status_calc_width = n
  865.     return n
  866.   end
  867.  
  868. end # Window_Status_Parameter
  869.  
  870. #===============================================================================
  871. # Window_Status_Affinity
  872. #===============================================================================
  873.  
  874. class Window_Status_Affinity < Window_Base
  875.  
  876.   #--------------------------------------------------------------------------
  877.   # initialize
  878.   #--------------------------------------------------------------------------
  879.   def initialize(actor)
  880.     super(0, 128, 544, 288)
  881.     self.opacity = 0
  882.     @actor = actor
  883.     refresh
  884.   end
  885.  
  886.   #--------------------------------------------------------------------------
  887.   # refresh
  888.   #--------------------------------------------------------------------------
  889. #~   def refresh
  890. #~     self.contents.clear
  891. #~     draw_elemental_affinity
  892. #~     draw_status_resistances
  893. #~   end
  894. #~  
  895.  def refresh
  896.     self.contents.clear
  897.     sw = self.width - 32
  898.     self.contents.font.color = system_color
  899.     text = YEZ::STATUS::AFFINITIES[:page_title]
  900.     self.contents.draw_text(48, 0, sw/2-48, WLH, text, 0)
  901.     dx = 0; dy = WLH
  902.     elements = YEZ::STATUS::AFFINITIES[:column1_elements]
  903.     draw_column(dx, dy, elements)
  904.     dx = (self.width - 32) / 2
  905.     elements = YEZ::STATUS::AFFINITIES[:column2_elements]
  906.     draw_column1(dx-24, dy*4, elements)
  907.     draw_status_resistances
  908.     draw_elemental_affinity
  909.   end
  910.   #--------------------------------------------------------------------------
  911.   # draw_elemental_affinity
  912.   #--------------------------------------------------------------------------
  913.   def draw_elemental_affinity
  914.     self.contents.font.size = Font.default_size
  915.     affinities = YEZ::STATUS::AFFINITIES
  916.     dx = 15; dy = -2; sw = self.width-32
  917.     if affinities[:elements_shown].size < 10
  918.       self.contents.font.color = system_color
  919.       text = affinities[:elements_title]
  920.       self.contents.draw_text(dx, dy, sw/2-24, WLH, text, 0)
  921.       dy += WLH
  922.     end
  923.   end
  924. #~     dw = calc_ele_width(YEZ::STATUS::AFFINITIES[:column1_elements])
  925. #~     for ele_id in affinities[:elements_shown]
  926. #~       next if ele_id > $data_system.elements.size
  927. #~       draw_icon(affinities[:element_icons][ele_id], dx, dy)
  928. #~       name = $data_system.elements[ele_id]
  929. #~       self.contents.font.color = normal_color
  930. #~       self.contents.font.size = Font.default_size - 5
  931. #~       self.contents.draw_text(dx+32, dy, dw+10, WLH, name, 0)
  932. #~       self.contents.font.color = affinity_colour(@actor.element_rate(ele_id))
  933. #~       self.contents.font.size = affinities[:rank_size]
  934. #~       self.contents.draw_text(dx+34+40, dy, 60, WLH, element_rate(ele_id), 2)
  935. #~       if @actor.element_rate(ele_id) < 0
  936. #~         self.contents.draw_text(dx+94+dw, dy, 60, WLH, affinities[:absorb])
  937. #~       end
  938. #~       dy += WLH
  939. #~     end
  940. #~   end
  941.   def draw_column(dx, dy, elements)
  942.     dw = calc_ele_width(YEZ::STATUS::AFFINITIES[:column1_elements])
  943.     dx += 10
  944.     ele_width = calc_ele_width(elements)
  945.     for item in elements
  946.       affinities = YEZ::STATUS::AFFINITIES
  947.       for ele_id in YEZ::STATUS::AFFINITIES[:column1_elements]
  948.         next if ele_id > $data_system.elements.size
  949.         draw_icon(affinities[:element_icons][ele_id], dx, dy-25)
  950.         name = $data_system.elements[ele_id]
  951.         self.contents.font.color = normal_color
  952.         self.contents.font.size = Font.default_size - 2
  953.         self.contents.draw_text(dx+25, dy-25, dw+10, WLH, name, 0)
  954.         self.contents.font.color = affinity_colour(@actor.element_rate(ele_id))
  955.         self.contents.draw_text(dx+50, dy-25, 60, WLH, element_rate(ele_id), 2)
  956.         if @actor.element_rate(ele_id) < 0
  957.           self.contents.draw_text(dx+50, dy-25, 60, WLH, affinities[:absorb])
  958.         end
  959.         dy += WLH
  960.       end
  961.     end
  962.   end
  963.  
  964.   def draw_column1(dx, dy, elements)
  965.     dw = calc_ele_width(YEZ::STATUS::AFFINITIES[:column2_elements])
  966.     dx -= 10
  967.     ele_width = calc_ele_width(elements)
  968.     for item in elements
  969.       affinities = YEZ::STATUS::AFFINITIES
  970.       for ele_id in YEZ::STATUS::AFFINITIES[:column2_elements]
  971.         next if ele_id > $data_system.elements.size
  972.         draw_icon(affinities[:element_icons][ele_id], dx-45, dy-95)
  973.         name = $data_system.elements[ele_id]
  974.         self.contents.font.color = normal_color
  975.         self.contents.font.size = Font.default_size - 2
  976.         self.contents.draw_text(dx-20, dy-95, dw+10, WLH, name, 0)
  977.         self.contents.font.color = affinity_colour(@actor.element_rate(ele_id))
  978.         self.contents.draw_text(dx+20, dy-95, 60, WLH, element_rate(ele_id), 2)
  979.         if @actor.element_rate(ele_id) < 0
  980.           self.contents.draw_text(dx+45, dy-95, 60, WLH, affinities[:absorb])
  981.         end
  982.         dy += WLH
  983.       end
  984.     end
  985.   end
  986.  
  987.   def calc_ele_width(elements)
  988.     return $game_temp.status_ele_width if $game_temp.status_ele_width != nil
  989.     n = 0
  990.     for ele_id in elements
  991.       next if ele_id > $data_system.elements.size
  992.       text = $data_system.elements[ele_id]
  993.       n = [n, contents.text_size(text).width].max
  994.     end
  995.     $game_temp.status_ele_width = n
  996.     return n
  997.   end
  998.  
  999.   #--------------------------------------------------------------------------
  1000.   # draw_status_resistances
  1001.   #--------------------------------------------------------------------------
  1002.   def draw_status_resistances
  1003.     self.contents.font.size = Font.default_size
  1004.     affinities = YEZ::STATUS::AFFINITIES
  1005.     dx = (self.width - 32)/2 + 24; dy = 0; sw = self.width-32
  1006.     if affinities[:states_shown].size < 10
  1007.       self.contents.font.color = system_color
  1008.       text = affinities[:states_title]
  1009.       self.contents.draw_text(dx+60, dy, sw/2-24, WLH, text, 0)
  1010.       dy += WLH
  1011.     end
  1012.     dw = calc_state_width(affinities[:states_shown])
  1013.     for state_id in affinities[:states_shown]
  1014.       state = $data_states[state_id]
  1015.       next if state == nil
  1016.       draw_icon(state.icon_index, dx+60, dy)
  1017.       self.contents.font.color = normal_color
  1018.       self.contents.font.size = Font.default_size - 2
  1019.       self.contents.draw_text(dx+92, dy, dw+20, WLH, state.name, 0)
  1020.       self.contents.font.color = rank_colour(@actor.state_probability(state_id))
  1021.       resist = sprintf("%d%%", @actor.state_probability(state_id))
  1022.       self.contents.font.size = affinities[:rank_size]
  1023.       self.contents.draw_text(dx+84+dw, dy, 60, WLH, resist, 2)
  1024.       dy += WLH
  1025.     end
  1026.   end
  1027.  
  1028.   #--------------------------------------------------------------------------
  1029.   # calc_ele_width
  1030.   #--------------------------------------------------------------------------
  1031.   def calc_ele_width(elements)
  1032.     return $game_temp.status_ele_width if $game_temp.status_ele_width != nil
  1033.     n = 0
  1034.     for ele_id in elements
  1035.       next if ele_id > $data_system.elements.size
  1036.       text = $data_system.elements[ele_id]
  1037.       n = [n, contents.text_size(text).width].max
  1038.     end
  1039.     $game_temp.status_ele_width = n
  1040.     return n
  1041.   end
  1042.  
  1043.   #--------------------------------------------------------------------------
  1044.   # calc_state_width
  1045.   #--------------------------------------------------------------------------
  1046.   def calc_state_width(states)
  1047.     return $game_temp.status_st_width if $game_temp.status_st_width != nil
  1048.     n = 0
  1049.     for state_id in states
  1050.       state = $data_states[state_id]
  1051.       next if state == nil
  1052.       text = state.name
  1053.       n = [n, contents.text_size(text).width].max
  1054.     end
  1055.     $game_temp.status_st_width = n
  1056.     return n
  1057.   end
  1058.  
  1059.   #--------------------------------------------------------------------------
  1060.   # affinity_colour
  1061.   #--------------------------------------------------------------------------
  1062.   def affinity_colour(amount)
  1063.     if amount > 200; n = YEZ::STATUS::AFFINITIES[:rank_colour][:srank]
  1064.     elsif amount > 150; n = YEZ::STATUS::AFFINITIES[:rank_colour][:arank]
  1065.     elsif amount > 100; n = YEZ::STATUS::AFFINITIES[:rank_colour][:brank]
  1066.     elsif amount > 50; n = YEZ::STATUS::AFFINITIES[:rank_colour][:crank]
  1067.     elsif amount > 25; n = YEZ::STATUS::AFFINITIES[:rank_colour][:drank]
  1068.     elsif amount > 0; n = YEZ::STATUS::AFFINITIES[:rank_colour][:erank]
  1069.     else; n = YEZ::STATUS::AFFINITIES[:rank_colour][:frank]
  1070.     end
  1071.     return text_color(n)
  1072.   end
  1073.  
  1074.   #--------------------------------------------------------------------------
  1075.   # rank_colour
  1076.   #--------------------------------------------------------------------------
  1077.   def rank_colour(amount)
  1078.     if amount > 100; n = YEZ::STATUS::AFFINITIES[:rank_colour][:srank]
  1079.     elsif amount > 80; n = YEZ::STATUS::AFFINITIES[:rank_colour][:arank]
  1080.     elsif amount > 60; n = YEZ::STATUS::AFFINITIES[:rank_colour][:brank]
  1081.     elsif amount > 40; n = YEZ::STATUS::AFFINITIES[:rank_colour][:crank]
  1082.     elsif amount > 20; n = YEZ::STATUS::AFFINITIES[:rank_colour][:drank]
  1083.     elsif amount > 0; n = YEZ::STATUS::AFFINITIES[:rank_colour][:erank]
  1084.     else; n = YEZ::STATUS::AFFINITIES[:rank_colour][:frank]
  1085.     end
  1086.     return text_color(n)
  1087.   end
  1088.  
  1089.   #--------------------------------------------------------------------------
  1090.   # element_rate
  1091.   #--------------------------------------------------------------------------
  1092.   def element_rate(ele_id)
  1093.     rate = @actor.element_rate(ele_id)
  1094.     if rate >= 0; text = sprintf("%+d%%", rate -100)
  1095.     elsif rate < 0; text = sprintf("%d%%", -rate)
  1096.     end
  1097.     return text
  1098.   end
  1099.  
  1100. end # Window_Status_Affinity
  1101.  
  1102. #===============================================================================
  1103. # Window_Status_Skill
  1104. #===============================================================================
  1105.  
  1106. class Window_Status_Skill < Window_Skill
  1107.  
  1108.   #--------------------------------------------------------------------------
  1109.   # initialize
  1110.   #--------------------------------------------------------------------------
  1111.   def initialize(actor)
  1112.     $game_temp.in_battle = true if YEZ::STATUS::SKILLS[:battle_only]
  1113.     super(0, 128, 544, 288, actor)
  1114.     self.opacity = 0
  1115.     self.index = -1
  1116.     $game_temp.in_battle = false if YEZ::STATUS::SKILLS[:battle_only]
  1117.   end
  1118.  
  1119. end # Window_Status_Affinity
  1120.  
  1121. #===============================================================================
  1122. # Window_Status_Equips
  1123. #===============================================================================
  1124.  
  1125. class Window_Status_Equips < Window_Status_Parameter
  1126.  
  1127.   #--------------------------------------------------------------------------
  1128.   # refresh
  1129.   #--------------------------------------------------------------------------
  1130.   def refresh
  1131.     self.contents.clear
  1132.     draw_equipments(32, 0)
  1133.     draw_column((self.width-32)/2-24, WLH, YEZ::STATUS::EQUIPS[:param])
  1134.   end
  1135.  
  1136.   #--------------------------------------------------------------------------
  1137.   # draw_equipments
  1138.   #--------------------------------------------------------------------------
  1139.   def draw_equipments(x, y)
  1140.     self.contents.font.color = system_color
  1141.     self.contents.draw_text(x, y, 120, WLH, YEZ::STATUS::EQUIPS[:page_title])
  1142.     if $imported["EquipExtension"]
  1143.       item_number = [@actor.equips.size, @actor.armor_number + 1].min
  1144.       item_number.times { |i|
  1145.         draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1)) }
  1146.     else
  1147.       for i in 0..4
  1148.         draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1))
  1149.       end
  1150.     end
  1151.   end
  1152.  
  1153. end # Window_Status_Equips
  1154.  
  1155. #===============================================================================
  1156. # Window_Status_Biography
  1157. #===============================================================================
  1158.  
  1159. class Window_Status_Biography < Window_Base
  1160.  
  1161.   #--------------------------------------------------------------------------
  1162.   # initialize
  1163.   #--------------------------------------------------------------------------
  1164.   def initialize(actor)
  1165.     super(0, 128, 544, 288)
  1166.     self.opacity = 0
  1167.     @actor = actor
  1168.     refresh
  1169.   end
  1170.  
  1171.   #--------------------------------------------------------------------------
  1172.   # refresh
  1173.   #--------------------------------------------------------------------------
  1174.   def refresh
  1175.     self.contents.clear
  1176.     if YEZ::STATUS::ACTOR_BIOS.include?(@actor.id)
  1177.       draw_actor_bio
  1178.     elsif YEZ::STATUS::CLASS_BIOS.include?(@actor.class_id)
  1179.       draw_class_bio
  1180.     end
  1181.   end
  1182.  
  1183.   #--------------------------------------------------------------------------
  1184.   # draw_actor_bio
  1185.   #--------------------------------------------------------------------------
  1186.   def draw_actor_bio
  1187.     self.contents.font.color = normal_color; dy = 0
  1188.     text = sprintf(YEZ::STATUS::BIOGRAPHY[:actor_bio], @actor.name)
  1189.     self.contents.draw_text(0, dy, self.width-32, WLH*2, text, 1)
  1190.     self.contents.font.size = YEZ::STATUS::BIOGRAPHY[:font_size]
  1191.     text = YEZ::STATUS::ACTOR_BIOS[@actor.id]
  1192.     txsize = YEZ::STATUS::BIOGRAPHY[:font_size] + 4
  1193.     nwidth = 544
  1194.     dx = 48; dy = WLH*2
  1195.     text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  1196.     text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  1197.     text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  1198.     lines = text.split(/(?:[|]|\\n)/i)
  1199.     lines.each_with_index { |l, i|
  1200.       l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
  1201.       self.contents.draw_text(dx - 24, i * txsize + dy, nwidth, WLH, l, 0)}
  1202.   end
  1203.  
  1204.   #--------------------------------------------------------------------------
  1205.   # draw_class_bio
  1206.   #--------------------------------------------------------------------------
  1207.   def draw_class_bio
  1208.     self.contents.font.color = normal_color; dy = 0
  1209.     text = sprintf(YEZ::STATUS::BIOGRAPHY[:class_des], @actor.class.name)
  1210.     self.contents.draw_text(0, dy, self.width-32, WLH*2, text, 1)
  1211.     self.contents.font.size = YEZ::STATUS::BIOGRAPHY[:font_size]
  1212.     text = YEZ::STATUS::CLASS_BIOS[@actor.class.id]
  1213.     txsize = YEZ::STATUS::BIOGRAPHY[:font_size] + 4
  1214.     nwidth = 544
  1215.     dx = 48; dy = WLH*2
  1216.     text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  1217.     text.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
  1218.     text.gsub!(/\\N\[([0-9]+)\]/i) { $game_actors[$1.to_i].name }
  1219.     lines = text.split(/(?:[|]|\\n)/i)
  1220.     lines.each_with_index { |l, i|
  1221.       l.gsub!(/\\__(\[\d+\])/i) { "\\N#{$1}" }
  1222.       self.contents.draw_text(dx - 24, i * txsize + dy, nwidth, WLH, l, 0)}
  1223.   end
  1224.  
  1225. end # Window_Status_Biography
  1226.  
  1227. #===============================================================================
  1228. # Window_Status_Command
  1229. #===============================================================================
  1230.  
  1231. class Window_Status_Command < Window_Command
  1232.  
  1233.   #--------------------------------------------------------------------------
  1234.   # initialize
  1235.   #--------------------------------------------------------------------------
  1236.   def initialize(actor)
  1237.     @actor = actor
  1238.     create_command_list
  1239.     super(160, @commands)
  1240.     self.height = 128
  1241.     self.oy = $game_temp.status_oy if $game_temp.status_oy != nil
  1242.     self.index = $game_temp.status_index if $game_temp.status_index != nil
  1243.     if $game_temp.status_index != nil and $game_temp.status_index > (@commands.size-1)
  1244.       self.index = @commands.size-1
  1245.     end
  1246.   end
  1247.  
  1248.   #--------------------------------------------------------------------------
  1249.   # create_command_list
  1250.   #--------------------------------------------------------------------------
  1251.   def create_command_list
  1252.     @commands = []
  1253.     for command in YEZ::STATUS::COMMANDS
  1254.       #--- Default Commands
  1255.       case command
  1256.       when :parameters; @commands.push(command)
  1257.       when :affinities; @commands.push(command)
  1258.       when :skills; @commands.push(command)
  1259.       when :equips; @commands.push(command)
  1260.       when :biography
  1261.         if !YEZ::STATUS::ACTOR_BIOS.include?(@actor.id)
  1262.           next if !YEZ::STATUS::CLASS_BIOS.include?(@actor.class_id)
  1263.         end
  1264.         @commands.push(command)
  1265.       #--- Imported Commands
  1266.       when :formations
  1267.         next unless $imported["FormationMacros"]
  1268.         next unless $game_switches[YEZ::MACRO::ENABLE_SWITCH]
  1269.         @commands.push(command)
  1270.       when :mastery
  1271.         next unless $imported["WeaponMasterySkills"]
  1272.         @commands.push(command)
  1273.        
  1274.       else
  1275.         next unless YEZ::STATUS::IMPORTED_COMMANDS.include?(command)
  1276.         if YEZ::STATUS::IMPORTED_COMMANDS[command][0] != nil
  1277.           next unless $game_switches[YEZ::STATUS::IMPORTED_COMMANDS[command][0]]
  1278.         end
  1279.         @commands.push(command)
  1280.       end
  1281.       #---
  1282.     end
  1283.   end
  1284.  
  1285.   #--------------------------------------------------------------------------
  1286.   # item
  1287.   #--------------------------------------------------------------------------
  1288.   def item; return @commands[index]; end
  1289.  
  1290.   #--------------------------------------------------------------------------
  1291.   # draw_item
  1292.   #--------------------------------------------------------------------------
  1293.   def draw_item(index, enabled = true)
  1294.     rect = item_rect(index)
  1295.     rect.x += 4
  1296.     rect.width -= 8
  1297.     self.contents.clear_rect(rect)
  1298.     self.contents.font.color = normal_color
  1299.     self.contents.font.color.alpha = enabled ? 255 : 128
  1300.     #--- Default ---
  1301.     case @commands[index]
  1302.     when :parameters
  1303.       text = YEZ::STATUS::PARAMETERS[:title]
  1304.       icon = YEZ::STATUS::PARAMETERS[:icon]
  1305.     when :affinities
  1306.       text = YEZ::STATUS::AFFINITIES[:title]
  1307.       icon = YEZ::STATUS::AFFINITIES[:icon]
  1308.     when :skills
  1309.       text = YEZ::STATUS::SKILLS[:title]
  1310.       icon = YEZ::STATUS::SKILLS[:icon]
  1311.     when :equips
  1312.       text = YEZ::STATUS::EQUIPS[:title]
  1313.       icon = YEZ::STATUS::EQUIPS[:icon]
  1314.     when :biography
  1315.       text = YEZ::STATUS::BIOGRAPHY[:title]
  1316.       icon = YEZ::STATUS::BIOGRAPHY[:icon]
  1317.     #--- Imported ---
  1318.     when :formations
  1319.       return unless $imported["FormationMacros"]
  1320.       return unless $game_switches[YEZ::MACRO::ENABLE_SWITCH]
  1321.       text = YEZ::MACRO::TITLE
  1322.       icon = YEZ::MACRO::ICON
  1323.     when :mastery
  1324.       return unless $imported["WeaponMasterySkills"]
  1325.       text = YEZ::WEAPON_MASTERY::TITLE
  1326.       icon = YEZ::WEAPON_MASTERY::ICON
  1327.      
  1328.     else
  1329.       return unless YEZ::STATUS::IMPORTED_COMMANDS.include?(@commands[index])
  1330.       text = YEZ::STATUS::IMPORTED_COMMANDS[@commands[index]][1]
  1331.       icon = YEZ::STATUS::IMPORTED_COMMANDS[@commands[index]][2]
  1332.      
  1333.     end
  1334.     #---
  1335.     align = 1
  1336.     if YEZ::STATUS::USE_ICONS
  1337.       rect.x += 24
  1338.       rect.width -= 24
  1339.       align = 0
  1340.     end
  1341.     self.contents.draw_text(rect, text, align)
  1342.     return unless YEZ::STATUS::USE_ICONS
  1343.     draw_icon(icon, rect.x-24, rect.y)
  1344.   end
  1345.  
  1346. end # Window_Status_Command
  1347.  
  1348. #===============================================================================
  1349. #
  1350. # END OF FILE
  1351. #
  1352. #===============================================================================
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top