vindaca510

V's Promotion System v0.2

Oct 9th, 2013
553
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 31.21 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                             V's Promotion System                             #
  4. #                                 Version  0.2                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                         Last Edited: January 5, 2013                         #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                                                                              #
  11. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  12.  
  13.  
  14. #==============================================================================#
  15. #------------------------------------------------------------------------------#
  16. # ** Disclaimer                                                                #
  17. #------------------------------------------------------------------------------#
  18. #                                                                              #
  19. # This script was intended for Non-commercial use only, if you wish to use     #
  20. # this script in a commercial game please PM me at which ever site you found   #
  21. # this script. Either way please give me credit in your game script as the     #
  22. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  23. #                                                                              #
  24. # Wooden Prize Wheel Image and Wooden Background Image found inside of the     #
  25. # demo was drawn and contributed by Cap'n K'nuckles, and can only be used      #
  26. # on his terms.                                                                #
  27. #                                                                              #
  28. #------------------------------------------------------------------------------#
  29. # ** How To Use                                                                #
  30. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  31. #                                                                              #
  32. # * Set-Up the promotions use the following tag in an actors note box as many  #
  33. #   times as you desire.                                                       #
  34. #                                                                              #
  35. #      <Promotion: Level, Graphic_Name, Graphic_Index, Cost, Class>            #
  36. #                                                                              #
  37. #                                                                              #
  38. # * To call the Promotion scene use the following command in a script call.    #
  39. #                                                                              #
  40. #       promote                                                                #
  41. #                                                                              #
  42. #                                                                              #
  43. # * To check for promotable party members scene use the following command in   #
  44. #   a conditional branch's script call.                                        #
  45. #                                                                              #
  46. #       check_if_members_are_promotable                                        #
  47. #                                                                              #
  48. #                                                                              #
  49. #------------------------------------------------------------------------------#
  50. # ** Description                                                               #
  51. #------------------------------------------------------------------------------#
  52. #                                                                              #
  53. #  v0.1                                                                        #
  54. # ~=~=~=~                                                                      #
  55. #  * This script creates a promotion scene and feature for the game. When an   #
  56. #    actor reaches a set level thy will not be able to gain more exp until     #
  57. #    they are promoted. Upon promoting the graphic and classes can be changed. #
  58. #                                                                              #
  59. #  v0.2                                                                        #
  60. # ~=~=~=~                                                                      #
  61. #  * I fixed a bug with the promotions not working right.                      #
  62. #                                                                              #
  63. #------------------------------------------------------------------------------#
  64. #==============================================================================#
  65.  
  66.  
  67.  
  68. #==============================================================================#
  69. #------------------------------------------------------------------------------#
  70. #                             Existing Class                                   #
  71. #------------------------------------------------------------------------------#
  72. #==============================================================================#
  73.  
  74. #==============================================================================
  75. # ** Game_Actor
  76. #------------------------------------------------------------------------------
  77. #  This class handles actors. It is used within the Game_Actors class
  78. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  79. #==============================================================================
  80.  
  81. class Game_Actor < Game_Battler
  82.  
  83.   #--------------------------------------------------------------------------
  84.   # * Public Instance Variables
  85.   #--------------------------------------------------------------------------
  86.   attr_accessor :needs_promotion                      # Actor needs promotion
  87.   attr_accessor :actor_note                           # Actors promotion note
  88.   attr_accessor :promotion_cost                       # Actors promotion cost
  89.   attr_accessor :next_promotion_name                  # Actors next promotion graphic name
  90.   attr_accessor :next_promotion_index                 # Actors next promotion graphic index
  91.   attr_accessor :next_promotion_class                 # Actors next promotion class
  92.  
  93.   #--------------------------------------------------------------------------
  94.   # * Alaising Method: Setup
  95.   #--------------------------------------------------------------------------
  96.   alias :s434 :setup
  97.  
  98.   #--------------------------------------------------------------------------
  99.   # * Setup
  100.   #--------------------------------------------------------------------------
  101.   def setup(actor_id)
  102.     @needs_promotion = false
  103.     @promotion_cost = 0
  104.     @next_promotion_name = ""
  105.     @next_promotion_index = 0
  106.     @next_promotion_class = 0
  107.     set_up_actor_note(actor_id)
  108.     s434(actor_id)
  109.   end
  110.  
  111. #~   #--------------------------------------------------------------------------
  112. #~   # * Alaising Method: Gain EXP
  113. #~   #--------------------------------------------------------------------------
  114. #~   alias :ge434 :gain_exp
  115.  
  116.   #--------------------------------------------------------------------------
  117.   # * Gain EXP (Account for Experience Rate)
  118.   #--------------------------------------------------------------------------
  119.   def gain_exp(exp)
  120.     ge434(exp) unless promotable?
  121.   end
  122.  
  123.   #--------------------------------------------------------------------------
  124.   # * Change Experience
  125.   #     show : Level up display flag
  126.   #--------------------------------------------------------------------------
  127.   def change_exp(exp, show)
  128.     @exp[@class_id] = [exp, 0].max unless promotable?
  129.     last_level = @level
  130.     last_skills = skills
  131.     level_up while !max_level? && self.exp >= next_level_exp
  132.     level_down while self.exp < current_level_exp
  133.     display_level_up(skills - last_skills) if show && @level > last_level
  134.     refresh
  135.   end
  136.  
  137.   #--------------------------------------------------------------------------
  138.   # * Alaising Method: Level Up
  139.   #--------------------------------------------------------------------------
  140.   alias :lu434 :level_up
  141.  
  142.   #--------------------------------------------------------------------------
  143.   # * Level Up
  144.   #--------------------------------------------------------------------------
  145.   def level_up
  146.     lu434() unless promotable?
  147.     check_for_promotion
  148.   end
  149.  
  150.   #--------------------------------------------------------------------------
  151.   # * Sets up the actor's note
  152.   #--------------------------------------------------------------------------
  153.   def set_up_actor_note(actor_id)
  154.     note= /<Promotion:\s*(\d*)\S*\s*(\w*)\S*\s*(\d*)\S*\s*(\d*)\S*\s*(\d*)>/i
  155.     @actors_note = $data_actors[actor_id].note.scan(note)
  156.   end
  157.  
  158.   #--------------------------------------------------------------------------
  159.   # * Check For Promotions
  160.   #--------------------------------------------------------------------------
  161.   def check_for_promotion
  162.     @actors_note.size.times { |i| @needs_promotion = true if @level == @actors_note[i][0].to_i } &&
  163.     @actors_note.size.times { |i| @promotion_cost = @actors_note[i][3].to_i if @level == @actors_note[i][0].to_i } &&
  164.     @actors_note.size.times { |i| @next_promotion_name = @actors_note[i][1] if @level == @actors_note[i][0].to_i } &&
  165.     @actors_note.size.times { |i| @next_promotion_index = @actors_note[i][2].to_i if @level == @actors_note[i][0].to_i } &&
  166.     @actors_note.size.times { |i| @next_promotion_class = @actors_note[i][4].to_i if @level == @actors_note[i][0].to_i }
  167.   end
  168.  
  169.   #--------------------------------------------------------------------------
  170.   # * Checks if actor is promotable
  171.   #--------------------------------------------------------------------------
  172.   def promotable?
  173.     @needs_promotion == true
  174.   end
  175.  
  176.   #--------------------------------------------------------------------------
  177.   # * Promote Proccessing
  178.   #--------------------------------------------------------------------------
  179.   def promote
  180.     @needs_promotion = false
  181.     @actors_note.size.times { |i| @character_name = @actors_note[i][1] if @level == @actors_note[i][0].to_i } &&
  182.     @actors_note.size.times { |i| @character_index = @actors_note[i][2].to_i if @level == @actors_note[i][0].to_i } &&
  183.     @actors_note.size.times { |i| change_class(@actors_note[i][4].to_i, true) if @level == @actors_note[i][0].to_i }
  184.     $game_party.lose_gold(promotion_cost?)
  185.     $game_player.refresh
  186.   end
  187.  
  188.   #--------------------------------------------------------------------------
  189.   # * Promote Proccessing
  190.   #--------------------------------------------------------------------------
  191.   def promotion_cost?
  192.     return @promotion_cost
  193.   end
  194.  
  195. end #<--- End Class============================================================
  196.  
  197.  
  198.  
  199. #==============================================================================#
  200. #------------------------------------------------------------------------------#
  201. #                             Existing Class                                   #
  202. #------------------------------------------------------------------------------#
  203. #==============================================================================#
  204.  
  205. #==============================================================================
  206. # ** Game_Interpreter
  207. #------------------------------------------------------------------------------
  208. #  An interpreter for executing event commands. This class is used within the
  209. # Game_Map, Game_Troop, and Game_Event classes.
  210. #==============================================================================
  211.  
  212. class Game_Interpreter
  213.  
  214.   #--------------------------------------------------------------------------
  215.   # * Method to call the Promotion Scene
  216.   #--------------------------------------------------------------------------
  217.   def promote
  218.     SceneManager.call( V_Promotion_Scene )
  219.   end
  220.  
  221.   #--------------------------------------------------------------------------
  222.   # * Method to check if party members are promotable
  223.   #--------------------------------------------------------------------------
  224.   def check_if_members_are_promotable
  225.     anwser = false
  226.     members = $game_party.members
  227.     members.size.times { |i| anwser = true if members[i].promotable? }
  228.     return anwser
  229.   end
  230.  
  231. end #<--- End Class============================================================
  232.  
  233.  
  234.  
  235. #==============================================================================#
  236. #------------------------------------------------------------------------------#
  237. #                             Existing Class                                   #
  238. #------------------------------------------------------------------------------#
  239. #==============================================================================#
  240.  
  241. #==============================================================================
  242. # ** Window_Base
  243. #------------------------------------------------------------------------------
  244. #  This is a super class of all windows within the game.
  245. #==============================================================================
  246.  
  247. class Window_Base < Window
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # * Draw Class
  251.   #--------------------------------------------------------------------------
  252.   def draw_actor_class(actor, x, y, width = 112)
  253.     change_color(normal_color)
  254.     draw_text(x, y, width, line_height, actor.class.name)
  255.   end
  256.  
  257.   #--------------------------------------------------------------------------
  258.   # * Alaising Method: Draw Level
  259.   #--------------------------------------------------------------------------
  260.   alias :dal434 :draw_actor_level
  261.  
  262.   #--------------------------------------------------------------------------
  263.   # * Draw Level
  264.   #--------------------------------------------------------------------------
  265.   def draw_actor_level(actor, x, y)
  266.     dal434(actor, x, y)
  267.     if actor.promotable?
  268.       draw_v_text(x, y + 25, 150, line_height, "Promotable", 0, 24, crisis_color)
  269.     end
  270.   end
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # * Draw V Level
  274.   #--------------------------------------------------------------------------
  275.   def draw_v_text(x, y, width, height, text, alignment, size, color = normal_color)
  276.     reset_font_settings
  277.     contents.font.size = size
  278.     change_color(color)
  279.     contents.draw_text(x, y, width, height, text, alignment)
  280.     reset_font_settings
  281.   end
  282.  
  283.   #--------------------------------------------------------------------------
  284.   # * Draw Zoomed Character
  285.   #--------------------------------------------------------------------------
  286.   def draw_zoomed_character(character_name, character_index, x, y, zoom)
  287.     return unless character_name
  288.     bitmap = Cache.character(character_name)
  289.     sign = character_name[/^[\!\$]./]
  290.     if sign && sign.include?('$')
  291.       cw = bitmap.width / 3
  292.       ch = bitmap.height / 4
  293.     else
  294.       cw = bitmap.width / 12
  295.       ch = bitmap.height / 8
  296.     end
  297.     n = character_index
  298.     src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
  299.     actor = Rect.new(x, y, cw * zoom, ch * zoom)
  300.     contents.stretch_blt(actor, bitmap, src_rect)    
  301.   end
  302.  
  303.   #--------------------------------------------------------------------------
  304.   # * Draw Zoomed Actor
  305.   #--------------------------------------------------------------------------
  306.   def draw_zoomed_actor_graphic(actor, x, y, zoom)
  307.     draw_zoomed_character(actor.character_name, actor.character_index, x, y, zoom)
  308.   end
  309.  
  310. end #<--- End Class============================================================
  311.  
  312.  
  313.  
  314. #==============================================================================#
  315. #------------------------------------------------------------------------------#
  316. #                                New Class                                     #
  317. #------------------------------------------------------------------------------#
  318. #==============================================================================#
  319.  
  320. #==============================================================================
  321. # ** Promotion_Header_Window
  322. #------------------------------------------------------------------------------
  323. #  This class handles all of the Promotion Header Window processing.
  324. #==============================================================================
  325.  
  326. class Promotion_Header_Window < Window_Base
  327.  
  328.   #--------------------------------------------------------------------------
  329.   # * Initialize Proccessing
  330.   #--------------------------------------------------------------------------
  331.   def initialize(x, y, width, height)
  332.     super(x, y, width, height)
  333.     draw_contents
  334.   end
  335.  
  336.   #--------------------------------------------------------------------------
  337.   # * Draw Contents
  338.   #--------------------------------------------------------------------------
  339.   def draw_contents
  340.     draw_v_text(-10, -15, Graphics.width, 75, "Who Do You Want To Promote?", 1, 34)
  341.   end
  342.  
  343. end #<--- End Class============================================================
  344.  
  345.  
  346.  
  347. #==============================================================================#
  348. #------------------------------------------------------------------------------#
  349. #                                New Class                                     #
  350. #------------------------------------------------------------------------------#
  351. #==============================================================================#
  352.  
  353. #==============================================================================
  354. # ** Promotion_Info_Window
  355. #------------------------------------------------------------------------------
  356. #  This class handles all of the Promotion Info Window processing.
  357. #==============================================================================
  358.  
  359. class Promotion_Info_Window < Window_Base
  360.  
  361.   #--------------------------------------------------------------------------
  362.   # * Initialize Proccessing
  363.   #--------------------------------------------------------------------------
  364.   def initialize(x, y, width, height)
  365.     super(x, y, width, height)
  366.     @index = 0
  367.     set_up_promotion_vars
  368.   end
  369.  
  370.   #--------------------------------------------------------------------------
  371.   # * Refresh (Index)
  372.   #--------------------------------------------------------------------------
  373.   def refresh(index)
  374.     contents.clear
  375.     @index = index if index != @index
  376.     draw_actor_info(@index)
  377.   end
  378.  
  379.   #--------------------------------------------------------------------------
  380.   # * Set up promotional variable
  381.   #--------------------------------------------------------------------------
  382.   def set_up_promotion_vars
  383.     @promotables = []
  384.     $game_party.members.size.times { |i| @promotables.push $game_party.members[i] if $game_party.members[i].promotable? }
  385.   end
  386.  
  387.   #--------------------------------------------------------------------------
  388.   # * Draws actors info
  389.   #--------------------------------------------------------------------------
  390.   def draw_actor_info(index)
  391.     actor = @promotables[@index]
  392.     cost = "Cost: " + actor.promotion_cost?.to_s
  393.     draw_v_text(120, 55, (Graphics.width / 3) * 2, 75, actor.name, 0, 45)
  394.     draw_actor_face(actor, 10, 10)
  395.     draw_zoomed_actor_graphic(actor, 40, 150, 2)
  396.     draw_v_text(-105, 200, (Graphics.width / 3) * 2, 75, $data_classes[actor.class_id].name, 1, 22)
  397.     draw_v_text(-10, 150, (Graphics.width / 3) * 2, 75, ">", 1, 55)
  398.     draw_zoomed_character(actor.next_promotion_name, actor.next_promotion_index, 230, 150, 2)
  399.     draw_v_text(85, 200, (Graphics.width / 3) * 2, 75, $data_classes[actor.next_promotion_class].name, 1, 22)
  400.     draw_v_text(-10, 250, (Graphics.width / 3) * 2, 75, cost, 1, 40)
  401.   end
  402.  
  403. end #<--- End Class============================================================
  404.  
  405.  
  406.  
  407. #==============================================================================#
  408. #------------------------------------------------------------------------------#
  409. #                                New Class                                     #
  410. #------------------------------------------------------------------------------#
  411. #==============================================================================#
  412.  
  413. #==============================================================================
  414. # ** Promotion_Command_Window
  415. #------------------------------------------------------------------------------
  416. #  This class handles all of the Promotion Command Window processing.
  417. #==============================================================================
  418.  
  419. class Promotion_Command_Window < Window_Command
  420.  
  421.   #--------------------------------------------------------------------------
  422.   # * Set up promotional variable
  423.   #--------------------------------------------------------------------------
  424.   def set_up_promotion_vars
  425.     @promotables = []
  426.     $game_party.members.size.times { |i| @promotables.push $game_party.members[i] if $game_party.members[i].promotable? }
  427.   end
  428.  
  429.   #--------------------------------------------------------------------------
  430.   # * Make Command List
  431.   #--------------------------------------------------------------------------
  432.   def make_command_list
  433.     set_up_promotion_vars
  434.     @promotables.size.times { |i| add_command(@promotables[i].name, @promotables[i].name.to_sym, afford?(i)) }
  435.   end
  436.  
  437.   #--------------------------------------------------------------------------
  438.   # * Window Width
  439.   #--------------------------------------------------------------------------
  440.   def window_width
  441.     return Graphics.width / 3
  442.   end
  443.  
  444.   #--------------------------------------------------------------------------
  445.   # * Window Height
  446.   #--------------------------------------------------------------------------
  447.   def window_height
  448.     return Graphics.height - 75
  449.   end
  450.  
  451.   #--------------------------------------------------------------------------
  452.   # * Checks if party has enough to but promotion
  453.   #--------------------------------------------------------------------------
  454.   def afford?(id)
  455.     $game_party.gold > @promotables[id].promotion_cost?
  456.   end
  457. end #<--- End Class============================================================
  458.  
  459.  
  460.  
  461. #==============================================================================#
  462. #------------------------------------------------------------------------------#
  463. #                                New Class                                     #
  464. #------------------------------------------------------------------------------#
  465. #==============================================================================#
  466.  
  467. #==============================================================================
  468. # ** Promotion_Command_Window
  469. #------------------------------------------------------------------------------
  470. #  This class handles all of the Promotion Command Window processing.
  471. #==============================================================================
  472.  
  473. class Promotion_Confirm_Window < Window_Command
  474.  
  475.   #--------------------------------------------------------------------------
  476.   # * Select Last Index
  477.   #--------------------------------------------------------------------------
  478.   def select_last
  479.     select(0)
  480.   end
  481.  
  482.   #--------------------------------------------------------------------------
  483.   # * Make Command List
  484.   #--------------------------------------------------------------------------
  485.   def make_command_list
  486.     add_command("Confirm", :confirm)
  487.     add_command("Cancel", :cancel)
  488.   end
  489.  
  490.   #--------------------------------------------------------------------------
  491.   # * Window Width
  492.   #--------------------------------------------------------------------------
  493.   def window_width
  494.     return (Graphics.width / 5) * 3
  495.   end
  496.  
  497.   #--------------------------------------------------------------------------
  498.   # * Window Height
  499.   #--------------------------------------------------------------------------
  500.   def window_height
  501.     return 50
  502.   end
  503.  
  504.   #--------------------------------------------------------------------------
  505.   # * Maximum number of colums
  506.   #--------------------------------------------------------------------------
  507.   def col_max
  508.     return item_max
  509.   end
  510.  
  511.   #--------------------------------------------------------------------------
  512.   # * Visible line number
  513.   #--------------------------------------------------------------------------
  514.   def visible_line_number
  515.     1
  516.   end
  517.  
  518.   #--------------------------------------------------------------------------
  519.   # * Alignment
  520.   #--------------------------------------------------------------------------
  521.   def alignment
  522.     return 1
  523.   end
  524.  
  525. end #<--- End Class============================================================
  526.  
  527.  
  528.  
  529. #==============================================================================#
  530. #------------------------------------------------------------------------------#
  531. #                                New Class                                     #
  532. #------------------------------------------------------------------------------#
  533. #==============================================================================#
  534.  
  535. #==============================================================================
  536. # ** Promotion_Header_Window
  537. #------------------------------------------------------------------------------
  538. #  This class handles all of the Promotion Header Window processing.
  539. #==============================================================================
  540.  
  541. class Promotion_Confirm_Text_Window < Window_Base
  542.  
  543.   #--------------------------------------------------------------------------
  544.   # * Initialize Proccessing
  545.   #--------------------------------------------------------------------------
  546.   def initialize(x, y, width, height)
  547.     super(x, y, width, height)
  548.     draw_contents
  549.   end
  550.  
  551.   #--------------------------------------------------------------------------
  552.   # * Draw Contents
  553.   #--------------------------------------------------------------------------
  554.   def draw_contents
  555.     draw_v_text(0, -15, (Graphics.width / 5) * 3, 75, "Are you sure?", 1, 28)
  556.   end
  557.  
  558. end #<--- End Class============================================================
  559.  
  560.  
  561.  
  562. #==============================================================================#
  563. #------------------------------------------------------------------------------#
  564. #                                New Class                                     #
  565. #------------------------------------------------------------------------------#
  566. #==============================================================================#
  567.  
  568. #==============================================================================
  569. # ** V_Promotion_Scene
  570. #------------------------------------------------------------------------------
  571. #  This class handles all of the Promotion Scene processing.
  572. #==============================================================================
  573.  
  574. class V_Promotion_Scene < Scene_Base
  575.  
  576.   #--------------------------------------------------------------------------
  577.   # * Initialize Proccessing
  578.   #--------------------------------------------------------------------------
  579.   def initialize
  580.     super
  581.     set_up_promotion_vars
  582.     setup_promotion_windows
  583.   end
  584.  
  585.   #--------------------------------------------------------------------------
  586.   # * Set up promotional variable
  587.   #--------------------------------------------------------------------------
  588.   def set_up_promotion_vars
  589.     @promotables = []
  590.     $game_party.members.each_index { |i| @promotables.push $game_party.members[i] if $game_party.members[i].promotable? }
  591.   end
  592.  
  593.   #--------------------------------------------------------------------------
  594.   # * Sets up all windows
  595.   #--------------------------------------------------------------------------
  596.   def setup_promotion_windows
  597.     @promotion_header_window = Promotion_Header_Window.new(0, 0, Graphics.width, 75)
  598.     @promotion_header_window.back_opacity = 200
  599.     @promotion_info_window = Promotion_Info_Window.new(Graphics.width / 3, 75, (Graphics.width / 3) * 2, Graphics.height - 75)
  600.     @promotion_info_window.back_opacity = 200
  601.     @promotion_command_window = Promotion_Command_Window.new(0, 75)
  602.     @promotion_command_window.back_opacity = 200
  603.     @promotables.size.times { |i| @promotion_command_window.set_handler(@promotables[i].name.to_sym, method(:command_confirm)) }
  604.     @promotion_conformation_window = Promotion_Confirm_Window.new(Graphics.width / 5, 183)
  605.     @promotion_conformation_window.set_handler(:confirm, method(:command_promote))
  606.     @promotion_conformation_window.set_handler(:cancel, method(:command_cancel))
  607.     @promotion_conformation_window.openness = 0
  608.     @promotion_conformation_window.unselect
  609.     @promotion_conformation_text_window = Promotion_Confirm_Text_Window.new((Graphics.width / 5) - 15, 108, ((Graphics.width / 5) * 3) + 30, 75)
  610.     @promotion_conformation_text_window.openness = 0
  611.   end
  612.  
  613.   #--------------------------------------------------------------------------
  614.   # * Promotion Confirm Processing
  615.   #--------------------------------------------------------------------------
  616.   def command_confirm
  617.     @promotion_conformation_text_window.open
  618.     @promotion_conformation_window.open
  619.     @promotion_conformation_window.activate
  620.     @promotion_conformation_window.select_last
  621.   end
  622.  
  623.   #--------------------------------------------------------------------------
  624.   # * Promotion Command Processing
  625.   #--------------------------------------------------------------------------
  626.   def command_promote
  627.     @promotables.size.times { |i| @promotables[i].promote if @promotion_command_window.current_symbol.to_s == @promotables[i].name }
  628.     return_scene
  629.   end
  630.  
  631.   #--------------------------------------------------------------------------
  632.   # * Promotion Cancel Processing
  633.   #--------------------------------------------------------------------------
  634.   def command_cancel
  635.     return_scene
  636.   end
  637.  
  638.   #--------------------------------------------------------------------------
  639.   # * Update Info Window Actor
  640.   #--------------------------------------------------------------------------
  641.   def update_info_window
  642.     @promotion_info_window.refresh((@promotion_command_window.index))
  643.   end
  644.  
  645.   #--------------------------------------------------------------------------
  646.   # * Update Processing
  647.   #--------------------------------------------------------------------------
  648.   def update
  649.     super
  650.     update_info_window
  651.     return_scene if Input.trigger?(:B)
  652.   end
  653.  
  654. end #<--- End Class============================================================
  655.  
  656.  
  657.  
  658. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  659. #                                                                              #
  660. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  661. #                                 End of Script                                #
  662. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  663. #                                                                              #
  664. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
Advertisement
Add Comment
Please, Sign In to add comment