Advertisement
roninator2

Ability Menu by Arttroy

Nov 20th, 2024
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 68.73 KB | None | 0 0
  1. # Ability Menu by Arttroy (advised and corrected by Estheone)
  2. # Contact on https://www.rpg-maker.fr/index.php?page=membre&id=22277
  3. # Modified by Roninator2
  4. # 2021-11-11
  5. # V 1.1
  6. #==============================================================================
  7. #  Instructions :
  8. #
  9. # * Modification of skills obtained and their level:
  10. #
  11. # Line 78 :
  12. #   Skills = [[3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
  13. #
  14. #  The id of skills matches that of the database, modify it as you want
  15. #-------------------------------------------------------------
  16. #
  17. # * Modification of the level when skill will be obtained
  18. #
  19. # Line 80 :
  20. #   Learn_Level = [[3, 6, 10], [3, 10, 30], [3, 10, 30], [3, 10, 30]]
  21. #
  22. #  You can modify the level of category when skill will be obtained.
  23. #
  24. # These two lines are matching together, if you want to add a skill you
  25. # must also modify the line for the level
  26. # Maximum of 4 skills supported
  27. #
  28. #-------------------------------------------------------------
  29. # * Modification of the actor parameters:
  30. #  
  31. # Line 124 :
  32. #   @augmentation = [0, 0, 0, 0, 0, 0, 0, 0]
  33. #  
  34. # Read this like :
  35. #   @augmentation = [HP, MP, Atk, Def, Mat, Mdf, Agi, Luk]
  36. # You will have to modify the values of the method addedstats_calculation
  37. # (Line 156)
  38. #
  39. #   @augmentation[2] = Random.new.rand(3..8)
  40. #
  41. #-------------------------------------------------------------
  42. # * Modification of the Crystal Images
  43. #  
  44. # Line 751:
  45. # @crystal_pictures = ["Crystal", "Glowing_Crystal", "Red_Crystal", "Glowing_Red_Crystal", "Blue_Crystal", "Glowing_Blue_Crystal",
  46. #     "Yellow_Crystal", "Glowing_Yellow_Crystal", "Green_Crystal", "Glowing_Green_Crystal", "Orange_Crystal", "Glowing_Orange_Crystal"]
  47. #    
  48. # Instructions on line 743 - two crystal files per column
  49. #   The first is the default no skill level
  50. #-------------------------------------------------------------
  51. # You can modify the values of random. At the same time modify the display values
  52. # from the line 759 (def refresh of the Scene_Ability).
  53. #
  54. # If you want to modify the parameter growth
  55. # you will have to change the display of contents for the adds.
  56. # I advise not to do this if you don't know how to do this.
  57. #
  58. # Do not forget to insert images in the folder Pictures
  59. #-------------------------------------------------------------
  60. # Added Feature:
  61. # abilitypoints_up -> actor gains one ability point
  62. #   make an item with hp damage. Formula = b.abilitypoints_up; 0
  63. #   Add in gain_tp 0% feature. Formula Variance 0
  64. #==============================================================================
  65.  
  66. module R2_Ability_Options
  67.   # Set the max level for all ability crystals
  68.   MAX_LEVEL = 30
  69.   # Show equiment icons or just the accessory name
  70.   Show_All_Equip = false
  71.   # show numbers on status page, by default only shows + sign
  72.   Show_Numbers = true
  73.   # true means the player will the numbers. This has a negative effect
  74.   # as the player can easily figure out that you can cancel and select
  75.   # again to have the numbers regenerated
  76.   Confirm_Text = " Add a point to this category?"
  77.   # Designate skills to learn when ability reaches the level below
  78.   Skills = [[3, 4, 5, 8], [6, 7, 8], [9, 10, 11], [12, 13, 14], [18, 19, 20]]
  79.   # 0 => 3, 4, 5 -> level 3, 6, 10 = 3 -> 3, 4 -> 6,  5 -> 10
  80.   Learn_Level = [[3, 6, 10, 12], [3, 10, 30], [3, 10, 30], [3, 10, 30], [4, 11, 32]]
  81. end
  82.  
  83. #==============================================================================
  84. # ** Game_Temp
  85. #==============================================================================
  86. class Game_Temp
  87.  
  88.   #--------------------------------------------------------------------------
  89.   # * Public Instance Variables
  90.   #--------------------------------------------------------------------------
  91.   attr_accessor :ability_index            # Index for ability menu
  92.  
  93.   #--------------------------------------------------------------------------
  94.   # * Aliasing method initialize
  95.   #--------------------------------------------------------------------------
  96.   alias ability_initialize initialize
  97.   def initialize
  98.     @ability_index = 0
  99.     ability_initialize
  100.   end
  101. end
  102.  
  103. #==============================================================================
  104. # ** Game_Actor
  105. #==============================================================================
  106.  
  107. class Game_Actor < Game_Battler
  108.  
  109.   attr_reader   :ability_level            # for ability level
  110.   attr_reader   :ability_points           # for new skill by levelling ability
  111.   attr_reader   :ability_new_skills_id    # for new skill by levelling ability
  112.   attr_reader   :ability_new_skills_level # required level for new skills
  113.   attr_reader   :augmentation             # for added stats by levelling ability
  114.  
  115.   #--------------------------------------------------------------------------
  116.   # * Aliasing method setup(actor_id)
  117.   #--------------------------------------------------------------------------
  118.   alias ability_setup setup
  119.   def setup(actor_id)
  120.     @ability_level = [0, 0, 0, 0, 0]
  121.     @ability_points = 0
  122.     @ability_new_skills_id = R2_Ability_Options::Skills
  123.     @ability_new_skills_level = R2_Ability_Options::Learn_Level
  124.     @augmentation = [0, 0, 0, 0, 0, 0, 0, 0]
  125.     ability_setup(actor_id)
  126.   end
  127.  
  128.   #--------------------------------------------------------------------------
  129.   # * Check if ability_level is equal to skill_level - 1
  130.   #--------------------------------------------------------------------------
  131.   def check_ability_skills_learning(n)
  132.     level = @ability_level[n]
  133.     for i in 0...@ability_new_skills_id[n].size
  134.       skill = @ability_new_skills_id[n][i]
  135.       required_level = @ability_new_skills_level[n][i]
  136.       learn_skill(skill) if level >= required_level
  137.     end
  138.   end
  139.  
  140.   #--------------------------------------------------------------------------
  141.   # * Ability Maximum Level
  142.   #--------------------------------------------------------------------------
  143.   def ability_max_level
  144.     return R2_Ability_Options::MAX_LEVEL
  145.   end
  146.   #--------------------------------------------------------------------------
  147.   # * Determine Maximum Level
  148.   #--------------------------------------------------------------------------
  149.   def ability_max_level?
  150.     @ability_level >= ability_max_level
  151.   end
  152.  
  153.   #--------------------------------------------------------------------------
  154.   # * Calculate Stats Augmentation
  155.   #--------------------------------------------------------------------------  
  156.   def addedstats_calculation
  157.     case $game_temp.ability_index
  158.       when 0
  159.         if @ability_level[0].between?(0, 9)
  160.           @augmentation[2] = Random.new.rand(2..3)
  161.           @augmentation[3] = Random.new.rand(2..3)
  162.           @augmentation[0] = Random.new.rand(20..35)
  163.         elsif @ability_level[0].between?(10, 19)
  164.           @augmentation[2] = Random.new.rand(3..4)
  165.           @augmentation[3] = Random.new.rand(3..4)
  166.           @augmentation[0] = Random.new.rand(40..50)
  167.         elsif @ability_level[0].between?(20, 29)
  168.           @augmentation[2] = Random.new.rand(5..6)
  169.           @augmentation[3] = Random.new.rand(5..6)
  170.           @augmentation[0] = Random.new.rand(60..70)
  171.         elsif @ability_level[0].between?(30, 39)
  172.           @augmentation[2] = Random.new.rand(7..9)
  173.           @augmentation[3] = Random.new.rand(7..9)
  174.           @augmentation[0] = Random.new.rand(80..100)
  175.         elsif @ability_level[0].between?(40, 49)
  176.           @augmentation[2] = Random.new.rand(10..14)
  177.           @augmentation[3] = Random.new.rand(10..14)
  178.           @augmentation[0] = Random.new.rand(100..120)
  179.         elsif @ability_level[0].between?(50, 59)
  180.           @augmentation[2] = Random.new.rand(15..20)
  181.           @augmentation[3] = Random.new.rand(15..20)
  182.           @augmentation[0] = Random.new.rand(120..150)
  183.         end
  184.       when 1
  185.         if @ability_level[1].between?(0, 9)
  186.           @augmentation[4] = Random.new.rand(2..3)
  187.           @augmentation[5] = Random.new.rand(2..3)
  188.           @augmentation[1] = Random.new.rand(10..15)
  189.         elsif @ability_level[1].between?(10, 19)
  190.           @augmentation[4] = Random.new.rand(4..5)
  191.           @augmentation[5] = Random.new.rand(4..5)
  192.           @augmentation[1] = Random.new.rand(15..20)
  193.         elsif @ability_level[1].between?(20, 29)
  194.           @augmentation[4] = Random.new.rand(6..7)
  195.           @augmentation[5] = Random.new.rand(6..7)
  196.           @augmentation[1] = Random.new.rand(20..30)
  197.         elsif @ability_level[1].between?(30, 39)
  198.           @augmentation[4] = Random.new.rand(8..10)
  199.           @augmentation[5] = Random.new.rand(8..10)
  200.           @augmentation[1] = Random.new.rand(40..50)
  201.         elsif @ability_level[1].between?(40, 49)
  202.           @augmentation[4] = Random.new.rand(10..15)
  203.           @augmentation[5] = Random.new.rand(10..15)
  204.           @augmentation[1] = Random.new.rand(60..70)
  205.         elsif @ability_level[1].between?(50, 59)
  206.           @augmentation[4] = Random.new.rand(16..20)
  207.           @augmentation[5] = Random.new.rand(16..20)
  208.           @augmentation[1] = Random.new.rand(80..90)
  209.         end
  210.       when 2
  211.         if @ability_level[2].between?(0, 9)
  212.           @augmentation[6] = Random.new.rand(2..3)
  213.           @augmentation[7] = Random.new.rand(2..3)
  214.           @augmentation[4] = Random.new.rand(1..2)
  215.           @augmentation[5] = Random.new.rand(1..2)
  216.         elsif @ability_level[2].between?(10, 19)
  217.           @augmentation[6] = Random.new.rand(4..6)
  218.           @augmentation[7] = Random.new.rand(4..6)
  219.           @augmentation[4] = Random.new.rand(2..3)
  220.           @augmentation[5] = Random.new.rand(2..3)
  221.         elsif @ability_level[2].between?(20, 29)
  222.           @augmentation[6] = Random.new.rand(7..9)
  223.           @augmentation[7] = Random.new.rand(7..9)
  224.           @augmentation[4] = Random.new.rand(4..6)
  225.           @augmentation[5] = Random.new.rand(4..6)
  226.         elsif @ability_level[2].between?(30, 39)
  227.           @augmentation[6] = Random.new.rand(10..12)
  228.           @augmentation[7] = Random.new.rand(10..12)
  229.           @augmentation[4] = Random.new.rand(7..9)
  230.           @augmentation[5] = Random.new.rand(7..9)
  231.         elsif @ability_level[2].between?(40, 49)
  232.           @augmentation[6] = Random.new.rand(14..16)
  233.           @augmentation[7] = Random.new.rand(14..16)
  234.           @augmentation[4] = Random.new.rand(10..12)
  235.           @augmentation[5] = Random.new.rand(10..12)
  236.         elsif @ability_level[2].between?(50, 59)
  237.           @augmentation[6] = Random.new.rand(18..20)
  238.           @augmentation[7] = Random.new.rand(18..20)
  239.           @augmentation[4] = Random.new.rand(14..15)
  240.           @augmentation[5] = Random.new.rand(14..15)
  241.         end
  242.       when 3
  243.         if @ability_level[3].between?(0, 9)
  244.           @augmentation[2] = Random.new.rand(2..3)
  245.           @augmentation[4] = Random.new.rand(2..3)
  246.           @augmentation[0] = Random.new.rand(15..25)
  247.           @augmentation[1] = Random.new.rand(5..10)
  248.         elsif @ability_level[3].between?(10, 19)
  249.           @augmentation[2] = Random.new.rand(4..6)
  250.           @augmentation[4] = Random.new.rand(4..6)
  251.           @augmentation[0] = Random.new.rand(25..35)
  252.           @augmentation[1] = Random.new.rand(10..15)
  253.         elsif @ability_level[3].between?(20, 29)
  254.           @augmentation[2] = Random.new.rand(7..9)
  255.           @augmentation[4] = Random.new.rand(7..9)
  256.           @augmentation[0] = Random.new.rand(40..50)
  257.           @augmentation[1] = Random.new.rand(20..25)
  258.         elsif @ability_level[3].between?(30, 39)
  259.           @augmentation[2] = Random.new.rand(10..12)
  260.           @augmentation[4] = Random.new.rand(10..12)
  261.           @augmentation[0] = Random.new.rand(50..75)
  262.           @augmentation[1] = Random.new.rand(30..35)
  263.         elsif @ability_level[3].between?(40, 49)
  264.           @augmentation[2] = Random.new.rand(15..17)
  265.           @augmentation[4] = Random.new.rand(15..17)
  266.           @augmentation[0] = Random.new.rand(80..85)
  267.           @augmentation[1] = Random.new.rand(35..40)
  268.         elsif @ability_level[3].between?(50, 59)
  269.           @augmentation[2] = Random.new.rand(18..20)
  270.           @augmentation[4] = Random.new.rand(18..20)
  271.           @augmentation[0] = Random.new.rand(90..95)
  272.           @augmentation[1] = Random.new.rand(40..50)
  273.         end
  274.       when 4
  275.         if @ability_level[4].between?(0, 9)
  276.           @augmentation[3] = Random.new.rand(2..4)
  277.           @augmentation[5] = Random.new.rand(2..4)
  278.           @augmentation[6] = Random.new.rand(2..3)
  279.           @augmentation[7] = Random.new.rand(2..3)
  280.         elsif @ability_level[4].between?(10, 19)
  281.           @augmentation[3] = Random.new.rand(4..6)
  282.           @augmentation[5] = Random.new.rand(4..6)
  283.           @augmentation[6] = Random.new.rand(4..5)
  284.           @augmentation[7] = Random.new.rand(4..5)
  285.         elsif @ability_level[4].between?(20, 29)
  286.           @augmentation[3] = Random.new.rand(7..9)
  287.           @augmentation[5] = Random.new.rand(7..9)
  288.           @augmentation[6] = Random.new.rand(6..8)
  289.           @augmentation[7] = Random.new.rand(6..8)
  290.         elsif @ability_level[4].between?(30, 39)
  291.           @augmentation[3] = Random.new.rand(10..12)
  292.           @augmentation[5] = Random.new.rand(10..12)
  293.           @augmentation[6] = Random.new.rand(8..10)
  294.           @augmentation[7] = Random.new.rand(8..10)
  295.         elsif @ability_level[4].between?(40, 49)
  296.           @augmentation[3] = Random.new.rand(12..14)
  297.           @augmentation[5] = Random.new.rand(12..14)
  298.           @augmentation[6] = Random.new.rand(10..12)
  299.           @augmentation[7] = Random.new.rand(10..12)
  300.         elsif @ability_level[4].between?(50, 59)
  301.           @augmentation[3] = Random.new.rand(15..18)
  302.           @augmentation[5] = Random.new.rand(15..18)
  303.           @augmentation[6] = Random.new.rand(12..14)
  304.           @augmentation[7] = Random.new.rand(12..14)
  305.         end
  306.     end
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # * Add Stats Augmentation
  310.   #--------------------------------------------------------------------------  
  311.   def stats_augmentation
  312.     case $game_temp.ability_index
  313.     when 0
  314.       add_param(2, @augmentation[2])
  315.       add_param(3, @augmentation[3])
  316.       add_param(0, @augmentation[0])
  317.     when 1
  318.       add_param(4, @augmentation[4])
  319.       add_param(5, @augmentation[5])
  320.       add_param(1, @augmentation[1])
  321.     when 2
  322.       add_param(6, @augmentation[6])
  323.       add_param(7, @augmentation[7])
  324.       add_param(4, @augmentation[4])
  325.       add_param(5, @augmentation[5])
  326.     when 3
  327.       add_param(2, @augmentation[2])
  328.       add_param(4, @augmentation[4])
  329.       add_param(0, @augmentation[0])
  330.       add_param(1, @augmentation[1])
  331.     when 4
  332.       add_param(3, @augmentation[3])
  333.       add_param(5, @augmentation[5])
  334.       add_param(6, @augmentation[6])
  335.       add_param(7, @augmentation[7])
  336.     end
  337.   end
  338.  
  339.   #--------------------------------------------------------------------------
  340.   # * Ability Points Down
  341.   #--------------------------------------------------------------------------
  342.   def abilitypoints_down
  343.     @ability_points -= 1
  344.   end
  345.  
  346.   #--------------------------------------------------------------------------
  347.   # * Ability Points Up
  348.   #--------------------------------------------------------------------------
  349.   def abilitypoints_up
  350.     @ability_points += 1
  351.   end
  352.  
  353.   #--------------------------------------------------------------------------
  354.   # * Aliasing method Level Up
  355.   #--------------------------------------------------------------------------
  356.   alias ability_level_up level_up
  357.   def level_up
  358.     @ability_points += 1
  359.     ability_level_up
  360.   end
  361. end
  362.  
  363. #==============================================================================
  364. # ** Window_MenuCommand
  365. #==============================================================================
  366.  
  367. class Window_MenuCommand < Window_Command
  368.   #--------------------------------------------------------------------------
  369.   # * Overwrite method Adding Original Commands
  370.   #--------------------------------------------------------------------------
  371.   def add_original_commands
  372.     add_command("Ability", :ability, main_commands_enabled)
  373.   end
  374. end  
  375.  
  376. #==============================================================================
  377. # ** Scene_Menu
  378. #==============================================================================
  379.  
  380. class Scene_Menu < Scene_MenuBase
  381.   #--------------------------------------------------------------------------
  382.   # * Overwrite method Create Command Window
  383.   #--------------------------------------------------------------------------
  384.   alias r2_ability_command_2837r    create_command_window
  385.   def create_command_window
  386.     r2_ability_command_2837r
  387.     @command_window.set_handler(:ability,   method(:command_ability))
  388.   end
  389.  
  390.   #--------------------------------------------------------------------------
  391.   # * [Ability] Command
  392.   #--------------------------------------------------------------------------
  393.   def command_ability
  394.     @status_window.select_last
  395.     @status_window.activate
  396.     @status_window.set_handler(:ok,     method(:on_ability_ok))
  397.     @status_window.set_handler(:cancel, method(:on_ability_cancel))
  398.   end
  399.  
  400.   #--------------------------------------------------------------------------
  401.   # * Ability [OK]
  402.   #--------------------------------------------------------------------------
  403.   def on_ability_ok
  404.     if @status_window.pending_index >= 0
  405.       @status_window.pending_index = @status_window.index
  406.     end
  407.     @status_window.activate
  408.     SceneManager.call(Scene_Ability)
  409.   end
  410.   #--------------------------------------------------------------------------
  411.   # * Ability [Cancel]
  412.   #--------------------------------------------------------------------------
  413.   def on_ability_cancel
  414.     if @status_window.pending_index >= 0
  415.       @status_window.pending_index = -1
  416.       @status_window.activate
  417.     else
  418.       @status_window.unselect
  419.       @command_window.activate
  420.     end
  421.   end
  422. end
  423.  
  424. #===============================================================================
  425. #   ** Scene_Ability
  426. #===============================================================================
  427.  
  428. class Scene_Ability < Scene_MenuBase
  429.    
  430.   #--------------------------------------------------------------------------
  431.   # * Start Processing
  432.   #--------------------------------------------------------------------------
  433.   def start
  434.     super
  435.     $game_temp.ability_index = 0
  436.     create_abilitystatus_window
  437.     create_category_windows
  438.     create_adds_windows
  439.     create_command_window
  440.     create_choices_windows
  441.     create_addedstats_window
  442.     create_showskill_window
  443.     create_images
  444.     @abilitymessage_window.visible = false
  445.     @addedstats_window.visible = false
  446.     refresh
  447.   end
  448.  
  449.   #--------------------------------------------------------------------------
  450.   # * Termination Processing
  451.   #--------------------------------------------------------------------------
  452.   def terminate
  453.     super
  454.     @crystal_sprites.each(&:dispose)
  455.   end
  456.  
  457.   #--------------------------------------------------------------------------
  458.   # * Frame Update
  459.   #--------------------------------------------------------------------------
  460.   def update    
  461.     super    
  462.     if @command_window.active
  463.       if Input.trigger?(:LEFT)
  464.         Sound.play_cursor
  465.         $game_temp.ability_index = ($game_temp.ability_index-1)%5
  466.         @showskill_asi_window.hide
  467.         @showskill_atk_window.hide
  468.         @showskill_mgc_window.hide
  469.         @showskill_agl_window.hide
  470.         @showskill_ble_window.hide
  471.         @mgc_adds_window.visible = true
  472.         @agl_adds_window.visible = true
  473.         @asi_adds_window.visible = true
  474.         @atk_adds_window.visible = true
  475.         @ble_adds_window.visible = true
  476.       elsif Input.trigger?(:RIGHT)
  477.         Sound.play_cursor
  478.         $game_temp.ability_index = ($game_temp.ability_index+1)%5
  479.         @showskill_asi_window.hide
  480.         @showskill_atk_window.hide
  481.         @showskill_mgc_window.hide
  482.         @showskill_agl_window.hide
  483.         @showskill_ble_window.hide
  484.         @asi_adds_window.visible = true
  485.         @atk_adds_window.visible = true
  486.         @mgc_adds_window.visible = true
  487.         @agl_adds_window.visible = true
  488.         @ble_adds_window.visible = true
  489.       elsif Input.trigger?(:DOWN)
  490.         case $game_temp.ability_index
  491.         when 0
  492.           @showskill_atk_window.refresh
  493.           @showskill_atk_window.show
  494.           @atk_adds_window.visible = false
  495.         when 1
  496.           @showskill_mgc_window.refresh
  497.           @showskill_mgc_window.show
  498.           @mgc_adds_window.visible = false
  499.         when 2
  500.           @showskill_agl_window.refresh
  501.           @showskill_agl_window.show
  502.           @agl_adds_window.visible = false
  503.         when 3
  504.           @showskill_asi_window.refresh
  505.           @showskill_asi_window.show
  506.           @asi_adds_window.visible = false
  507.         when 4
  508.           @showskill_ble_window.refresh
  509.           @showskill_ble_window.show
  510.           @ble_adds_window.visible = false
  511.         end
  512.       elsif Input.trigger?(:UP)
  513.         case $game_temp.ability_index
  514.         when 0
  515.           @showskill_atk_window.hide
  516.           @atk_adds_window.visible = true
  517.         when 1
  518.           @showskill_mgc_window.hide
  519.           @mgc_adds_window.visible = true
  520.         when 2
  521.           @showskill_agl_window.hide
  522.           @agl_adds_window.visible = true
  523.         when 3
  524.           @showskill_asi_window.hide
  525.           @asi_adds_window.visible = true
  526.         when 4
  527.           @showskill_ble_window.hide
  528.           @ble_adds_window.visible = true
  529.         end        
  530.       elsif Input.trigger?(:C)
  531.         if @actor.ability_points != 0 &&
  532.           @actor.ability_level[$game_temp.ability_index] < @actor.ability_max_level
  533.           @abilitymessage_window.visible = true
  534.           @actor.addedstats_calculation
  535.           @addedstats_window.refresh
  536.           @addedstats_window.visible = true
  537.           @command_window.active = false
  538.           @abilitychoices_window.start
  539.         else
  540.           Sound.play_buzzer
  541.         end
  542.       end
  543.     end
  544.     5.times do |i|      
  545.       j = $game_temp.ability_index == i ? 1 : 0      
  546.       bitmap_name = @actor.ability_level[i] == 0 ? @crystal_pictures[j] : @crystal_pictures[i*2+2+j]      
  547.       @crystal_sprites[i].bitmap = Cache.picture(bitmap_name)    
  548.     end    
  549.     pattern = (Graphics.frame_count/5)%6
  550.     sprite = @crystal_sprites[$game_temp.ability_index]    
  551.     w, h = sprite.bitmap.width/6, sprite.bitmap.height    
  552.     sprite.src_rect.set(w*pattern, 0, w, h)  
  553.   end
  554.  
  555.   #--------------------------------------------------------------------------
  556.   # * Ability Status Window creation
  557.   #--------------------------------------------------------------------------
  558.   def create_abilitystatus_window
  559.     @abilitystatus_window = Window_AbilityStatus.new
  560.     @abilitystatus_window.actor = @actor
  561.   end
  562.  
  563.   #--------------------------------------------------------------------------
  564.   # * Ability Category Window creation
  565.   #--------------------------------------------------------------------------
  566.   def create_category_windows
  567.     @atk_category_window = Window_AbilityCategory.new
  568.     @atk_category_window.x = 50
  569.     @atk_category_window.contents.draw_text(4, 0, 60, 20, "ATK")
  570.     @mgc_category_window = Window_AbilityCategory.new
  571.     @mgc_category_window.x = 150
  572.     @mgc_category_window.contents.draw_text(2, 0, 60, 20, "MGC")
  573.     @agl_category_window = Window_AbilityCategory.new
  574.     @agl_category_window.x = 250
  575.     @agl_category_window.contents.draw_text(2, 0, 60, 20, "AGL")
  576.     @asi_category_window = Window_AbilityCategory.new
  577.     @asi_category_window.x = 350
  578.     @asi_category_window.contents.draw_text(2, 0, 60, 20, "ASI")
  579.     @ble_category_window = Window_AbilityCategory.new
  580.     @ble_category_window.x = 450
  581.     @ble_category_window.contents.draw_text(2, 0, 60, 20, "BLE")
  582.   end
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # * Ability Status Window creation
  586.   #--------------------------------------------------------------------------
  587.   def create_adds_windows
  588.     @atk_adds_window = Window_AbilityAdds.new(25, 290)
  589.     @atk_adds_window.actor = @actor
  590.     @atk_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[0].to_s, 1)
  591.     @mgc_adds_window = Window_AbilityAdds.new(125, 290)
  592.     @mgc_adds_window.actor = @actor
  593.     @mgc_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[1].to_s, 1)
  594.     @agl_adds_window = Window_AbilityAdds.new(225, 290)
  595.     @agl_adds_window.actor = @actor
  596.     @agl_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[2].to_s, 1)
  597.     @asi_adds_window = Window_AbilityAdds.new(325, 290)
  598.     @asi_adds_window.actor = @actor
  599.     @asi_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[3].to_s, 1)
  600.     @ble_adds_window = Window_AbilityAdds.new(425, 290)
  601.     @ble_adds_window.actor = @actor
  602.     @ble_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[4].to_s, 1)
  603.   end
  604.  
  605.   #--------------------------------------------------------------------------
  606.   # * Ability Command Window creation
  607.   #--------------------------------------------------------------------------
  608.   def create_command_window
  609.     @command_window = Window_Ability_Command.new
  610.     @command_window.set_handler(:cancel,   method(:return_scene))
  611.     @command_window.set_handler(:pagedown, method(:next_actor))
  612.     @command_window.set_handler(:pageup,   method(:prev_actor))
  613.   end
  614.  
  615.   #--------------------------------------------------------------------------
  616.   # * Ability Choices Windows creation
  617.   #--------------------------------------------------------------------------  
  618.   def create_choices_windows
  619.     @abilitymessage_window = Window_Ability_Confirmation.new
  620.     @abilitychoices_window = Window_Ability_ChoiceList.new
  621.     @abilitychoices_window.set_handler(:yes,    method(:add_ability_points))
  622.     @abilitychoices_window.set_handler(:no,     method(:return_category))
  623.     @abilitychoices_window.set_handler(:cancel, method(:return_category))    
  624.   end
  625.  
  626.   def create_addedstats_window
  627.     @addedstats_window = Window_Ability_AddedStats.new
  628.     @addedstats_window.actor = @actor
  629.   end
  630.  
  631.   def create_showskill_window
  632.     @showskill_atk_window = Window_AbilitySkillList.new(25, 290, 0)
  633.     @showskill_atk_window.actor = @actor
  634.     @showskill_mgc_window = Window_AbilitySkillList.new(125, 290, 1)
  635.     @showskill_mgc_window.actor = @actor
  636.     @showskill_agl_window = Window_AbilitySkillList.new(225, 290, 2)
  637.     @showskill_agl_window.actor = @actor
  638.     @showskill_asi_window = Window_AbilitySkillList.new(325, 290, 3)
  639.     @showskill_asi_window.actor = @actor
  640.     @showskill_ble_window = Window_AbilitySkillList.new(425, 290, 4)
  641.     @showskill_ble_window.actor = @actor
  642.     @showskill_asi_window.hide
  643.     @showskill_atk_window.hide
  644.     @showskill_mgc_window.hide
  645.     @showskill_agl_window.hide
  646.     @showskill_ble_window.hide
  647.   end
  648.  
  649.   #--------------------------------------------------------------------------
  650.   # * Change Actors
  651.   #--------------------------------------------------------------------------
  652.   def on_actor_change
  653.     @abilitystatus_window.actor = @actor
  654.     @addedstats_window.actor = @actor
  655.     @atk_adds_window.actor = @actor
  656.     @mgc_adds_window.actor = @actor
  657.     @agl_adds_window.actor = @actor
  658.     @asi_adds_window.actor = @actor
  659.     @ble_adds_window.actor = @actor
  660.     @showskill_atk_window.actor = @actor
  661.     @showskill_mgc_window.actor = @actor
  662.     @showskill_agl_window.actor = @actor
  663.     @showskill_asi_window.actor = @actor
  664.     @showskill_ble_window.actor = @actor
  665.     @command_window.activate
  666.     refresh
  667.   end
  668.  
  669.   #--------------------------------------------------------------------------
  670.   # * Add Ability Points
  671.   #--------------------------------------------------------------------------
  672.   def add_ability_points
  673.     if @actor.ability_points == 0
  674.       Sound.play_buzzer
  675.     else
  676.       case $game_temp.ability_index
  677.         when 0
  678.           @actor.ability_level[0] += 1
  679.           @actor.abilitypoints_down
  680.           @actor.stats_augmentation
  681.           @actor.check_ability_skills_learning(0)
  682.           @atk_adds_window.refresh
  683.         when 1
  684.           @actor.ability_level[1] += 1
  685.           @actor.abilitypoints_down
  686.           @actor.stats_augmentation
  687.           @actor.check_ability_skills_learning(1)
  688.           @mgc_adds_window.refresh
  689.         when 2
  690.           @actor.ability_level[2] += 1
  691.           @actor.abilitypoints_down
  692.           @actor.stats_augmentation
  693.           @actor.check_ability_skills_learning(2)
  694.           @agl_adds_window.refresh
  695.         when 3
  696.           @actor.ability_level[3] += 1
  697.           @actor.abilitypoints_down
  698.           @actor.stats_augmentation
  699.           @actor.check_ability_skills_learning(3)
  700.           @asi_adds_window.refresh
  701.         when 4
  702.           @actor.ability_level[4] += 1
  703.           @actor.abilitypoints_down
  704.           @actor.stats_augmentation
  705.           @actor.check_ability_skills_learning(4)
  706.           @ble_adds_window.refresh
  707.         end
  708.       Sound.play_cursor
  709.     end
  710.     refresh
  711.     @abilitystatus_window.refresh
  712.     @abilitymessage_window.visible = false
  713.     @addedstats_window.visible = false
  714.     @addedstats_window.refresh
  715.     @abilitychoices_window.deactivate
  716.     @abilitychoices_window.openness = 0
  717.     @command_window.activate
  718.   end
  719.  
  720.   #--------------------------------------------------------------------------
  721.   # * Return to category choice
  722.   #--------------------------------------------------------------------------  
  723.   def return_category
  724.     Sound.play_cancel
  725.     @abilitymessage_window.visible = false
  726.     @addedstats_window.visible = false
  727.     @addedstats_window.refresh
  728.     @abilitychoices_window.openness = 0
  729.     @abilitychoices_window.deactivate
  730.     @command_window.activate
  731.   end
  732.  
  733.   #--------------------------------------------------------------------------
  734.   # * Images creation
  735.   #--------------------------------------------------------------------------
  736.   def create_images    
  737.     @crystal_sprites = []    
  738.     5.times do |i|      
  739.     @crystal_sprites[i] = Sprite.new      
  740.     @crystal_sprites[i].x = 50+100*i      
  741.     @crystal_sprites[i].y = 130    
  742.   end    
  743.   # crystal order
  744.   # unskilled -> crystal , glowing crystal
  745.   # Column 0 -> red crystal, glowing red
  746.   # Column 1 -> blue crystal, glowing blue
  747.   # Column 2 -> yellow crystal, glowing yellow
  748.   # Column 3 -> Green crystal, glowing green
  749.   # Column 4 -> Orange crystal, glowing orange
  750.   # The order can be swapped around to your preference
  751.     @crystal_pictures = ["Crystal", "Glowing_Crystal", "Red_Crystal", "Glowing_Red_Crystal", "Blue_Crystal", "Glowing_Blue_Crystal",
  752.     "Yellow_Crystal", "Glowing_Yellow_Crystal", "Green_Crystal", "Glowing_Green_Crystal", "Orange_Crystal", "Glowing_Orange_Crystal"]
  753.     update  
  754.   end
  755.  
  756.   #--------------------------------------------------------------------------
  757.   # * Refresh
  758.   #--------------------------------------------------------------------------
  759.   def refresh
  760.     @command_window.index = 0
  761.     @command_window.refresh
  762.     @atk_adds_window.refresh
  763.     @mgc_adds_window.refresh
  764.     @agl_adds_window.refresh
  765.     @asi_adds_window.refresh
  766.     @ble_adds_window.refresh
  767.     @atk_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[0].to_s, 1)
  768.     @atk_adds_window.contents.draw_text(0, 30, 40, 14, "ATK")
  769.     @atk_adds_window.contents.draw_text(0, 42, 40, 14, "DEF")
  770.     @atk_adds_window.contents.draw_text(0, 54, 40, 14, "HP")
  771.     if @actor.ability_level[0].between?(0, 9)
  772.       @atk_adds_window.contents.draw_text(2, 30, 60, 14, "+ 2/3", 2) if @actor.ability_level[0] < @actor.ability_max_level
  773.       @atk_adds_window.contents.draw_text(2, 42, 60, 14, "+ 2/3", 2) if @actor.ability_level[0] < @actor.ability_max_level
  774.       @atk_adds_window.contents.draw_text(16, 54, 60, 14, "+ 20/35", 2) if @actor.ability_level[0] < @actor.ability_max_level
  775.     elsif @actor.ability_level[0].between?(10, 19)
  776.       @atk_adds_window.contents.draw_text(2, 30, 60, 14, "+ 3/4", 2) if @actor.ability_level[0] < @actor.ability_max_level
  777.       @atk_adds_window.contents.draw_text(2, 42, 60, 14, "+ 3/4", 2) if @actor.ability_level[0] < @actor.ability_max_level
  778.       @atk_adds_window.contents.draw_text(16, 54, 60, 14, "+ 40/50", 2) if @actor.ability_level[0] < @actor.ability_max_level
  779.     elsif @actor.ability_level[0].between?(20, 29)
  780.       @atk_adds_window.contents.draw_text(2, 30, 60, 14, "+ 5/6", 2) if @actor.ability_level[0] < @actor.ability_max_level
  781.       @atk_adds_window.contents.draw_text(2, 42, 60, 14, "+ 5/6", 2) if @actor.ability_level[0] < @actor.ability_max_level
  782.       @atk_adds_window.contents.draw_text(16, 54, 60, 14, "+ 60/70", 2) if @actor.ability_level[0] < @actor.ability_max_level
  783.     elsif @actor.ability_level[0].between?(30, 39)
  784.       @atk_adds_window.contents.draw_text(2, 30, 60, 14, "+ 7/9", 2) if @actor.ability_level[0] < @actor.ability_max_level
  785.       @atk_adds_window.contents.draw_text(2, 42, 60, 14, "+ 7/9", 2) if @actor.ability_level[0] < @actor.ability_max_level
  786.       @atk_adds_window.contents.draw_text(13, 54, 70, 14, "+ 80/100 ", 2) if @actor.ability_level[0] < @actor.ability_max_level
  787.     elsif @actor.ability_level[0].between?(40, 49)
  788.       @atk_adds_window.contents.draw_text(15, 30, 60, 14, "+ 10/14", 2) if @actor.ability_level[0] < @actor.ability_max_level
  789.       @atk_adds_window.contents.draw_text(15, 42, 60, 14, "+ 10/14", 2) if @actor.ability_level[0] < @actor.ability_max_level
  790.       @atk_adds_window.contents.draw_text(10, 54, 70, 14, "+ 100/120", 2) if @actor.ability_level[0] < @actor.ability_max_level
  791.     elsif @actor.ability_level[0].between?(50, 59)
  792.       @atk_adds_window.contents.draw_text(15, 30, 60, 14, "+ 15/20", 2) if @actor.ability_level[0] < @actor.ability_max_level
  793.       @atk_adds_window.contents.draw_text(15, 42, 60, 14, "+ 15/20", 2) if @actor.ability_level[0] < @actor.ability_max_level
  794.       @atk_adds_window.contents.draw_text(10, 54, 70, 14, "+ 120/150", 2) if @actor.ability_level[0] < @actor.ability_max_level
  795.     elsif @actor.ability_level[0] == 60
  796.     end
  797.     @mgc_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[1].to_s, 1)
  798.     @mgc_adds_window.contents.draw_text(0, 30, 40, 14, "MAT")
  799.     @mgc_adds_window.contents.draw_text(0, 42, 40, 14, "MDF")
  800.     @mgc_adds_window.contents.draw_text(0, 54, 40, 14, "MP")
  801.     if @actor.ability_level[1].between?(0, 9)
  802.       @mgc_adds_window.contents.draw_text(2, 30, 60, 14, "+ 2/3", 2) if @actor.ability_level[1] < @actor.ability_max_level
  803.       @mgc_adds_window.contents.draw_text(2, 42, 60, 14, "+ 2/3", 2) if @actor.ability_level[1] < @actor.ability_max_level
  804.       @mgc_adds_window.contents.draw_text(16, 54, 60, 14, "+ 10/15", 2) if @actor.ability_level[1] < @actor.ability_max_level
  805.     elsif @actor.ability_level[1].between?(10, 19)
  806.       @mgc_adds_window.contents.draw_text(2, 30, 60, 14, "+ 4/5", 2) if @actor.ability_level[1] < @actor.ability_max_level
  807.       @mgc_adds_window.contents.draw_text(2, 42, 60, 14, "+ 4/5", 2) if @actor.ability_level[1] < @actor.ability_max_level
  808.       @mgc_adds_window.contents.draw_text(16, 54, 60, 14, "+ 15/20", 2) if @actor.ability_level[1] < @actor.ability_max_level
  809.     elsif @actor.ability_level[1].between?(20, 29)
  810.       @mgc_adds_window.contents.draw_text(2, 30, 60, 14, "+ 6/7", 2) if @actor.ability_level[1] < @actor.ability_max_level
  811.       @mgc_adds_window.contents.draw_text(2, 42, 60, 14, "+ 6/7", 2) if @actor.ability_level[1] < @actor.ability_max_level
  812.       @mgc_adds_window.contents.draw_text(16, 54, 60, 14, "+ 20/30", 2) if @actor.ability_level[1] < @actor.ability_max_level
  813.     elsif @actor.ability_level[1].between?(30, 39)
  814.       @mgc_adds_window.contents.draw_text(9, 30, 60, 14, "+ 8/10", 2) if @actor.ability_level[1] < @actor.ability_max_level
  815.       @mgc_adds_window.contents.draw_text(9, 42, 60, 14, "+ 8/10", 2) if @actor.ability_level[1] < @actor.ability_max_level
  816.       @mgc_adds_window.contents.draw_text(16, 54, 60, 14, "+ 40/50", 2) if @actor.ability_level[1] < @actor.ability_max_level
  817.     elsif @actor.ability_level[1].between?(40, 49)
  818.       @mgc_adds_window.contents.draw_text(15, 30, 60, 14, "+ 10/15", 2) if @actor.ability_level[1] < @actor.ability_max_level
  819.       @mgc_adds_window.contents.draw_text(15, 42, 60, 14, "+ 10/15", 2) if @actor.ability_level[1] < @actor.ability_max_level
  820.       @mgc_adds_window.contents.draw_text(16, 54, 60, 14, "+ 60/70", 2) if @actor.ability_level[1] < @actor.ability_max_level
  821.     elsif @actor.ability_level[1].between?(50, 59)
  822.       @mgc_adds_window.contents.draw_text(15, 30, 60, 14, "+ 16/20", 2) if @actor.ability_level[1] < @actor.ability_max_level
  823.       @mgc_adds_window.contents.draw_text(15, 42, 60, 14, "+ 16/20", 2) if @actor.ability_level[1] < @actor.ability_max_level
  824.       @mgc_adds_window.contents.draw_text(16, 54, 60, 14, "+ 80/90", 2) if @actor.ability_level[1] < @actor.ability_max_level
  825.     elsif @actor.ability_level[1] == 60
  826.     end    
  827.     @agl_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[2].to_s, 1)
  828.     @agl_adds_window.contents.draw_text(0, 30, 40, 14, "AGI")
  829.     @agl_adds_window.contents.draw_text(0, 42, 40, 14, "LUK")
  830.     @agl_adds_window.contents.draw_text(0, 54, 40, 14, "MAT")    
  831.     @agl_adds_window.contents.draw_text(0, 66, 40, 14, "MDF")    
  832.     if @actor.ability_level[2].between?(0, 9)
  833.       @agl_adds_window.contents.draw_text(2, 30, 60, 14, "+ 2/3", 2) if @actor.ability_level[2] < @actor.ability_max_level
  834.       @agl_adds_window.contents.draw_text(2, 42, 60, 14, "+ 2/3", 2) if @actor.ability_level[2] < @actor.ability_max_level
  835.       @agl_adds_window.contents.draw_text(2, 54, 60, 14, "+ 1/2", 2) if @actor.ability_level[2] < @actor.ability_max_level
  836.       @agl_adds_window.contents.draw_text(2, 66, 60, 14, "+ 1/2", 2) if @actor.ability_level[2] < @actor.ability_max_level
  837.     elsif @actor.ability_level[2].between?(10, 19)
  838.       @agl_adds_window.contents.draw_text(2, 30, 60, 14, "+ 4/6", 2) if @actor.ability_level[2] < @actor.ability_max_level
  839.       @agl_adds_window.contents.draw_text(2, 42, 60, 14, "+ 4/6", 2) if @actor.ability_level[2] < @actor.ability_max_level
  840.       @agl_adds_window.contents.draw_text(2, 54, 60, 14, "+ 2/3", 2) if @actor.ability_level[2] < @actor.ability_max_level
  841.       @agl_adds_window.contents.draw_text(2, 66, 60, 14, "+ 2/3", 2) if @actor.ability_level[2] < @actor.ability_max_level
  842.     elsif @actor.ability_level[2].between?(20, 29)
  843.       @agl_adds_window.contents.draw_text(2, 30, 60, 14, "+ 7/9", 2) if @actor.ability_level[2] < @actor.ability_max_level
  844.       @agl_adds_window.contents.draw_text(2, 42, 60, 14, "+ 7/9", 2) if @actor.ability_level[2] < @actor.ability_max_level
  845.       @agl_adds_window.contents.draw_text(2, 54, 60, 14, "+ 4/6", 2) if @actor.ability_level[2] < @actor.ability_max_level
  846.       @agl_adds_window.contents.draw_text(2, 66, 60, 14, "+ 4/6", 2) if @actor.ability_level[2] < @actor.ability_max_level
  847.     elsif @actor.ability_level[2].between?(30, 39)
  848.       @agl_adds_window.contents.draw_text(15, 30, 60, 14, "+ 10/12", 2) if @actor.ability_level[2] < @actor.ability_max_level
  849.       @agl_adds_window.contents.draw_text(15, 42, 60, 14, "+ 10/12", 2) if @actor.ability_level[2] < @actor.ability_max_level
  850.       @agl_adds_window.contents.draw_text(2, 54, 60, 14, "+ 7/9", 2) if @actor.ability_level[2] < @actor.ability_max_level
  851.       @agl_adds_window.contents.draw_text(2, 66, 60, 14, "+ 7/9", 2) if @actor.ability_level[2] < @actor.ability_max_level
  852.     elsif @actor.ability_level[2].between?(40, 49)
  853.       @agl_adds_window.contents.draw_text(15, 30, 60, 14, "+ 14/16", 2) if @actor.ability_level[2] < @actor.ability_max_level
  854.       @agl_adds_window.contents.draw_text(15, 42, 60, 14, "+ 14/16", 2) if @actor.ability_level[2] < @actor.ability_max_level
  855.       @agl_adds_window.contents.draw_text(15, 54, 60, 14, "+ 10/12", 2) if @actor.ability_level[2] < @actor.ability_max_level
  856.       @agl_adds_window.contents.draw_text(15, 66, 60, 14, "+ 10/12", 2) if @actor.ability_level[2] < @actor.ability_max_level
  857.     elsif @actor.ability_level[2].between?(50, 59)
  858.       @agl_adds_window.contents.draw_text(15, 30, 60, 14, "+ 18/20", 2) if @actor.ability_level[2] < @actor.ability_max_level
  859.       @agl_adds_window.contents.draw_text(15, 42, 60, 14, "+ 18/20", 2) if @actor.ability_level[2] < @actor.ability_max_level
  860.       @agl_adds_window.contents.draw_text(15, 54, 60, 14, "+ 14/15", 2) if @actor.ability_level[2] < @actor.ability_max_level
  861.       @agl_adds_window.contents.draw_text(15, 66, 60, 14, "+ 14/15", 2) if @actor.ability_level[2] < @actor.ability_max_level
  862.     elsif @actor.ability_level[2] == 60
  863.     end    
  864.     @asi_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[3].to_s, 1)
  865.     @asi_adds_window.contents.draw_text(0, 30, 40, 14, "ATK")
  866.     @asi_adds_window.contents.draw_text(0, 42, 40, 14, "MAT")
  867.     @asi_adds_window.contents.draw_text(0, 54, 40, 14, "HP")
  868.     @asi_adds_window.contents.draw_text(0, 66, 40, 14, "MP")
  869.     if @actor.ability_level[3].between?(0, 9)
  870.       @asi_adds_window.contents.draw_text(2, 30, 60, 14, "+ 2/3", 2) if @actor.ability_level[3] < @actor.ability_max_level
  871.       @asi_adds_window.contents.draw_text(2, 42, 60, 14, "+ 2/3", 2) if @actor.ability_level[3] < @actor.ability_max_level
  872.       @asi_adds_window.contents.draw_text(16, 54, 60, 14, "+ 15/25", 2) if @actor.ability_level[3] < @actor.ability_max_level
  873.       @asi_adds_window.contents.draw_text(10, 66, 60, 14, "+ 5/10", 2) if @actor.ability_level[3] < @actor.ability_max_level
  874.     elsif @actor.ability_level[3].between?(10, 19)
  875.       @asi_adds_window.contents.draw_text(2, 30, 60, 14, "+ 4/6", 2) if @actor.ability_level[3] < @actor.ability_max_level
  876.       @asi_adds_window.contents.draw_text(2, 42, 60, 14, "+ 4/6", 2) if @actor.ability_level[3] < @actor.ability_max_level
  877.       @asi_adds_window.contents.draw_text(16, 54, 60, 14, "+ 25/35", 2) if @actor.ability_level[3] < @actor.ability_max_level
  878.       @asi_adds_window.contents.draw_text(16, 66, 60, 14, "+ 10/15", 2) if @actor.ability_level[3] < @actor.ability_max_level
  879.     elsif @actor.ability_level[3].between?(20, 29)
  880.       @asi_adds_window.contents.draw_text(2, 30, 60, 14, "+ 7/9", 2) if @actor.ability_level[3] < @actor.ability_max_level
  881.       @asi_adds_window.contents.draw_text(2, 42, 60, 14, "+ 7/9", 2) if @actor.ability_level[3] < @actor.ability_max_level
  882.       @asi_adds_window.contents.draw_text(16, 54, 60, 14, "+ 40/50", 2) if @actor.ability_level[3] < @actor.ability_max_level
  883.       @asi_adds_window.contents.draw_text(16, 66, 60, 14, "+ 20/25", 2) if @actor.ability_level[3] < @actor.ability_max_level
  884.     elsif @actor.ability_level[3].between?(30, 39)
  885.       @asi_adds_window.contents.draw_text(15, 30, 60, 14, "+ 10/12", 2) if @actor.ability_level[3] < @actor.ability_max_level
  886.       @asi_adds_window.contents.draw_text(15, 42, 60, 14, "+ 10/12", 2) if @actor.ability_level[3] < @actor.ability_max_level
  887.       @asi_adds_window.contents.draw_text(16, 54, 60, 14, "+ 50/75", 2) if @actor.ability_level[3] < @actor.ability_max_level
  888.       @asi_adds_window.contents.draw_text(16, 66, 60, 14, "+ 30/35", 2) if @actor.ability_level[3] < @actor.ability_max_level
  889.     elsif @actor.ability_level[3].between?(40, 49)
  890.       @asi_adds_window.contents.draw_text(15, 30, 60, 14, "+ 15/17", 2) if @actor.ability_level[3] < @actor.ability_max_level
  891.       @asi_adds_window.contents.draw_text(15, 42, 60, 14, "+ 15/17", 2) if @actor.ability_level[3] < @actor.ability_max_level
  892.       @asi_adds_window.contents.draw_text(16, 54, 60, 14, "+ 80/85", 2) if @actor.ability_level[3] < @actor.ability_max_level
  893.       @asi_adds_window.contents.draw_text(16, 66, 60, 14, "+ 35/40", 2) if @actor.ability_level[3] < @actor.ability_max_level
  894.     elsif @actor.ability_level[3].between?(50, 59)
  895.       @asi_adds_window.contents.draw_text(15, 30, 60, 14, "+ 18/20", 2) if @actor.ability_level[3] < @actor.ability_max_level
  896.       @asi_adds_window.contents.draw_text(15, 42, 60, 14, "+ 18/20", 2) if @actor.ability_level[3] < @actor.ability_max_level
  897.       @asi_adds_window.contents.draw_text(16, 54, 60, 14, "+ 90/95", 2) if @actor.ability_level[3] < @actor.ability_max_level
  898.       @asi_adds_window.contents.draw_text(16, 66, 60, 14, "+ 40/50", 2) if @actor.ability_level[3] < @actor.ability_max_level
  899.     elsif @actor.ability_level[3] == 60
  900.     end    
  901.     @ble_adds_window.contents.draw_text(30, 0, 40, 20, @actor.ability_level[4].to_s, 1)
  902.     @ble_adds_window.contents.draw_text(0, 30, 40, 14, "DEF")
  903.     @ble_adds_window.contents.draw_text(0, 42, 40, 14, "MDF")
  904.     @ble_adds_window.contents.draw_text(0, 54, 40, 14, "AGI")
  905.     @ble_adds_window.contents.draw_text(0, 66, 40, 14, "LUK")
  906.     if @actor.ability_level[4].between?(0, 9)
  907.       @ble_adds_window.contents.draw_text(2, 30, 60, 14, "+ 2/4", 2) if @actor.ability_level[4] < @actor.ability_max_level
  908.       @ble_adds_window.contents.draw_text(2, 42, 60, 14, "+ 2/4", 2) if @actor.ability_level[4] < @actor.ability_max_level
  909.       @ble_adds_window.contents.draw_text(2, 54, 60, 14, "+ 2/3", 2) if @actor.ability_level[4] < @actor.ability_max_level
  910.       @ble_adds_window.contents.draw_text(2, 66, 60, 14, "+ 2/3", 2) if @actor.ability_level[4] < @actor.ability_max_level
  911.     elsif @actor.ability_level[4].between?(10, 19)
  912.       @ble_adds_window.contents.draw_text(2, 30, 60, 14, "+ 4/6", 2) if @actor.ability_level[4] < @actor.ability_max_level
  913.       @ble_adds_window.contents.draw_text(2, 42, 60, 14, "+ 4/6", 2) if @actor.ability_level[4] < @actor.ability_max_level
  914.       @ble_adds_window.contents.draw_text(2, 54, 60, 14, "+ 4/5", 2) if @actor.ability_level[4] < @actor.ability_max_level
  915.       @ble_adds_window.contents.draw_text(2, 66, 60, 14, "+ 4/5", 2) if @actor.ability_level[4] < @actor.ability_max_level
  916.     elsif @actor.ability_level[4].between?(20, 29)
  917.       @ble_adds_window.contents.draw_text(2, 30, 60, 14, "+ 7/9", 2) if @actor.ability_level[4] < @actor.ability_max_level
  918.       @ble_adds_window.contents.draw_text(2, 42, 60, 14, "+ 7/9", 2) if @actor.ability_level[4] < @actor.ability_max_level
  919.       @ble_adds_window.contents.draw_text(2, 54, 60, 14, "+ 6/8", 2) if @actor.ability_level[4] < @actor.ability_max_level
  920.       @ble_adds_window.contents.draw_text(2, 66, 60, 14, "+ 6/8", 2) if @actor.ability_level[4] < @actor.ability_max_level
  921.     elsif @actor.ability_level[4].between?(30, 39)
  922.       @ble_adds_window.contents.draw_text(15, 30, 60, 14, "+ 10/12", 2) if @actor.ability_level[4] < @actor.ability_max_level
  923.       @ble_adds_window.contents.draw_text(15, 42, 60, 14, "+ 10/12", 2) if @actor.ability_level[4] < @actor.ability_max_level
  924.       @ble_adds_window.contents.draw_text(7, 54, 60, 14, "+ 8/10", 2) if @actor.ability_level[4] < @actor.ability_max_level
  925.       @ble_adds_window.contents.draw_text(7, 66, 60, 14, "+ 8/10", 2) if @actor.ability_level[4] < @actor.ability_max_level
  926.     elsif @actor.ability_level[4].between?(40, 49)
  927.       @ble_adds_window.contents.draw_text(15, 30, 60, 14, "+ 12/14", 2) if @actor.ability_level[4] < @actor.ability_max_level
  928.       @ble_adds_window.contents.draw_text(15, 42, 60, 14, "+ 12/14", 2) if @actor.ability_level[4] < @actor.ability_max_level
  929.       @ble_adds_window.contents.draw_text(15, 54, 60, 14, "+ 10/12", 2) if @actor.ability_level[4] < @actor.ability_max_level
  930.       @ble_adds_window.contents.draw_text(15, 66, 60, 14, "+ 10/12", 2) if @actor.ability_level[4] < @actor.ability_max_level
  931.     elsif @actor.ability_level[4].between?(50, 59)
  932.       @ble_adds_window.contents.draw_text(15, 30, 60, 14, "+ 15/18", 2) if @actor.ability_level[4] < @actor.ability_max_level
  933.       @ble_adds_window.contents.draw_text(15, 42, 60, 14, "+ 15/18", 2) if @actor.ability_level[4] < @actor.ability_max_level
  934.       @ble_adds_window.contents.draw_text(15, 54, 60, 14, "+ 12/14", 2) if @actor.ability_level[4] < @actor.ability_max_level
  935.       @ble_adds_window.contents.draw_text(15, 66, 60, 14, "+ 12/14", 2) if @actor.ability_level[4] < @actor.ability_max_level
  936.     elsif @actor.ability_level[4] == 60
  937.     end    
  938.   end
  939. end
  940.  
  941. #===============================================================================
  942. #   ** Window_AbilityStatus
  943. #-------------------------------------------------------------------------------
  944. #   This class perform the status window for the Ability system
  945. #===============================================================================
  946.  
  947. class Window_AbilityStatus < Window_Base
  948.   #--------------------------------------------------------------------------
  949.   # * Object Initialization
  950.   #--------------------------------------------------------------------------  
  951.   def initialize
  952.     super(22, 6, 500, 120)
  953.     self.contents.font.size = 16
  954.     @actor = nil
  955.     @temp_actor = nil
  956.     refresh
  957.   end
  958.    
  959.   #--------------------------------------------------------------------------
  960.   # * Get Number of Lines to Show
  961.   #--------------------------------------------------------------------------
  962.   def visible_line_number
  963.     return 4
  964.   end
  965.  
  966.   #--------------------------------------------------------------------------
  967.   # * Set Actor
  968.   #--------------------------------------------------------------------------
  969.   def actor=(actor)
  970.     return if @actor == actor
  971.     @actor = actor
  972.     refresh
  973.   end
  974.  
  975.   #--------------------------------------------------------------------------
  976.   # * Refresh
  977.   #--------------------------------------------------------------------------
  978.   def refresh
  979.     contents.clear
  980.     draw_actor_face(@actor, 0, 0) if @actor
  981.     draw_actor_name(@actor, 104, 0) if @actor
  982.     draw_actor_hp(@actor, 104, 20, width = 60) if @actor
  983.     draw_actor_mp(@actor, 212, 20, width = 60) if @actor
  984.     draw_item(100, 38, 0)
  985.     draw_ability_points(@actor, 0, 0) if @actor
  986.     draw_actor_accessory(@actor, 0, 0) if @actor
  987.   end
  988.  
  989.   #--------------------------------------------------------------------------
  990.   # * Set Temporary Actor After Equipment Change
  991.   #--------------------------------------------------------------------------
  992.   def set_temp_actor(temp_actor)
  993.     return if @temp_actor == temp_actor
  994.     @temp_actor = temp_actor
  995.     refresh
  996.   end
  997.  
  998.   #--------------------------------------------------------------------------
  999.   # * Draw Max Value in Fractional Format
  1000.   #     max     : Maximum value
  1001.   #     color1  : Color of maximum value
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_max_values(x, y, width, max, color1)
  1004.     xr = x + width
  1005.     if width < 96
  1006.       draw_text(xr - 40, y, 42, line_height, max, 2)
  1007.     else
  1008.       draw_text(xr - 42, y, 42, line_height, max, 2)
  1009.     end
  1010.   end
  1011.  
  1012.   #--------------------------------------------------------------------------
  1013.   # * Draw HP
  1014.   #--------------------------------------------------------------------------
  1015.   def draw_actor_hp(actor, x, y, width = 124)
  1016.     contents.font.size = 17
  1017.     draw_text(x, y, 30, line_height, Vocab::hp_a)
  1018.     draw_max_values(x + 12, y, width, actor.mhp, normal_color)
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # * Draw MP
  1022.   #--------------------------------------------------------------------------
  1023.   def draw_actor_mp(actor, x, y, width = 124)
  1024.     contents.font.size = 17
  1025.     draw_text(x, y, 30, line_height, Vocab::mp_a)
  1026.     draw_max_values(x + 22, y, width, actor.mmp, normal_color)
  1027.   end
  1028.  
  1029.   #--------------------------------------------------------------------------
  1030.   # * Draw Item
  1031.   #--------------------------------------------------------------------------
  1032.   def draw_item(x, y, param_id)
  1033.     draw_param_name(x + 4, y, 2)
  1034.     draw_current_param(x + 46, y, 2) if @actor
  1035.     draw_param_name(x + 4, y + 18, 3)
  1036.     draw_current_param(x + 46, y + 18, 3) if @actor
  1037.     draw_param_name(x + 4, y + 36, 6)
  1038.     draw_current_param(x + 46, y + 36, 6) if @actor
  1039.     draw_param_name(x + 112, y, 4)
  1040.     draw_current_param(x + 164, y, 4) if @actor
  1041.     draw_param_name(x + 112, y + 18, 5)
  1042.     draw_current_param(x + 164, y + 18, 5) if @actor
  1043.     draw_param_name(x + 112, y + 36, 7)
  1044.     draw_current_param(x + 164, y + 36, 7) if @actor
  1045.   end
  1046.  
  1047.   #--------------------------------------------------------------------------
  1048.   # * Draw Parameter Name
  1049.   #--------------------------------------------------------------------------
  1050.   def draw_param_name(x, y, param_id)
  1051.     contents.font.size = 17
  1052.     change_color(normal_color)
  1053.     draw_text(x, y, 80, line_height, Vocab::param(param_id))
  1054.   end
  1055.   #--------------------------------------------------------------------------
  1056.   # * Draw Current Parameter
  1057.   #--------------------------------------------------------------------------
  1058.   def draw_current_param(x, y, param_id)
  1059.     contents.font.size = 17
  1060.     change_color(normal_color)
  1061.     draw_text(x, y, 32, line_height, @actor.param(param_id), 2)
  1062.   end
  1063.    
  1064.   #--------------------------------------------------------------------------
  1065.   # * Draw actor ability points
  1066.   #--------------------------------------------------------------------------
  1067.   def draw_ability_points(actor, x, y)
  1068.     contents.font.size = 20
  1069.     draw_text(330, 4, 160, 20, "Ability Points:")
  1070.     draw_text(360, 24, 40, 20, actor.ability_points.to_s, 1)
  1071.   end
  1072.  
  1073.   #--------------------------------------------------------------------------
  1074.   # * Draw actor accessory
  1075.   #--------------------------------------------------------------------------
  1076.   def draw_actor_accessory(actor, x, y)
  1077.     contents.font.size = 20
  1078.     if R2_Ability_Options::Show_All_Equip == true
  1079.       draw_text(330, 50, 160, line_height, "Equipment:")
  1080.       draw_icon(actor.equips[0].icon_index, 320, 72) if !actor.equips[0].nil?
  1081.       draw_icon(actor.equips[1].icon_index, 350, 72) if !actor.equips[1].nil?
  1082.       draw_icon(actor.equips[2].icon_index, 380, 72) if !actor.equips[2].nil?
  1083.       draw_icon(actor.equips[3].icon_index, 410, 72) if !actor.equips[3].nil?
  1084.       draw_icon(actor.equips[4].icon_index, 440, 72) if !actor.equips[4].nil?
  1085.     else
  1086.       draw_text(320, 50, 160, line_height, "Equipped Accessory:")
  1087.       draw_item_name(actor.equips[4], 340, 72)
  1088.     end
  1089.   end
  1090.  
  1091.   #--------------------------------------------------------------------------
  1092.   # * Draw Item Name
  1093.   #     enabled : Enabled flag. When false, draw semi-transparently.
  1094.   #--------------------------------------------------------------------------
  1095.   def draw_item_name(item, x, y, enabled = true, width = 172)
  1096.     return unless item
  1097.     contents.font.size = 17
  1098.     change_color(normal_color, enabled)
  1099.     draw_text(x, y, width, line_height, item.name)
  1100.   end
  1101. end
  1102.  
  1103. #===============================================================================
  1104. #   ** Window_AbilityCategory
  1105. #-------------------------------------------------------------------------------
  1106. #   This class handle the category_name for the Ability system
  1107. #===============================================================================
  1108.  
  1109. class Window_AbilityCategory < Window_Base
  1110.   #--------------------------------------------------------------------------
  1111.   # * Object Initialization
  1112.   #--------------------------------------------------------------------------
  1113.   def initialize
  1114.     super(0, 240, 60, 40)
  1115.     self.contents.font.size = 19
  1116.   end
  1117. end
  1118.  
  1119. #===============================================================================
  1120. #   ** Window_AbilityAdds
  1121. #-------------------------------------------------------------------------------
  1122. #   This class handle the lvl, stats & skill added by the Ability system
  1123. #===============================================================================
  1124.  
  1125. class Window_AbilityAdds < Window_Base
  1126.   #--------------------------------------------------------------------------
  1127.   # * Object Initialization
  1128.   #--------------------------------------------------------------------------
  1129.   def initialize(x, y)
  1130.     super(x, y, 102, 125)
  1131.     self.contents.font.size = 17
  1132.     @actor = nil
  1133.     @temp_actor = nil
  1134.     refresh
  1135.   end
  1136.  
  1137.   #--------------------------------------------------------------------------
  1138.   # * Set Actor
  1139.   #--------------------------------------------------------------------------
  1140.   def actor=(actor)
  1141.     return if @actor == actor
  1142.     @actor = actor
  1143.     refresh
  1144.   end
  1145.  
  1146.   #--------------------------------------------------------------------------
  1147.   # * Refresh
  1148.   #--------------------------------------------------------------------------
  1149.   def refresh
  1150.     self.contents.clear
  1151.     self.contents.draw_text(5, 0, 100, 20, "Level")
  1152.     self.contents.draw_text(4, 14, 100, 20, "Next Level:")
  1153.     self.contents.draw_text(60, 85, 100, 20, "↓")
  1154.   end
  1155.  
  1156.   #--------------------------------------------------------------------------
  1157.   # * Set Temporary Actor After Equipment Change
  1158.   #--------------------------------------------------------------------------
  1159.   def set_temp_actor(temp_actor)
  1160.     return if @temp_actor == temp_actor
  1161.     @temp_actor = temp_actor
  1162.     refresh
  1163.   end
  1164. end
  1165.  
  1166. #==============================================================================
  1167. # ** Window_Ability_Command
  1168. #------------------------------------------------------------------------------
  1169. #  This class perform the Command Window for the Ability System
  1170. #==============================================================================
  1171.  
  1172. class Window_Ability_Command < Window_Command
  1173.   #--------------------------------------------------------------------------
  1174.   # * Object Initialization
  1175.   #--------------------------------------------------------------------------
  1176.   def initialize
  1177.     super(115, 295)
  1178.     self.contents.font.size = 20
  1179.     self.opacity = 0
  1180.     self.back_opacity = 0
  1181.     cursor_rect.empty
  1182.     refresh
  1183.   end
  1184.    
  1185.   #--------------------------------------------------------------------------
  1186.   # * Get Window Width
  1187.   #--------------------------------------------------------------------------
  1188.   def window_width
  1189.     return 150
  1190.   end
  1191.  
  1192.   #--------------------------------------------------------------------------
  1193.   # * Processing When OK Button Is Pressed
  1194.   #--------------------------------------------------------------------------
  1195.   def process_ok
  1196.   end
  1197.  
  1198.   #--------------------------------------------------------------------------
  1199.   # * Processing When Cancel Button Is Pressed
  1200.   #--------------------------------------------------------------------------
  1201.   def process_cancel
  1202.     Sound.play_cancel
  1203.     Input.update
  1204.     deactivate
  1205.     call_cancel_handler
  1206.     cursor_rect.empty
  1207.   end
  1208.  
  1209.   #--------------------------------------------------------------------------
  1210.   # * Refresh
  1211.   #--------------------------------------------------------------------------
  1212.   def refresh
  1213.     clear_command_list
  1214.     make_command_list
  1215.     cursor_rect.empty
  1216.     self.arrows_visible = false
  1217.     super
  1218.   end
  1219. end
  1220.  
  1221. #==============================================================================
  1222. # ** Window_Ability_Confirmation
  1223. #------------------------------------------------------------------------------
  1224. #  This class perform the Confirmation Window for the Ability System
  1225. #==============================================================================
  1226.  
  1227. class Window_Ability_Confirmation < Window_Base
  1228.  
  1229.   #--------------------------------------------------------------------------
  1230.   # * Object Initialization
  1231.   #--------------------------------------------------------------------------
  1232.   def initialize
  1233.     super(118,126,300,120)
  1234.     self.contents.font.size = 23
  1235.     self.z = 500
  1236.     refresh
  1237.   end
  1238.  
  1239.   #--------------------------------------------------------------------------
  1240.   # * Refresh
  1241.   #--------------------------------------------------------------------------
  1242.   def refresh
  1243.     draw_text(28, 28, 230, 24, R2_Ability_Options::Confirm_Text)
  1244.   end
  1245. end
  1246.  
  1247. #==============================================================================
  1248. # ** Window_Ability_ChoiceList
  1249. #------------------------------------------------------------------------------
  1250. #  This window is used for showing choices on Ability Confirmation Window
  1251. #==============================================================================
  1252.  
  1253. class Window_Ability_ChoiceList < Window_Command
  1254.   #--------------------------------------------------------------------------
  1255.   # * Object Initialization
  1256.   #--------------------------------------------------------------------------
  1257.   def initialize
  1258.     super(196, 190)
  1259.     self.opacity = 0
  1260.     self.back_opacity = 0
  1261.     self.z = 501
  1262.     self.openness = 0
  1263.     deactivate
  1264.   end
  1265.   #--------------------------------------------------------------------------
  1266.   # * Start Input Processing
  1267.   #--------------------------------------------------------------------------
  1268.   def start
  1269.     update_placement
  1270.     refresh
  1271.     select(0)
  1272.     open
  1273.     activate
  1274.   end
  1275.  
  1276.   #--------------------------------------------------------------------------
  1277.   # * Get Digit Count
  1278.   #--------------------------------------------------------------------------
  1279.   def col_max
  1280.     return 2
  1281.   end
  1282.   #--------------------------------------------------------------------------
  1283.   # * Update Window Position
  1284.   #--------------------------------------------------------------------------
  1285.   def update_placement
  1286.     self.width = 160
  1287.     self.height = 80
  1288.   end
  1289.  
  1290.   #--------------------------------------------------------------------------
  1291.   # * Get Maximum Width of Choices
  1292.   #--------------------------------------------------------------------------
  1293.   def max_choice_width
  1294.     $game_message.choices.collect {|s| text_size(s).width }.max
  1295.   end
  1296.  
  1297.   #--------------------------------------------------------------------------
  1298.   # * Create Command List
  1299.   #--------------------------------------------------------------------------
  1300.   def make_command_list
  1301.     add_command("Yes", :yes)
  1302.     add_command("No",  :no)
  1303.   end
  1304.  
  1305.   #--------------------------------------------------------------------------
  1306.   # * Processing When OK Button Is Pressed
  1307.   #--------------------------------------------------------------------------
  1308.   def process_ok
  1309.     if current_item_enabled?
  1310.       Input.update
  1311.       deactivate
  1312.       call_ok_handler
  1313.     else
  1314.       Sound.play_buzzer
  1315.     end
  1316.   end
  1317. end
  1318.  
  1319. #===============================================================================
  1320. #   ** Window_AbilityAddedStats
  1321. #-------------------------------------------------------------------------------
  1322. #   This class perform the window for the Added Stats of the Ability system
  1323. #===============================================================================
  1324.  
  1325. class Window_Ability_AddedStats < Window_Base
  1326.   #--------------------------------------------------------------------------
  1327.   # * Object Initialization
  1328.   #--------------------------------------------------------------------------  
  1329.   def initialize
  1330.     super(22, 6, 500, 120)
  1331.     self.contents.font.size = 17
  1332.     self.opacity = 0
  1333.     self.back_opacity = 0
  1334.     @actor = nil
  1335.     @temp_actor = nil
  1336.     refresh
  1337.   end
  1338.    
  1339.   #--------------------------------------------------------------------------
  1340.   # * Get Number of Lines to Show
  1341.   #--------------------------------------------------------------------------
  1342.   def visible_line_number
  1343.     return 5
  1344.   end
  1345.  
  1346.   #--------------------------------------------------------------------------
  1347.   # * Set Actor
  1348.   #--------------------------------------------------------------------------
  1349.   def actor=(actor)
  1350.     return if @actor == actor
  1351.     @actor = actor
  1352.     refresh
  1353.   end
  1354.  
  1355.   #--------------------------------------------------------------------------
  1356.   # * Refresh
  1357.   #--------------------------------------------------------------------------
  1358.   def refresh
  1359.     contents.clear
  1360.     draw_added_stats(@actor, 180, 20) if @actor
  1361.   end
  1362.  
  1363.   #--------------------------------------------------------------------------
  1364.   # * Set Temporary Actor After Equipment Change
  1365.   #--------------------------------------------------------------------------
  1366.   def set_temp_actor(temp_actor)
  1367.     return if @temp_actor == temp_actor
  1368.     @temp_actor = temp_actor
  1369.     refresh
  1370.   end
  1371.  
  1372.   #--------------------------------------------------------------------------
  1373.   # * Draw Plus
  1374.   #--------------------------------------------------------------------------
  1375.   def draw_plus(x, y)
  1376.     draw_text(x, y, 22, line_height, "↑", 1)
  1377.   end
  1378.  
  1379.   #--------------------------------------------------------------------------
  1380.   # * Draw Added Stats
  1381.   #--------------------------------------------------------------------------
  1382.   def draw_added_stats(actor, x, y)
  1383.     # 172 -> left column
  1384.     # 290 -> right column
  1385.     case $game_temp.ability_index
  1386.     when 0
  1387.       change_color(hp_gauge_color1)
  1388.       3.times do |i|
  1389.         draw_plus(172, 20 + 18 * i)
  1390.       end
  1391.     when 1
  1392.       change_color(system_color)
  1393.       3.times do |i|
  1394.         draw_plus(290, 20 + 18 * i)
  1395.       end
  1396.     when 2
  1397.       change_color(tp_cost_color)
  1398.       3.times do |i|
  1399.         draw_plus(290, 38 + 18 * i)
  1400.       end
  1401.       draw_plus(172, 74)
  1402.     when 3
  1403.       change_color(power_up_color)
  1404.       2.times do |i|
  1405.         draw_plus(290, 20 + 18 * i)
  1406.       end
  1407.       2.times do |i|
  1408.         draw_plus(172, 20 + 18 * i)
  1409.       end
  1410.     when 4
  1411.       change_color(crisis_color)
  1412.       2.times do |i|
  1413.         draw_plus(290, 54 + 18 * i)
  1414.       end
  1415.       2.times do |i|
  1416.         draw_plus(172, 54 + 18 * i)
  1417.       end
  1418.     end
  1419.     if R2_Ability_Options::Show_Numbers == true
  1420.       case $game_temp.ability_index
  1421.       when 0
  1422.         change_color(hp_gauge_color1)
  1423.         draw_text(x, y, 30, line_height, actor.augmentation[0].to_s, 1)
  1424.         draw_text(x, y + 18, 30, line_height, actor.augmentation[2].to_s, 1)
  1425.         draw_text(x, y + 36, 30, line_height, actor.augmentation[3].to_s, 1)
  1426.       when 1
  1427.         change_color(system_color)
  1428.         draw_text(x + 118, y + 18, 30, line_height, actor.augmentation[4].to_s, 1)
  1429.         draw_text(x + 118, y + 36, 30, line_height, actor.augmentation[5].to_s, 1)
  1430.         draw_text(x + 118, y, 30, line_height, actor.augmentation[1].to_s, 1)
  1431.       when 2
  1432.         change_color(tp_cost_color)
  1433.         draw_text(x, y + 54, 30, line_height, actor.augmentation[6].to_s, 1)
  1434.         draw_text(x + 118, y + 54, 30, line_height, actor.augmentation[7].to_s, 1)
  1435.         draw_text(x + 118, y + 18, 30, line_height, actor.augmentation[4].to_s, 1)
  1436.         draw_text(x + 118, y + 36, 30, line_height, actor.augmentation[5].to_s, 1)
  1437.       when 3
  1438.         change_color(power_up_color)
  1439.         draw_text(x, y + 18, 30, line_height, actor.augmentation[2].to_s, 1)
  1440.         draw_text(x + 118, y + 18, 30, line_height, actor.augmentation[4].to_s, 1)
  1441.         draw_text(x, y, 30, line_height, actor.augmentation[0].to_s, 1)
  1442.         draw_text(x + 118, y, 30, line_height, actor.augmentation[1].to_s, 1)
  1443.       when 4
  1444.         change_color(crisis_color)
  1445.         draw_text(x, y + 36, 30, line_height, actor.augmentation[3].to_s, 1)
  1446.         draw_text(x + 118, y + 36, 30, line_height, actor.augmentation[5].to_s, 1)
  1447.         draw_text(x, y + 54, 30, line_height, actor.augmentation[6].to_s, 1)
  1448.         draw_text(x + 118, y + 54, 30, line_height, actor.augmentation[7].to_s, 1)
  1449.       end
  1450.     end
  1451.   end
  1452. end
  1453.  
  1454. #==============================================================================
  1455. # ** Window_AbilitySkillList
  1456. #------------------------------------------------------------------------------
  1457. #  This window is for displaying a list of available skills on the skill window.
  1458. #==============================================================================
  1459.  
  1460. class Window_AbilitySkillList < Window_Selectable
  1461.   #--------------------------------------------------------------------------
  1462.   # * Object Initialization
  1463.   #--------------------------------------------------------------------------
  1464.   def initialize(x, y, index)
  1465.     super(x, y, 100, 125)
  1466.     self.contents.font.size = 12
  1467.     @actor = nil
  1468.     @temp_actor = nil
  1469.     @index = index
  1470.     refresh
  1471.   end
  1472.  
  1473.   #--------------------------------------------------------------------------
  1474.   # * Get Number of Lines to Show
  1475.   #--------------------------------------------------------------------------
  1476.   def visible_line_number
  1477.     return 5
  1478.   end
  1479.  
  1480.   #--------------------------------------------------------------------------
  1481.   # * Set Actor
  1482.   #--------------------------------------------------------------------------
  1483.   def actor=(actor)
  1484.     return if @actor == actor
  1485.     @actor = actor
  1486.     refresh
  1487.   end
  1488.  
  1489.   #--------------------------------------------------------------------------
  1490.   # * Refresh
  1491.   #--------------------------------------------------------------------------
  1492.   def refresh
  1493.     self.contents.clear
  1494.     return unless @actor
  1495.     for i in 0...@actor.ability_new_skills_id[@index].size
  1496.       if @actor.ability_level[@index] >= @actor.ability_new_skills_level[@index][i]
  1497.         text = $data_skills[@actor.ability_new_skills_id[@index][i]].name
  1498.         self.contents.draw_text(2, 20 + i * 18, 92, 20, text)
  1499.       end
  1500.     end
  1501.     self.contents.font.size = 18
  1502.     self.contents.draw_text(4, 4, 100, 20, "Skills:")
  1503.     self.contents.draw_text(60, 0, 100, 20, "↑")
  1504.     self.contents.font.size = 12
  1505.   end
  1506.   #--------------------------------------------------------------------------
  1507.   # * Set Temporary Actor After Equipment Change
  1508.   #--------------------------------------------------------------------------
  1509.   def set_temp_actor(temp_actor)
  1510.     return if @temp_actor == temp_actor
  1511.     @temp_actor = temp_actor
  1512.     refresh
  1513.   end
  1514. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement