查看: 3836|回复: 2

[已经解决] 这个职业系统的脚本怎么用啊?

[复制链接]
梦石
0
星屑
50
在线时间
211 小时
注册时间
2011-10-2
回帖
26
发表于 2013-2-14 23:18:52 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 Mic_洛洛 于 2013-3-20 23:52 编辑

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

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

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

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

  228. #==============================================================================
  229. # ■ Switch
  230. #==============================================================================

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

  282. #==============================================================================
  283. # ■ Numeric
  284. #==============================================================================

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

  295. #==============================================================================
  296. # ■ DataManager
  297. #==============================================================================

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

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

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

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

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

  389. #==============================================================================
  390. # ■ Game_Temp
  391. #==============================================================================

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

  401. #==============================================================================
  402. # ■ Game_Action
  403. #==============================================================================

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

  428. #==============================================================================
  429. # ■ Game_BattlerBase
  430. #==============================================================================

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

  482. #==============================================================================
  483. # ■ Game_Actor
  484. #==============================================================================

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

  672. #==============================================================================
  673. # ■ Game_Interpreter
  674. #==============================================================================

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

  689. #==============================================================================
  690. # ■ Window_Base
  691. #==============================================================================

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

  709. #==============================================================================
  710. # ■ Window_MenuCommand
  711. #==============================================================================

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

  733. #==============================================================================
  734. # ■ Window_ClassCommand
  735. #==============================================================================

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

  850. #==============================================================================
  851. # ■ Window_ClassStatus
  852. #==============================================================================

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

  888. #==============================================================================
  889. # ■ Window_ClassParam
  890. #==============================================================================

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

  995. #==============================================================================
  996. # ■ Window_ClassList
  997. #==============================================================================

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

  1200. #==============================================================================
  1201. # ■ Scene_Menu
  1202. #==============================================================================

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

  1228. #==============================================================================
  1229. # ■ Scene_Class
  1230. #==============================================================================

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

  1411. #==============================================================================
  1412. #
  1413. # ▼ End of File
  1414. #
  1415. #==============================================================================
  1416. 职业解锁系统:
  1417. #==============================================================================
  1418. #
  1419. # ▼ Yanfly Engine Ace - Class System Add-On: Class Unlock Level v1.00
  1420. # -- Last Updated: 2011.12.20
  1421. # -- Level: Normal
  1422. # -- Requires: YEA - Class System v1.01+
  1423. #
  1424. #==============================================================================

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

  1427. #==============================================================================
  1428. # ▼ Updates
  1429. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1430. # 2011.12.20 - Started Script and Finished.
  1431. #
  1432. #==============================================================================
  1433. # ▼ Introduction
  1434. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1435. # This script allows for classes to be unlocked after a class reaches a certain
  1436. # level. Note that this script is made for the Class System script and not
  1437. # using the MAINTAIN_LEVELS feature. Requirements for unlocking a class can be
  1438. # multiple level requirements as well.
  1439. #
  1440. #==============================================================================
  1441. # ▼ Instructions
  1442. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1443. # To install this script, open up your script editor and copy/paste this script
  1444. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  1445. #
  1446. # -----------------------------------------------------------------------------
  1447. # Class Notetags - These notetags go in the class notebox in the database.
  1448. # -----------------------------------------------------------------------------
  1449. # <level unlock requirements>
  1450. #   class x: level y
  1451. #   class x: level y
  1452. # </level unlock requirements>
  1453. # Sets the requirements for unlocking that particular class. The unlocking of
  1454. # the class will require classes x to be at level y. Insert multiple of the
  1455. # strings in between the two opening and closing notetags to require all of the
  1456. # class levels to be met.
  1457. #
  1458. #==============================================================================
  1459. # ▼ Compatibility
  1460. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1461. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1462. # it will run with RPG Maker VX without adjusting.
  1463. #
  1464. # This script requires Yanfly Engine Ace - Class System v1.01+.
  1465. #
  1466. #==============================================================================
  1467. # ▼ Editting anything past this point may potentially result in causing
  1468. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1469. # halitosis so edit at your own risk.
  1470. #==============================================================================

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

  1472. module YEA
  1473.   module REGEXP
  1474.   module CLASS
  1475.    
  1476.     LV_UNLOCK_ON =
  1477.       /<(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  1478.     LV_UNLOCK_OFF =
  1479.       /<\/(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  1480.     LV_UNLOCK_STR = /CLASS[ ](\d+): LEVEL[ ](\d+)/i
  1481.    
  1482.   end # CLASS
  1483.   end # REGEXP
  1484. end # YEA

  1485. #==============================================================================
  1486. # ■ DataManager
  1487. #==============================================================================

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

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

  1513. class RPG::Class < RPG::BaseItem
  1514.   
  1515.   #--------------------------------------------------------------------------
  1516.   # public instance variables
  1517.   #--------------------------------------------------------------------------
  1518.   attr_accessor :level_unlock
  1519.   
  1520.   #--------------------------------------------------------------------------
  1521.   # common cache: load_notetags_cul
  1522.   #--------------------------------------------------------------------------
  1523.   def load_notetags_cul
  1524.     @level_unlock = {}
  1525.     @level_unlock_on = false
  1526.     #---
  1527.     self.note.split(/[\r\n]+/).each { |line|
  1528.       case line
  1529.       #---
  1530.       when YEA::REGEXP::CLASS::LV_UNLOCK_ON
  1531.         @level_unlock_on = true
  1532.       when YEA::REGEXP::CLASS::LV_UNLOCK_OFF
  1533.         @level_unlock_on = false
  1534.       when YEA::REGEXP::CLASS::LV_UNLOCK_STR
  1535.         next unless @level_unlock_on
  1536.         @level_unlock[$1.to_i] = $2.to_i
  1537.       end
  1538.     } # self.note.split
  1539.     #---
  1540.   end
  1541.   
  1542. end # RPG::Class

  1543. #==============================================================================
  1544. # ■ Game_Actor
  1545. #==============================================================================

  1546. class Game_Actor < Game_Battler
  1547.   
  1548.   #--------------------------------------------------------------------------
  1549.   # check_level_unlocked_classes
  1550.   #--------------------------------------------------------------------------
  1551.   def check_level_unlocked_classes
  1552.     for item in $data_classes
  1553.       next if item.nil?
  1554.       next if unlocked_classes.include?(item.id)
  1555.       next if item.level_unlock == {}
  1556.       next unless class_unlock_level_requirements_met?(item)
  1557.       unlock_class(item.id)
  1558.     end
  1559.   end
  1560.   
  1561.   #--------------------------------------------------------------------------
  1562.   # class_unlock_level_requirements_met?
  1563.   #--------------------------------------------------------------------------
  1564.   def class_unlock_level_requirements_met?(item)
  1565.     for key in item.level_unlock
  1566.       class_id = key[0]
  1567.       level_req = key[1]
  1568.       return false if class_level(class_id) < level_req
  1569.     end
  1570.     return true
  1571.   end
  1572.   
  1573. end # Game_Actor

  1574. #==============================================================================
  1575. # ■ Window_ClassList
  1576. #==============================================================================

  1577. class Window_ClassList < Window_Selectable
  1578.   
  1579.   #--------------------------------------------------------------------------
  1580.   # alias method: actor=
  1581.   #--------------------------------------------------------------------------
  1582.   alias window_classlist_actor_equals_cul actor=
  1583.   def actor=(actor)
  1584.     return if @actor == actor
  1585.     actor.check_level_unlocked_classes
  1586.     window_classlist_actor_equals_cul(actor)
  1587.   end
  1588.   
  1589. end # Window_ClassList

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

  1591. #==============================================================================
  1592. #
  1593. # ▼ End of File
  1594. #
  1595. #==============================================================================
  1596. 主要次要职业系统:
  1597. #==============================================================================
  1598. #
  1599. # ▼ Yanfly Engine Ace - Class Specifics v1.00
  1600. # -- Last Updated: 2011.12.23
  1601. # -- Level: Normal
  1602. # -- Requires: YEA - Class System v1.03+
  1603. #
  1604. #==============================================================================

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

  1607. #==============================================================================
  1608. # ▼ Updates
  1609. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1610. # 2011.12.23 - Started Script and Finished.
  1611. #
  1612. #==============================================================================
  1613. # ▼ Introduction
  1614. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1615. # This script allows for certain classes to be primary-only or sublcass-only.
  1616. # In addition to that, subclasses can require certain classes to be primary
  1617. # classes in order to be applied.
  1618. #
  1619. #==============================================================================
  1620. # ▼ Instructions
  1621. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1622. # To install this script, open up your script editor and copy/paste this script
  1623. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  1624. #
  1625. # -----------------------------------------------------------------------------
  1626. # Class Notetags - These notetags go in the class notebox in the database.
  1627. # -----------------------------------------------------------------------------
  1628. # <primary only>
  1629. # Makes this class equippable only if it's the primary class.
  1630. #
  1631. # <subclass only>
  1632. # Makes this class equippable only if it's the subclass class.
  1633. #
  1634. # <subclass to: x>
  1635. # <subclass to: x, x>
  1636. # This makes the class subclass only and only equippable if the primary class
  1637. # is one of the listed x classes.
  1638. #
  1639. #==============================================================================
  1640. # ▼ Compatibility
  1641. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1642. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1643. # it will run with RPG Maker VX without adjusting.
  1644. #
  1645. # This script requires Yanfly Engine Ace - Class System v1.03+.
  1646. #
  1647. #==============================================================================
  1648. # ▼ Editting anything past this point may potentially result in causing
  1649. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1650. # halitosis so edit at your own risk.
  1651. #==============================================================================

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

  1653. module YEA
  1654.   module REGEXP
  1655.   module CLASS
  1656.    
  1657.     PRIMARY_ONLY  = /<(?:PRIMARY_ONLY|primary only)>/i
  1658.     SUBCLASS_ONLY = /<(?:SUBCLASS_ONLY|subclass only)>/i
  1659.     SUBCLASS_TO = /<(?:SUBCLASS_TO|subclass to):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  1660.    
  1661.   end # CLASS
  1662.   end # REGEXP
  1663. end # YEA

  1664. #==============================================================================
  1665. # ■ DataManager
  1666. #==============================================================================

  1667. module DataManager
  1668.   
  1669.   #--------------------------------------------------------------------------
  1670.   # alias method: load_database
  1671.   #--------------------------------------------------------------------------
  1672.   class <<self; alias load_database_csp load_database; end
  1673.   def self.load_database
  1674.     load_database_csp
  1675.     load_notetags_csp
  1676.   end
  1677.   
  1678.   #--------------------------------------------------------------------------
  1679.   # new method: load_notetags_csp
  1680.   #--------------------------------------------------------------------------
  1681.   def self.load_notetags_csp
  1682.     for obj in $data_classes
  1683.       next if obj.nil?
  1684.       obj.load_notetags_csp
  1685.     end
  1686.   end
  1687.   
  1688. end # DataManager

  1689. #==============================================================================
  1690. # ■ RPG::Class
  1691. #==============================================================================

  1692. class RPG::Class < RPG::BaseItem
  1693.   
  1694.   #--------------------------------------------------------------------------
  1695.   # public instance variables
  1696.   #--------------------------------------------------------------------------
  1697.   attr_accessor :primary_only
  1698.   attr_accessor :subclass_only
  1699.   attr_accessor :subclass_to
  1700.   
  1701.   #--------------------------------------------------------------------------
  1702.   # common cache: load_notetags_csp
  1703.   #--------------------------------------------------------------------------
  1704.   def load_notetags_csp
  1705.     @primary_only = false
  1706.     @subclass_only = false
  1707.     @subclass_to = []
  1708.     #---
  1709.     self.note.split(/[\r\n]+/).each { |line|
  1710.       case line
  1711.       #---
  1712.       when YEA::REGEXP::CLASS::PRIMARY_ONLY
  1713.         @primary_only = true
  1714.         @subclass_only = false
  1715.         @subclass_to = []
  1716.       when YEA::REGEXP::CLASS::SUBCLASS_ONLY
  1717.         @primary_only = false
  1718.         @subclass_only = true
  1719.       when YEA::REGEXP::CLASS::SUBCLASS_TO
  1720.         @primary_only = false
  1721.         @subclass_only = true
  1722.         $1.scan(/\d+/).each { |num|
  1723.         @subclass_to.push(num.to_i) if num.to_i > 0 }
  1724.       end
  1725.     } # self.note.split
  1726.     #---
  1727.   end
  1728.   
  1729. end # RPG::Class

  1730. #==============================================================================
  1731. # ■ Game_Actor
  1732. #==============================================================================

  1733. class Game_Actor < Game_Battler
  1734.   
  1735.   #--------------------------------------------------------------------------
  1736.   # alias method: change_class
  1737.   #--------------------------------------------------------------------------
  1738.   alias game_actor_change_class_csp change_class
  1739.   def change_class(class_id, keep_exp = false)
  1740.     return if $data_classes[class_id].subclass_only
  1741.     game_actor_change_class_csp(class_id, keep_exp)
  1742.     correct_subclass
  1743.   end
  1744.   
  1745.   #--------------------------------------------------------------------------
  1746.   # alias method: change_subclass
  1747.   #--------------------------------------------------------------------------
  1748.   alias game_actor_change_subclass_csp change_subclass
  1749.   def change_subclass(class_id)
  1750.     return unless subclass_requirements_met?(class_id)
  1751.     game_actor_change_subclass_csp(class_id)
  1752.   end
  1753.   
  1754.   #--------------------------------------------------------------------------
  1755.   # new method: subclass_requirements_met?
  1756.   #--------------------------------------------------------------------------
  1757.   def subclass_requirements_met?(class_id)
  1758.     subclass = $data_classes[class_id]
  1759.     return false if subclass.primary_only
  1760.     return subclass_to?(class_id) if subclass.subclass_to != []
  1761.     return true
  1762.   end
  1763.   
  1764.   #--------------------------------------------------------------------------
  1765.   # new method: subclass_to?
  1766.   #--------------------------------------------------------------------------
  1767.   def subclass_to?(class_id)
  1768.     return true if class_id == 0
  1769.     subclass = $data_classes[class_id]
  1770.     return false if subclass.nil?
  1771.     for class_id in subclass.subclass_to
  1772.       return true if class_id == self.class.id
  1773.     end
  1774.     return false
  1775.   end
  1776.   
  1777.   #--------------------------------------------------------------------------
  1778.   # new method: correct_subclass
  1779.   #--------------------------------------------------------------------------
  1780.   def correct_subclass
  1781.     return if @subclass_id == 0
  1782.     subclass = $data_classes[@subclass_id]
  1783.     return if subclass.nil?
  1784.     return if subclass.subclass_to == []
  1785.     @subclass_id = 0 if !subclass_to?(@subclass_id)
  1786.   end
  1787.   
  1788. end # Game_Actor

  1789. #==============================================================================
  1790. # ■ Window_ClassList
  1791. #==============================================================================

  1792. class Window_ClassList < Window_Selectable
  1793.   
  1794.   #--------------------------------------------------------------------------
  1795.   # alias method: enable?
  1796.   #--------------------------------------------------------------------------
  1797.   alias window_classlist_enable_csp enable?
  1798.   def enable?(item)
  1799.     case @command_window.current_symbol
  1800.     when :primary
  1801.       return false if item.subclass_only
  1802.     when :subclass
  1803.       return false if item.primary_only
  1804.       return @actor.subclass_to?(item.id) if item.subclass_to != []
  1805.     end
  1806.     return window_classlist_enable_csp(item)
  1807.   end
  1808.   
  1809. end # Window_ClassList

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

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

帮帮忙吧,实在不会用。谢谢  

唯一的信徒

梦石
0
星屑
1697
在线时间
1359 小时
注册时间
2013-1-29
回帖
1537
发表于 2013-2-15 06:34:13 | 显示全部楼层
整 合 害 人!这个是Yanfly的脚本。。多拉菌在搞的时候没有把原来的使用说明搞到= =鄙视多拉菌
以下均来自Yanfly的博客
cs-01.jpg
This script adds the ability for your player to freely change the classes of actors outside of battle from a menu. When changing classes, this script gives the option for the developer to choose whether or not classes have their own levels (causing the actor’s level to reset back to the class’s level) or to maintain the current level. In addition to providing the ability to change classes, equipping a subclass is also doable, and the mechanics of having a subclass can also be defined within this script.

这个脚本让你能在不战斗的时候为角色转职。当转职时,这个脚本提供作者一个可选功能:“是否让一个职业有他的特定等级”(这样会让角色重置到一定等级),或,保持原有等级。这个还提供了“副职”这个功能,这个功能也可以在脚本中明确设置。

cs-02.jpg
【图片文字:这个系统可以通过一个开关来解锁】
The “Class” menu item can be set to appear with a switch. Likewise, it can also be enabled and disabled through the use of a switch. If you do not wish to use these functions, just set the switch ID’s to 0 and they’ll always be on

这个“职业”系统可以通过一个开关解锁。这样的话,他也能被一个开关开启或关闭。如果你不想使用这个效果,请设置开关ID为0,这样的话,菜单将会一直出现在系统里。

cs-03.jpg
【图片文字:无论是副职还是主职,都可以被更改。获得一个副职可以对角色的能力造成影响。】
Classes can be changed for both primary and subclasses. Equipping a subclass can have a positive impact on an actor. Most notably, increasing the stats of an actor (by an adjustable rate). For those who wish to hide/show or disable/enable the “Primary” or “Subclass” commands, they can be done so through the aid of switches. Like with the “Class” menu item, setting the switch to 0 will ignore this and always have them appear.

Also note that classes have levels now. Developers can choose to maintain the levels or not, but if they choose not to, the stat boost will be based on the level of the class when equipped as a subclass.

无论是副职还是主职,都可以被更改。获得一个副职可以对角色的能力造成影响。也就是改变角色的能力(一个可以调整的比率)。为了方便那些希望 隐藏或显示 或 开启或关闭 主职(副职)指令的,他们可以通过开关来控制。就像开启或关闭“职业”菜单一样,设置开关为0会让脚本忽略开关,并让这个指令永远显示。

cs-04.jpg
【图片文字:副职可以增加角色技能种类,使角色领悟更多技能】
Subclasses can add their skill types to become usable for actors. For example, the Warrior class comes with the “Battle” skill type. By subclassing into a Berserker, Eric gains access to the “Berserk” skill type. This skill type inheritance can be enabled/disabled in the script.

副职可以增加角色技能种类,使角色领悟更多技能。比如说,职业:“佣兵”会有“战斗”,这个技能种类。当转副职为“狂战士”时,埃里克可以使用“狂战士”这个技能种类的技能。这个技能功能可以通过修改脚本被开启或关闭。

cs-05.jpg
【图片文字:副职可以影响角色的装备种类,让角色装备自己本来不能装备的道具】
Subclasses can influence equippable items and allow actors to wear items not normally allowed within their class. For instance, Eric as a Berserker can only equip axes. Now, he’s able to wield swords since he subclassed as a Warrior. This can be applied to both weapons and armours. This feature can be disabled within the script.

副职可以影响角色的装备种类,让角色装备自己本来不能装备的道具。举例来说,埃里克是一个狂战士,他只能装备斧头。因为他转职成了“佣兵”,现在他可以装备剑了。这项功能同样对防具适用。这个功能可以通过修改脚本被开启或关闭。

cs-06.jpg
【图片文字:在角色初始化时决定他已经解锁的职业】
Have actors start out with unlocked classes instead of having just their primary class available. Since there are multiple ways developers would like class unlocking to be handled, I’ll be including those methods in potential future add-ons for this script. For now, there are script calls you can use to unlock classes:

在角色初始化时就决定他已经解锁的职业,而不是就解锁他的本来职业。因为有多种可能的方式作者设置解锁职业的方法,我(译者注:代指作者Yanfly)可能会在将来的脚本中设置这个功能。现在而言,这些是唯一的方法来设置角色可转职业(译者注:= =)。

  1. $game_actors[x].unlock_class(y)
复制代码
This allows actor x to unlock class y, making it available for switching in and out in the Class scene.

这脚本让角色X解锁职业Y,使得该职业在切换进入或离开职业选单时被解锁(译者注:好难翻译= =)

  1. $game_actors[x].remove_class(y)
复制代码
This causes actor x to remove class y from being able to switch to and from. If the actor is currently class y, the class will not be removed. If the actor’s current subclass is y, the subclass will be unequipped.

这让角色X的Y职业被移除。如果该角色当前处于Y职业,那么这个职业不会被移除。如果该角色的副职是Y,那么这个副职将会被解除。

cs-07.jpg
【图片文字:图标可以通过备注栏设置并帮助完善职业。】
Icons and help descriptions for classes can be set through the aid of notetags. While these aren’t used anywhere else besides the class change scene, it does add that consistency for the game that you see everywhere else. These tags go into the class noteboxes:

图标可以通过备注栏设置并帮助完善职业。这些不会被其他地方所设置,但是这个提供了职业的一致性。这些备注请放入职业备注栏。
  1. <icon: x>
复制代码
Sets the icon representing the class to x.

将这个职业的图标设置为x

  1. <help description>
  2.   string
  3.   string
  4. </help description>
复制代码
Sets the text used for the help window in the class scene. Multiple lines in the notebox will be strung together. Use | for a line break.

设置职业选单中,帮助窗口的文字。多行文字会被合在一起,请用 | ,来分割多行。

— And that’s all, folks! —

这就是我要说的了!



翻译感言:Yanfly真是一个认真的人啊= =

评分

参与人数 1星屑 +10 梦石 +1 收起 理由
Mic_洛洛 + 10 + 1 精品文章

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
211 小时
注册时间
2011-10-2
回帖
26
 楼主| 发表于 2013-2-15 18:11:36 | 显示全部楼层
谢谢!!!
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部