CrowMakerVX

SkillMaker1.0

Jul 25th, 2014
539
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 73.37 KB | None | 0 0
  1. ################################################################################
  2. #                             SKILL MAKER
  3. #                             By: Ixfuru
  4. ################################################################################
  5. # This script creates a scene by which a player can create a new skill at
  6. # game time.  All the options available when creating a skill from the database
  7. # is also at the disposal of the player in this new scene, including animation_id,
  8. # icon, damage, mp_cost, elements and states, etc.
  9. #
  10. # To call the scene in a game, just go to the third page of the event commands
  11. # and enter the following into a 'script' call:
  12. #
  13. #                 $scene = Scene_SkillMaker.new
  14. #
  15. ################################################################################
  16. # There are many some settings which can be altered in the module below, just
  17. # follow the directions for each part and you shouldn't have any trouble with it.
  18. ################################################################################
  19. #
  20. # If you use this script, you must credit Ixfuru.  Also, the script is available
  21. # for non-commercial projects, but for commercial types, please contact Ixfuru
  22. # on any of the following sites:
  23. #
  24. #           www.rpgmakervx.net
  25. #           www.rmrk.net
  26. #           www.rpgmakerweb.com
  27. #           www.rpgmaker.net
  28. #
  29. # The script is licensed under Creative Commons
  30. ################################################################################
  31. module Ixfuru
  32.   module SkillMaker
  33.    
  34.     #===========================================================================
  35.     #
  36.     # SECTION 1
  37.     #
  38.     # Property Costs
  39.     #
  40.     # During the scene, the skill being created will be given a price.  This price
  41.     # is equal to how much gold the party must have in their possession to
  42.     # successufully create the skill.  In addition, each skill is given a
  43.     # mp_cost.  Both of these things are dependent upon the properties the player
  44.     # elects to endow their new skill with.  In each of the following sub-sections,
  45.     # you decide what specific properties are valued at.  Prices are given as
  46.     # two-element arrays:
  47.     #
  48.     #                  [gold_price, mp_cost]
  49.     #
  50.     # Read through the description of each sub-section so that you understand
  51.     # what the property in question does so that you can set the price and cost
  52.     # wisely.
  53.     #
  54.     # 1a.  SCOPE
  55.     #
  56.     # Scope tells who is impacted by the skill.  There are 12 different options
  57.     # for the scope property.  It is important to understand what each of them
  58.     # represent:
  59.     #
  60.     # scope_amount
  61.     #
  62.     # 0 : none
  63.     # 1 : one enemy
  64.     # 2 : all enemies
  65.     # 3 : one enemy dual
  66.     # 4 : one random enemy
  67.     # 5 : 2 random enemies
  68.     # 6 : 3 random enemies
  69.     # 7 : one ally
  70.     # 8 : all allies
  71.     # 9 : one dead ally
  72.     # 10 : all dead allies
  73.     # 11 : user
  74.    
  75.     SCOPE_COST = {
  76.        
  77.       0 => [50, 2],
  78.       1 => [250, 5],
  79.       2 => [1000, 10],
  80.       3 => [500, 3],
  81.       4 => [150, 1],
  82.       5 => [350, 2],
  83.       6 => [650, 4],
  84.       7 => [250, 2],
  85.       8 => [1000, 10],
  86.       9 => [200, 1],
  87.       10 => [900, 5],
  88.       11 => [100, 1],
  89.      
  90.     }
  91.    
  92.     # 1b. OCCASION
  93.     #
  94.     # Occasion is the property which tells when the skill can be used
  95.     #
  96.     # occasion_amount
  97.     #
  98.     # 0 : always
  99.     # 1 : used in battle only
  100.     # 2 : used from menu only
  101.     # 3 : never used
  102.    
  103.     OCCASION_COST = {
  104.    
  105.       0 => [250, 5],
  106.       1 => [100, 3],
  107.       2 => [100, 3],
  108.       3 => [50, 1],
  109.      
  110.     }
  111.    
  112.     # 1c. PRICE PER POINT
  113.     #
  114.     # The following parameters are decided by giving the price/cost given in the
  115.     # array for every point of the property the skill has.  For instance, if a
  116.     # if you set the parameter "speed" => [5, 0], you are saying that for
  117.     # every point of 'speed' the skill is given, the price of it will rise
  118.     # by five gold.
  119.    
  120.     PER_POINT_COST = {
  121.    
  122.       "speed" => [5, 0],  # How fast the skill is when selected to use in battle
  123.       "base_damage" => [25, 1], # How much damage/heal the skill does when used
  124.       "variance" => [12, 0], # a random variable amount added to or subtracted
  125.                              # from the base damage when used
  126.       "atk_f" => [10, 0], # The random amount to add based on the user's ATK parameter
  127.       "spi_f" => [10, 0], # The random amount to add based on the user's SPI parameter
  128.      
  129.     }
  130.    
  131.     # 1d. BOOLEANS
  132.     #
  133.     # These properties are either true or false.  The price adjustment given
  134.     # attributed to these properties are therefor only in effect if the player
  135.     # chooses to set these properties to true in the creator.
  136.    
  137.     BOOLEAN_COST = {
  138.      
  139.       "damage_to_mp" => [50, 1],
  140.       "absorb_damage" => [500, 5],
  141.       "ignore_defense" => [250, 3],
  142.       "physical_attack" => [0, 0]
  143.    
  144.     }
  145.    
  146.     # 1e. PRICE FOR EACH
  147.     #
  148.     # These properties are those which are a group of selections made from a list.
  149.     # This includes both states and elements defined for the skill being made.
  150.     # These values are therefor added to the price/cost for each one of the
  151.     # selections which the player has selected during creation phase.
  152.    
  153.     FOR_EACH_COST = {
  154.    
  155.       "element_set" => [100, 1],
  156.       "plus_state_set" => [200, 2],
  157.       "minus_state_set" => [200, 2],
  158.      
  159.     }
  160.    
  161.     # 1f. COMMON EVENT PRICE
  162.     #
  163.     # The following hash allows you to assign a value to every selectable common
  164.     # event in the game.  That is, those which can be assigned to run when the
  165.     # skill being created is used.  If the player links the common event to the
  166.     # skill when it is created, the costs of the skill will rise by the
  167.     # amount which is assigned to the common_event's id in the following hash.
  168.    
  169.     COMMON_EVENT_COST = {
  170.    
  171.     }
  172.  
  173.     #===========================================================================
  174.     # SECTION 3
  175.     #
  176.     # MISCELLANEOUS
  177.     #
  178.     #===========================================================================
  179.    
  180.     # When using the system, all skills will be given costs.  If you choose
  181.     # to place this at true, then all skills will be given a price by running
  182.     # them each through the pricing system from Section 1.
  183.     REPRICE_ALL_SKILL_COSTS = true  
  184.    
  185.     MAX_PER_POINT_CAP = 125
  186.    
  187.     #===========================================================================
  188.     # SECTION 4
  189.     #
  190.     # ELEMENTS
  191.     #
  192.     # Ths following hash ties each element (based on it's ID in the database) to
  193.     # an icon_index.  The icon_index points to a specific icon found on the
  194.     # Iconset graphics picture.
  195.     ############################################################################
  196.    
  197.     ELEMENT_ICONS  = {
  198.    
  199.       1 => 13,
  200.       2 => 10,
  201.       3 => 5,
  202.       4 => 14,
  203.       5 => 16,
  204.       6 => 12,
  205.       7 => 129,
  206.       8 => 128,
  207.       9 => 104,
  208.       10 => 105,
  209.       11 => 106,
  210.       12 => 107,
  211.       13 => 108,
  212.       14 => 109,
  213.       15 => 110,
  214.       16 => 111,
  215.    
  216.     }
  217.    
  218.     # This value tells the system how many icons to make visible to the player when
  219.     # creating the skill.  It goes 0 through the value you set here.  So by placing
  220.     # it at 255, you can cover every element on the Iconset graphic by its index.
  221.    
  222.     MAX_ICON_ID = 255
  223.    
  224.    
  225.   end
  226. end
  227.  
  228.  
  229. ################################################################################
  230. #                            RPG::SKILL
  231. ################################################################################
  232. class RPG::Skill
  233.  
  234.   #-----------------------------------------------------------------------------
  235.   # Skill Cost
  236.   #
  237.   # cost_type :  "gold", "mp"
  238.   #
  239.   #-----------------------------------------------------------------------------
  240.   def skill_cost(cost_type)
  241.     case cost_type
  242.     when "gold"
  243.       ct = 0
  244.     when "mp"
  245.       ct = 1
  246.     end
  247.     c = Ixfuru::SkillMaker::SCOPE_COST[self.scope][ct]
  248.     c += Ixfuru::SkillMaker::OCCASION_COST[self.occasion][ct]
  249.     Ixfuru::SkillMaker::PER_POINT_COST.each { |tag, cost|
  250.     case tag
  251.     when "Speed"
  252.       c += cost[ct] * self.speed
  253.     when "BaseDamage"
  254.       c += cost[ct] * self.base_damage
  255.     when "Variance"
  256.       c += cost[ct] * self.variance
  257.     when "atk_f"
  258.       c += cost[ct]
  259.     when "spi_f"
  260.     end
  261.     }
  262.     Ixfuru::SkillMaker::BOOLEAN_COST.each { |tag, cost|
  263.     case tag
  264.     when "damage_to_mp"
  265.       c += cost[ct] if self.damage_to_mp
  266.     when "absorb_damage"
  267.       c += cost[ct] if self.absorb_damage
  268.     when "ignore_defense"
  269.       c += cost[ct] if self.ignore_defense
  270.     when "physical_attack"
  271.       c += cost[ct] if self.physical_attack
  272.     end
  273.     }
  274.     Ixfuru::SkillMaker::FOR_EACH_COST.each { |tag, cost|
  275.     case tag
  276.     when "element_set"
  277.       c += cost[ct] * self.element_set.size
  278.     when "plus_state_set"
  279.       c += cost[ct] * self.plus_state_set.size
  280.     when "minus_state_set"
  281.       c += cost[ct] * self.minus_state_set.size
  282.     end
  283.     }
  284.     unless Ixfuru::SkillMaker::COMMON_EVENT_COST.empty?
  285.       Ixfuru::SkillMaker::COMMON_EVENT_COST.each { |ce_id, cost|
  286.       c += cost[ct] if @common_event_id == ce_id
  287.       }
  288.     end
  289.     return c
  290.   end
  291.  
  292.   #-----------------------------------------------------------------------------
  293.   # Initialize (Aliased)
  294.   #-----------------------------------------------------------------------------
  295.   alias ixsklmkrrpgsklinitialize initialize unless $@
  296.   def initialize
  297.     if Ixfuru::SkillMaker::REPRICE_ALL_SKILL_COSTS
  298.       super
  299.       @scope = 1
  300.       @mp_cost = skill_cost("mp")
  301.       @hit = 100
  302.       @message1 = ""
  303.       @message2 = ""
  304.     else
  305.       ixsklmkrrpgsklinitialize
  306.     end
  307.   end
  308.  
  309.  
  310. end
  311.  
  312. ################################################################################
  313. #                            GAME SYSTEM
  314. ################################################################################
  315. class Game_System
  316.  
  317.   attr_accessor :last_custom_skill_id
  318.   attr_accessor :custom_skills
  319.  
  320.   #-----------------------------------------------------------------------------
  321.   # Initialize (Aliased)
  322.   #-----------------------------------------------------------------------------
  323.   alias ixsklmkrgmsysinitialize initialize unless $@
  324.   def initialize
  325.     ixsklmkrgmsysinitialize
  326.     @last_custom_skill_id = -1
  327.     @custom_skills = {}
  328.   end
  329.  
  330. end
  331.  
  332. ################################################################################
  333. #                         GAME BATTLEACTION
  334. ################################################################################
  335. class Game_BattleAction
  336.  
  337.   #--------------------------------------------------------------------------
  338.   # * Get Skill Object (Aliased)
  339.   #--------------------------------------------------------------------------
  340.   alias ixsklmkrgmbaskill skill unless $@
  341.   def skill
  342.     if @skill_id < 0
  343.       return skill? ? $game_system.custom_skills[@skill_id] : nil
  344.     else
  345.       ixsklmkrgmbaskill
  346.     end
  347.   end
  348.  
  349. end
  350.  
  351. ################################################################################
  352. #                          GAME ACTOR
  353. ################################################################################
  354. class Game_Actor < Game_Battler
  355.  
  356. #~    #--------------------------------------------------------------------------
  357. #~   # * Get Skill Object Array
  358. #~   #--------------------------------------------------------------------------
  359. #~   def skills
  360. #~     result = []
  361. #~     for i in @skills
  362. #~       result.push($data_skills[i])
  363. #~     end
  364. #~     return result
  365. #~   end
  366.  
  367.   #--------------------------------------------------------------------------
  368.   # * Get Skill Object Array (Overwritten)
  369.   #--------------------------------------------------------------------------
  370.   def skills
  371.     result = []
  372.     for i in @skills
  373. #~       p "@skills i", i
  374.       if i < 0
  375.         result.push($game_system.custom_skills[i])
  376.       else
  377.         result.push($data_skills[i])
  378.       end
  379.     end
  380.     return result
  381.   end
  382.  
  383.   #--------------------------------------------------------------------------
  384.   # * Learn Skill (OVERWRITTEN)
  385.   #     skill_id : skill ID
  386.   #--------------------------------------------------------------------------
  387.   def learn_skill(skill_id)
  388.     if skill_id < 0
  389.       unless skill_learn?($game_system.custom_skills[skill_id])
  390.         @skills.push(skill_id)
  391.         @skills.sort!
  392.       end
  393.     else
  394.       unless skill_learn?($data_skills[skill_id])
  395.         @skills.push(skill_id)
  396.         @skills.sort!
  397.       end
  398.     end
  399.   end
  400.  
  401. end
  402.  
  403. ################################################################################
  404. #                            GAME INTERPRETER
  405. ################################################################################
  406. class Game_Interpreter
  407.  
  408.   #--------------------------------------------------------------------------
  409.   # * Conditional Branch (OVERWRITTEN)
  410.   #--------------------------------------------------------------------------
  411.   def command_111
  412.     result = false
  413.     case @params[0]
  414.     when 0  # Switch
  415.       result = ($game_switches[@params[1]] == (@params[2] == 0))
  416.     when 1  # Variable
  417.       value1 = $game_variables[@params[1]]
  418.       if @params[2] == 0
  419.         value2 = @params[3]
  420.       else
  421.         value2 = $game_variables[@params[3]]
  422.       end
  423.       case @params[4]
  424.       when 0  # value1 is equal to value2
  425.         result = (value1 == value2)
  426.       when 1  # value1 is greater than or equal to value2
  427.         result = (value1 >= value2)
  428.       when 2  # value1 is less than or equal to value2
  429.         result = (value1 <= value2)
  430.       when 3  # value1 is greater than value2
  431.         result = (value1 > value2)
  432.       when 4  # value1 is less than value2
  433.         result = (value1 < value2)
  434.       when 5  # value1 is not equal to value2
  435.         result = (value1 != value2)
  436.       end
  437.     when 2  # Self switch
  438.       if @original_event_id > 0
  439.         key = [@map_id, @original_event_id, @params[1]]
  440.         if @params[2] == 0
  441.           result = ($game_self_switches[key] == true)
  442.         else
  443.           result = ($game_self_switches[key] != true)
  444.         end
  445.       end
  446.     when 3  # Timer
  447.       if $game_system.timer_working
  448.         sec = $game_system.timer / Graphics.frame_rate
  449.         if @params[2] == 0
  450.           result = (sec >= @params[1])
  451.         else
  452.           result = (sec <= @params[1])
  453.         end
  454.       end
  455.     when 4  # Actor
  456.       actor = $game_actors[@params[1]]
  457.       if actor != nil
  458.         case @params[2]
  459.         when 0  # in party
  460.           result = ($game_party.members.include?(actor))
  461.         when 1  # name
  462.           result = (actor.name == @params[3])
  463.         when 2  # skill
  464.           if @params[3] < 0
  465.             result = (actor.skill_learn?($game_system.custom_skills[@params[3]]))
  466.           else
  467.             result = (actor.skill_learn?($data_skills[@params[3]]))
  468.           end
  469.         when 3  # weapon
  470.           result = (actor.weapons.include?($data_weapons[@params[3]]))
  471.         when 4  # armor
  472.           result = (actor.armors.include?($data_armors[@params[3]]))
  473.         when 5  # state
  474.           result = (actor.state?(@params[3]))
  475.         end
  476.       end
  477.     when 5  # Enemy
  478.       enemy = $game_troop.members[@params[1]]
  479.       if enemy != nil
  480.         case @params[2]
  481.         when 0  # appear
  482.           result = (enemy.exist?)
  483.         when 1  # state
  484.           result = (enemy.state?(@params[3]))
  485.         end
  486.       end
  487.     when 6  # Character
  488.       character = get_character(@params[1])
  489.       if character != nil
  490.         result = (character.direction == @params[2])
  491.       end
  492.     when 7  # Gold
  493.       if @params[2] == 0
  494.         result = ($game_party.gold >= @params[1])
  495.       else
  496.         result = ($game_party.gold <= @params[1])
  497.       end
  498.     when 8  # Item
  499.       result = $game_party.has_item?($data_items[@params[1]])
  500.     when 9  # Weapon
  501.       result = $game_party.has_item?($data_weapons[@params[1]], @params[2])
  502.     when 10  # Armor
  503.       result = $game_party.has_item?($data_armors[@params[1]], @params[2])
  504.     when 11  # Button
  505.       result = Input.press?(@params[1])
  506.     when 12  # Script
  507.       result = eval(@params[1])
  508.     when 13  # Vehicle
  509.       result = ($game_player.vehicle_type == @params[1])
  510.     end
  511.     @branch[@indent] = result     # Store determination results in hash
  512.     if @branch[@indent] == true
  513.       @branch.delete(@indent)
  514.       return true
  515.     end
  516.     return command_skip
  517.   end
  518.  
  519. end
  520.  
  521.  
  522. ################################################################################
  523. #                         SKILL MAKER
  524. ################################################################################
  525. class SkillMaker
  526.  
  527.   attr_accessor :skill
  528.  
  529.   #-----------------------------------------------------------------------------
  530.   # Initialize
  531.   #-----------------------------------------------------------------------------
  532.   def initialize
  533.     @skill = RPG::Skill.new
  534.     @skill.id = $game_system.last_custom_skill_id
  535.   end
  536.  
  537.   #-----------------------------------------------------------------------------
  538.   # Mp Cost
  539.   #-----------------------------------------------------------------------------
  540.   def set_mp_cost
  541.     @skill.mp_cost = @skill.skill_cost("mp")
  542.   end
  543.  
  544.   #-----------------------------------------------------------------------------
  545.   # Create Price
  546.   #-----------------------------------------------------------------------------
  547.   def create_price
  548.     return @skill.skill_cost("gold")
  549.   end
  550.  
  551.   #-----------------------------------------------------------------------------
  552.   # Finish Skill Creation
  553.   #-----------------------------------------------------------------------------
  554.   def finish_skill_creation
  555.     $game_system.custom_skills[@skill.id] = @skill
  556.     $game_system.last_custom_skill_id -= 1
  557.   end
  558.  
  559.  
  560. end
  561.  
  562. ################################################################################
  563. #                          WINDOW BOOLEAN
  564. ################################################################################
  565. class Window_Boolean < Window_Selectable
  566.  
  567.   attr_accessor :result
  568.  
  569.   def initialize(x, y, start_true = false)
  570.     super(x, y, 140, 56)
  571.     @result = start_true
  572.     c1 = "True"
  573.     c2 = "False"
  574.     @commands = [c1, c2]
  575.     @item_max = @commands.size
  576.     refresh
  577.     self.index = 0
  578.     self.visible = false
  579.     self.active = false
  580.   end
  581.  
  582.   def refresh
  583.     create_contents
  584.     for i in 0...@item_max
  585.       draw_command(i)
  586.     end
  587.   end
  588.  
  589.   def draw_command(index)
  590.     rect = item_rect(index)
  591.     rect.width += 4
  592.     rect.x -= 8
  593.     self.contents.font.color = normal_color
  594.     case index
  595.     when 0
  596.       self.contents.font.color = system_color if @result
  597.     when 1
  598.       self.contents.font.color = system_color if !@result
  599.     end
  600.     self.contents.draw_text(rect, @commands[index], 1)
  601.   end
  602.  
  603. end
  604.  
  605.  
  606. ################################################################################
  607. #                                 WINDOW VALUE
  608. ################################################################################
  609. class Window_Value < Window_Selectable
  610.  
  611.   attr_accessor :current_value
  612.   attr_accessor :max_value
  613.   attr_accessor :string
  614.   attr_accessor :min_value
  615.  
  616.   def initialize(current, max, string, multisymbol = false, min = 0)
  617.     super(180, 100, 220, 56)
  618.     @current_value = current
  619.     @max_value = max
  620.     @min_value = min
  621.     @string = string
  622.     @multisymbol = multisymbol
  623.     @item_max = 1
  624.     refresh
  625.     self.index = 0
  626.     self.visible = false
  627.     self.active = false
  628.   end
  629.  
  630.   def refresh
  631.     create_contents
  632.     for i in 0...@item_max
  633.       draw_value(i)
  634.     end
  635.   end
  636.  
  637.   def draw_value(index)
  638.     rect = item_rect(index)
  639.     rect.width += 8
  640.     rect.x -= 4
  641.     if @multisymbol
  642.       self.contents.draw_text(rect, @string + " x " + @current_value.to_s, 1)
  643.     else
  644.       self.contents.draw_text(rect, @string + " " + @current_value.to_s, 1)
  645.     end
  646.   end
  647.  
  648. end
  649.  
  650. ################################################################################
  651. #                               WINDOW STATE SELECT
  652. ################################################################################c
  653. class Window_StateSelect < Window_Selectable
  654.  
  655.   attr_accessor :states
  656.   attr_accessor :selected_states
  657.  
  658.   def initialize(x, y)
  659.     super(x, y, 180, 280)
  660.     @selected_states = []
  661.     refresh
  662.     self.index = 0
  663.     self.visible = false
  664.     self.active = false
  665.   end
  666.  
  667.   def included_states
  668.     result = []
  669.     for i in 1...$data_states.size
  670.       next if $data_states[i].nil? || $data_states[i].name == ""
  671.       result.push(i)
  672.     end
  673.     return result
  674.   end
  675.  
  676.   def refresh
  677.     @states = included_states
  678.     @item_max = @states.size
  679.     create_contents
  680.     for i in 0...@item_max
  681.       draw_state_display(i)
  682.     end
  683.   end
  684.  
  685.   def draw_state_display(index)
  686.     rect = item_rect(index)
  687.     if @selected_states.include?(@states[index])
  688.       self.contents.font.color = power_up_color
  689.     else
  690.       self.contents.font.color = normal_color
  691.     end
  692.     draw_icon($data_states[@states[index]].icon_index, rect.x, rect.y)
  693.     self.contents.draw_text(rect, $data_states[@states[index]].name, 2)
  694.   end
  695.  
  696. end
  697.  
  698. ################################################################################
  699. #                              WINDOW ELEMENT SELECT
  700. ################################################################################
  701. class Window_ElementSelect < Window_Selectable
  702.  
  703.   attr_accessor :selected_elements
  704.   attr_accessor :elements
  705.  
  706.   def initialize(x, y)
  707.     super(x, y, 180, 280)
  708.     @selected_elements = []
  709.     refresh
  710.     self.index = 0
  711.     self.active = false
  712.     self.visible = false
  713.   end
  714.  
  715.   def included_elements
  716.     result = []
  717.     for i in 0...$data_system.elements.size
  718.       next if $data_system.elements[i] == ""
  719.       result.push(i)
  720.     end
  721.     return result
  722.   end
  723.  
  724.   def refresh
  725.     @elements = included_elements
  726.     @item_max = @elements.size
  727.     create_contents
  728.     for i in 0...@item_max
  729.       draw_element_display(i)
  730.     end
  731.   end
  732.  
  733.   def draw_element_display(index)
  734.     rect = item_rect(index)
  735.     if @selected_elements.include?(@elements[index])
  736.       self.contents.font.color = power_up_color
  737.     else
  738.       self.contents.font.color = power_down_color
  739.     end
  740.     draw_icon(rect.x, rect.y, Ixfuru::SkillMaker::ELEMENT_ICONS[@elements[index]])
  741.     self.contents.draw_text(rect, $data_system.elements[@elements[index]], 2)
  742.   end
  743.  
  744. end
  745.  
  746. ################################################################################
  747. #                            WINDOW ICONS
  748. ################################################################################
  749. class Window_Icons < Window_Selectable
  750.  
  751.   attr_accessor :icons
  752.  
  753.   def initialize
  754.     super(0, 0, 544, 416)
  755.     @spacing = 0
  756.     refresh
  757.     self.index = 0
  758.     self.active = false
  759.     self.visible = false
  760.   end
  761.  
  762.   def refresh
  763.     @icons = []
  764.     @item_max = Ixfuru::SkillMaker::MAX_ICON_ID
  765.     @column_max = 16
  766.     for i in 0..item_max
  767.       @icons.push(i)
  768.       draw_window_icon(i)
  769.     end
  770.   end
  771.  
  772.   def draw_window_icon(index)
  773.     rect = item_rect(index)
  774.     rect.x += 4
  775.     rect.width -= 8
  776.     draw_icon(@icons[index], rect.x, rect.y)
  777.   end
  778.  
  779. end
  780.  
  781. ################################################################################
  782. #                           WINDOW LETTERS
  783. ################################################################################
  784. class Window_Letters < Window_Selectable
  785.  
  786.   SHIFT_LETTERS = {
  787.  
  788.     0 => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
  789.           "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
  790.           "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "_", "'", "-",
  791.           " ", "cancel", "done"],
  792.          
  793.     1 => ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
  794.           "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
  795.           "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "_", "'", "-",
  796.           " ", "CANCEL", "DONE"],
  797.        
  798.   }
  799.  
  800.   TYPE_LETTER_SE = ["Close2", 80, 150]
  801.   SHIFT_SE = ["Open2", 80, 150]
  802.   DELETE_SE = ["Water1", 80, 50]
  803.   FINISHED_SE = ["Decision2", 80, 50]
  804.  
  805.   attr_accessor :shift_index
  806.   attr_accessor :letters
  807.  
  808.   def initialize
  809.     super(0, 56, 544, 416)
  810.     @shift_index = 0
  811.     refresh
  812.     self.active = false
  813.     self.visible = false
  814.     self.index = 0
  815.   end
  816.  
  817.   def play_letter
  818.     se = TYPE_LETTER_SE
  819.     RPG::SE.new(se[0], se[1], se[2]).play
  820.   end
  821.  
  822.   def play_shift
  823.     se = SHIFT_SE
  824.     RPG::SE.new(se[0], se[1], se[2]).play
  825.   end
  826.  
  827.   def play_delete
  828.     se = DELETE_SE
  829.     RPG::SE.new(se[0], se[1], se[2]).play
  830.   end
  831.  
  832.   def play_finished
  833.     se = FINISHED_SE
  834.     RPG::SE.new(se[0], se[1], se[2]).play
  835.   end
  836.  
  837.   def refresh
  838.     @letters = SHIFT_LETTERS[@shift_index]
  839.     @item_max = @letters.size
  840.     @column_max = 5
  841.     create_contents
  842.     for i in 0...@item_max
  843.       draw_letter(i)
  844.     end
  845.   end
  846.  
  847.   def draw_letter(index)
  848.     rect = item_rect(index)
  849.     rect.x += 4
  850.     rect.width -= 8
  851.     self.contents.draw_text(rect, @letters[index], 1)
  852.   end
  853.  
  854.  
  855.  
  856.  
  857. end
  858.  
  859. ################################################################################
  860. #                             WINDOW STRING EDIT
  861. ################################################################################
  862. class Window_StringEdit < Window_Selectable
  863.  
  864.   attr_accessor :max_characters
  865.   attr_accessor :string
  866.  
  867.   def initialize(max_characters)
  868.     super(0, 0, 544, 56)
  869.     @max_characters = max_characters
  870.     @column_max = @max_characters
  871.     @string = ""
  872.     @spacing = 0
  873.     refresh
  874.     self.active = false
  875.     self.visible = false
  876.   end
  877.  
  878.   def refresh
  879.     @item_max = @string.size
  880.     create_contents
  881.     return if @item_max < 1
  882.     for i in 0...@item_max
  883.       draw_string_letter(i)
  884.     end
  885.   end
  886.  
  887.   def draw_string_letter(index)
  888.     rect = item_rect(index)
  889.     rect.x += 4
  890.     rect.width -= 8
  891.     letter = @string.slice(index, 1)
  892.     self.contents.draw_text(rect, letter, 1)
  893.   end
  894.  
  895.   def delete_a_letter
  896.     @string.slice!(index, 1)
  897.     self.index -= 1
  898.     refresh
  899.   end
  900.  
  901.   def add_a_letter(letter_to_add)
  902.     @string.concat(letter_to_add)
  903.     self.index += 1
  904.     refresh
  905.   end
  906.  
  907.  
  908. end
  909.  
  910.  
  911. ################################################################################
  912. #                          WINDOW CONFIRMATION
  913. ################################################################################
  914. class Window_Confirmation < Window_Selectable
  915.  
  916.   COMPLETION_SE = ["Magic", 80, 50]
  917.  
  918.   def initialize(c1, c2, starting_index = 1)
  919.     super(180, 100, 180, 80)
  920.     @commands = [c1, c2]
  921.     @item_max = @commands.size
  922.     refresh
  923.     self.index = starting_index
  924.     self.active = false
  925.     self.visible = false
  926.   end
  927.  
  928.   def refresh
  929.     create_contents
  930.     for i in 0...@item_max
  931.       draw_command(i)
  932.     end
  933.   end
  934.  
  935.   def play_completion
  936.     se = COMPLETION_SE
  937.     RPG::SE.new(se[0], se[1], se[2]).play
  938.   end
  939.  
  940.  
  941.   def draw_command(index)
  942.     rect = item_rect(index)
  943.     rect.x += 4
  944.     rect.width -= 8
  945.     self.contents.draw_text(rect, @commands[index], 1)
  946.   end
  947.  
  948. end
  949.  
  950. ################################################################################
  951. #                           RESULT WINDOW
  952. ################################################################################
  953. class Window_Result < Window_Base
  954.  
  955.   attr_accessor :result_string
  956.   attr_accessor :icon_id
  957.  
  958.   ACCOMPANY_ME = ["Victory1", 80, 100]
  959.  
  960.   def initialize(result_string = "", icon_id = nil)
  961.     super(22, 180, 500, 56)
  962.     @result_string = result_string
  963.     @icon_id = icon_id
  964.     refresh
  965.     self.visible = false
  966.   end
  967.  
  968.   def play_accompany
  969.     se = ACCOMPANY_SE
  970.     RPG::SE.new(se[0], se[1], se[2]).play
  971.   end
  972.  
  973.   def refresh
  974.     self.contents.clear
  975.     rect = Rect.new(0, 0, self.width - 32, WLH)
  976.     if @icon_id.nil?
  977.       self.contents.draw_text(rect, @result_string, 1)
  978.     else
  979.       x = (rect.width / 2) - (self.contents.text_size(@result_string).width / 2)
  980.       draw_icon(@icon_id, x, rect.y)
  981.       self.contents.draw_text(x + 26, rect.y, rect.width, rect.height, @result_string)
  982.     end
  983.   end
  984.  
  985.  
  986. end
  987.  
  988. ################################################################################
  989. #                            WINDOW CUSTOM SKILL MAKER
  990. ################################################################################
  991. class Window_SkillMaker < Window_Selectable
  992.  
  993.   #-----------------------------------------------------------------------------
  994.   # Initialize
  995.   #-----------------------------------------------------------------------------
  996.   def initialize
  997.     super(0, 56, 544, 248)
  998.     c1 = "Edit Name"
  999.     c2 = "Edit Icon"
  1000.     c3 = "Edit Description"
  1001.     c4 = "Set Scope"
  1002.     c5 = "Set Occasion"
  1003.     c6 = "Set Speed"
  1004.     c7 = "Edit Animation"
  1005.     c8 = "Edit Common Event"
  1006.     c9 = "Set Base Damage"
  1007.     c10 = "Set Variance"
  1008.     c11 = "Set Attack Factor"
  1009.     c12 = "Set Spirit Factor"
  1010.     c13 = "Decide Physical Attack"
  1011.     c14 = "Decide Damage To MP"
  1012.     c15 = "Decide Absorb Damage"
  1013.     c16 = "Decide Ignore Defense"
  1014.     c17 = "Choose Elements"
  1015.     c18 = "Choose Plus States"
  1016.     c19 = "Choose Minus States"
  1017.     c20 = "Edit Message 1"
  1018.     c21 = "Edit Message 2"
  1019.     c22 = "Set Hit"
  1020.     c23 = "FINALIZE!"
  1021.     @commands = [c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14,
  1022.     c15, c16, c17, c18, c19, c20, c21, c22, c23]
  1023.     @item_max = @commands.size
  1024. #~     p @item_max,"item_max"
  1025.     refresh
  1026.     self.index = 0
  1027.   end
  1028.  
  1029.   #-----------------------------------------------------------------------------
  1030.   # Refresh
  1031.   #-----------------------------------------------------------------------------
  1032.   def refresh
  1033.     @skill = $scene.maker.skill
  1034.     create_contents
  1035.     for i in 0...@item_max
  1036.       draw_command(i)
  1037.     end
  1038.     $scene.set_costs
  1039.   end
  1040.  
  1041.   #-----------------------------------------------------------------------------
  1042.   # Draw Command
  1043.   #-----------------------------------------------------------------------------
  1044.   def draw_command(index)
  1045.     rect = item_rect(index)
  1046.     self.contents.font.color = system_color
  1047.     self.contents.draw_text(rect, @commands[index])
  1048.     self.contents.font.color = normal_color
  1049.     case index
  1050.     when 0 # name
  1051.       self.contents.font.color = crisis_color
  1052.       self.contents.draw_text(rect, @skill.name, 2)
  1053.     when 1 # Icon
  1054.       draw_icon(@skill.icon_index, (rect.x + rect.width - 26), rect.y)
  1055.     when 2 # Description
  1056.       self.contents.draw_text(rect, @skill.description, 2)
  1057.     when 3 # Scope
  1058.       case @skill.scope
  1059.       when 0
  1060.         scp = "None"
  1061.       when 1
  1062.         scp = "One Enemy"
  1063.       when 2
  1064.         scp = "All Enemies"
  1065.       when 3
  1066.         scp = "One Enemy Dual"
  1067.       when 4
  1068.         scp = "One Enemy Random"
  1069.       when 5
  1070.         scp = "Two Random Enemies"
  1071.       when 6
  1072.         scp = "Three Random Enemies"
  1073.       when 7
  1074.         scp = "One Ally"
  1075.       when 8
  1076.         scp = "All Allies"
  1077.       when 9
  1078.         scp = "One Dead Ally"
  1079.       when 10
  1080.         scp = "All Dead Allies"
  1081.       when 11
  1082.         scp = "User"
  1083.       end
  1084.       self.contents.draw_text(rect, "(" + @skill.scope.to_s + ") " + scp, 2)
  1085.     when 4 # Occasion
  1086.       case @skill.occasion
  1087.       when 0 #always
  1088.         occ = "Always"
  1089.       when 1 #Only in Battle
  1090.         occ = "Battle Only"
  1091.       when 2 # Menu Only
  1092.         occ = "Menu Only"
  1093.       when 3 # Never
  1094.         occ = "Never"
  1095.       end
  1096.       self.contents.draw_text(rect, "(" + @skill.occasion.to_s + ") " + occ, 2)
  1097.     when 5 # Speed
  1098.       self.contents.draw_text(rect, @skill.speed.to_s, 2)
  1099.     when 6 # Animation
  1100. #~       p "Skill", @skill
  1101. #~       p "Skill's Animation ID", @skill.animation_id
  1102.       if !@skill.animation_id.nil? && @skill.animation_id > 0
  1103.         self.contents.draw_text(rect, $data_animations[@skill.animation_id].name, 2)
  1104.       else
  1105.         self.contents.draw_text(rect, "NONE", 2)
  1106.       end
  1107.     when 7 # Common Event
  1108.       if !@skill.common_event_id.nil? && @skill.common_event_id > 0
  1109.         self.contents.draw_text(rect, $data_common_events[@skill.common_event_id.name], 2)
  1110.       else
  1111.         self.contents.draw_text(rect, "NONE", 2)
  1112.       end
  1113.     when 8 # Base Damage
  1114.       self.contents.draw_text(rect, @skill.base_damage.to_s, 2)
  1115.     when 9 # Variance
  1116.       self.contents.draw_text(rect, @skill.variance.to_s, 2)
  1117.     when 10 # Atk F
  1118.       self.contents.draw_text(rect, @skill.atk_f.to_s, 2)
  1119.     when 11 # Spi F
  1120.       self.contents.draw_text(rect, @skill.spi_f.to_s, 2)
  1121.     when 12 # Physical Attack?
  1122.       self.contents.font.color = @skill.physical_attack ? power_up_color : power_down_color
  1123.       self.contents.draw_text(rect, @skill.physical_attack.to_s, 2)
  1124.     when 13 # Damage To MP?
  1125.       self.contents.font.color = @skill.damage_to_mp ? power_up_color : power_down_color
  1126.       self.contents.draw_text(rect, @skill.damage_to_mp.to_s, 2)
  1127.     when 14 # Absorb Damage?
  1128.       self.contents.font.color = @skill.absorb_damage ? power_up_color : power_down_color
  1129.       self.contents.draw_text(rect, @skill.absorb_damage.to_s, 2)
  1130.     when 15 # Ignore Defense?
  1131.       self.contents.font.color = @skill.ignore_defense ? power_up_color : power_down_color
  1132.       self.contents.draw_text(rect, @skill.ignore_defense.to_s, 2)
  1133.     when 16 # Elements
  1134.       unless @skill.element_set.empty?
  1135.         x = (rect.x + rect.width) - (@skill.element_set.size * 24)
  1136.         elements = Ixfuru::SkillMaker::ELEMENT_ICONS
  1137.         for element_id in @skill.element_set
  1138.           draw_icon(elements[element_id], x, rect.y)
  1139.           x += 24
  1140.         end
  1141.       end
  1142.     when 17 # Plus States
  1143.       unless @skill.plus_state_set.empty?
  1144.         state_icons = []
  1145.         for state_id in @skill.plus_state_set
  1146.           icon_id = $data_states[state_id].icon_index
  1147.           state_icons.push(icon_id)
  1148.         end
  1149.         x = (rect.x + rect.width) - (state_icons.size * 24)
  1150.         for s in state_icons
  1151.           draw_icon(s, x, rect.y)
  1152.           x += 24
  1153.         end
  1154.       end
  1155.     when 18 # Minus States
  1156.       unless @skill.minus_state_set.empty?
  1157.         state_icons = []
  1158.         for state_id in @skill.minus_state_set
  1159.           icon_id = $data_states[state_id].icon_index
  1160.           state_icons.push(icon_id)
  1161.         end
  1162.         x = (rect.x + rect.width) - (state_icons.size * 24)
  1163.         for s in state_icons
  1164.           draw_icon(s, x, rect.y)
  1165.           x += 24
  1166.         end
  1167.       end
  1168.     when 19 # Message 1
  1169.       self.contents.draw_text(rect, @skill.message1, 2)
  1170.     when 20 # Message 2
  1171.       self.contents.draw_text(rect, @skill.message2, 2)
  1172.     when 21 # Hit Pct
  1173.       self.contents.draw_text(rect, @skill.hit.to_s, 2)
  1174.     end
  1175.   end
  1176.  
  1177.    
  1178.  
  1179. end
  1180.  
  1181. ################################################################################
  1182. #                           WINDOW COST PREVIEW
  1183. ################################################################################
  1184. class Window_CostPreview < Window_Base
  1185.  
  1186.   attr_accessor :cost_type # 0 for mp cost, 1 for gold price
  1187.   attr_accessor :cost
  1188.  
  1189.   COST_TYPE_INITIALS = ["G", "MP"]
  1190.  
  1191.   def initialize(cost_type, x, y)
  1192.     super(x, y, 272, 56)
  1193.     @cost_type = cost_type
  1194.     @cost = 0
  1195.     refresh
  1196.   end
  1197.  
  1198.   def refresh
  1199.     self.contents.clear
  1200.     self.contents.font.color = system_color
  1201.     self.contents.draw_text(0, 0, self.width - 32, WLH, COST_TYPE_INITIALS[@cost_type])
  1202.     self.contents.draw_text(0, 0, self.width - 32, WLH, @cost.to_s, 2)
  1203.   end
  1204.  
  1205. end
  1206.  
  1207. ################################################################################
  1208. #                           WINDOW ANIMATOR
  1209. ################################################################################
  1210. class Window_Animator < Window_Base
  1211.  
  1212.   attr_accessor :anisprite
  1213.   attr_accessor :viewport
  1214.  
  1215.   def initialize
  1216.     super(200, 0, 344, 416)
  1217.     @viewport = Viewport.new(200, 0, 344, 416)
  1218.     @viewport.z = 150
  1219.     refresh
  1220.     self.visible = false
  1221.   end
  1222.  
  1223.   def refresh
  1224.     self.contents.clear
  1225.     create_anisprite
  1226.   end
  1227.  
  1228.   def create_anisprite
  1229.     unless @anisprite.nil? || @anisprite.disposed?
  1230.       @anisprite.dispose
  1231.     end
  1232.     @anisprite = Sprite_Base.new(@viewport)
  1233.     @anisprite.x = 172
  1234.     @anisprite.y = 208
  1235.   end
  1236.  
  1237.   def update_animation
  1238.     unless @anisprite.nil? || @anisprite.disposed?
  1239.       if @anisprite.animation?
  1240.         @anisprite.update
  1241.         @viewport.update
  1242.       end
  1243.     end
  1244.   end
  1245.  
  1246.   def dispose
  1247.     unless @anisprite.nil? || @anisprite.disposed?
  1248.       @anisprite.dispose
  1249.     end
  1250.     @viewport.dispose
  1251.     super
  1252.   end
  1253.  
  1254. end
  1255.  
  1256. ################################################################################
  1257. #                             WINDOW SELECTION
  1258. ################################################################################
  1259. class Window_Selection < Window_Selectable
  1260.  
  1261.   attr_accessor :selection_ids
  1262.  
  1263.   def initialize(selection_type) # 0 for animations,  1 for common events
  1264.     super(0, 0, 200, 416)
  1265.     @selection_type = selection_type
  1266.     @selection_ids = []
  1267.     case @selection_type
  1268.     when 0 # animations
  1269.       for i in $data_animations
  1270.         next if i.nil?
  1271.         next if i.name == ""
  1272.         @selection_ids.push(i.id)
  1273.       end
  1274.     when 1 #common events
  1275.       for i in $data_common_events
  1276.         next if i.nil?
  1277.         next if i.name == ""
  1278.         @selection_ids.push(i.id)
  1279.       end
  1280.     end
  1281.     @item_max = @selection_ids.size
  1282.     refresh
  1283.     self.index = 0
  1284.     self.active = false
  1285.     self.visible = false
  1286.   end
  1287.  
  1288.   def refresh
  1289.     create_contents
  1290.     for i in 0...@item_max
  1291.       draw_selection(i)
  1292.     end
  1293.   end
  1294.  
  1295.   def draw_selection(index)
  1296.     rect = item_rect(index)
  1297.     rect.x += 4
  1298.     rect.width -= 8
  1299.     case @selection_type
  1300.     when 0 # animations
  1301.       self.contents.draw_text(rect, $data_animations[@selection_ids[index]].name, 1)
  1302.     when 1 # common events
  1303.       self.contents.draw_text(rect, $data_common_events[@selection_ids[index]].name, 1)
  1304.     end
  1305.   end
  1306.  
  1307. end
  1308.  
  1309. ################################################################################
  1310. #                             WINDOW SCENE HELP
  1311. ################################################################################
  1312. class Window_SceneHelp < Window_Base
  1313.  
  1314.   attr_accessor :string
  1315.  
  1316.   def initialize
  1317.     super(0, 304, 544, 56)
  1318.     @string = ""
  1319.     refresh
  1320.   end
  1321.  
  1322.   def refresh
  1323.     self.contents.clear
  1324.     self.contents.draw_text(0, 0, self.width - 32, WLH, @string, 1)
  1325.   end
  1326.  
  1327. end
  1328.  
  1329. ################################################################################
  1330. #                               WINDOW HEADER
  1331. ################################################################################
  1332. class Window_SkillMaker_Header < Window_Base
  1333.  
  1334.   def initialize
  1335.     super(0, 0, 544, 56)
  1336.     @string = "************CREATE A SKILL************"
  1337.     refresh
  1338.   end
  1339.  
  1340.   def refresh
  1341.     self.contents.clear
  1342.     self.contents.font.color = system_color
  1343.     self.contents.draw_text(0, 0, self.width - 32, WLH, @string, 1)
  1344.   end
  1345.  
  1346. end
  1347.  
  1348.      
  1349.  
  1350. ################################################################################
  1351. #                                SCENE SKILL MAKER
  1352. ################################################################################
  1353. class Scene_SkillMaker < Scene_Base
  1354.  
  1355.   attr_accessor :maker
  1356.   attr_accessor :win_animation_select
  1357.  
  1358.   #-----------------------------------------------------------------------------
  1359.   # Initialize
  1360.   #-----------------------------------------------------------------------------
  1361.   def initialize(actor = $game_party.members[0])
  1362.     @maker = SkillMaker.new
  1363.     @letters_window = nil
  1364.     @object_of_string = 0
  1365.     @actor = actor
  1366.   end
  1367.  
  1368.   #-----------------------------------------------------------------------------
  1369.   # Start
  1370.   #-----------------------------------------------------------------------------
  1371.   def start
  1372.     super
  1373.     create_menu_background
  1374.     @win_mp_cost = Window_CostPreview.new(1, 0, 360)
  1375.     @win_create_cost = Window_CostPreview.new(0, 272, 360)
  1376.     @win_skillmaker = Window_SkillMaker.new
  1377.     @win_help = Window_SceneHelp.new
  1378.     @win_header = Window_SkillMaker_Header.new
  1379.     @win_name_preview = Window_StringEdit.new(12)
  1380.     @win_letters = Window_Letters.new
  1381.     @win_icons = Window_Icons.new
  1382.     @win_description_preview = Window_StringEdit.new(12)
  1383.     @win_scope = Window_Value.new(0, 11, "Scope", false)
  1384.     @win_occasion = Window_Value.new(0, 3, "Occasion", false)
  1385.     @win_speed = Window_Value.new(0, 100, "Speed")
  1386.     @win_animation_select = Window_Selection.new(0)
  1387.     @win_animation_preview = Window_Animator.new
  1388.     @win_common_event_select = Window_Selection.new(1)
  1389.     @max_cap = Ixfuru::SkillMaker::MAX_PER_POINT_CAP
  1390.     @win_base_damage = Window_Value.new(0, @max_cap, "Damage", false, -999)
  1391.     @win_variance = Window_Value.new(0, @max_cap, "Variance")
  1392.     @win_atk_f = Window_Value.new(0, @max_cap, "Atk Factor")
  1393.     @win_spi_f = Window_Value.new(0, @max_cap, "Spi Factor")
  1394.     @win_physical_attack = Window_Boolean.new(180, 100)
  1395.     @win_damage_to_mp = Window_Boolean.new(180, 100)
  1396.     @win_absorb_damage = Window_Boolean.new(180, 100)
  1397.     @win_ignore_defense = Window_Boolean.new(180, 100)
  1398.     @win_elements = Window_ElementSelect.new(180, 100)
  1399.     @win_plus_state_set = Window_StateSelect.new(180, 100)
  1400.     @win_minus_state_set = Window_StateSelect.new(180, 100)
  1401.     @win_message1 = Window_StringEdit.new(12)
  1402.     @win_message2 = Window_StringEdit.new(12)
  1403.     @win_hit = Window_Value.new(100, 100, "Hit Pct")
  1404.     @win_confirm = Window_Confirmation.new("Create the Skill", "Cancel")
  1405.     @win_result = Window_Result.new
  1406.   end
  1407.  
  1408.   #-----------------------------------------------------------------------------
  1409.   # Update Scene Help
  1410.   #-----------------------------------------------------------------------------
  1411.   def update_scene_help
  1412.     case @win_skillmaker.index
  1413.     when 0
  1414.       s = "Skill must have a name before it can be finalized!"
  1415.     when 1
  1416.       s = "Choose the icon which represents the skill in windows."
  1417.     when 2
  1418.       s = "Write information about what the skill does."
  1419.     when 3
  1420.       s = "Determine who is effected by the skill."
  1421.     when 4
  1422.       s = "Determine when the skill can be used."
  1423.     when 5
  1424.       s = "Determine how quickly the skill is during battle."
  1425.     when 6
  1426.       s = "Decide what the skill will look like when it's used."
  1427.     when 7
  1428.       s = "Decide what kind of event you want to link the skill with."
  1429.     when 8
  1430.       s = "For attacks use positive numbers; to heal used negatives."
  1431.     when 9
  1432.       s = "Adjust how far from the actual base figure the damage/heal can be."
  1433.     when 10
  1434.       s = "Adjust the bonus given based on the user's strength."
  1435.     when 11
  1436.       s = "Adjust the bonus given based on the user's intelligence."
  1437.     when 12
  1438.       s = "Is the skill a physical attack?"
  1439.     when 13
  1440.       s = "Does the skill damage MP instead of HP?"
  1441.     when 14
  1442.       s = "Does the user of the spell absorb some of the damage/heal?"
  1443.     when 15
  1444.       s = "Is the damage/heal dealt bypassing the defense of the target?"
  1445.     when 16
  1446.       s = "What elements are associated with the skill?"
  1447.     when 17
  1448.       s = "What states are given to the target as a result of the skill?"
  1449.     when 18
  1450.       s = "What states are removed from the target as a result of the skill?"
  1451.     when 19
  1452.       s = "Write an explanatory message which tells the skill has been used in battle."
  1453.     when 20
  1454.       s = "Write an extra message which can be anything really."
  1455.     when 21
  1456.       s = "Determine the percentage of chance the user has at performing the skill successfully."
  1457.     when 22
  1458.       s = "Finalize and Complete the New skill!"
  1459.     end
  1460.     if @win_help.string != s
  1461.       @win_help.string = s
  1462.       @win_help.refresh
  1463.     end
  1464.   end
  1465.  
  1466.   #-----------------------------------------------------------------------------
  1467.   # Update
  1468.   #-----------------------------------------------------------------------------
  1469.   def update
  1470.     super
  1471.     update_scene_help
  1472.     if @win_result.visible
  1473.       update_result
  1474.     elsif @win_confirm.active
  1475.       update_confirm
  1476.     elsif @win_hit.active
  1477.       update_hit
  1478.     elsif @win_minus_state_set.active
  1479.       update_minus_state_set
  1480.     elsif @win_plus_state_set.active
  1481.       update_plus_state_set
  1482.     elsif @win_elements.active
  1483.       update_elements
  1484.     elsif @win_ignore_defense.active
  1485.       update_ignore_defense
  1486.     elsif @win_absorb_damage.active
  1487.       update_absorb_damage
  1488.     elsif @win_damage_to_mp.active
  1489.       update_damage_to_mp
  1490.     elsif @win_physical_attack.active
  1491.       update_physical_attack
  1492.     elsif @win_spi_f.active
  1493.       update_spi_f
  1494.     elsif @win_atk_f.active
  1495.       update_atk_f
  1496.     elsif @win_variance.active
  1497.       update_variance
  1498.     elsif @win_base_damage.active
  1499.       update_base_damage
  1500.     elsif @win_common_event_select.active
  1501.       update_common_event_select
  1502.     elsif @win_animation_select.active
  1503.       update_animation_select
  1504.     elsif @win_speed.active
  1505.       update_speed
  1506.     elsif @win_occasion.active
  1507.       update_occasion
  1508.     elsif @win_scope.active
  1509.       update_scope
  1510.     elsif @win_icons.active
  1511.       update_icons
  1512.     elsif @win_letters.active
  1513.       update_letters
  1514.     elsif @win_skillmaker.active
  1515.       update_skillmaker
  1516.     end
  1517.   end
  1518.  
  1519.   #-----------------------------------------------------------------------------
  1520.   # Update SkillMaker
  1521.   #-----------------------------------------------------------------------------
  1522.   def update_skillmaker
  1523.     @win_skillmaker.update
  1524.     if Input.trigger?(Input::C)
  1525.       Sound.play_decision
  1526.       @win_skillmaker.active = false
  1527.       case @win_skillmaker.index
  1528.       when 0 # name
  1529.         @letter_window = @win_name_preview
  1530.         activate_letters(16, 0)
  1531.       when 1 # icon
  1532.         @win_icons.visible = true
  1533.         @win_icons.index = 0
  1534.         @win_icons.refresh
  1535.         @win_icons.active = true
  1536.       when 2 # description
  1537.         @letter_window = @win_description_preview
  1538.         activate_letters(60, 1)
  1539.       when 3 # scope
  1540.         @win_scope.visible = true
  1541.         @win_scope.active = true
  1542.       when 4 # occasion
  1543.         @win_occasion.visible = true
  1544.         @win_occasion.active = true
  1545.       when 5 # speed
  1546.         @win_speed.visible = true
  1547.         @win_speed.active = true
  1548.       when 6 # Animation
  1549.         @win_animation_preview.visible = true
  1550.         @win_animation_select.visible = true
  1551.         @win_animation_select.index = 0
  1552.         @win_animation_select.active = true
  1553.       when 7 # Common Event
  1554.         @win_common_event_select.visible = true
  1555.         @win_common_event_select.visible = true
  1556.         @win_common_event_select.index = 0
  1557.         @win_common_event_select.active = true
  1558.       when 8 # Base Damage
  1559.         @win_base_damage.visible = true
  1560.         @win_base_damage.active = true
  1561.       when 9 # Variance
  1562.         @win_variance.visible = true
  1563.         @win_variance.active = true
  1564.       when 10 # Atk F
  1565.         @win_atk_f.visible = true
  1566.         @win_atk_f.active = true
  1567.       when 11 # Spi F
  1568.         @win_spi_f.visible = true
  1569.         @win_spi_f.active = true
  1570.       when 12 # physical attack?
  1571.         @win_physical_attack.visible = true
  1572.         @win_physical_attack.active = true
  1573.       when 13 # Damage to MP
  1574.         @win_damage_to_mp.visible = true
  1575.         @win_damage_to_mp.active = true
  1576.       when 14 # Absorb Damage
  1577.         @win_absorb_damage.visible = true
  1578.         @win_absorb_damage.active = true
  1579.       when 15 # Ignore Defense
  1580.         @win_ignore_defense.visible = true
  1581.         @win_ignore_defense.active = true
  1582.       when 16 # Choose Elements
  1583.         @win_elements.visible = true
  1584.         @win_elements.active = true
  1585.       when 17 # Choose Plus State Set
  1586.         @win_plus_state_set.visible = true
  1587.         @win_plus_state_set.active = true
  1588.       when 18 # Minus State Set
  1589.         @win_minus_state_set.visible = true
  1590.         @win_minus_state_set.active = true
  1591.       when 19 # Message 1
  1592.         @letter_window = @win_message1
  1593.         activate_letters(40, 2)
  1594.       when 20 # Message 2
  1595.         @letter_window = @win_message2
  1596.         activate_letters(40, 3)
  1597.       when 21 # Hit
  1598.         @win_hit.visible = true
  1599.         @win_hit.active = true
  1600.       when 22 # Finalize
  1601.         @win_confirm.visible = true
  1602.         @win_confirm.active = true
  1603.       end
  1604.     elsif Input.trigger?(Input::B)
  1605.       Sound.play_cancel
  1606.       $scene = Scene_Map.new
  1607.     elsif Input.trigger?(Input::Y)
  1608.       Sound.play_decision
  1609.       p @maker
  1610.       p @maker.skill
  1611.     end
  1612.   end
  1613.  
  1614.   #-----------------------------------------------------------------------------
  1615.   # Set Costs
  1616.   #-----------------------------------------------------------------------------
  1617.   def set_costs
  1618.     @maker.set_mp_cost
  1619.     @maker.create_price
  1620.     @win_mp_cost.cost = @maker.skill.mp_cost
  1621.     @win_create_cost.cost = @maker.skill.skill_cost("gold")
  1622.     refresh_costs
  1623.   end
  1624.      
  1625.   #-----------------------------------------------------------------------------
  1626.   # Activate Letters
  1627.   #-----------------------------------------------------------------------------
  1628.   def activate_letters(max_chars, object_of_string)
  1629.     @letter_window.string = ""
  1630.     @letter_window.max_characters = max_chars
  1631.     @letter_window.refresh
  1632.     @object_of_string = object_of_string
  1633.     @win_letters.active = true
  1634.     @letter_window.visible = true
  1635.     @win_letters.visible = true
  1636.   end
  1637.  
  1638.   #-----------------------------------------------------------------------------
  1639.   # Alter Letter String
  1640.   #-----------------------------------------------------------------------------
  1641.   def alter_letter_string
  1642.     str = @letter_window.string.to_s
  1643.     case @object_of_string
  1644.     when 0 # Name
  1645.       @maker.skill.name = str
  1646.     when 1 # Description
  1647.       @maker.skill.description = str
  1648.     when 2 # Message1
  1649.       @maker.skill.message1 = str
  1650.     when 3 # Message2
  1651.       @maker.skill.message2 = str
  1652.     end
  1653.   end
  1654.  
  1655.   #-----------------------------------------------------------------------------
  1656.   # Update Letters
  1657.   #-----------------------------------------------------------------------------
  1658.   def update_letters
  1659.     @win_letters.update
  1660.     @letter_window.refresh
  1661.     if Input.trigger?(Input::A) # Shift
  1662.       @win_letters.play_shift
  1663.       case @win_letters.shift_index
  1664.       when 0
  1665.         @win_letters.shift_index = 1
  1666.       when 1
  1667.         @win_letters.shift_index = 0
  1668.       end
  1669.       @win_letters.refresh
  1670.     elsif Input.trigger?(Input::B) # Delete
  1671.       if @letter_window.index > 0
  1672.         @win_letters.play_delete
  1673.         @letter_window.delete_a_letter
  1674.       else
  1675.         Sound.play_buzzer
  1676.       end
  1677.     elsif Input.trigger?(Input::C) # Select
  1678.       if @letter_window.index < @letter_window.max_characters
  1679.         if @win_letters.index == 41
  1680.           @win_letters.play_finished
  1681.           alter_letter_string
  1682.           @win_letters.active = false
  1683.           @letter_window.visible = false
  1684.           @win_letters.visible = false
  1685.           @win_skillmaker.refresh
  1686.           @win_skillmaker.active = true
  1687.         elsif @win_letters.index == 40
  1688.           Sound.play_cancel
  1689.           @win_letters.active = false
  1690.           @letter_window.visible = false
  1691.           @win_letters.visible = false
  1692.           @win_skillmaker.active = true
  1693.         else
  1694.           @win_letters.play_letter
  1695.           l = @win_letters.letters[@win_letters.index]
  1696.           @letter_window.add_a_letter(l)
  1697.         end
  1698.       else
  1699.         Sound.play_buzzer
  1700.       end
  1701.     end
  1702.   end
  1703.  
  1704.   #-----------------------------------------------------------------------------
  1705.   # Update Icons
  1706.   #-----------------------------------------------------------------------------
  1707.   def update_icons
  1708.     @win_icons.update
  1709.     @win_icons.refresh
  1710.     if Input.trigger?(Input::B)
  1711.       Sound.play_cancel
  1712.       @win_icons.visible = false
  1713.       @win_skillmaker.active = true
  1714.       @win_icons.active = false
  1715.     elsif Input.trigger?(Input::C)
  1716.       Sound.play_decision
  1717.       icon_id = @win_icons.icons[@win_icons.index]
  1718.       @maker.skill.icon_index = icon_id
  1719.       @win_skillmaker.refresh
  1720.       @win_icons.visible = false
  1721.       @win_skillmaker.active = true
  1722.       @win_icons.active = false
  1723.     end
  1724.   end
  1725.  
  1726.   #-----------------------------------------------------------------------------
  1727.   # Update Scope
  1728.   #-----------------------------------------------------------------------------
  1729.   def update_scope
  1730.     @win_scope.update
  1731.     @win_scope.refresh
  1732.     if Input.trigger?(Input::B)
  1733.       Sound.play_cancel
  1734.       @win_scope.visible = false
  1735.       @win_scope.active = false
  1736.       @win_skillmaker.active = true
  1737.     elsif Input.trigger?(Input::C)
  1738.       Sound.play_decision
  1739.       @maker.skill.scope = @win_scope.current_value
  1740.       @win_scope.visible = false
  1741.       @win_scope.active = false
  1742.       @win_skillmaker.refresh
  1743.       @win_skillmaker.active = true
  1744.     elsif Input.trigger?(Input::RIGHT)
  1745.       if @win_scope.current_value < @win_scope.max_value
  1746.         Sound.play_cursor
  1747.         @win_scope.current_value += 1
  1748.       else
  1749.         @win_scope.current_value = @win_scope.max_value
  1750.         Sound.play_buzzer
  1751.       end
  1752.     elsif Input.trigger?(Input::LEFT)
  1753.       if @win_scope.current_value > @win_scope.min_value
  1754.         Sound.play_cursor
  1755.         @win_scope.current_value -= 1
  1756.       else
  1757.         @win_scope.current_value = @win_scope.min_value
  1758.         Sound.play_buzzer
  1759.       end
  1760.     end
  1761.   end
  1762.  
  1763.   #-----------------------------------------------------------------------------
  1764.   # Update Occasion
  1765.   #-----------------------------------------------------------------------------
  1766.   def update_occasion
  1767.     @win_occasion.update
  1768.     @win_occasion.refresh
  1769.     if Input.trigger?(Input::B)
  1770.       Sound.play_cancel
  1771.       @win_occasion.visible = false
  1772.       @win_occasion.active = false
  1773.       @win_skillmaker.active = true
  1774.     elsif Input.trigger?(Input::C)
  1775.       Sound.play_decision
  1776.       @maker.skill.occasion = @win_occasion.current_value
  1777.       @win_occasion.visible = false
  1778.       @win_occasion.active = false
  1779.       @win_skillmaker.refresh
  1780.       @win_skillmaker.active = true
  1781.     elsif Input.trigger?(Input::RIGHT)
  1782.       if @win_occasion.current_value < @win_occasion.max_value
  1783.         Sound.play_cursor
  1784.         @win_occasion.current_value += 1
  1785.       else
  1786.         @win_occasion.current_value = @win_occasion.max_value
  1787.         Sound.play_buzzer
  1788.       end
  1789.     elsif Input.trigger?(Input::LEFT)
  1790.       if @win_occasion.current_value > @win_occasion.min_value
  1791.         Sound.play_cursor
  1792.         @win_occasion.current_value -= 1
  1793.       else
  1794.         @win_occasion.current_value = @win_occasion.min_value
  1795.         Sound.play_buzzer
  1796.       end
  1797.     end
  1798.   end
  1799.  
  1800.   #-----------------------------------------------------------------------------
  1801.   # Update Speed
  1802.   #-----------------------------------------------------------------------------
  1803.   def update_speed
  1804.     @win_speed.update
  1805.     @win_speed.refresh
  1806.     if Input.trigger?(Input::B)
  1807.       Sound.play_cancel
  1808.       @win_speed.visible = false
  1809.       @win_speed.active = false
  1810.       @win_skillmaker.active = true
  1811.     elsif Input.trigger?(Input::C)
  1812.       Sound.play_decision
  1813.       @maker.skill.speed = @win_speed.current_value
  1814.       @win_speed.visible = false
  1815.       @win_speed.active = false
  1816.       @win_skillmaker.refresh
  1817.       @win_skillmaker.active = true
  1818.     elsif Input.trigger?(Input::RIGHT)
  1819.       if @win_speed.current_value < @win_speed.max_value
  1820.         Sound.play_cursor
  1821.         @win_speed.current_value += 1
  1822.       else
  1823.         @win_speed.current_value = @win_speed.max_value
  1824.         Sound.play_buzzer
  1825.       end
  1826.     elsif Input.trigger?(Input::LEFT)
  1827.       if @win_speed.current_value > @win_speed.min_value
  1828.         Sound.play_cursor
  1829.         @win_speed.current_value -= 1
  1830.       else
  1831.         @win_speed.current_value = @win_speed.min_value
  1832.         Sound.play_buzzer
  1833.       end
  1834.     end
  1835.   end
  1836.  
  1837.   #-----------------------------------------------------------------------------
  1838.   # Update Animation Select
  1839.   #-----------------------------------------------------------------------------
  1840.   def update_animation_select
  1841.     @win_animation_select.update
  1842.     @win_animation_preview.update_animation
  1843.     selection_id = @win_animation_select.selection_ids[@win_animation_select.index]
  1844.     if Input.trigger?(Input::B)
  1845.       Sound.play_cancel
  1846.       @win_animation_select.visible = false
  1847.       @win_animation_preview.visible = false
  1848.       @win_animation_select.active = false
  1849.       @win_skillmaker.active = true
  1850.     elsif Input.trigger?(Input::C)
  1851.       Sound.play_decision
  1852. #~       p "Selection_ID", selection_id
  1853. #~       p "Selections", @win_animation_select.selection_ids
  1854.       @maker.skill.animation_id = selection_id
  1855.       @win_animation_select.visible = false
  1856.       @win_animation_preview.visible = false
  1857.       @win_skillmaker.refresh
  1858.       @win_skillmaker.active = true
  1859.       @win_animation_select.active = false
  1860.     elsif Input.trigger?(Input::Y)
  1861.       Sound.play_decision
  1862.       @win_animation_preview.anisprite.start_animation($data_animations[selection_id])
  1863.     end
  1864.   end
  1865.  
  1866.   #-----------------------------------------------------------------------------
  1867.   # Update Common Event Select
  1868.   #-----------------------------------------------------------------------------
  1869.   def update_common_event_select
  1870.     @win_common_event_select.update
  1871.     selection_id = @win_common_event_select.selection_ids[@win_common_event_select.index]
  1872.     if Input.trigger?(Input::B)
  1873.       Sound.play_cancel
  1874.       @win_common_event_select.visible = false
  1875.       @win_common_event_select.active = false
  1876.       @win_skillmaker.active = true
  1877.     elsif Input.trigger?(Input::C)
  1878.       Sound.play_decision
  1879.       @maker.skill.common_event_id = selection_id
  1880.       @win_common_event_select.visible = false
  1881.       @win_common_event_select.active = false
  1882.       @win_skillmaker.refresh
  1883.       @win_skillmaker.active = true
  1884.     end
  1885.   end
  1886.  
  1887.   #-----------------------------------------------------------------------------
  1888.   # Update Base Damage
  1889.   #-----------------------------------------------------------------------------
  1890.   def update_base_damage
  1891.     @win_base_damage.update
  1892.     @win_base_damage.refresh
  1893.     if Input.trigger?(Input::B)
  1894.       Sound.play_cancel
  1895.       @win_base_damage.visible = false
  1896.       @win_base_damage.active = false
  1897.       @win_skillmaker.active = true
  1898.     elsif Input.trigger?(Input::C)
  1899.       Sound.play_decision
  1900.       @maker.skill.base_damage = @win_base_damage.current_value
  1901.       @win_base_damage.visible = false
  1902.       @win_base_damage.active = false
  1903.       @win_skillmaker.refresh
  1904.       @win_skillmaker.active = true
  1905.     elsif Input.trigger?(Input::RIGHT)
  1906.       if @win_base_damage.current_value < @win_base_damage.max_value
  1907.         Sound.play_cursor
  1908.         @win_base_damage.current_value += 1
  1909.       else
  1910.         @win_base_damage.current_value = @win_base_damage.max_value
  1911.         Sound.play_buzzer
  1912.       end
  1913.     elsif Input.trigger?(Input::LEFT)
  1914.       if @win_base_damage.current_value > @win_base_damage.min_value
  1915.         Sound.play_cursor
  1916.         @win_base_damage.current_value -= 1
  1917.       else
  1918.         @win_base_damage.current_value = @win_base_damage.min_value
  1919.         Sound.play_buzzer
  1920.       end
  1921.     end
  1922.   end
  1923.  
  1924.   #-----------------------------------------------------------------------------
  1925.   # Update Variance
  1926.   #-----------------------------------------------------------------------------
  1927.   def update_variance
  1928.     @win_variance.update
  1929.     @win_variance.refresh
  1930.     if Input.trigger?(Input::B)
  1931.       Sound.play_cancel
  1932.       @win_variance.visible = false
  1933.       @win_variance.active = false
  1934.       @win_skillmaker.active = true
  1935.     elsif Input.trigger?(Input::C)
  1936.       Sound.play_decision
  1937.       @maker.skill.variance = @win_variance.current_value
  1938.       @win_variance.visible = false
  1939.       @win_variance.active = false
  1940.       @win_skillmaker.refresh
  1941.       @win_skillmaker.active = true
  1942.     elsif Input.trigger?(Input::RIGHT)
  1943.       if @win_variance.current_value < @win_variance.max_value
  1944.         Sound.play_cursor
  1945.         @win_variance.current_value += 1
  1946.       else
  1947.         @win_variance.current_value = @win_variance.max_value
  1948.         Sound.play_buzzer
  1949.       end
  1950.     elsif Input.trigger?(Input::LEFT)
  1951.       if @win_variance.current_value > @win_variance.min_value
  1952.         Sound.play_cursor
  1953.         @win_variance.current_value -= 1
  1954.       else
  1955.         @win_variance.current_value = @win_variance.min_value
  1956.         Sound.play_buzzer
  1957.       end
  1958.     end
  1959.   end
  1960.  
  1961.   #-----------------------------------------------------------------------------
  1962.   # Update Atk F
  1963.   #-----------------------------------------------------------------------------
  1964.   def update_atk_f
  1965.     @win_atk_f.update
  1966.     @win_atk_f.refresh
  1967.     if Input.trigger?(Input::B)
  1968.       Sound.play_cancel
  1969.       @win_atk_f.visible = false
  1970.       @win_atk_f.active = false
  1971.       @win_skillmaker.active = true
  1972.     elsif Input.trigger?(Input::C)
  1973.       Sound.play_decision
  1974.       @maker.skill.atk_f = @win_atk_f.current_value
  1975.       @win_atk_f.visible = false
  1976.       @win_atk_f.active = false
  1977.       @win_skillmaker.refresh
  1978.       @win_skillmaker.active = true
  1979.     elsif Input.trigger?(Input::RIGHT)
  1980.       if @win_atk_f.current_value < @win_atk_f.max_value
  1981.         Sound.play_cursor
  1982.         @win_atk_f.current_value += 1
  1983.       else
  1984.         @win_atk_f.current_value = @win_atk_f.max_value
  1985.         Sound.play_buzzer
  1986.       end
  1987.     elsif Input.trigger?(Input::LEFT)
  1988.       if @win_atk_f.current_value > @win_atk_f.min_value
  1989.         Sound.play_cursor
  1990.         @win_atk_f.current_value -= 1
  1991.       else
  1992.         @win_atk_f.current_value = @win_atk_f.min_value
  1993.         Sound.play_buzzer
  1994.       end
  1995.     end
  1996.   end
  1997.  
  1998.   #-----------------------------------------------------------------------------
  1999.   # Update Spi_F
  2000.   #-----------------------------------------------------------------------------
  2001.   def update_spi_f
  2002.     @win_spi_f.update
  2003.     @win_spi_f.refresh
  2004.     if Input.trigger?(Input::B)
  2005.       Sound.play_cancel
  2006.       @win_spi_f.visible = false
  2007.       @win_spi_f.active = false
  2008.       @win_skillmaker.active = true
  2009.     elsif Input.trigger?(Input::C)
  2010.       Sound.play_decision
  2011.       @maker.skill.spi_f = @win_spi_f.current_value
  2012.       @win_spi_f.visible = false
  2013.       @win_spi_f.active = false
  2014.       @win_skillmaker.refresh
  2015.       @win_skillmaker.active = true
  2016.     elsif Input.trigger?(Input::RIGHT)
  2017.       if @win_spi_f.current_value < @win_spi_f.max_value
  2018.         Sound.play_cursor
  2019.         @win_spi_f.current_value += 1
  2020.       else
  2021.         @win_spi_f.current_value = @win_spi_f.max_value
  2022.         Sound.play_buzzer
  2023.       end
  2024.     elsif Input.trigger?(Input::LEFT)
  2025.       if @win_spi_f.current_value > @win_spi_f.min_value
  2026.         Sound.play_cursor
  2027.         @win_spi_f.current_value -= 1
  2028.       else
  2029.         @win_spi_f.current_value = @win_spi_f.min_value
  2030.         Sound.play_buzzer
  2031.       end
  2032.     end
  2033.   end
  2034.  
  2035.   #-----------------------------------------------------------------------------
  2036.   # Update Physical Attack
  2037.   #-----------------------------------------------------------------------------
  2038.   def update_physical_attack
  2039.     @win_physical_attack.update
  2040.     @win_physical_attack.refresh
  2041.     if Input.trigger?(Input::B)
  2042.       Sound.play_cancel
  2043.       @win_physical_attack.visible = false
  2044.       @win_physical_attack.active = false
  2045.       @win_skillmaker.active = true
  2046.     elsif Input.trigger?(Input::C)
  2047.       Sound.play_decision
  2048.       case @win_physical_attack.index
  2049.       when 0
  2050.         @maker.skill.physical_attack = true
  2051.       when 1
  2052.         @maker.skill.physical_attack = false
  2053.       end
  2054.       @win_physical_attack.visible = false
  2055.       @win_physical_attack.active = false
  2056.       @win_skillmaker.refresh
  2057.       @win_skillmaker.active = true
  2058.     end
  2059.   end
  2060.  
  2061.   #-----------------------------------------------------------------------------
  2062.   # Update Damage To Mp
  2063.   #-----------------------------------------------------------------------------
  2064.   def update_damage_to_mp
  2065.     @win_damage_to_mp.update
  2066.     @win_damage_to_mp.refresh
  2067.     if Input.trigger?(Input::B)
  2068.       Sound.play_cancel
  2069.       @win_damage_to_mp.visible = false
  2070.       @win_damage_to_mp.active = false
  2071.       @win_skillmaker.active = true
  2072.     elsif Input.trigger?(Input::C)
  2073.       Sound.play_decision
  2074.       case @win_damage_to_mp.index
  2075.       when 0
  2076.         @maker.skill.damage_to_mp = true
  2077.       when 1
  2078.         @maker.skill.damage_to_mp = false
  2079.       end
  2080.       @win_damage_to_mp.visible = false
  2081.       @win_damage_to_mp.active = false
  2082.       @win_skillmaker.refresh
  2083.       @win_skillmaker.active = true
  2084.     end
  2085.   end
  2086.  
  2087.   #-----------------------------------------------------------------------------
  2088.   # Update Absorb Damage
  2089.   #-----------------------------------------------------------------------------
  2090.   def update_absorb_damage
  2091.     @win_absorb_damage.update
  2092.     @win_absorb_damage.refresh
  2093.     if Input.trigger?(Input::B)
  2094.       Sound.play_cancel
  2095.       @win_absorb_damage.visible = false
  2096.       @win_absorb_damage.active = false
  2097.       @win_skillmaker.active = true
  2098.     elsif Input.trigger?(Input::C)
  2099.       Sound.play_decision
  2100.       case @win_absorb_damage.index
  2101.       when 0
  2102.         @maker.skill.absorb_damage = true
  2103.       when 1
  2104.         @maker.skill.absorb_damage = false
  2105.       end
  2106.       @win_absorb_damage.visible = false
  2107.       @win_absorb_damage.active = false
  2108.       @win_skillmaker.refresh
  2109.       @win_skillmaker.active = true
  2110.     end
  2111.   end
  2112.  
  2113.   #-----------------------------------------------------------------------------
  2114.   # Update Ignore Defense
  2115.   #-----------------------------------------------------------------------------
  2116.   def update_ignore_defense
  2117.     @win_ignore_defense.update
  2118.     @win_ignore_defense.refresh
  2119.     if Input.trigger?(Input::B)
  2120.       Sound.play_cancel
  2121.       @win_ignore_defense.visible = false
  2122.       @win_ignore_defense.active = false
  2123.       @win_skillmaker.active = true
  2124.     elsif Input.trigger?(Input::C)
  2125.       Sound.play_decision
  2126.       case @win_ignore_defense.index
  2127.       when 0
  2128.         @maker.skill.ignore_defense = true
  2129.       when 1
  2130.         @maker.skill.ignore_defense = false
  2131.       end
  2132.       @win_ignore_defense.visible = false
  2133.       @win_ignore_defense.active = false
  2134.       @win_skillmaker.refresh
  2135.       @win_skillmaker.active = true
  2136.     end
  2137.   end
  2138.  
  2139.   #-----------------------------------------------------------------------------
  2140.   # Update Elements
  2141.   #-----------------------------------------------------------------------------
  2142.   def update_elements
  2143.     @win_elements.update
  2144.     @win_elements.refresh
  2145.     if Input.trigger?(Input::B)
  2146.       Sound.play_cancel
  2147.       @win_elements.visible = false
  2148.       @win_elements.active = false
  2149.       @maker.skill.element_set = @win_elements.selected_elements
  2150.       @win_skillmaker.refresh
  2151.       @win_skillmaker.active = true
  2152.     elsif Input.trigger?(Input::A)
  2153.       unless !@win_elements.selected_elements.include?(@win_elements.elements[@win_elements.index])
  2154.         Sound.play_decision
  2155.         @win_elements.selected_elements.delete(@win_elements.elements[@win_elements.index])
  2156.       end
  2157.     elsif Input.trigger?(Input::C)
  2158.       unless @win_elements.selected_elements.include?(@win_elements.elements[@win_elements.index])
  2159.         Sound.play_decision
  2160.         @win_elements.selected_elements.push(@win_elements.elements[@win_elements.index])
  2161.       end
  2162.     end
  2163.   end
  2164.  
  2165.   #-----------------------------------------------------------------------------
  2166.   # Update Plus State Set
  2167.   #-----------------------------------------------------------------------------
  2168.   def update_plus_state_set
  2169.     @win_plus_state_set.update
  2170.     @win_plus_state_set.refresh
  2171.     if Input.trigger?(Input::B)
  2172.       Sound.play_cancel
  2173.       @win_plus_state_set.visible = false
  2174.       @win_plus_state_set.active = false
  2175.       @maker.skill.plus_state_set = @win_plus_state_set.selected_states
  2176.       @win_skillmaker.refresh
  2177.       @win_skillmaker.active = true
  2178.     elsif Input.trigger?(Input::A)
  2179.       unless !@win_plus_state_set.selected_states.include?(@win_plus_state_set.states[@win_plus_state_set.index])
  2180.         Sound.play_decision
  2181.         @win_plus_state_set.selected_states.delete(@win_plus_state_set.states[@win_plus_state_set.index])
  2182.       end
  2183.     elsif Input.trigger?(Input::C)
  2184.       unless @win_plus_state_set.selected_states.include?(@win_plus_state_set.states[@win_plus_state_set.index])
  2185.         Sound.play_decision
  2186.         @win_plus_state_set.selected_states.push(@win_plus_state_set.states[@win_plus_state_set.index])
  2187.       end
  2188.     end
  2189.   end
  2190.  
  2191.   #-----------------------------------------------------------------------------
  2192.   # Update Minus State Set
  2193.   #-----------------------------------------------------------------------------
  2194.   def update_minus_state_set
  2195.     @win_minus_state_set.update
  2196.     @win_minus_state_set.refresh
  2197.     if Input.trigger?(Input::B)
  2198.       Sound.play_cancel
  2199.       @win_minus_state_set.visible = false
  2200.       @win_minus_state_set.active = false
  2201.       @maker.skill.minus_state_set = @win_minus_state_set.selected_states
  2202.       @win_skillmaker.refresh
  2203.       @win_skillmaker.active = true
  2204.     elsif Input.trigger?(Input::A)
  2205.       unless !@win_minus_state_set.selected_states.include?(@win_minus_state_set.states[@win_minus_state_set.index])
  2206.         Sound.play_decision
  2207.         @win_minus_state_set.selected_states.delete(@win_minus_state_set.states[@win_minus_state_set.index])
  2208.       end
  2209.     elsif Input.trigger?(Input::C)
  2210.       unless @win_minus_state_set.selected_states.include?(@win_minus_state_set.states[@win_minus_state_set.index])
  2211.         Sound.play_decision
  2212.         @win_minus_state_set.selected_states.push(@win_minus_state_set.states[@win_minus_state_set.index])
  2213.       end
  2214.     end
  2215.   end
  2216.  
  2217.   #-----------------------------------------------------------------------------
  2218.   # Update Hit
  2219.   #-----------------------------------------------------------------------------
  2220.   def update_hit
  2221.     @win_hit.update
  2222.     @win_hit.refresh
  2223.     if Input.trigger?(Input::B)
  2224.       Sound.play_cancel
  2225.       @win_hit.visible = false
  2226.       @win_hit.active = false
  2227.       @win_skillmaker.active = true
  2228.     elsif Input.trigger?(Input::C)
  2229.       Sound.play_decision
  2230.       @maker.skill.hit = @win_hit.current_value
  2231.       @win_hit.visible = false
  2232.       @win_hit.active = false
  2233.       @win_skillmaker.refresh
  2234.       @win_skillmaker.active = true
  2235.     elsif Input.trigger?(Input::RIGHT)
  2236.       if @win_hit.current_value <= @win_hit.max_value
  2237.         Sound.play_cursor
  2238.         @win_hit.current_value += 1
  2239.       else
  2240.         @win_hit.current_value = @win_hit.max_value
  2241.         Sound.play_buzzer
  2242.       end
  2243.     elsif Input.trigger?(Input::LEFT)
  2244.       if @win_hit.current_value > @win_hit.min_value
  2245.         Sound.play_cursor
  2246.         @win_hit.current_value -= 1
  2247.       else
  2248.         @win_hit.current_value = @win_hit.min_value
  2249.         Sound.play_buzzer
  2250.       end
  2251.     end
  2252.   end
  2253.  
  2254.   #-----------------------------------------------------------------------------
  2255.   # Update Confirm
  2256.   #-----------------------------------------------------------------------------
  2257.   def update_confirm
  2258.     @win_confirm.update
  2259.     if Input.trigger?(Input::B)
  2260.       Sound.play_cancel
  2261.       @win_confirm.visible = false
  2262.       @win_skillmaker.active = true
  2263.       @win_confirm.active = false
  2264.     elsif Input.trigger?(Input::C)
  2265.       if @maker.skill.name == ""
  2266.         Sound.play_buzzer
  2267.       elsif $game_party.gold < @win_create_cost.cost
  2268.         Sound.play_buzzer
  2269.       else
  2270.         $game_party.lose_gold(@win_create_cost.cost)
  2271.         @win_confirm.play_completion
  2272.         @maker.finish_skill_creation
  2273. #~         p "maker skill id", maker.skill.id
  2274.         @actor.learn_skill(maker.skill.id)
  2275.         show_result_window
  2276.         @win_confirm.visible = false
  2277.         @win_confirm.active = false
  2278.       end
  2279.     end
  2280.   end
  2281.  
  2282.   #-----------------------------------------------------------------------------
  2283.   # Show Result Window
  2284.   #-----------------------------------------------------------------------------
  2285.   def show_result_window
  2286.     @win_result.result_string = "New Skill, " + @maker.skill.name + ", was created!"
  2287.     @win_result.icon_id = @maker.skill.icon_index
  2288.     @win_result.refresh
  2289.     @win_result.visible = true
  2290.   end
  2291.  
  2292.   #-----------------------------------------------------------------------------
  2293.   # Update Result
  2294.   #-----------------------------------------------------------------------------
  2295.   def update_result
  2296.     if Input.trigger?(Input::C) || Input.trigger?(Input::B)
  2297.       Sound.play_decision
  2298.       $scene = Scene_Map.new
  2299.     end
  2300.   end
  2301.  
  2302.   #-----------------------------------------------------------------------------
  2303.   # Refresh Costs
  2304.   #-----------------------------------------------------------------------------
  2305.   def refresh_costs
  2306.     @win_create_cost.refresh
  2307.     @win_mp_cost.refresh
  2308.   end
  2309.  
  2310.   #-----------------------------------------------------------------------------
  2311.   # Terminate
  2312.   #-----------------------------------------------------------------------------
  2313.   def terminate
  2314.     super
  2315.     dispose_menu_background
  2316.     windows = [@win_create_cost, @win_mp_cost, @win_message1, @win_message2,
  2317.     @win_minus_state_set, @win_plus_state_set, @win_elements, @win_ignore_defense,
  2318.     @win_absorb_damage, @win_damage_to_mp, @win_physical_attack, @win_atk_f,
  2319.     @win_spi_f, @win_variance, @win_base_damage, @win_common_event_select,
  2320.     @win_animation_preview, @win_animation_select, @win_speed, @win_occasion,
  2321.     @win_scope, @win_description_preview, @win_icons, @win_letters,
  2322.     @win_name_preview, @win_skillmaker, @win_hit, @win_confirm, @win_result,
  2323.     @win_help, @win_header]
  2324.     for window in windows
  2325.       window.dispose
  2326.       Graphics.update
  2327.     end
  2328.   end
  2329.  
  2330. end
Advertisement
Add Comment
Please, Sign In to add comment