设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3157|回复: 7
打印 上一主题 下一主题

[转载] 【好久没来地球村了】真·职业系统

[复制链接]

Lv1.梦旅人

梦石
0
星屑
66
在线时间
140 小时
注册时间
2012-2-6
帖子
384
跳转到指定楼层
1
发表于 2012-3-11 20:37:16 | 只看该作者 回帖奖励 |正序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
YF作品。此系统与《凡仙》完全无关。
http://yanflychannel.wordpress.c ... class-unlock-level/
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Class System v1.09
  4. # -- Last Updated: 2012.01.29
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-ClassSystem"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.29 - Visual Bug: Disabled classes now have faded icons.
  15. # 2012.01.08 - Compatibility Update: Learn Skill Engine
  16. # 2012.01.05 - Bug Fixed: Equipment no longer gets duplicated.
  17. # 2012.01.04 - Update: Autobattle will no longer use skills not available to
  18. #              that class for specific actors.
  19. # 2012.01.02 - Efficiency Update.
  20. # 2011.12.26 - Added custom command functionality.
  21. # 2011.12.23 - Compatibility Update: Class Specifics.
  22. # 2011.12.22 - Compatibility Update: Ace Menu Engine.
  23. # 2011.12.20 - Compatibility Update: Class Unlock Level.
  24. # 2011.12.19 - Started Script and Finished.
  25. #
  26. #==============================================================================
  27. # ▼ Introduction
  28. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. # This script adds the ability for your player to freely change the classes of
  30. # actors outside of battle from a menu. When changing classes, this script
  31. # gives the option for the developer to choose whether or not classes have
  32. # their own levels (causing the actor's level to reset back to the class's
  33. # level) or to maintain the current level. In addition to providing the ability
  34. # to change classes, equipping a subclass is also doable, and the mechanics of
  35. # having a subclass can also be defined within this script.
  36. #
  37. #==============================================================================
  38. # ▼ Instructions
  39. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  40. # To install this script, open up your script editor and copy/paste this script
  41. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  42. #
  43. # -----------------------------------------------------------------------------
  44. # Actor Notetags - These notetags go in the actors notebox in the database.
  45. # -----------------------------------------------------------------------------
  46. # <unlocked classes: x>
  47. # <unlocked classes: x, x>
  48. # This will set the default classes as unlocked for the actor. This does not
  49. # override the default classes unlocked in the module, but instead, adds on
  50. # to the number of unlocked classes.
  51. #
  52. # -----------------------------------------------------------------------------
  53. # Class Notetags - These notetags go in the class notebox in the database.
  54. # -----------------------------------------------------------------------------
  55. # <icon: x>
  56. # Sets the icon representing the class to x.
  57. #
  58. # <help description>
  59. #  string
  60. #  string
  61. # </help description>
  62. # Sets the text used for the help window in the class scene. Multiple lines in
  63. # the notebox will be strung together. Use | for a line break.
  64. #
  65. # -----------------------------------------------------------------------------
  66. # Script Calls - These commands are used with script calls.
  67. # -----------------------------------------------------------------------------
  68. # $game_actors[x].unlock_class(y)
  69. # This allows actor x to unlock class y, making it available for switching in
  70. # and out in the Class scene.
  71. #
  72. # $game_actors[x].remove_class(y)
  73. # This causes actor x to remove class y from being able to switch to and from.
  74. # If the actor is currently class y, the class will not be removed. If the
  75. # actor's current subclass is y, the subclass will be unequipped.
  76. #
  77. #==============================================================================
  78. # ▼ Compatibility
  79. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  80. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  81. # it will run with RPG Maker VX without adjusting.
  82. #
  83. #==============================================================================

  84. module YEA
  85.   module CLASS_SYSTEM
  86.    
  87.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  88.     # - General Class Settings -
  89.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90.     # These are the general settings regarding the whole script. They control
  91.     # various rules and regulations that this script undergoes. These settings
  92.     # will also determine what a subclass can do for a player.
  93.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94.     CLASS_MENU_TEXT = "Class"  # Text that appears in the Main Menu.
  95.     MAINTAIN_LEVELS = false    # Maintain through all classes. Default: false.
  96.     DEFAULT_UNLOCKS = [ 1, 11, 21, 31]   # Classes unlocked by default.
  97.    
  98.     # The display between a primary class and a subclass when written in a
  99.     # window will appear as such.
  100.     SUBCLASS_TEXT = "%s/%s"
  101.    
  102.     # This adjusts the stat rate inheritance for an actor if an actor has a
  103.     # subclass equipped. If you want to disable this, set the rate to 0.0.
  104.     SUBCLASS_STAT_RATE = 0.20
  105.    
  106.     # This adds subclass skill types to the available skill types usable.
  107.     SUBCLASS_SKILL_TYPES = true
  108.    
  109.     # This adds subclass weapons to equippable weapon types.
  110.     SUBCLASS_WEAPON_TYPES = true
  111.    
  112.     # This adds subclass weapons to equippable armour types.
  113.     SUBCLASS_ARMOUR_TYPES = true
  114.    
  115.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  116.     # - Class Scene Commands -
  117.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  118.     # These settings adjust how the class scene appears. Here, you can adjust
  119.     # the command list and the order at which items appear. These are mostly
  120.     # visual settings. Adjust them as you see fit.
  121.     #
  122.     # -------------------------------------------------------------------------
  123.     # :command         Description
  124.     # -------------------------------------------------------------------------
  125.     # :primary         Allows the player to change the primary class.
  126.     # :subclass        Allows the player to change the subclass.
  127.     #
  128.     # :learn_skill     Requires YEA - Learn Skill Engine
  129.     #
  130.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  131.     COMMANDS =[ # The order at which the menu items are shown.
  132.     # [ :command,   "Display"],
  133.       [ :primary,   "Primary"],
  134.       [:subclass,  "Subclass"],
  135.       [:learn_skill, "Custom"],
  136.     # [ :custom1,   "Custom1"],
  137.     # [ :custom2,   "Custom2"],
  138.     ] # Do not remove this.
  139.    
  140.     #--------------------------------------------------------------------------
  141.     # - Status Class Commands -
  142.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  143.     # For those who use scripts to that may produce unique effects for the
  144.     # class menu, use this hash to manage the custom commands for the Class
  145.     # Command Window. You can disable certain commands or prevent them from
  146.     # appearing by using switches. If you don't wish to bind them to a switch,
  147.     # set the proper switch to 0 for it to have no impact.
  148.     #--------------------------------------------------------------------------
  149.     CUSTOM_CLASS_COMMANDS ={
  150.     # :command => [EnableSwitch, ShowSwitch, Handler Method,
  151.       :custom1 => [           0,          0, :command_name1],
  152.       :custom2 => [           0,          0, :command_name2],
  153.     } # Do not remove this.
  154.    
  155.     # These settings adjust the colour displays for classes.
  156.     CURRENT_CLASS_COLOUR = 17     # "Window" colour used for current class.
  157.     SUBCLASS_COLOUR      = 4      # "Window" colour used for subclass.
  158.    
  159.     # This adjusts the display for class levels if MAINTAIN_LEVELS is false.
  160.     CLASS_LEVEL     = "LV%s"      # Text display for level.
  161.     LEVEL_FONT_SIZE = 16          # Font size used for level.
  162.    
  163.     # This array sets the order of how classes are ordered in the class listing
  164.     # window. Any class ID's unlisted will not be shown.
  165.     CLASS_ORDER = [41..999, 1..40]
  166.    
  167.     # This adjusts the font size for the Parameters window.
  168.     PARAM_FONT_SIZE = 20
  169.    
  170.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  171.     # - Switch Settings -
  172.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173.     # These are the switches that govern whether or not certain menu items will
  174.     # appear and/or will be enabled. By binding them to a Switch, you can just
  175.     # set the Switch ON/OFF to show/hide or enable/disable a menu command. If
  176.     # you do not wish to use this feature, set these commands to 0.
  177.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  178.     SWITCH_SHOW_CLASS      = 0    # Switch that shows Class in Main Menu.
  179.     SWITCH_ENABLE_CLASS    = 0    # Switch that enables Class in Main Menu.
  180.     SWITCH_SHOW_PRIMARY    = 0    # Switch that shows Subclass in Class Menu.
  181.     SWITCH_ENABLE_PRIMARY  = 0    # Switch that enables Subclass in Class Menu.
  182.     SWITCH_SHOW_SUBCLASS   = 0    # Switch that shows Subclass in Class Menu.
  183.     SWITCH_ENABLE_SUBCLASS = 0    # Switch that enables Subclass in Class Menu.
  184.    
  185.   end # CLASS_SYSTEM
  186. end # YEA

  187. #==============================================================================
  188. # ▼ Editting anything past this point may potentially result in causing
  189. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  190. # halitosis so edit at your own risk.
  191. #==============================================================================

  192. module YEA
  193.   module CLASS_SYSTEM
  194.     module_function
  195.     #--------------------------------------------------------------------------
  196.     # convert_integer_array
  197.     #--------------------------------------------------------------------------
  198.     def convert_integer_array(array)
  199.       result = []
  200.       array.each { |i|
  201.         case i
  202.         when Range; result |= i.to_a
  203.         when Integer; result |= [i]
  204.         end }
  205.       return result
  206.     end
  207.     #--------------------------------------------------------------------------
  208.     # converted_contants
  209.     #--------------------------------------------------------------------------
  210.     DEFAULT_UNLOCKS = convert_integer_array(DEFAULT_UNLOCKS)
  211.     CLASS_ORDER = convert_integer_array(CLASS_ORDER)
  212.   end # CLASS_SYSTEM
  213.   module REGEXP
  214.   module ACTOR
  215.    
  216.     UNLOCKED_CLASSES =
  217.       /<(?:UNLOCKED_CLASSES|unlocked classes):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  218.    
  219.   end # ACTOR
  220.   module CLASS
  221.    
  222.     ICON_INDEX = /<(?:ICON_INDEX|icon index|icon):[ ](\d+)>/i
  223.     HELP_DESCRIPTION_ON  = /<(?:HELP_DESCRIPTION|help description)>/i
  224.     HELP_DESCRIPTION_OFF = /<\/(?:HELP_DESCRIPTION|help description)>/i
  225.    
  226.   end # CLASS
  227.   end # REGEXP
  228. end # YEA

  229. #==============================================================================
  230. # ■ Switch
  231. #==============================================================================

  232. module Switch
  233.   
  234.   #--------------------------------------------------------------------------
  235.   # self.class_show
  236.   #--------------------------------------------------------------------------
  237.   def self.class_show
  238.     return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_CLASS <= 0
  239.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_CLASS]
  240.   end
  241.   
  242.   #--------------------------------------------------------------------------
  243.   # self.class_enable
  244.   #--------------------------------------------------------------------------
  245.   def self.class_enable
  246.     return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_CLASS <= 0
  247.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_CLASS]
  248.   end
  249.   
  250.   #--------------------------------------------------------------------------
  251.   # self.primary_show
  252.   #--------------------------------------------------------------------------
  253.   def self.primary_show
  254.     return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_PRIMARY <= 0
  255.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_PRIMARY]
  256.   end
  257.   
  258.   #--------------------------------------------------------------------------
  259.   # self.primary_enable
  260.   #--------------------------------------------------------------------------
  261.   def self.primary_enable
  262.     return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_PRIMARY <= 0
  263.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_PRIMARY]
  264.   end
  265.   
  266.   #--------------------------------------------------------------------------
  267.   # self.subclass_show
  268.   #--------------------------------------------------------------------------
  269.   def self.subclass_show
  270.     return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_SUBCLASS <= 0
  271.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_SUBCLASS]
  272.   end
  273.   
  274.   #--------------------------------------------------------------------------
  275.   # self.subclass_enable
  276.   #--------------------------------------------------------------------------
  277.   def self.subclass_enable
  278.     return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_SUBCLASS <= 0
  279.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_SUBCLASS]
  280.   end
  281.    
  282. end # Switch

  283. #==============================================================================
  284. # ■ Numeric
  285. #==============================================================================

  286. class Numeric
  287.   
  288.   #--------------------------------------------------------------------------
  289.   # new method: group_digits
  290.   #--------------------------------------------------------------------------
  291.   unless $imported["YEA-CoreEngine"]
  292.   def group; return self.to_s; end
  293.   end # $imported["YEA-CoreEngine"]
  294.    
  295. end # Numeric

  296. #==============================================================================
  297. # ■ DataManager
  298. #==============================================================================

  299. module DataManager
  300.   
  301.   #--------------------------------------------------------------------------
  302.   # alias method: load_database
  303.   #--------------------------------------------------------------------------
  304.   class <<self; alias load_database_cs load_database; end
  305.   def self.load_database
  306.     load_database_cs
  307.     load_notetags_cs
  308.   end
  309.   
  310.   #--------------------------------------------------------------------------
  311.   # new method: load_notetags_cs
  312.   #--------------------------------------------------------------------------
  313.   def self.load_notetags_cs
  314.     groups = [$data_actors, $data_classes]
  315.     for group in groups
  316.       for obj in group
  317.         next if obj.nil?
  318.         obj.load_notetags_cs
  319.       end
  320.     end
  321.   end
  322.   
  323. end # DataManager

  324. #==============================================================================
  325. # ■ RPG::Actor
  326. #==============================================================================

  327. class RPG::Actor < RPG::BaseItem
  328.   
  329.   #--------------------------------------------------------------------------
  330.   # public instance variables
  331.   #--------------------------------------------------------------------------
  332.   attr_accessor :unlocked_classes
  333.   
  334.   #--------------------------------------------------------------------------
  335.   # common cache: load_notetags_cs
  336.   #--------------------------------------------------------------------------
  337.   def load_notetags_cs
  338.     @unlocked_classes = []
  339.     #---
  340.     self.note.split(/[\r\n]+/).each { |line|
  341.       case line
  342.       #---
  343.       when YEA::REGEXP::ACTOR::UNLOCKED_CLASSES
  344.         $1.scan(/\d+/).each { |num|
  345.         @unlocked_classes.push(num.to_i) if num.to_i > 0 }
  346.       #---
  347.       end
  348.     } # self.note.split
  349.     #---
  350.   end
  351.   
  352. end # RPG::Actor

  353. #==============================================================================
  354. # ■ RPG::Class
  355. #==============================================================================

  356. class RPG::Class < RPG::BaseItem
  357.   
  358.   #--------------------------------------------------------------------------
  359.   # public instance variables
  360.   #--------------------------------------------------------------------------
  361.   attr_accessor :icon_index
  362.   
  363.   #--------------------------------------------------------------------------
  364.   # common cache: load_notetags_cs
  365.   #--------------------------------------------------------------------------
  366.   def load_notetags_cs
  367.     @icon_index = 0
  368.     @help_description_on = false
  369.     #---
  370.     self.note.split(/[\r\n]+/).each { |line|
  371.       case line
  372.       #---
  373.       when YEA::REGEXP::CLASS::ICON_INDEX
  374.         @icon_index = $1.to_i
  375.       #---
  376.       when YEA::REGEXP::CLASS::HELP_DESCRIPTION_ON
  377.         @help_description_on = true
  378.       when YEA::REGEXP::CLASS::HELP_DESCRIPTION_OFF
  379.         @help_description_on = false
  380.       #---
  381.       else
  382.         @description += line.to_s if @help_description_on
  383.       end
  384.     } # self.note.split
  385.     #---
  386.     @description.gsub!(/[|]/i) { "\n" }
  387.   end
  388.   
  389. end # RPG::Class

  390. #==============================================================================
  391. # ■ Game_Temp
  392. #==============================================================================

  393. class Game_Temp
  394.   
  395.   #--------------------------------------------------------------------------
  396.   # public instance variables
  397.   #--------------------------------------------------------------------------
  398.   attr_accessor :scene_class_index
  399.   attr_accessor :scene_class_oy
  400.   
  401. end # Game_Temp

  402. #==============================================================================
  403. # ■ Game_Action
  404. #==============================================================================

  405. class Game_Action
  406.   
  407.   #--------------------------------------------------------------------------
  408.   # alias method: valid?
  409.   #--------------------------------------------------------------------------
  410.   alias game_action_valid_cs valid?
  411.   def valid?
  412.     return false if check_auto_battle_class
  413.     return game_action_valid_cs
  414.   end
  415.   
  416.   #--------------------------------------------------------------------------
  417.   # new method: check_auto_battle_class
  418.   #--------------------------------------------------------------------------
  419.   def check_auto_battle_class
  420.     return false unless subject.actor?
  421.     return false unless subject.auto_battle?
  422.     return false if item.nil?
  423.     return false if subject.added_skill_types.include?(item.stype_id)
  424.     return false if item.id == subject.attack_skill_id
  425.     return true
  426.   end
  427.   
  428. end # Game_Action

  429. #==============================================================================
  430. # ■ Game_BattlerBase
  431. #==============================================================================

  432. class Game_BattlerBase
  433.   
  434.   #--------------------------------------------------------------------------
  435.   # public instance variables
  436.   #--------------------------------------------------------------------------
  437.   attr_accessor :temp_flag
  438.   
  439.   #--------------------------------------------------------------------------
  440.   # alias method: added_skill_types
  441.   #--------------------------------------------------------------------------
  442.   alias game_battlerbase_added_skill_types_cs added_skill_types
  443.   def added_skill_types
  444.     result = game_battlerbase_added_skill_types_cs
  445.     result |= subclass_skill_types
  446.     return result
  447.   end
  448.   
  449.   #--------------------------------------------------------------------------
  450.   # new method: subclass_skill_types
  451.   #--------------------------------------------------------------------------
  452.   def subclass_skill_types; return []; end
  453.   
  454.   #--------------------------------------------------------------------------
  455.   # alias method: equip_wtype_ok?
  456.   #--------------------------------------------------------------------------
  457.   alias game_battlerbase_equip_wtype_ok_cs equip_wtype_ok?
  458.   def equip_wtype_ok?(wtype_id)
  459.     return true if subclass_equip_wtype?(wtype_id)
  460.     return game_battlerbase_equip_wtype_ok_cs(wtype_id)
  461.   end
  462.   
  463.   #--------------------------------------------------------------------------
  464.   # new method: subclass_equip_wtype?
  465.   #--------------------------------------------------------------------------
  466.   def subclass_equip_wtype?(wtype_id); return false; end
  467.   
  468.   #--------------------------------------------------------------------------
  469.   # alias method: equip_atype_ok?
  470.   #--------------------------------------------------------------------------
  471.   alias game_battlerbase_equip_atype_ok_cs equip_atype_ok?
  472.   def equip_atype_ok?(atype_id)
  473.     return true if subclass_equip_atype?(atype_id)
  474.     return game_battlerbase_equip_atype_ok_cs(atype_id)
  475.   end
  476.   
  477.   #--------------------------------------------------------------------------
  478.   # new method: subclass_equip_atype?
  479.   #--------------------------------------------------------------------------
  480.   def subclass_equip_atype?(atype_id); return false; end
  481.   
  482. end # Game_BattlerBase

  483. #==============================================================================
  484. # ■ Game_Actor
  485. #==============================================================================

  486. class Game_Actor < Game_Battler
  487.   
  488.   #--------------------------------------------------------------------------
  489.   # alias method: setup
  490.   #--------------------------------------------------------------------------
  491.   alias game_actor_setup_cs setup
  492.   def setup(actor_id)
  493.     game_actor_setup_cs(actor_id)
  494.     init_unlocked_classes
  495.     init_subclass
  496.   end
  497.   
  498.   #--------------------------------------------------------------------------
  499.   # new method: init_unlocked_classes
  500.   #--------------------------------------------------------------------------
  501.   def init_unlocked_classes
  502.     @unlocked_classes = actor.unlocked_classes.clone
  503.     @unlocked_classes.push(@class_id) if !@unlocked_classes.include?(@class_id)
  504.     @unlocked_classes.sort!
  505.   end
  506.   
  507.   #--------------------------------------------------------------------------
  508.   # new method: init_subclass
  509.   #--------------------------------------------------------------------------
  510.   def init_subclass
  511.     @subclass_id = 0
  512.   end
  513.   
  514.   #--------------------------------------------------------------------------
  515.   # new method: unlocked_classes
  516.   #--------------------------------------------------------------------------
  517.   def unlocked_classes
  518.     init_unlocked_classes if @unlocked_classes.nil?
  519.     return @unlocked_classes
  520.   end
  521.   
  522.   #--------------------------------------------------------------------------
  523.   # new method: unlock_class
  524.   #--------------------------------------------------------------------------
  525.   def unlock_class(class_id)
  526.     init_unlocked_classes if @unlocked_classes.nil?
  527.     return if @unlocked_classes.include?(class_id)
  528.     @unlocked_classes.push(class_id)
  529.     learn_class_skills(class_id)
  530.   end
  531.   
  532.   #--------------------------------------------------------------------------
  533.   # new method: remove_class
  534.   #--------------------------------------------------------------------------
  535.   def remove_class(class_id)
  536.     init_unlocked_classes if @unlocked_classes.nil?
  537.     return if class_id == @class_id
  538.     @unlocked_classes.delete(class_id)
  539.     @subclass_id = 0 if class_id == @subclass_id
  540.     refresh
  541.   end
  542.   
  543.   #--------------------------------------------------------------------------
  544.   # new method: subclass
  545.   #--------------------------------------------------------------------------
  546.   def subclass
  547.     init_subclass if @subclass_id.nil?
  548.     return $data_classes[@subclass_id]
  549.   end
  550.   
  551.   #--------------------------------------------------------------------------
  552.   # alias method: change_class
  553.   #--------------------------------------------------------------------------
  554.   alias game_actor_change_class_cs change_class
  555.   def change_class(class_id, keep_exp = false)
  556.     @subclass_id = 0 if @subclass_id == class_id
  557.     game_actor_change_class_cs(class_id, keep_exp)
  558.     learn_class_skills(class_id)
  559.     unlock_class(class_id)
  560.   end
  561.   
  562.   #--------------------------------------------------------------------------
  563.   # new method: learn_class_skills
  564.   #--------------------------------------------------------------------------
  565.   def learn_class_skills(class_id)
  566.     return if class_id <= 0
  567.     return if $data_classes[class_id].nil?
  568.     $data_classes[class_id].learnings.each do |learning|
  569.       learn_skill(learning.skill_id) if learning.level == class_level(class_id)
  570.     end
  571.   end
  572.   
  573.   #--------------------------------------------------------------------------
  574.   # new method: change_subclass
  575.   #--------------------------------------------------------------------------
  576.   def change_subclass(class_id)
  577.     return if class_id == @class_id
  578.     unlock_class(class_id)
  579.     @subclass_id = @subclass_id == class_id ? 0 : class_id
  580.     learn_class_skills(@subclass_id)
  581.     refresh
  582.   end
  583.   
  584.   #--------------------------------------------------------------------------
  585.   # new method: class_level
  586.   #--------------------------------------------------------------------------
  587.   def class_level(class_id)
  588.     return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  589.     temp_class = $data_classes[class_id]
  590.     @exp[class_id] = 0 if @exp[class_id].nil?
  591.     n = 1
  592.     loop do
  593.       break if temp_class.exp_for_level(n+1) > @exp[class_id]
  594.       n += 1
  595.     end
  596.     return n
  597.   end
  598.   
  599.   #--------------------------------------------------------------------------
  600.   # new method: subclass_level
  601.   #--------------------------------------------------------------------------
  602.   def subclass_level
  603.     return 0 if @subclass_id == 0
  604.     return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  605.     return class_level(@subclass_id)
  606.   end
  607.   
  608.   #--------------------------------------------------------------------------
  609.   # alias method: param_base
  610.   #--------------------------------------------------------------------------
  611.   alias game_actor_param_base_cs param_base
  612.   def param_base(param_id)
  613.     result = game_actor_param_base_cs(param_id)
  614.     unless subclass.nil?
  615.       subclass_rate = YEA::CLASS_SYSTEM::SUBCLASS_STAT_RATE
  616.       slevel = subclass_level
  617.       result += subclass.params[param_id, slevel] * subclass_rate
  618.     end
  619.     return result.to_i
  620.   end
  621.   
  622.   #--------------------------------------------------------------------------
  623.   # new method: subclass_skill_types
  624.   #--------------------------------------------------------------------------
  625.   def subclass_skill_types
  626.     return [] unless YEA::CLASS_SYSTEM::SUBCLASS_SKILL_TYPES
  627.     return [] if subclass.nil?
  628.     array = []
  629.     for feature in subclass.features
  630.       next unless feature.code == FEATURE_STYPE_ADD
  631.       next if features_set(FEATURE_STYPE_ADD).include?(feature.data_id)
  632.       array.push(feature.data_id)
  633.     end
  634.     return array
  635.   end
  636.   
  637.   #--------------------------------------------------------------------------
  638.   # new method: subclass_equip_wtype?
  639.   #--------------------------------------------------------------------------
  640.   def subclass_equip_wtype?(wtype_id)
  641.     return false unless YEA::CLASS_SYSTEM::SUBCLASS_WEAPON_TYPES
  642.     return false if subclass.nil?
  643.     for feature in subclass.features
  644.       next unless feature.code == FEATURE_EQUIP_WTYPE
  645.       return true if wtype_id == feature.data_id
  646.     end
  647.     return super
  648.   end
  649.   
  650.   #--------------------------------------------------------------------------
  651.   # new method: subclass_equip_atype?
  652.   #--------------------------------------------------------------------------
  653.   def subclass_equip_atype?(atype_id)
  654.     return false unless YEA::CLASS_SYSTEM::SUBCLASS_ARMOUR_TYPES
  655.     return false if subclass.nil?
  656.     for feature in subclass.features
  657.       next unless feature.code == FEATURE_EQUIP_ATYPE
  658.       return true if atype_id == feature.data_id
  659.     end
  660.     return super
  661.   end
  662.   
  663.   #--------------------------------------------------------------------------
  664.   # alias method: release_unequippable_items
  665.   #--------------------------------------------------------------------------
  666.   alias game_actor_release_unequippable_items_cs release_unequippable_items
  667.   def release_unequippable_items(item_gain = true)
  668.     item_gain = false if @temp_flag
  669.     game_actor_release_unequippable_items_cs(item_gain)
  670.   end
  671.   
  672. end # Game_Actor

  673. #==============================================================================
  674. # ■ Game_Interpreter
  675. #==============================================================================

  676. class Game_Interpreter
  677.   
  678.   #--------------------------------------------------------------------------
  679.   # overwrite method: command_321
  680.   #--------------------------------------------------------------------------
  681.   def command_321
  682.     actor = $game_actors[@params[0]]
  683.     if actor && $data_classes[@params[1]]
  684.       maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  685.       actor.change_class(@params[1], maintain)
  686.     end
  687.   end
  688.   
  689. end # Game_Interpreter

  690. #==============================================================================
  691. # ■ Window_Base
  692. #==============================================================================

  693. class Window_Base < Window
  694.   
  695.   #--------------------------------------------------------------------------
  696.   # overwrite method: draw_actor_class
  697.   #--------------------------------------------------------------------------
  698.   def draw_actor_class(actor, x, y, width = 112)
  699.     change_color(normal_color)
  700.     if actor.subclass.nil?
  701.       text = actor.class.name
  702.     else
  703.       fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
  704.       text = sprintf(fmt, actor.class.name, actor.subclass.name)
  705.     end
  706.     draw_text(x, y, width, line_height, text)
  707.   end
  708.   
  709. end # Window_Base

  710. #==============================================================================
  711. # ■ Window_MenuCommand
  712. #==============================================================================

  713. class Window_MenuCommand < Window_Command
  714.   
  715.   #--------------------------------------------------------------------------
  716.   # alias method: add_formation_command
  717.   #--------------------------------------------------------------------------
  718.   alias window_menucommand_add_formation_command_cs add_formation_command
  719.   def add_formation_command
  720.     add_class_command unless $imported["YEA-AceMenuEngine"]
  721.     window_menucommand_add_formation_command_cs
  722.   end
  723.   
  724.   #--------------------------------------------------------------------------
  725.   # new method: add_class_command
  726.   #--------------------------------------------------------------------------
  727.   def add_class_command
  728.     return unless Switch.class_show
  729.     text = YEA::CLASS_SYSTEM::CLASS_MENU_TEXT
  730.     add_command(text, :class, Switch.class_enable)
  731.   end
  732.   
  733. end # Window_MenuCommand

  734. #==============================================================================
  735. # ■ Window_ClassCommand
  736. #==============================================================================

  737. class Window_ClassCommand < Window_Command
  738.   
  739.   #--------------------------------------------------------------------------
  740.   # initialize
  741.   #--------------------------------------------------------------------------
  742.   def initialize(x, y)
  743.     super(x, y)
  744.     @actor = nil
  745.   end
  746.   
  747.   #--------------------------------------------------------------------------
  748.   # ● ウィンドウ幅の取得
  749.   #--------------------------------------------------------------------------
  750.   def window_width; return 160; end
  751.   
  752.   #--------------------------------------------------------------------------
  753.   # actor=
  754.   #--------------------------------------------------------------------------
  755.   def actor=(actor)
  756.     return if @actor == actor
  757.     @actor = actor
  758.     refresh
  759.   end
  760.   
  761.   #--------------------------------------------------------------------------
  762.   # item_window=
  763.   #--------------------------------------------------------------------------
  764.   def item_window=(window)
  765.     @item_window = window
  766.   end
  767.   
  768.   #--------------------------------------------------------------------------
  769.   # visible_line_number
  770.   #--------------------------------------------------------------------------
  771.   def visible_line_number; return 4; end
  772.   
  773.   #--------------------------------------------------------------------------
  774.   # make_command_list
  775.   #--------------------------------------------------------------------------
  776.   def make_command_list
  777.     return if @actor.nil?
  778.     for command in YEA::CLASS_SYSTEM::COMMANDS
  779.       case command[0]
  780.       when :primary
  781.         next unless Switch.primary_show
  782.         add_command(command[1], command[0], Switch.primary_enable)
  783.       when :subclass
  784.         next unless Switch.subclass_show
  785.         add_command(command[1], command[0], Switch.subclass_enable)
  786.       when :learn_skill
  787.         next unless $imported["YEA-LearnSkillEngine"]
  788.         add_learn_skill_command
  789.       else
  790.         process_custom_command(command)
  791.       end
  792.     end
  793.     if !$game_temp.scene_class_index.nil?
  794.       select($game_temp.scene_class_index)
  795.       self.oy = $game_temp.scene_class_oy
  796.     end
  797.     $game_temp.scene_class_index = nil
  798.     $game_temp.scene_class_oy = nil
  799.   end
  800.   
  801.   #--------------------------------------------------------------------------
  802.   # process_ok
  803.   #--------------------------------------------------------------------------
  804.   def process_ok
  805.     $game_temp.scene_class_index = index
  806.     $game_temp.scene_class_oy = self.oy
  807.     super
  808.   end
  809.   
  810.   #--------------------------------------------------------------------------
  811.   # process_custom_command
  812.   #--------------------------------------------------------------------------
  813.   def process_custom_command(command)
  814.     return unless YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS.include?(command[0])
  815.     show = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][1]
  816.     continue = show <= 0 ? true : $game_switches[show]
  817.     return unless continue
  818.     text = command[1]
  819.     switch = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][0]
  820.     enabled = switch <= 0 ? true : $game_switches[switch]
  821.     add_command(text, command[0], enabled)
  822.   end
  823.   
  824.   #--------------------------------------------------------------------------
  825.   # update
  826.   #--------------------------------------------------------------------------
  827.   def update
  828.     super
  829.     update_visible_windows
  830.   end
  831.   
  832.   #--------------------------------------------------------------------------
  833.   # update_visible_windows
  834.   #--------------------------------------------------------------------------
  835.   def update_visible_windows
  836.     return if @current_index == current_symbol
  837.     @current_index = current_symbol
  838.     @item_window.refresh unless @item_window.nil?
  839.   end
  840.   
  841.   #--------------------------------------------------------------------------
  842.   # add_learn_skill_command
  843.   #--------------------------------------------------------------------------
  844.   def add_learn_skill_command
  845.     return unless Switch.show_learn_skill
  846.     name = YEA::LEARN_SKILL::COMMAND_NAME
  847.     add_command(name, :learn_skill, true)
  848.   end
  849.   
  850. end # Window_ClassCommand

  851. #==============================================================================
  852. # ■ Window_ClassStatus
  853. #==============================================================================

  854. class Window_ClassStatus < Window_Base
  855.   
  856.   #--------------------------------------------------------------------------
  857.   # initialize
  858.   #--------------------------------------------------------------------------
  859.   def initialize(dx, dy)
  860.     super(dx, dy, window_width, fitting_height(4))
  861.     @actor = nil
  862.   end
  863.   
  864.   #--------------------------------------------------------------------------
  865.   # window_width
  866.   #--------------------------------------------------------------------------
  867.   def window_width; Graphics.width - 160; end
  868.   
  869.   #--------------------------------------------------------------------------
  870.   # actor=
  871.   #--------------------------------------------------------------------------
  872.   def actor=(actor)
  873.     return if @actor == actor
  874.     @actor = actor
  875.     refresh
  876.   end
  877.   
  878.   #--------------------------------------------------------------------------
  879.   # refresh
  880.   #--------------------------------------------------------------------------
  881.   def refresh
  882.     contents.clear
  883.     return if @actor.nil?
  884.     draw_actor_face(@actor, 0, 0)
  885.     draw_actor_simple_status(@actor, 108, line_height / 2)
  886.   end
  887.   
  888. end # Window_ClassStatus

  889. #==============================================================================
  890. # ■ Window_ClassParam
  891. #==============================================================================

  892. class Window_ClassParam < Window_Base
  893.   
  894.   #--------------------------------------------------------------------------
  895.   # initialize
  896.   #--------------------------------------------------------------------------
  897.   def initialize(dx, dy)
  898.     super(dx, dy, window_width, Graphics.height - dy)
  899.     @actor = nil
  900.     @temp_actor = nil
  901.     refresh
  902.   end
  903.   
  904.   #--------------------------------------------------------------------------
  905.   # window_width
  906.   #--------------------------------------------------------------------------
  907.   def window_width; return Graphics.width * 2 / 5; end
  908.   
  909.   #--------------------------------------------------------------------------
  910.   # actor=
  911.   #--------------------------------------------------------------------------
  912.   def actor=(actor)
  913.     return if @actor == actor
  914.     @actor = actor
  915.     refresh
  916.   end
  917.   
  918.   #--------------------------------------------------------------------------
  919.   # refresh
  920.   #--------------------------------------------------------------------------
  921.   def refresh
  922.     contents.clear
  923.     8.times {|i| draw_item(0, line_height * i, i) }
  924.   end
  925.   
  926.   #--------------------------------------------------------------------------
  927.   # set_temp_actor
  928.   #--------------------------------------------------------------------------
  929.   def set_temp_actor(temp_actor)
  930.     return if @temp_actor == temp_actor
  931.     @temp_actor = temp_actor
  932.     refresh
  933.   end
  934.   
  935.   #--------------------------------------------------------------------------
  936.   # draw_item
  937.   #--------------------------------------------------------------------------
  938.   def draw_item(dx, dy, param_id)
  939.     draw_background_colour(dx, dy)
  940.     draw_param_name(dx + 4, dy, param_id)
  941.     draw_current_param(dx + 4, dy, param_id) if @actor
  942.     drx = (contents.width + 22) / 2
  943.     draw_right_arrow(drx, dy)
  944.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  945.     reset_font_settings
  946.   end
  947.   
  948.   #--------------------------------------------------------------------------
  949.   # draw_background_colour
  950.   #--------------------------------------------------------------------------
  951.   def draw_background_colour(dx, dy)
  952.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  953.     rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  954.     contents.fill_rect(rect, colour)
  955.   end
  956.   
  957.   #--------------------------------------------------------------------------
  958.   # overwrite method: draw_param_name
  959.   #--------------------------------------------------------------------------
  960.   def draw_param_name(dx, dy, param_id)
  961.     contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  962.     change_color(system_color)
  963.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  964.   end
  965.   
  966.   #--------------------------------------------------------------------------
  967.   # overwrite method: draw_current_param
  968.   #--------------------------------------------------------------------------
  969.   def draw_current_param(dx, dy, param_id)
  970.     change_color(normal_color)
  971.     dw = (contents.width + 22) / 2
  972.     draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  973.     reset_font_settings
  974.   end
  975.   
  976.   #--------------------------------------------------------------------------
  977.   # draw_right_arrow
  978.   #--------------------------------------------------------------------------
  979.   def draw_right_arrow(x, y)
  980.     change_color(system_color)
  981.     draw_text(x, y, 22, line_height, "→", 1)
  982.   end
  983.   
  984.   #--------------------------------------------------------------------------
  985.   # draw_new_param
  986.   #--------------------------------------------------------------------------
  987.   def draw_new_param(dx, dy, param_id)
  988.     contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  989.     new_value = @temp_actor.param(param_id)
  990.     change_color(param_change_color(new_value - @actor.param(param_id)))
  991.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  992.     reset_font_settings
  993.   end
  994.   
  995. end # Window_ClassParam

  996. #==============================================================================
  997. # ■ Window_ClassList
  998. #==============================================================================

  999. class Window_ClassList < Window_Selectable
  1000.   
  1001.   #--------------------------------------------------------------------------
  1002.   # initialize
  1003.   #--------------------------------------------------------------------------
  1004.   def initialize(dx, dy)
  1005.     dw = Graphics.width - (Graphics.width * 2 / 5)
  1006.     dh = Graphics.height - dy
  1007.     super(dx, dy, dw, dh)
  1008.     @actor = nil
  1009.     @command_window = nil
  1010.     @status_window
  1011.     @data = []
  1012.   end
  1013.   
  1014.   #--------------------------------------------------------------------------
  1015.   # actor=
  1016.   #--------------------------------------------------------------------------
  1017.   def actor=(actor)
  1018.     return if @actor == actor
  1019.     @actor = actor
  1020.     @last_item = nil
  1021.     refresh
  1022.     self.oy = 0
  1023.   end
  1024.   
  1025.   #--------------------------------------------------------------------------
  1026.   # command_window=
  1027.   #--------------------------------------------------------------------------
  1028.   def command_window=(command_window)
  1029.     @command_window = command_window
  1030.   end
  1031.   
  1032.   #--------------------------------------------------------------------------
  1033.   # status_window=
  1034.   #--------------------------------------------------------------------------
  1035.   def status_window=(status_window)
  1036.     @status_window = status_window
  1037.   end
  1038.   
  1039.   #--------------------------------------------------------------------------
  1040.   # item_max
  1041.   #--------------------------------------------------------------------------
  1042.   def item_max; return @data ? @data.size : 1; end
  1043.   
  1044.   #--------------------------------------------------------------------------
  1045.   # item
  1046.   #--------------------------------------------------------------------------
  1047.   def item; return @data && index >= 0 ? @data[index] : nil; end
  1048.   
  1049.   #--------------------------------------------------------------------------
  1050.   # current_item_enabled?
  1051.   #--------------------------------------------------------------------------
  1052.   def current_item_enabled?; return enable?(@data[index]); end
  1053.   
  1054.   #--------------------------------------------------------------------------
  1055.   # include?
  1056.   #--------------------------------------------------------------------------
  1057.   def include?(item)
  1058.     return true if YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id)
  1059.     return @actor.unlocked_classes.include?(item.id)
  1060.   end
  1061.   
  1062.   #--------------------------------------------------------------------------
  1063.   # enable?
  1064.   #--------------------------------------------------------------------------
  1065.   def enable?(item)
  1066.     return false if item == @actor.class
  1067.     return true
  1068.   end
  1069.   
  1070.   #--------------------------------------------------------------------------
  1071.   # make_item_list
  1072.   #--------------------------------------------------------------------------
  1073.   def make_item_list
  1074.     @data = []
  1075.     for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
  1076.       next if $data_classes[class_id].nil?
  1077.       item = $data_classes[class_id]
  1078.       @data.push(item) if include?(item)
  1079.     end
  1080.   end
  1081.   
  1082.   #--------------------------------------------------------------------------
  1083.   # select_last
  1084.   #--------------------------------------------------------------------------
  1085.   def select_last
  1086.     case @command_window.current_symbol
  1087.     when :primary
  1088.       select(@data.index(@actor.class))
  1089.     when :subclass
  1090.       select(0) if @actor.subclass.nil?
  1091.       select(@data.index(@actor.subclass)) unless @actor.subclass.nil?
  1092.     else
  1093.       select(0)
  1094.     end
  1095.   end
  1096.   
  1097.   #--------------------------------------------------------------------------
  1098.   # draw_item
  1099.   #--------------------------------------------------------------------------
  1100.   def draw_item(index)
  1101.     item = @data[index]
  1102.     return if item.nil?
  1103.     rect = item_rect(index)
  1104.     rect.width -= 4
  1105.     reset_font_settings
  1106.     set_item_colour(item)
  1107.     draw_class_icon(item, rect)
  1108.     draw_class_name(item, rect)
  1109.     draw_class_level(item, rect)
  1110.   end
  1111.   
  1112.   #--------------------------------------------------------------------------
  1113.   # set_item_colour
  1114.   #--------------------------------------------------------------------------
  1115.   def set_item_colour(item)
  1116.     if item == @actor.class
  1117.       change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR))
  1118.     elsif item == @actor.subclass
  1119.       change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR))
  1120.     else
  1121.       change_color(normal_color, enable?(item))
  1122.     end
  1123.   end
  1124.   
  1125.   #--------------------------------------------------------------------------
  1126.   # draw_class_icon
  1127.   #--------------------------------------------------------------------------
  1128.   def draw_class_icon(item, rect)
  1129.     icon = item.icon_index
  1130.     draw_icon(icon, rect.x, rect.y, enable?(item))
  1131.   end
  1132.   
  1133.   #--------------------------------------------------------------------------
  1134.   # draw_class_name
  1135.   #--------------------------------------------------------------------------
  1136.   def draw_class_name(item, rect)
  1137.     text = item.name
  1138.     draw_text(24, rect.y, rect.width-24, line_height, text)
  1139.   end
  1140.   
  1141.   #--------------------------------------------------------------------------
  1142.   # draw_class_level
  1143.   #--------------------------------------------------------------------------
  1144.   def draw_class_level(item, rect)
  1145.     return if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  1146.     return if @actor.nil?
  1147.     level = @actor.class_level(item.id)
  1148.     contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE
  1149.     text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group)
  1150.     draw_text(rect, text, 2)
  1151.   end
  1152.   
  1153.   #--------------------------------------------------------------------------
  1154.   # update_help
  1155.   #--------------------------------------------------------------------------
  1156.   def update_help
  1157.     @help_window.set_item(item)
  1158.     return if @actor.nil?
  1159.     return if @status_window.nil?
  1160.     update_param_window
  1161.   end
  1162.   
  1163.   #--------------------------------------------------------------------------
  1164.   # update_param_window
  1165.   #--------------------------------------------------------------------------
  1166.   def update_param_window
  1167.     return if @last_item == item
  1168.     @last_item = item
  1169.     class_id = item.nil? ? @actor.class_id : item.id
  1170.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1171.     temp_actor.temp_flag = true
  1172.     case @command_window.current_symbol
  1173.     when :primary
  1174.       temp_actor.change_class(class_id, YEA::CLASS_SYSTEM::MAINTAIN_LEVELS)
  1175.     when :subclass
  1176.       temp_actor.change_subclass(class_id)
  1177.     end
  1178.     @status_window.set_temp_actor(temp_actor)
  1179.   end
  1180.   
  1181.   #--------------------------------------------------------------------------
  1182.   # update_class
  1183.   #--------------------------------------------------------------------------
  1184.   def update_class
  1185.     @last_item = nil
  1186.     update_help
  1187.     refresh
  1188.     activate
  1189.   end
  1190.   
  1191.   #--------------------------------------------------------------------------
  1192.   # refresh
  1193.   #--------------------------------------------------------------------------
  1194.   def refresh
  1195.     make_item_list
  1196.     create_contents
  1197.     draw_all_items
  1198.   end
  1199.   
  1200. end # Window_ClassList

  1201. #==============================================================================
  1202. # ■ Scene_Menu
  1203. #==============================================================================

  1204. class Scene_Menu < Scene_MenuBase
  1205.   
  1206.   #--------------------------------------------------------------------------
  1207.   # alias method: create_command_window
  1208.   #--------------------------------------------------------------------------
  1209.   alias scene_menu_create_command_window_cs create_command_window
  1210.   def create_command_window
  1211.     scene_menu_create_command_window_cs
  1212.     @command_window.set_handler(:class, method(:command_personal))
  1213.   end
  1214.   
  1215.   #--------------------------------------------------------------------------
  1216.   # alias method: on_personal_ok
  1217.   #--------------------------------------------------------------------------
  1218.   alias scene_menu_on_personal_ok_cs on_personal_ok
  1219.   def on_personal_ok
  1220.     case @command_window.current_symbol
  1221.     when :class
  1222.       SceneManager.call(Scene_Class)
  1223.     else
  1224.       scene_menu_on_personal_ok_cs
  1225.     end
  1226.   end
  1227.   
  1228. end # Scene_Menu

  1229. #==============================================================================
  1230. # ■ Scene_Class
  1231. #==============================================================================

  1232. class Scene_Class < Scene_MenuBase
  1233.   
  1234.   #--------------------------------------------------------------------------
  1235.   # start
  1236.   #--------------------------------------------------------------------------
  1237.   def start
  1238.     super
  1239.     create_help_window
  1240.     create_command_window
  1241.     create_status_window
  1242.     create_param_window
  1243.     create_item_window
  1244.     relocate_windows
  1245.   end
  1246.   
  1247.   #--------------------------------------------------------------------------
  1248.   # create_command_window
  1249.   #--------------------------------------------------------------------------
  1250.   def create_command_window
  1251.     wy = @help_window.height
  1252.     @command_window = Window_ClassCommand.new(0, wy)
  1253.     @command_window.viewport = @viewport
  1254.     @command_window.help_window = @help_window
  1255.     @command_window.actor = @actor
  1256.     @command_window.set_handler(:cancel,   method(:return_scene))
  1257.     @command_window.set_handler(:primary,  method(:command_class_change))
  1258.     @command_window.set_handler(:subclass, method(:command_class_change))
  1259.     process_custom_class_commands
  1260.     return if $game_party.in_battle
  1261.     @command_window.set_handler(:pagedown, method(:next_actor))
  1262.     @command_window.set_handler(:pageup,   method(:prev_actor))
  1263.     @command_window.set_handler(:learn_skill, method(:command_learn_skill))
  1264.   end
  1265.   
  1266.   #--------------------------------------------------------------------------
  1267.   # process_custom_class_commands
  1268.   #--------------------------------------------------------------------------
  1269.   def process_custom_class_commands
  1270.     for command in YEA::CLASS_SYSTEM::COMMANDS
  1271.       next unless YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS.include?(command[0])
  1272.       called_method = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][2]
  1273.       @command_window.set_handler(command[0], method(called_method))
  1274.     end
  1275.   end
  1276.   
  1277.   #--------------------------------------------------------------------------
  1278.   # create_status_window
  1279.   #--------------------------------------------------------------------------
  1280.   def create_status_window
  1281.     wy = @help_window.height
  1282.     @status_window = Window_ClassStatus.new(@command_window.width, wy)
  1283.     @status_window.viewport = @viewport
  1284.     @status_window.actor = @actor
  1285.   end
  1286.   
  1287.   #--------------------------------------------------------------------------
  1288.   # create_param_window
  1289.   #--------------------------------------------------------------------------
  1290.   def create_param_window
  1291.     dx = Graphics.width - (Graphics.width * 2 / 5)
  1292.     dy = @status_window.y + @status_window.height
  1293.     @param_window = Window_ClassParam.new(dx, dy)
  1294.     @param_window.viewport = @viewport
  1295.     @param_window.actor = @actor
  1296.   end
  1297.   
  1298.   #--------------------------------------------------------------------------
  1299.   # create_item_window
  1300.   #--------------------------------------------------------------------------
  1301.   def create_item_window
  1302.     dy = @status_window.y + @status_window.height
  1303.     @item_window = Window_ClassList.new(0, dy)
  1304.     @item_window.help_window = @help_window
  1305.     @item_window.command_window = @command_window
  1306.     @item_window.status_window = @param_window
  1307.     @item_window.viewport = @viewport
  1308.     @item_window.actor = @actor
  1309.     @command_window.item_window = @item_window
  1310.     @item_window.set_handler(:ok,     method(:on_class_ok))
  1311.     @item_window.set_handler(:cancel, method(:on_class_cancel))
  1312.   end
  1313.   
  1314.   #--------------------------------------------------------------------------
  1315.   # relocate_windows
  1316.   #--------------------------------------------------------------------------
  1317.   def relocate_windows
  1318.     return unless $imported["YEA-AceMenuEngine"]
  1319.     case Menu.help_window_location
  1320.     when 0 # Top
  1321.       @help_window.y = 0
  1322.       @command_window.y = @help_window.height
  1323.       @param_window.y = @command_window.y + @command_window.height
  1324.     when 1 # Middle
  1325.       @command_window.y = 0
  1326.       @help_window.y = @command_window.height
  1327.       @param_window.y = @help_window.y + @help_window.height
  1328.     else # Bottom
  1329.       @command_window.y = 0
  1330.       @param_window.y = @command_window.height
  1331.       @help_window.y = @param_window.y + @param_window.height
  1332.     end
  1333.     @status_window.y = @command_window.y
  1334.     @item_window.y = @param_window.y
  1335.   end
  1336.   
  1337.   #--------------------------------------------------------------------------
  1338.   # on_actor_change
  1339.   #--------------------------------------------------------------------------
  1340.   def on_actor_change
  1341.     @command_window.actor = @actor
  1342.     @status_window.actor = @actor
  1343.     @param_window.actor = @actor
  1344.     @item_window.actor = @actor
  1345.     @command_window.activate
  1346.   end
  1347.   
  1348.   #--------------------------------------------------------------------------
  1349.   # command_class_change
  1350.   #--------------------------------------------------------------------------
  1351.   def command_class_change
  1352.     @item_window.activate
  1353.     @item_window.select_last
  1354.   end
  1355.   
  1356.   #--------------------------------------------------------------------------
  1357.   # on_class_cancel
  1358.   #--------------------------------------------------------------------------
  1359.   def on_class_cancel
  1360.     @item_window.unselect
  1361.     @command_window.activate
  1362.     @param_window.set_temp_actor(nil)
  1363.   end
  1364.   
  1365.   #--------------------------------------------------------------------------
  1366.   # on_class_ok
  1367.   #--------------------------------------------------------------------------
  1368.   def on_class_ok
  1369.     Sound.play_equip
  1370.     class_id = @item_window.item.id
  1371.     maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  1372.     hp = @actor.hp * 1.0 / @actor.mhp
  1373.     mp = @actor.mp * 1.0 / [@actor.mmp, 1].max
  1374.     case @command_window.current_symbol
  1375.     when :primary
  1376.       @actor.change_class(class_id, maintain)
  1377.     when :subclass
  1378.       @actor.change_subclass(class_id)
  1379.     else
  1380.       @item_window.activate
  1381.       return
  1382.     end
  1383.     @actor.hp = (@actor.mhp * hp).to_i
  1384.     @actor.mp = (@actor.mmp * mp).to_i
  1385.     @status_window.refresh
  1386.     @item_window.update_class
  1387.   end
  1388.   
  1389.   #--------------------------------------------------------------------------
  1390.   # new method: command_learn_skill
  1391.   #--------------------------------------------------------------------------
  1392.   def command_learn_skill
  1393.     return unless $imported["YEA-LearnSkillEngine"]
  1394.     SceneManager.call(Scene_LearnSkill)
  1395.   end
  1396.   
  1397.   #--------------------------------------------------------------------------
  1398.   # command_name1
  1399.   #--------------------------------------------------------------------------
  1400.   def command_name1
  1401.     # Do nothing.
  1402.   end
  1403.   
  1404.   #--------------------------------------------------------------------------
  1405.   # command_name2
  1406.   #--------------------------------------------------------------------------
  1407.   def command_name2
  1408.     # Do nothing.
  1409.   end
  1410.   
  1411. end # Scene_Class

  1412. #==============================================================================
  1413. #
  1414. # ▼ End of File
  1415. #
  1416. #==============================================================================
  1417. #==============================================================================
  1418. #
  1419. # ▼ Yanfly Engine Ace - Class Specifics v1.00
  1420. # -- Last Updated: 2011.12.23
  1421. # -- Level: Normal
  1422. # -- Requires: YEA - Class System v1.03+
  1423. #
  1424. #==============================================================================

  1425. $imported = {} if $imported.nil?
  1426. $imported["YEA-ClassSpecifics"] = true

  1427. #==============================================================================
  1428. # ▼ Updates
  1429. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1430. # 2011.12.23 - Started Script and Finished.
  1431. #
  1432. #==============================================================================
  1433. # ▼ Introduction
  1434. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1435. # This script allows for certain classes to be primary-only or sublcass-only.
  1436. # In addition to that, subclasses can require certain classes to be primary
  1437. # classes in order to be applied.
  1438. #
  1439. #==============================================================================
  1440. # ▼ Instructions
  1441. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1442. # To install this script, open up your script editor and copy/paste this script
  1443. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  1444. #
  1445. # -----------------------------------------------------------------------------
  1446. # Class Notetags - These notetags go in the class notebox in the database.
  1447. # -----------------------------------------------------------------------------
  1448. # <primary only>
  1449. # Makes this class equippable only if it's the primary class.
  1450. #
  1451. # <subclass only>
  1452. # Makes this class equippable only if it's the subclass class.
  1453. #
  1454. # <subclass to: x>
  1455. # <subclass to: x, x>
  1456. # This makes the class subclass only and only equippable if the primary class
  1457. # is one of the listed x classes.
  1458. #
  1459. #==============================================================================
  1460. # ▼ Compatibility
  1461. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1462. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1463. # it will run with RPG Maker VX without adjusting.
  1464. #
  1465. # This script requires Yanfly Engine Ace - Class System v1.03+.
  1466. #
  1467. #==============================================================================
  1468. # ▼ Editting anything past this point may potentially result in causing
  1469. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1470. # halitosis so edit at your own risk.
  1471. #==============================================================================

  1472. if $imported["YEA-ClassSystem"]

  1473. module YEA
  1474.   module REGEXP
  1475.   module CLASS
  1476.    
  1477.     PRIMARY_ONLY  = /<(?:PRIMARY_ONLY|primary only)>/i
  1478.     SUBCLASS_ONLY = /<(?:SUBCLASS_ONLY|subclass only)>/i
  1479.     SUBCLASS_TO = /<(?:SUBCLASS_TO|subclass to):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  1480.    
  1481.   end # CLASS
  1482.   end # REGEXP
  1483. end # YEA

  1484. #==============================================================================
  1485. # ■ DataManager
  1486. #==============================================================================

  1487. module DataManager
  1488.   
  1489.   #--------------------------------------------------------------------------
  1490.   # alias method: load_database
  1491.   #--------------------------------------------------------------------------
  1492.   class <<self; alias load_database_csp load_database; end
  1493.   def self.load_database
  1494.     load_database_csp
  1495.     load_notetags_csp
  1496.   end
  1497.   
  1498.   #--------------------------------------------------------------------------
  1499.   # new method: load_notetags_csp
  1500.   #--------------------------------------------------------------------------
  1501.   def self.load_notetags_csp
  1502.     for obj in $data_classes
  1503.       next if obj.nil?
  1504.       obj.load_notetags_csp
  1505.     end
  1506.   end
  1507.   
  1508. end # DataManager

  1509. #==============================================================================
  1510. # ■ RPG::Class
  1511. #==============================================================================

  1512. class RPG::Class < RPG::BaseItem
  1513.   
  1514.   #--------------------------------------------------------------------------
  1515.   # public instance variables
  1516.   #--------------------------------------------------------------------------
  1517.   attr_accessor :primary_only
  1518.   attr_accessor :subclass_only
  1519.   attr_accessor :subclass_to
  1520.   
  1521.   #--------------------------------------------------------------------------
  1522.   # common cache: load_notetags_csp
  1523.   #--------------------------------------------------------------------------
  1524.   def load_notetags_csp
  1525.     @primary_only = false
  1526.     @subclass_only = false
  1527.     @subclass_to = []
  1528.     #---
  1529.     self.note.split(/[\r\n]+/).each { |line|
  1530.       case line
  1531.       #---
  1532.       when YEA::REGEXP::CLASS::PRIMARY_ONLY
  1533.         @primary_only = true
  1534.         @subclass_only = false
  1535.         @subclass_to = []
  1536.       when YEA::REGEXP::CLASS::SUBCLASS_ONLY
  1537.         @primary_only = false
  1538.         @subclass_only = true
  1539.       when YEA::REGEXP::CLASS::SUBCLASS_TO
  1540.         @primary_only = false
  1541.         @subclass_only = true
  1542.         $1.scan(/\d+/).each { |num|
  1543.         @subclass_to.push(num.to_i) if num.to_i > 0 }
  1544.       end
  1545.     } # self.note.split
  1546.     #---
  1547.   end
  1548.   
  1549. end # RPG::Class

  1550. #==============================================================================
  1551. # ■ Game_Actor
  1552. #==============================================================================

  1553. class Game_Actor < Game_Battler
  1554.   
  1555.   #--------------------------------------------------------------------------
  1556.   # alias method: change_class
  1557.   #--------------------------------------------------------------------------
  1558.   alias game_actor_change_class_csp change_class
  1559.   def change_class(class_id, keep_exp = false)
  1560.     return if $data_classes[class_id].subclass_only
  1561.     game_actor_change_class_csp(class_id, keep_exp)
  1562.     correct_subclass
  1563.   end
  1564.   
  1565.   #--------------------------------------------------------------------------
  1566.   # alias method: change_subclass
  1567.   #--------------------------------------------------------------------------
  1568.   alias game_actor_change_subclass_csp change_subclass
  1569.   def change_subclass(class_id)
  1570.     return unless subclass_requirements_met?(class_id)
  1571.     game_actor_change_subclass_csp(class_id)
  1572.   end
  1573.   
  1574.   #--------------------------------------------------------------------------
  1575.   # new method: subclass_requirements_met?
  1576.   #--------------------------------------------------------------------------
  1577.   def subclass_requirements_met?(class_id)
  1578.     subclass = $data_classes[class_id]
  1579.     return false if subclass.primary_only
  1580.     return subclass_to?(class_id) if subclass.subclass_to != []
  1581.     return true
  1582.   end
  1583.   
  1584.   #--------------------------------------------------------------------------
  1585.   # new method: subclass_to?
  1586.   #--------------------------------------------------------------------------
  1587.   def subclass_to?(class_id)
  1588.     return true if class_id == 0
  1589.     subclass = $data_classes[class_id]
  1590.     return false if subclass.nil?
  1591.     for class_id in subclass.subclass_to
  1592.       return true if class_id == self.class.id
  1593.     end
  1594.     return false
  1595.   end
  1596.   
  1597.   #--------------------------------------------------------------------------
  1598.   # new method: correct_subclass
  1599.   #--------------------------------------------------------------------------
  1600.   def correct_subclass
  1601.     return if @subclass_id == 0
  1602.     subclass = $data_classes[@subclass_id]
  1603.     return if subclass.nil?
  1604.     return if subclass.subclass_to == []
  1605.     @subclass_id = 0 if !subclass_to?(@subclass_id)
  1606.   end
  1607.   
  1608. end # Game_Actor

  1609. #==============================================================================
  1610. # ■ Window_ClassList
  1611. #==============================================================================

  1612. class Window_ClassList < Window_Selectable
  1613.   
  1614.   #--------------------------------------------------------------------------
  1615.   # alias method: enable?
  1616.   #--------------------------------------------------------------------------
  1617.   alias window_classlist_enable_csp enable?
  1618.   def enable?(item)
  1619.     case @command_window.current_symbol
  1620.     when :primary
  1621.       return false if item.subclass_only
  1622.     when :subclass
  1623.       return false if item.primary_only
  1624.       return @actor.subclass_to?(item.id) if item.subclass_to != []
  1625.     end
  1626.     return window_classlist_enable_csp(item)
  1627.   end
  1628.   
  1629. end # Window_ClassList

  1630. end # $imported["YEA-ClassSystem"]

  1631. #==============================================================================
  1632. #
  1633. # ▼ End of File
  1634. #
  1635. #==============================================================================
  1636. #==============================================================================
  1637. #
  1638. # ▼ Yanfly Engine Ace - Class System Add-On: Class Unlock Level v1.00
  1639. # -- Last Updated: 2011.12.20
  1640. # -- Level: Normal
  1641. # -- Requires: YEA - Class System v1.01+
  1642. #
  1643. #==============================================================================

  1644. $imported = {} if $imported.nil?
  1645. $imported["YEA-ClassUnlockLevel"] = true

  1646. #==============================================================================
  1647. # ▼ Updates
  1648. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1649. # 2011.12.20 - Started Script and Finished.
  1650. #
  1651. #==============================================================================
  1652. # ▼ Introduction
  1653. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1654. # This script allows for classes to be unlocked after a class reaches a certain
  1655. # level. Note that this script is made for the Class System script and not
  1656. # using the MAINTAIN_LEVELS feature. Requirements for unlocking a class can be
  1657. # multiple level requirements as well.
  1658. #
  1659. #==============================================================================
  1660. # ▼ Instructions
  1661. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1662. # To install this script, open up your script editor and copy/paste this script
  1663. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  1664. #
  1665. # -----------------------------------------------------------------------------
  1666. # Class Notetags - These notetags go in the class notebox in the database.
  1667. # -----------------------------------------------------------------------------
  1668. # <level unlock requirements>
  1669. #   class x: level y
  1670. #   class x: level y
  1671. # </level unlock requirements>
  1672. # Sets the requirements for unlocking that particular class. The unlocking of
  1673. # the class will require classes x to be at level y. Insert multiple of the
  1674. # strings in between the two opening and closing notetags to require all of the
  1675. # class levels to be met.
  1676. #
  1677. #==============================================================================
  1678. # ▼ Compatibility
  1679. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1680. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1681. # it will run with RPG Maker VX without adjusting.
  1682. #
  1683. # This script requires Yanfly Engine Ace - Class System v1.01+.
  1684. #
  1685. #==============================================================================
  1686. # ▼ Editting anything past this point may potentially result in causing
  1687. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1688. # halitosis so edit at your own risk.
  1689. #==============================================================================

  1690. if $imported["YEA-ClassSystem"] && !YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

  1691. module YEA
  1692.   module REGEXP
  1693.   module CLASS
  1694.    
  1695.     LV_UNLOCK_ON =
  1696.       /<(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  1697.     LV_UNLOCK_OFF =
  1698.       /<\/(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  1699.     LV_UNLOCK_STR = /CLASS[ ](\d+): LEVEL[ ](\d+)/i
  1700.    
  1701.   end # CLASS
  1702.   end # REGEXP
  1703. end # YEA

  1704. #==============================================================================
  1705. # ■ DataManager
  1706. #==============================================================================

  1707. module DataManager
  1708.   
  1709.   #--------------------------------------------------------------------------
  1710.   # alias method: load_database
  1711.   #--------------------------------------------------------------------------
  1712.   class <<self; alias load_database_cul load_database; end
  1713.   def self.load_database
  1714.     load_database_cul
  1715.     load_notetags_cul
  1716.   end
  1717.   
  1718.   #--------------------------------------------------------------------------
  1719.   # new method: load_notetags_cul
  1720.   #--------------------------------------------------------------------------
  1721.   def self.load_notetags_cul
  1722.     for obj in $data_classes
  1723.       next if obj.nil?
  1724.       obj.load_notetags_cul
  1725.     end
  1726.   end
  1727.   
  1728. end # DataManager

  1729. #==============================================================================
  1730. # ■ RPG::Class
  1731. #==============================================================================

  1732. class RPG::Class < RPG::BaseItem
  1733.   
  1734.   #--------------------------------------------------------------------------
  1735.   # public instance variables
  1736.   #--------------------------------------------------------------------------
  1737.   attr_accessor :level_unlock
  1738.   
  1739.   #--------------------------------------------------------------------------
  1740.   # common cache: load_notetags_cul
  1741.   #--------------------------------------------------------------------------
  1742.   def load_notetags_cul
  1743.     @level_unlock = {}
  1744.     @level_unlock_on = false
  1745.     #---
  1746.     self.note.split(/[\r\n]+/).each { |line|
  1747.       case line
  1748.       #---
  1749.       when YEA::REGEXP::CLASS::LV_UNLOCK_ON
  1750.         @level_unlock_on = true
  1751.       when YEA::REGEXP::CLASS::LV_UNLOCK_OFF
  1752.         @level_unlock_on = false
  1753.       when YEA::REGEXP::CLASS::LV_UNLOCK_STR
  1754.         next unless @level_unlock_on
  1755.         @level_unlock[$1.to_i] = $2.to_i
  1756.       end
  1757.     } # self.note.split
  1758.     #---
  1759.   end
  1760.   
  1761. end # RPG::Class

  1762. #==============================================================================
  1763. # ■ Game_Actor
  1764. #==============================================================================

  1765. class Game_Actor < Game_Battler
  1766.   
  1767.   #--------------------------------------------------------------------------
  1768.   # check_level_unlocked_classes
  1769.   #--------------------------------------------------------------------------
  1770.   def check_level_unlocked_classes
  1771.     for item in $data_classes
  1772.       next if item.nil?
  1773.       next if unlocked_classes.include?(item.id)
  1774.       next if item.level_unlock == {}
  1775.       next unless class_unlock_level_requirements_met?(item)
  1776.       unlock_class(item.id)
  1777.     end
  1778.   end
  1779.   
  1780.   #--------------------------------------------------------------------------
  1781.   # class_unlock_level_requirements_met?
  1782.   #--------------------------------------------------------------------------
  1783.   def class_unlock_level_requirements_met?(item)
  1784.     for key in item.level_unlock
  1785.       class_id = key[0]
  1786.       level_req = key[1]
  1787.       return false if class_level(class_id) < level_req
  1788.     end
  1789.     return true
  1790.   end
  1791.   
  1792. end # Game_Actor

  1793. #==============================================================================
  1794. # ■ Window_ClassList
  1795. #==============================================================================

  1796. class Window_ClassList < Window_Selectable
  1797.   
  1798.   #--------------------------------------------------------------------------
  1799.   # alias method: actor=
  1800.   #--------------------------------------------------------------------------
  1801.   alias window_classlist_actor_equals_cul actor=
  1802.   def actor=(actor)
  1803.     return if @actor == actor
  1804.     actor.check_level_unlocked_classes
  1805.     window_classlist_actor_equals_cul(actor)
  1806.   end
  1807.   
  1808. end # Window_ClassList

  1809. end # $imported["YEA-ClassSystem"] && !YEA::CLASS_SYSTEM::MAINTAIN_LEVELS

  1810. #==============================================================================
  1811. #
  1812. # ▼ End of File
  1813. #
  1814. #==============================================================================
复制代码

评分

参与人数 1星屑 +50 收起 理由
无双sxa + 50 我很赞同

查看全部评分

Lv1.梦旅人

梦石
0
星屑
50
在线时间
23 小时
注册时间
2012-7-25
帖子
13
8
发表于 2012-8-17 17:20:09 | 只看该作者
我是脚本盲    Class  Subclass Primary   谁来解释一下.........
主要是Subclass Primary   我看这两个都没什么变化的..........   
不知是否有什么东西没弄   
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
102 小时
注册时间
2010-6-20
帖子
16
7
发表于 2012-4-10 19:27:17 | 只看该作者
LZ發的是CLASS SYSTEM的腳本,
是指職業有分主職業跟副職業,一個人可以玩到很多職業的技能與使用武器等,
至於樓主發的網址是Class Unlock Level,是附屬於職業腳本下的功能,可以指定什麼職業在主職業幾等時解鎖。
(我也有使用職業腳本,不過Class Unlock Level沒使用過,大抵上是我的認知,如有誤請告知我,謝謝!)
希望對你有幫助^^

评分

参与人数 1星屑 +20 收起 理由
无双sxa + 20 乐于助人:)

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
65
在线时间
77 小时
注册时间
2012-1-29
帖子
44
6
发表于 2012-4-4 13:34:00 | 只看该作者
谢谢楼主分享!
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
175 小时
注册时间
2011-12-28
帖子
93
5
发表于 2012-3-13 22:30:47 | 只看该作者
话说...功能使用方面??是如何设置的??使用方法??主职业和副职业之间的关系是??又是如何区分的?
代码太长了..而英文水平又....麻烦LZ帮忙解答...不然这么好用的脚本不会使用...就太浪费了.
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
2188 小时
注册时间
2011-6-23
帖子
1044
4
发表于 2012-3-12 09:39:10 | 只看该作者
本帖最后由 lsu666666 于 2012-3-12 11:41 编辑

好像很棒的功能耶...不過我想問...什麼是...真.職業系統阿?..難不成還有 假.職業的嗎...

点评

= =那个叫 伪 职业系统  发表于 2012-4-4 14:15
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
154
在线时间
664 小时
注册时间
2011-9-25
帖子
241
3
发表于 2012-3-12 09:36:06 | 只看该作者
额。。。这种代码框在哪弄的?
回复 支持 反对

使用道具 举报

Lv1.梦旅人

派大星

梦石
0
星屑
195
在线时间
2133 小时
注册时间
2011-9-18
帖子
2652
2
发表于 2012-3-11 21:26:15 | 只看该作者
ace的脚本又多了一个,作者和楼主都很厉害啊。

点评

这个系统其实很早就有 不过最近才抓到  发表于 2012-3-11 21:44
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-23 10:41

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表