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

Project1

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

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
211 小时
注册时间
2011-10-2
帖子
35
跳转到指定楼层
1
 楼主| 发表于 2013-2-14 23:18:52 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

好像是某人的脚本大集合里的,不知道怎么用,希望帮助!
职业系统:
RUBY 代码复制
  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.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-ClassSystem"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.08 - Compatibility Update: Learn Skill Engine
  17. # 2012.01.05 - Bug Fixed: Equipment no longer gets duplicated.
  18. # 2012.01.04 - Update: Autobattle will no longer use skills not available to
  19. #              that class for specific actors.
  20. # 2012.01.02 - Efficiency Update.
  21. # 2011.12.26 - Added custom command functionality.
  22. # 2011.12.23 - Compatibility Update: Class Specifics.
  23. # 2011.12.22 - Compatibility Update: Ace Menu Engine.
  24. # 2011.12.20 - Compatibility Update: Class Unlock Level.
  25. # 2011.12.19 - Started Script and Finished.
  26. #
  27. #==============================================================================
  28. # ▼ Introduction
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # This script adds the ability for your player to freely change the classes of
  31. # actors outside of battle from a menu. When changing classes, this script
  32. # gives the option for the developer to choose whether or not classes have
  33. # their own levels (causing the actor's level to reset back to the class's
  34. # level) or to maintain the current level. In addition to providing the ability
  35. # to change classes, equipping a subclass is also doable, and the mechanics of
  36. # having a subclass can also be defined within this script.
  37. #
  38. #==============================================================================
  39. # ▼ Instructions
  40. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  41. # To install this script, open up your script editor and copy/paste this script
  42. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  43. #
  44. # -----------------------------------------------------------------------------
  45. # Actor Notetags - These notetags go in the actors notebox in the database.
  46. # -----------------------------------------------------------------------------
  47. # <unlocked classes: x>
  48. # <unlocked classes: x, x>
  49. # This will set the default classes as unlocked for the actor. This does not
  50. # override the default classes unlocked in the module, but instead, adds on
  51. # to the number of unlocked classes.
  52. #
  53. # -----------------------------------------------------------------------------
  54. # Class Notetags - These notetags go in the class notebox in the database.
  55. # -----------------------------------------------------------------------------
  56. # <icon: x>
  57. # Sets the icon representing the class to x.
  58. #
  59. # <help description>
  60. #  string
  61. #  string
  62. # </help description>
  63. # Sets the text used for the help window in the class scene. Multiple lines in
  64. # the notebox will be strung together. Use | for a line break.
  65. #
  66. # -----------------------------------------------------------------------------
  67. # Script Calls - These commands are used with script calls.
  68. # -----------------------------------------------------------------------------
  69. # $game_actors[x].unlock_class(y)
  70. # This allows actor x to unlock class y, making it available for switching in
  71. # and out in the Class scene.
  72. #
  73. # $game_actors[x].remove_class(y)
  74. # This causes actor x to remove class y from being able to switch to and from.
  75. # If the actor is currently class y, the class will not be removed. If the
  76. # actor's current subclass is y, the subclass will be unequipped.
  77. #
  78. #==============================================================================
  79. # ▼ Compatibility
  80. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  81. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  82. # it will run with RPG Maker VX without adjusting.
  83. #
  84. #==============================================================================
  85.  
  86. module YEA
  87.   module CLASS_SYSTEM
  88.  
  89.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  90.     # - General Class Settings -
  91.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  92.     # These are the general settings regarding the whole script. They control
  93.     # various rules and regulations that this script undergoes. These settings
  94.     # will also determine what a subclass can do for a player.
  95.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  96.     CLASS_MENU_TEXT = "职业"  # Text that appears in the Main Menu.
  97.     MAINTAIN_LEVELS = false    # Maintain through all classes. Default: false.
  98.     DEFAULT_UNLOCKS = [ ]   # Classes unlocked by default.
  99.  
  100.     # The display between a primary class and a subclass when written in a
  101.     # window will appear as such.
  102.     SUBCLASS_TEXT = "%s/%s"
  103.  
  104.     # This adjusts the stat rate inheritance for an actor if an actor has a
  105.     # subclass equipped. If you want to disable this, set the rate to 0.0.
  106.     SUBCLASS_STAT_RATE = 0.20
  107.  
  108.     # This adds subclass skill types to the available skill types usable.
  109.     SUBCLASS_SKILL_TYPES = true
  110.  
  111.     # This adds subclass weapons to equippable weapon types.
  112.     SUBCLASS_WEAPON_TYPES = true
  113.  
  114.     # This adds subclass weapons to equippable armour types.
  115.     SUBCLASS_ARMOUR_TYPES = true
  116.  
  117.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  118.     # - Class Scene Commands -
  119.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  120.     # These settings adjust how the class scene appears. Here, you can adjust
  121.     # the command list and the order at which items appear. These are mostly
  122.     # visual settings. Adjust them as you see fit.
  123.     #
  124.     # -------------------------------------------------------------------------
  125.     # :command         Description
  126.     # -------------------------------------------------------------------------
  127.     # :primary         Allows the player to change the primary class.
  128.     # :subclass        Allows the player to change the subclass.
  129.     #
  130.     # :learn_skill     Requires YEA - Learn Skill Engine
  131.     #
  132.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  133.     COMMANDS =[ # The order at which the menu items are shown.
  134.     # [ :command,   "Display"],
  135.       [ :primary,   "主要职业"],
  136.       [:subclass,  "次要职业"],
  137.       [:learn_skill, "学习技能"],
  138.     # [ :custom1,   "Custom1"],
  139.     # [ :custom2,   "Custom2"],
  140.     ] # Do not remove this.
  141.  
  142.     #--------------------------------------------------------------------------
  143.     # - Status Class Commands -
  144.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  145.     # For those who use scripts to that may produce unique effects for the
  146.     # class menu, use this hash to manage the custom commands for the Class
  147.     # Command Window. You can disable certain commands or prevent them from
  148.     # appearing by using switches. If you don't wish to bind them to a switch,
  149.     # set the proper switch to 0 for it to have no impact.
  150.     #--------------------------------------------------------------------------
  151.     CUSTOM_CLASS_COMMANDS ={
  152.     # :command => [EnableSwitch, ShowSwitch, Handler Method,
  153.       :custom1 => [           0,          0, :command_name1],
  154.       :custom2 => [           0,          0, :command_name2],
  155.     } # Do not remove this.
  156.  
  157.     # These settings adjust the colour displays for classes.
  158.     CURRENT_CLASS_COLOUR = 17     # "Window" colour used for current class.
  159.     SUBCLASS_COLOUR      = 4      # "Window" colour used for subclass.
  160.  
  161.     # This adjusts the display for class levels if MAINTAIN_LEVELS is false.
  162.     CLASS_LEVEL     = "LV%s"      # Text display for level.
  163.     LEVEL_FONT_SIZE = 16          # Font size used for level.
  164.  
  165.     # This array sets the order of how classes are ordered in the class listing
  166.     # window. Any class ID's unlisted will not be shown.
  167.     CLASS_ORDER = [41..999, 1..40]
  168.  
  169.     # This adjusts the font size for the Parameters window.
  170.     PARAM_FONT_SIZE = 20
  171.  
  172.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173.     # - Switch Settings -
  174.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  175.     # These are the switches that govern whether or not certain menu items will
  176.     # appear and/or will be enabled. By binding them to a Switch, you can just
  177.     # set the Switch ON/OFF to show/hide or enable/disable a menu command. If
  178.     # you do not wish to use this feature, set these commands to 0.
  179.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  180.     SWITCH_SHOW_CLASS      = 0    # Switch that shows Class in Main Menu.
  181.     SWITCH_ENABLE_CLASS    = 0    # Switch that enables Class in Main Menu.
  182.     SWITCH_SHOW_PRIMARY    = 0    # Switch that shows Subclass in Class Menu.
  183.     SWITCH_ENABLE_PRIMARY  = 0    # Switch that enables Subclass in Class Menu.
  184.     SWITCH_SHOW_SUBCLASS   = 0    # Switch that shows Subclass in Class Menu.
  185.     SWITCH_ENABLE_SUBCLASS = 0    # Switch that enables Subclass in Class Menu.
  186.  
  187.   end # CLASS_SYSTEM
  188. end # YEA
  189.  
  190. #==============================================================================
  191. # ▼ Editting anything past this point may potentially result in causing
  192. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  193. # halitosis so edit at your own risk.
  194. #==============================================================================
  195.  
  196. module YEA
  197.   module CLASS_SYSTEM
  198.     module_function
  199.     #--------------------------------------------------------------------------
  200.     # convert_integer_array
  201.     #--------------------------------------------------------------------------
  202.     def convert_integer_array(array)
  203.       result = []
  204.       array.each { |i|
  205.         case i
  206.         when Range; result |= i.to_a
  207.         when Integer; result |= [i]
  208.         end }
  209.       return result
  210.     end
  211.     #--------------------------------------------------------------------------
  212.     # converted_contants
  213.     #--------------------------------------------------------------------------
  214.     DEFAULT_UNLOCKS = convert_integer_array(DEFAULT_UNLOCKS)
  215.     CLASS_ORDER = convert_integer_array(CLASS_ORDER)
  216.   end # CLASS_SYSTEM
  217.   module REGEXP
  218.   module ACTOR
  219.  
  220.     UNLOCKED_CLASSES =
  221.       /<(?:UNLOCKED_CLASSES|unlocked classes):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  222.  
  223.   end # ACTOR
  224.   module CLASS
  225.  
  226.     ICON_INDEX = /<(?:ICON_INDEX|icon index|icon):[ ](\d+)>/i
  227.     HELP_DESCRIPTION_ON  = /<(?:HELP_DESCRIPTION|help description)>/i
  228.     HELP_DESCRIPTION_OFF = /<\/(?:HELP_DESCRIPTION|help description)>/i
  229.  
  230.   end # CLASS
  231.   end # REGEXP
  232. end # YEA
  233.  
  234. #==============================================================================
  235. # ■ Switch
  236. #==============================================================================
  237.  
  238. module Switch
  239.  
  240.   #--------------------------------------------------------------------------
  241.   # self.class_show
  242.   #--------------------------------------------------------------------------
  243.   def self.class_show
  244.     return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_CLASS <= 0
  245.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_CLASS]
  246.   end
  247.  
  248.   #--------------------------------------------------------------------------
  249.   # self.class_enable
  250.   #--------------------------------------------------------------------------
  251.   def self.class_enable
  252.     return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_CLASS <= 0
  253.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_CLASS]
  254.   end
  255.  
  256.   #--------------------------------------------------------------------------
  257.   # self.primary_show
  258.   #--------------------------------------------------------------------------
  259.   def self.primary_show
  260.     return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_PRIMARY <= 0
  261.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_PRIMARY]
  262.   end
  263.  
  264.   #--------------------------------------------------------------------------
  265.   # self.primary_enable
  266.   #--------------------------------------------------------------------------
  267.   def self.primary_enable
  268.     return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_PRIMARY <= 0
  269.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_PRIMARY]
  270.   end
  271.  
  272.   #--------------------------------------------------------------------------
  273.   # self.subclass_show
  274.   #--------------------------------------------------------------------------
  275.   def self.subclass_show
  276.     return true if YEA::CLASS_SYSTEM::SWITCH_SHOW_SUBCLASS <= 0
  277.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_SHOW_SUBCLASS]
  278.   end
  279.  
  280.   #--------------------------------------------------------------------------
  281.   # self.subclass_enable
  282.   #--------------------------------------------------------------------------
  283.   def self.subclass_enable
  284.     return true if YEA::CLASS_SYSTEM::SWITCH_ENABLE_SUBCLASS <= 0
  285.     return $game_switches[YEA::CLASS_SYSTEM::SWITCH_ENABLE_SUBCLASS]
  286.   end
  287.  
  288. end # Switch
  289.  
  290. #==============================================================================
  291. # ■ Numeric
  292. #==============================================================================
  293.  
  294. class Numeric
  295.  
  296.   #--------------------------------------------------------------------------
  297.   # new method: group_digits
  298.   #--------------------------------------------------------------------------
  299.   unless $imported["YEA-CoreEngine"]
  300.   def group; return self.to_s; end
  301.   end # $imported["YEA-CoreEngine"]
  302.  
  303. end # Numeric
  304.  
  305. #==============================================================================
  306. # ■ DataManager
  307. #==============================================================================
  308.  
  309. module DataManager
  310.  
  311.   #--------------------------------------------------------------------------
  312.   # alias method: load_database
  313.   #--------------------------------------------------------------------------
  314.   class <<self; alias load_database_cs load_database; end
  315.   def self.load_database
  316.     load_database_cs
  317.     load_notetags_cs
  318.   end
  319.  
  320.   #--------------------------------------------------------------------------
  321.   # new method: load_notetags_cs
  322.   #--------------------------------------------------------------------------
  323.   def self.load_notetags_cs
  324.     groups = [$data_actors, $data_classes]
  325.     for group in groups
  326.       for obj in group
  327.         next if obj.nil?
  328.         obj.load_notetags_cs
  329.       end
  330.     end
  331.   end
  332.  
  333. end # DataManager
  334.  
  335. #==============================================================================
  336. # ■ RPG::Actor
  337. #==============================================================================
  338.  
  339. class RPG::Actor < RPG::BaseItem
  340.  
  341.   #--------------------------------------------------------------------------
  342.   # public instance variables
  343.   #--------------------------------------------------------------------------
  344.   attr_accessor :unlocked_classes
  345.  
  346.   #--------------------------------------------------------------------------
  347.   # common cache: load_notetags_cs
  348.   #--------------------------------------------------------------------------
  349.   def load_notetags_cs
  350.     @unlocked_classes = []
  351.     #---
  352.     self.note.split(/[\r\n]+/).each { |line|
  353.       case line
  354.       #---
  355.       when YEA::REGEXP::ACTOR::UNLOCKED_CLASSES
  356.         $1.scan(/\d+/).each { |num|
  357.         @unlocked_classes.push(num.to_i) if num.to_i > 0 }
  358.       #---
  359.       end
  360.     } # self.note.split
  361.     #---
  362.   end
  363.  
  364. end # RPG::Actor
  365.  
  366. #==============================================================================
  367. # ■ RPG::Class
  368. #==============================================================================
  369.  
  370. class RPG::Class < RPG::BaseItem
  371.  
  372.   #--------------------------------------------------------------------------
  373.   # public instance variables
  374.   #--------------------------------------------------------------------------
  375.   attr_accessor :icon_index
  376.  
  377.   #--------------------------------------------------------------------------
  378.   # common cache: load_notetags_cs
  379.   #--------------------------------------------------------------------------
  380.   def load_notetags_cs
  381.     @icon_index = 0
  382.     @help_description_on = false
  383.     #---
  384.     self.note.split(/[\r\n]+/).each { |line|
  385.       case line
  386.       #---
  387.       when YEA::REGEXP::CLASS::ICON_INDEX
  388.         @icon_index = $1.to_i
  389.       #---
  390.       when YEA::REGEXP::CLASS::HELP_DESCRIPTION_ON
  391.         @help_description_on = true
  392.       when YEA::REGEXP::CLASS::HELP_DESCRIPTION_OFF
  393.         @help_description_on = false
  394.       #---
  395.       else
  396.         @description += line.to_s if @help_description_on
  397.       end
  398.     } # self.note.split
  399.     #---
  400.     @description.gsub!(/[|]/i) { "\n" }
  401.   end
  402.  
  403. end # RPG::Class
  404.  
  405. #==============================================================================
  406. # ■ Game_Temp
  407. #==============================================================================
  408.  
  409. class Game_Temp
  410.  
  411.   #--------------------------------------------------------------------------
  412.   # public instance variables
  413.   #--------------------------------------------------------------------------
  414.   attr_accessor :scene_class_index
  415.   attr_accessor :scene_class_oy
  416.  
  417. end # Game_Temp
  418.  
  419. #==============================================================================
  420. # ■ Game_Action
  421. #==============================================================================
  422.  
  423. class Game_Action
  424.  
  425.   #--------------------------------------------------------------------------
  426.   # alias method: valid?
  427.   #--------------------------------------------------------------------------
  428.   alias game_action_valid_cs valid?
  429.   def valid?
  430.     return false if check_auto_battle_class
  431.     return game_action_valid_cs
  432.   end
  433.  
  434.   #--------------------------------------------------------------------------
  435.   # new method: check_auto_battle_class
  436.   #--------------------------------------------------------------------------
  437.   def check_auto_battle_class
  438.     return false unless subject.actor?
  439.     return false unless subject.auto_battle?
  440.     return false if item.nil?
  441.     return false if subject.added_skill_types.include?(item.stype_id)
  442.     return false if item.id == subject.attack_skill_id
  443.     return true
  444.   end
  445.  
  446. end # Game_Action
  447.  
  448. #==============================================================================
  449. # ■ Game_BattlerBase
  450. #==============================================================================
  451.  
  452. class Game_BattlerBase
  453.  
  454.   #--------------------------------------------------------------------------
  455.   # public instance variables
  456.   #--------------------------------------------------------------------------
  457.   attr_accessor :temp_flag
  458.  
  459.   #--------------------------------------------------------------------------
  460.   # alias method: added_skill_types
  461.   #--------------------------------------------------------------------------
  462.   alias game_battlerbase_added_skill_types_cs added_skill_types
  463.   def added_skill_types
  464.     result = game_battlerbase_added_skill_types_cs
  465.     result |= subclass_skill_types
  466.     return result
  467.   end
  468.  
  469.   #--------------------------------------------------------------------------
  470.   # new method: subclass_skill_types
  471.   #--------------------------------------------------------------------------
  472.   def subclass_skill_types; return []; end
  473.  
  474.   #--------------------------------------------------------------------------
  475.   # alias method: equip_wtype_ok?
  476.   #--------------------------------------------------------------------------
  477.   alias game_battlerbase_equip_wtype_ok_cs equip_wtype_ok?
  478.   def equip_wtype_ok?(wtype_id)
  479.     return true if subclass_equip_wtype?(wtype_id)
  480.     return game_battlerbase_equip_wtype_ok_cs(wtype_id)
  481.   end
  482.  
  483.   #--------------------------------------------------------------------------
  484.   # new method: subclass_equip_wtype?
  485.   #--------------------------------------------------------------------------
  486.   def subclass_equip_wtype?(wtype_id); return false; end
  487.  
  488.   #--------------------------------------------------------------------------
  489.   # alias method: equip_atype_ok?
  490.   #--------------------------------------------------------------------------
  491.   alias game_battlerbase_equip_atype_ok_cs equip_atype_ok?
  492.   def equip_atype_ok?(atype_id)
  493.     return true if subclass_equip_atype?(atype_id)
  494.     return game_battlerbase_equip_atype_ok_cs(atype_id)
  495.   end
  496.  
  497.   #--------------------------------------------------------------------------
  498.   # new method: subclass_equip_atype?
  499.   #--------------------------------------------------------------------------
  500.   def subclass_equip_atype?(atype_id); return false; end
  501.  
  502. end # Game_BattlerBase
  503.  
  504. #==============================================================================
  505. # ■ Game_Actor
  506. #==============================================================================
  507.  
  508. class Game_Actor < Game_Battler
  509.  
  510.   #--------------------------------------------------------------------------
  511.   # alias method: setup
  512.   #--------------------------------------------------------------------------
  513.   alias game_actor_setup_cs setup
  514.   def setup(actor_id)
  515.     game_actor_setup_cs(actor_id)
  516.     init_unlocked_classes
  517.     init_subclass
  518.   end
  519.  
  520.   #--------------------------------------------------------------------------
  521.   # new method: init_unlocked_classes
  522.   #--------------------------------------------------------------------------
  523.   def init_unlocked_classes
  524.     @unlocked_classes = actor.unlocked_classes.clone
  525.     @unlocked_classes.push(@class_id) if !@unlocked_classes.include?(@class_id)
  526.     @unlocked_classes.sort!
  527.   end
  528.  
  529.   #--------------------------------------------------------------------------
  530.   # new method: init_subclass
  531.   #--------------------------------------------------------------------------
  532.   def init_subclass
  533.     @subclass_id = 0
  534.   end
  535.  
  536.   #--------------------------------------------------------------------------
  537.   # new method: unlocked_classes
  538.   #--------------------------------------------------------------------------
  539.   def unlocked_classes
  540.     init_unlocked_classes if @unlocked_classes.nil?
  541.     return @unlocked_classes
  542.   end
  543.  
  544.   #--------------------------------------------------------------------------
  545.   # new method: unlock_class
  546.   #--------------------------------------------------------------------------
  547.   def unlock_class(class_id)
  548.     init_unlocked_classes if @unlocked_classes.nil?
  549.     return if @unlocked_classes.include?(class_id)
  550.     @unlocked_classes.push(class_id)
  551.     learn_class_skills(class_id)
  552.   end
  553.  
  554.   #--------------------------------------------------------------------------
  555.   # new method: remove_class
  556.   #--------------------------------------------------------------------------
  557.   def remove_class(class_id)
  558.     init_unlocked_classes if @unlocked_classes.nil?
  559.     return if class_id == @class_id
  560.     @unlocked_classes.delete(class_id)
  561.     @subclass_id = 0 if class_id == @subclass_id
  562.     refresh
  563.   end
  564.  
  565.   #--------------------------------------------------------------------------
  566.   # new method: subclass
  567.   #--------------------------------------------------------------------------
  568.   def subclass
  569.     init_subclass if @subclass_id.nil?
  570.     return $data_classes[@subclass_id]
  571.   end
  572.  
  573.   #--------------------------------------------------------------------------
  574.   # alias method: change_class
  575.   #--------------------------------------------------------------------------
  576.   alias game_actor_change_class_cs change_class
  577.   def change_class(class_id, keep_exp = false)
  578.     @subclass_id = 0 if @subclass_id == class_id
  579.     game_actor_change_class_cs(class_id, keep_exp)
  580.     learn_class_skills(class_id)
  581.     unlock_class(class_id)
  582.   end
  583.  
  584.   #--------------------------------------------------------------------------
  585.   # new method: learn_class_skills
  586.   #--------------------------------------------------------------------------
  587.   def learn_class_skills(class_id)
  588.     return if class_id <= 0
  589.     return if $data_classes[class_id].nil?
  590.     $data_classes[class_id].learnings.each do |learning|
  591.       learn_skill(learning.skill_id) if learning.level == class_level(class_id)
  592.     end
  593.   end
  594.  
  595.   #--------------------------------------------------------------------------
  596.   # new method: change_subclass
  597.   #--------------------------------------------------------------------------
  598.   def change_subclass(class_id)
  599.     return if class_id == @class_id
  600.     unlock_class(class_id)
  601.     @subclass_id = @subclass_id == class_id ? 0 : class_id
  602.     learn_class_skills(@subclass_id)
  603.     refresh
  604.   end
  605.  
  606.   #--------------------------------------------------------------------------
  607.   # new method: class_level
  608.   #--------------------------------------------------------------------------
  609.   def class_level(class_id)
  610.     return [url=home.php?mod=space&uid=22147]@level[/url] if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  611.     temp_class = $data_classes[class_id]
  612.     @exp[class_id] = 0 if @exp[class_id].nil?
  613.     n = 1
  614.     loop do
  615.       break if temp_class.exp_for_level(n+1) > @exp[class_id]
  616.       n += 1
  617.     end
  618.     return n
  619.   end
  620.  
  621.   #--------------------------------------------------------------------------
  622.   # new method: subclass_level
  623.   #--------------------------------------------------------------------------
  624.   def subclass_level
  625.     return 0 if @subclass_id == 0
  626.     return [url=home.php?mod=space&uid=22147]@level[/url] if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  627.     return class_level(@subclass_id)
  628.   end
  629.  
  630.   #--------------------------------------------------------------------------
  631.   # alias method: param_base
  632.   #--------------------------------------------------------------------------
  633.   alias game_actor_param_base_cs param_base
  634.   def param_base(param_id)
  635.     result = game_actor_param_base_cs(param_id)
  636.     unless subclass.nil?
  637.       subclass_rate = YEA::CLASS_SYSTEM::SUBCLASS_STAT_RATE
  638.       slevel = subclass_level
  639.       result += subclass.params[param_id, slevel] * subclass_rate
  640.     end
  641.     return result.to_i
  642.   end
  643.  
  644.   #--------------------------------------------------------------------------
  645.   # new method: subclass_skill_types
  646.   #--------------------------------------------------------------------------
  647.   def subclass_skill_types
  648.     return [] unless YEA::CLASS_SYSTEM::SUBCLASS_SKILL_TYPES
  649.     return [] if subclass.nil?
  650.     array = []
  651.     for feature in subclass.features
  652.       next unless feature.code == FEATURE_STYPE_ADD
  653.       next if features_set(FEATURE_STYPE_ADD).include?(feature.data_id)
  654.       array.push(feature.data_id)
  655.     end
  656.     return array
  657.   end
  658.  
  659.   #--------------------------------------------------------------------------
  660.   # new method: subclass_equip_wtype?
  661.   #--------------------------------------------------------------------------
  662.   def subclass_equip_wtype?(wtype_id)
  663.     return false unless YEA::CLASS_SYSTEM::SUBCLASS_WEAPON_TYPES
  664.     return false if subclass.nil?
  665.     for feature in subclass.features
  666.       next unless feature.code == FEATURE_EQUIP_WTYPE
  667.       return true if wtype_id == feature.data_id
  668.     end
  669.     return super
  670.   end
  671.  
  672.   #--------------------------------------------------------------------------
  673.   # new method: subclass_equip_atype?
  674.   #--------------------------------------------------------------------------
  675.   def subclass_equip_atype?(atype_id)
  676.     return false unless YEA::CLASS_SYSTEM::SUBCLASS_ARMOUR_TYPES
  677.     return false if subclass.nil?
  678.     for feature in subclass.features
  679.       next unless feature.code == FEATURE_EQUIP_ATYPE
  680.       return true if atype_id == feature.data_id
  681.     end
  682.     return super
  683.   end
  684.  
  685.   #--------------------------------------------------------------------------
  686.   # alias method: release_unequippable_items
  687.   #--------------------------------------------------------------------------
  688.   alias game_actor_release_unequippable_items_cs release_unequippable_items
  689.   def release_unequippable_items(item_gain = true)
  690.     item_gain = false if @temp_flag
  691.     game_actor_release_unequippable_items_cs(item_gain)
  692.   end
  693.  
  694. end # Game_Actor
  695.  
  696. #==============================================================================
  697. # ■ Game_Interpreter
  698. #==============================================================================
  699.  
  700. class Game_Interpreter
  701.  
  702.   #--------------------------------------------------------------------------
  703.   # overwrite method: command_321
  704.   #--------------------------------------------------------------------------
  705.   def command_321
  706.     actor = $game_actors[@params[0]]
  707.     if actor && $data_classes[@params[1]]
  708.       maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  709.       actor.change_class(@params[1], maintain)
  710.     end
  711.   end
  712.  
  713. end # Game_Interpreter
  714.  
  715. #==============================================================================
  716. # ■ Window_Base
  717. #==============================================================================
  718.  
  719. class Window_Base < Window
  720.  
  721.   #--------------------------------------------------------------------------
  722.   # overwrite method: draw_actor_class
  723.   #--------------------------------------------------------------------------
  724.   def draw_actor_class(actor, x, y, width = 112)
  725.     change_color(normal_color)
  726.     if actor.subclass.nil?
  727.       text = actor.class.name
  728.     else
  729.       fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
  730.       text = sprintf(fmt, actor.class.name, actor.subclass.name)
  731.     end
  732.     draw_text(x, y, width, line_height, text)
  733.   end
  734.  
  735. end # Window_Base
  736.  
  737. #==============================================================================
  738. # ■ Window_MenuCommand
  739. #==============================================================================
  740.  
  741. class Window_MenuCommand < Window_Command
  742.  
  743.   #--------------------------------------------------------------------------
  744.   # alias method: add_formation_command
  745.   #--------------------------------------------------------------------------
  746.   alias window_menucommand_add_formation_command_cs add_formation_command
  747.   def add_formation_command
  748.     add_class_command unless $imported["YEA-AceMenuEngine"]
  749.     window_menucommand_add_formation_command_cs
  750.   end
  751.  
  752.   #--------------------------------------------------------------------------
  753.   # new method: add_class_command
  754.   #--------------------------------------------------------------------------
  755.   def add_class_command
  756.     return unless Switch.class_show
  757.     text = YEA::CLASS_SYSTEM::CLASS_MENU_TEXT
  758.     add_command(text, :class, Switch.class_enable)
  759.   end
  760.  
  761. end # Window_MenuCommand
  762.  
  763. #==============================================================================
  764. # ■ Window_ClassCommand
  765. #==============================================================================
  766.  
  767. class Window_ClassCommand < Window_Command
  768.  
  769.   #--------------------------------------------------------------------------
  770.   # initialize
  771.   #--------------------------------------------------------------------------
  772.   def initialize(x, y)
  773.     super(x, y)
  774.     [url=home.php?mod=space&uid=95897]@actor[/url] = nil
  775.   end
  776.  
  777.   #--------------------------------------------------------------------------
  778.   # ● ウィンドウ幅の取得
  779.   #--------------------------------------------------------------------------
  780.   def window_width; return 160; end
  781.  
  782.   #--------------------------------------------------------------------------
  783.   # actor=
  784.   #--------------------------------------------------------------------------
  785.   def actor=(actor)
  786.     return if [url=home.php?mod=space&uid=95897]@actor[/url] == actor
  787.     @actor = actor
  788.     refresh
  789.   end
  790.  
  791.   #--------------------------------------------------------------------------
  792.   # item_window=
  793.   #--------------------------------------------------------------------------
  794.   def item_window=(window)
  795.     @item_window = window
  796.   end
  797.  
  798.   #--------------------------------------------------------------------------
  799.   # visible_line_number
  800.   #--------------------------------------------------------------------------
  801.   def visible_line_number; return 4; end
  802.  
  803.   #--------------------------------------------------------------------------
  804.   # make_command_list
  805.   #--------------------------------------------------------------------------
  806.   def make_command_list
  807.     return if @actor.nil?
  808.     for command in YEA::CLASS_SYSTEM::COMMANDS
  809.       case command[0]
  810.       when :primary
  811.         next unless Switch.primary_show
  812.         add_command(command[1], command[0], Switch.primary_enable)
  813.       when :subclass
  814.         next unless Switch.subclass_show
  815.         add_command(command[1], command[0], Switch.subclass_enable)
  816.       when :learn_skill
  817.         next unless $imported["YEA-LearnSkillEngine"]
  818.         add_learn_skill_command
  819.       else
  820.         process_custom_command(command)
  821.       end
  822.     end
  823.     if !$game_temp.scene_class_index.nil?
  824.       select($game_temp.scene_class_index)
  825.       self.oy = $game_temp.scene_class_oy
  826.     end
  827.     $game_temp.scene_class_index = nil
  828.     $game_temp.scene_class_oy = nil
  829.   end
  830.  
  831.   #--------------------------------------------------------------------------
  832.   # process_ok
  833.   #--------------------------------------------------------------------------
  834.   def process_ok
  835.     $game_temp.scene_class_index = index
  836.     $game_temp.scene_class_oy = self.oy
  837.     super
  838.   end
  839.  
  840.   #--------------------------------------------------------------------------
  841.   # process_custom_command
  842.   #--------------------------------------------------------------------------
  843.   def process_custom_command(command)
  844.     return unless YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS.include?(command[0])
  845.     show = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][1]
  846.     continue = show <= 0 ? true : $game_switches[show]
  847.     return unless continue
  848.     text = command[1]
  849.     switch = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][0]
  850.     enabled = switch <= 0 ? true : $game_switches[switch]
  851.     add_command(text, command[0], enabled)
  852.   end
  853.  
  854.   #--------------------------------------------------------------------------
  855.   # update
  856.   #--------------------------------------------------------------------------
  857.   def update
  858.     super
  859.     update_visible_windows
  860.   end
  861.  
  862.   #--------------------------------------------------------------------------
  863.   # update_visible_windows
  864.   #--------------------------------------------------------------------------
  865.   def update_visible_windows
  866.     return if @current_index == current_symbol
  867.     @current_index = current_symbol
  868.     @item_window.refresh unless @item_window.nil?
  869.   end
  870.  
  871.   #--------------------------------------------------------------------------
  872.   # add_learn_skill_command
  873.   #--------------------------------------------------------------------------
  874.   def add_learn_skill_command
  875.     return unless Switch.show_learn_skill
  876.     name = YEA::LEARN_SKILL::COMMAND_NAME
  877.     add_command(name, :learn_skill, true)
  878.   end
  879.  
  880. end # Window_ClassCommand
  881.  
  882. #==============================================================================
  883. # ■ Window_ClassStatus
  884. #==============================================================================
  885.  
  886. class Window_ClassStatus < Window_Base
  887.  
  888.   #--------------------------------------------------------------------------
  889.   # initialize
  890.   #--------------------------------------------------------------------------
  891.   def initialize(dx, dy)
  892.     super(dx, dy, window_width, fitting_height(4))
  893.     @actor = nil
  894.   end
  895.  
  896.   #--------------------------------------------------------------------------
  897.   # window_width
  898.   #--------------------------------------------------------------------------
  899.   def window_width; Graphics.width - 160; end
  900.  
  901.   #--------------------------------------------------------------------------
  902.   # actor=
  903.   #--------------------------------------------------------------------------
  904.   def actor=(actor)
  905.     return if @actor == actor
  906.     @actor = actor
  907.     refresh
  908.   end
  909.  
  910.   #--------------------------------------------------------------------------
  911.   # refresh
  912.   #--------------------------------------------------------------------------
  913.   def refresh
  914.     contents.clear
  915.     return if @actor.nil?
  916.     draw_actor_face(@actor, 0, 0)
  917.     draw_actor_simple_status(@actor, 108, line_height / 2)
  918.   end
  919.  
  920. end # Window_ClassStatus
  921.  
  922. #==============================================================================
  923. # ■ Window_ClassParam
  924. #==============================================================================
  925.  
  926. class Window_ClassParam < Window_Base
  927.  
  928.   #--------------------------------------------------------------------------
  929.   # initialize
  930.   #--------------------------------------------------------------------------
  931.   def initialize(dx, dy)
  932.     super(dx, dy, window_width, Graphics.height - dy)
  933.     @actor = nil
  934.     @temp_actor = nil
  935.     refresh
  936.   end
  937.  
  938.   #--------------------------------------------------------------------------
  939.   # window_width
  940.   #--------------------------------------------------------------------------
  941.   def window_width; return Graphics.width * 2 / 5; end
  942.  
  943.   #--------------------------------------------------------------------------
  944.   # actor=
  945.   #--------------------------------------------------------------------------
  946.   def actor=(actor)
  947.     return if @actor == actor
  948.     @actor = actor
  949.     refresh
  950.   end
  951.  
  952.   #--------------------------------------------------------------------------
  953.   # refresh
  954.   #--------------------------------------------------------------------------
  955.   def refresh
  956.     contents.clear
  957.     8.times {|i| draw_item(0, line_height * i, i) }
  958.   end
  959.  
  960.   #--------------------------------------------------------------------------
  961.   # set_temp_actor
  962.   #--------------------------------------------------------------------------
  963.   def set_temp_actor(temp_actor)
  964.     return if @temp_actor == temp_actor
  965.     @temp_actor = temp_actor
  966.     refresh
  967.   end
  968.  
  969.   #--------------------------------------------------------------------------
  970.   # draw_item
  971.   #--------------------------------------------------------------------------
  972.   def draw_item(dx, dy, param_id)
  973.     draw_background_colour(dx, dy)
  974.     draw_param_name(dx + 4, dy, param_id)
  975.     draw_current_param(dx + 4, dy, param_id) if @actor
  976.     drx = (contents.width + 22) / 2
  977.     draw_right_arrow(drx, dy)
  978.     draw_new_param(drx + 22, dy, param_id) if @temp_actor
  979.     reset_font_settings
  980.   end
  981.  
  982.   #--------------------------------------------------------------------------
  983.   # draw_background_colour
  984.   #--------------------------------------------------------------------------
  985.   def draw_background_colour(dx, dy)
  986.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  987.     rect = Rect.new(dx+1, dy+1, contents.width - 2, line_height - 2)
  988.     contents.fill_rect(rect, colour)
  989.   end
  990.  
  991.   #--------------------------------------------------------------------------
  992.   # overwrite method: draw_param_name
  993.   #--------------------------------------------------------------------------
  994.   def draw_param_name(dx, dy, param_id)
  995.     contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  996.     change_color(system_color)
  997.     draw_text(dx, dy, contents.width, line_height, Vocab::param(param_id))
  998.   end
  999.  
  1000.   #--------------------------------------------------------------------------
  1001.   # overwrite method: draw_current_param
  1002.   #--------------------------------------------------------------------------
  1003.   def draw_current_param(dx, dy, param_id)
  1004.     change_color(normal_color)
  1005.     dw = (contents.width + 22) / 2
  1006.     draw_text(0, dy, dw, line_height, @actor.param(param_id).group, 2)
  1007.     reset_font_settings
  1008.   end
  1009.  
  1010.   #--------------------------------------------------------------------------
  1011.   # draw_right_arrow
  1012.   #--------------------------------------------------------------------------
  1013.   def draw_right_arrow(x, y)
  1014.     change_color(system_color)
  1015.     draw_text(x, y, 22, line_height, "→", 1)
  1016.   end
  1017.  
  1018.   #--------------------------------------------------------------------------
  1019.   # draw_new_param
  1020.   #--------------------------------------------------------------------------
  1021.   def draw_new_param(dx, dy, param_id)
  1022.     contents.font.size = YEA::CLASS_SYSTEM::PARAM_FONT_SIZE
  1023.     new_value = @temp_actor.param(param_id)
  1024.     change_color(param_change_color(new_value - @actor.param(param_id)))
  1025.     draw_text(0, dy, contents.width-4, line_height, new_value.group, 2)
  1026.     reset_font_settings
  1027.   end
  1028.  
  1029. end # Window_ClassParam
  1030.  
  1031. #==============================================================================
  1032. # ■ Window_ClassList
  1033. #==============================================================================
  1034.  
  1035. class Window_ClassList < Window_Selectable
  1036.  
  1037.   #--------------------------------------------------------------------------
  1038.   # initialize
  1039.   #--------------------------------------------------------------------------
  1040.   def initialize(dx, dy)
  1041.     dw = Graphics.width - (Graphics.width * 2 / 5)
  1042.     dh = Graphics.height - dy
  1043.     super(dx, dy, dw, dh)
  1044.     @actor = nil
  1045.     @command_window = nil
  1046.     @status_window
  1047.     @data = []
  1048.   end
  1049.  
  1050.   #--------------------------------------------------------------------------
  1051.   # actor=
  1052.   #--------------------------------------------------------------------------
  1053.   def actor=(actor)
  1054.     return if @actor == actor
  1055.     @actor = actor
  1056.     @last_item = nil
  1057.     refresh
  1058.     self.oy = 0
  1059.   end
  1060.  
  1061.   #--------------------------------------------------------------------------
  1062.   # command_window=
  1063.   #--------------------------------------------------------------------------
  1064.   def command_window=(command_window)
  1065.     @command_window = command_window
  1066.   end
  1067.  
  1068.   #--------------------------------------------------------------------------
  1069.   # status_window=
  1070.   #--------------------------------------------------------------------------
  1071.   def status_window=(status_window)
  1072.     @status_window = status_window
  1073.   end
  1074.  
  1075.   #--------------------------------------------------------------------------
  1076.   # item_max
  1077.   #--------------------------------------------------------------------------
  1078.   def item_max; return @data ? @data.size : 1; end
  1079.  
  1080.   #--------------------------------------------------------------------------
  1081.   # item
  1082.   #--------------------------------------------------------------------------
  1083.   def item; return @data && index >= 0 ? @data[index] : nil; end
  1084.  
  1085.   #--------------------------------------------------------------------------
  1086.   # current_item_enabled?
  1087.   #--------------------------------------------------------------------------
  1088.   def current_item_enabled?; return enable?(@data[index]); end
  1089.  
  1090.   #--------------------------------------------------------------------------
  1091.   # include?
  1092.   #--------------------------------------------------------------------------
  1093.   def include?(item)
  1094.     return true if YEA::CLASS_SYSTEM::DEFAULT_UNLOCKS.include?(item.id)
  1095.     return @actor.unlocked_classes.include?(item.id)
  1096.   end
  1097.  
  1098.   #--------------------------------------------------------------------------
  1099.   # enable?
  1100.   #--------------------------------------------------------------------------
  1101.   def enable?(item)
  1102.     return false if item == @actor.class
  1103.     return true
  1104.   end
  1105.  
  1106.   #--------------------------------------------------------------------------
  1107.   # make_item_list
  1108.   #--------------------------------------------------------------------------
  1109.   def make_item_list
  1110.     @data = []
  1111.     for class_id in YEA::CLASS_SYSTEM::CLASS_ORDER
  1112.       next if $data_classes[class_id].nil?
  1113.       item = $data_classes[class_id]
  1114.       @data.push(item) if include?(item)
  1115.     end
  1116.   end
  1117.  
  1118.   #--------------------------------------------------------------------------
  1119.   # select_last
  1120.   #--------------------------------------------------------------------------
  1121.   def select_last
  1122.     case @command_window.current_symbol
  1123.     when :primary
  1124.       select(@data.index(@actor.class))
  1125.     when :subclass
  1126.       select(0) if @actor.subclass.nil?
  1127.       select(@data.index(@actor.subclass)) unless @actor.subclass.nil?
  1128.     else
  1129.       select(0)
  1130.     end
  1131.   end
  1132.  
  1133.   #--------------------------------------------------------------------------
  1134.   # draw_item
  1135.   #--------------------------------------------------------------------------
  1136.   def draw_item(index)
  1137.     item = @data[index]
  1138.     return if item.nil?
  1139.     rect = item_rect(index)
  1140.     rect.width -= 4
  1141.     reset_font_settings
  1142.     set_item_colour(item)
  1143.     draw_class_icon(item, rect)
  1144.     draw_class_name(item, rect)
  1145.     draw_class_level(item, rect)
  1146.   end
  1147.  
  1148.   #--------------------------------------------------------------------------
  1149.   # set_item_colour
  1150.   #--------------------------------------------------------------------------
  1151.   def set_item_colour(item)
  1152.     if item == @actor.class
  1153.       change_color(text_color(YEA::CLASS_SYSTEM::CURRENT_CLASS_COLOUR))
  1154.     elsif item == @actor.subclass
  1155.       change_color(text_color(YEA::CLASS_SYSTEM::SUBCLASS_COLOUR))
  1156.     else
  1157.       change_color(normal_color, enable?(item))
  1158.     end
  1159.   end
  1160.  
  1161.   #--------------------------------------------------------------------------
  1162.   # draw_class_icon
  1163.   #--------------------------------------------------------------------------
  1164.   def draw_class_icon(item, rect)
  1165.     icon = item.icon_index
  1166.     draw_icon(icon, rect.x, rect.y)
  1167.   end
  1168.  
  1169.   #--------------------------------------------------------------------------
  1170.   # draw_class_name
  1171.   #--------------------------------------------------------------------------
  1172.   def draw_class_name(item, rect)
  1173.     text = item.name
  1174.     draw_text(24, rect.y, rect.width-24, line_height, text)
  1175.   end
  1176.  
  1177.   #--------------------------------------------------------------------------
  1178.   # draw_class_level
  1179.   #--------------------------------------------------------------------------
  1180.   def draw_class_level(item, rect)
  1181.     return if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  1182.     return if @actor.nil?
  1183.     level = @actor.class_level(item.id)
  1184.     contents.font.size = YEA::CLASS_SYSTEM::LEVEL_FONT_SIZE
  1185.     text = sprintf(YEA::CLASS_SYSTEM::CLASS_LEVEL, level.group)
  1186.     draw_text(rect, text, 2)
  1187.   end
  1188.  
  1189.   #--------------------------------------------------------------------------
  1190.   # update_help
  1191.   #--------------------------------------------------------------------------
  1192.   def update_help
  1193.     @help_window.set_item(item)
  1194.     return if @actor.nil?
  1195.     return if @status_window.nil?
  1196.     update_param_window
  1197.   end
  1198.  
  1199.   #--------------------------------------------------------------------------
  1200.   # update_param_window
  1201.   #--------------------------------------------------------------------------
  1202.   def update_param_window
  1203.     return if @last_item == item
  1204.     @last_item = item
  1205.     class_id = item.nil? ? @actor.class_id : item.id
  1206.     temp_actor = Marshal.load(Marshal.dump(@actor))
  1207.     temp_actor.temp_flag = true
  1208.     case @command_window.current_symbol
  1209.     when :primary
  1210.       temp_actor.change_class(class_id, YEA::CLASS_SYSTEM::MAINTAIN_LEVELS)
  1211.     when :subclass
  1212.       temp_actor.change_subclass(class_id)
  1213.     end
  1214.     @status_window.set_temp_actor(temp_actor)
  1215.   end
  1216.  
  1217.   #--------------------------------------------------------------------------
  1218.   # update_class
  1219.   #--------------------------------------------------------------------------
  1220.   def update_class
  1221.     @last_item = nil
  1222.     update_help
  1223.     refresh
  1224.     activate
  1225.   end
  1226.  
  1227.   #--------------------------------------------------------------------------
  1228.   # refresh
  1229.   #--------------------------------------------------------------------------
  1230.   def refresh
  1231.     make_item_list
  1232.     create_contents
  1233.     draw_all_items
  1234.   end
  1235.  
  1236. end # Window_ClassList
  1237.  
  1238. #==============================================================================
  1239. # ■ Scene_Menu
  1240. #==============================================================================
  1241.  
  1242. class Scene_Menu < Scene_MenuBase
  1243.  
  1244.   #--------------------------------------------------------------------------
  1245.   # alias method: create_command_window
  1246.   #--------------------------------------------------------------------------
  1247.   alias scene_menu_create_command_window_cs create_command_window
  1248.   def create_command_window
  1249.     scene_menu_create_command_window_cs
  1250.     @command_window.set_handler(:class, method(:command_personal))
  1251.   end
  1252.  
  1253.   #--------------------------------------------------------------------------
  1254.   # alias method: on_personal_ok
  1255.   #--------------------------------------------------------------------------
  1256.   alias scene_menu_on_personal_ok_cs on_personal_ok
  1257.   def on_personal_ok
  1258.     case @command_window.current_symbol
  1259.     when :class
  1260.       SceneManager.call(Scene_Class)
  1261.     else
  1262.       scene_menu_on_personal_ok_cs
  1263.     end
  1264.   end
  1265.  
  1266. end # Scene_Menu
  1267.  
  1268. #==============================================================================
  1269. # ■ Scene_Class
  1270. #==============================================================================
  1271.  
  1272. class Scene_Class < Scene_MenuBase
  1273.  
  1274.   #--------------------------------------------------------------------------
  1275.   # start
  1276.   #--------------------------------------------------------------------------
  1277.   def start
  1278.     super
  1279.     create_help_window
  1280.     create_command_window
  1281.     create_status_window
  1282.     create_param_window
  1283.     create_item_window
  1284.     relocate_windows
  1285.   end
  1286.  
  1287.   #--------------------------------------------------------------------------
  1288.   # create_command_window
  1289.   #--------------------------------------------------------------------------
  1290.   def create_command_window
  1291.     wy = @help_window.height
  1292.     @command_window = Window_ClassCommand.new(0, wy)
  1293.     @command_window.viewport = @viewport
  1294.     @command_window.help_window = @help_window
  1295.     @command_window.actor = @actor
  1296.     @command_window.set_handler(:cancel,   method(:return_scene))
  1297.     @command_window.set_handler(:primary,  method(:command_class_change))
  1298.     @command_window.set_handler(:subclass, method(:command_class_change))
  1299.     process_custom_class_commands
  1300.     return if $game_party.in_battle
  1301.     @command_window.set_handler(:pagedown, method(:next_actor))
  1302.     @command_window.set_handler(:pageup,   method(:prev_actor))
  1303.     @command_window.set_handler(:learn_skill, method(:command_learn_skill))
  1304.   end
  1305.  
  1306.   #--------------------------------------------------------------------------
  1307.   # process_custom_class_commands
  1308.   #--------------------------------------------------------------------------
  1309.   def process_custom_class_commands
  1310.     for command in YEA::CLASS_SYSTEM::COMMANDS
  1311.       next unless YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS.include?(command[0])
  1312.       called_method = YEA::CLASS_SYSTEM::CUSTOM_CLASS_COMMANDS[command[0]][2]
  1313.       @command_window.set_handler(command[0], method(called_method))
  1314.     end
  1315.   end
  1316.  
  1317.   #--------------------------------------------------------------------------
  1318.   # create_status_window
  1319.   #--------------------------------------------------------------------------
  1320.   def create_status_window
  1321.     wy = @help_window.height
  1322.     @status_window = Window_ClassStatus.new(@command_window.width, wy)
  1323.     @status_window.viewport = @viewport
  1324.     @status_window.actor = @actor
  1325.   end
  1326.  
  1327.   #--------------------------------------------------------------------------
  1328.   # create_param_window
  1329.   #--------------------------------------------------------------------------
  1330.   def create_param_window
  1331.     dx = Graphics.width - (Graphics.width * 2 / 5)
  1332.     dy = @status_window.y + @status_window.height
  1333.     @param_window = Window_ClassParam.new(dx, dy)
  1334.     @param_window.viewport = @viewport
  1335.     @param_window.actor = @actor
  1336.   end
  1337.  
  1338.   #--------------------------------------------------------------------------
  1339.   # create_item_window
  1340.   #--------------------------------------------------------------------------
  1341.   def create_item_window
  1342.     dy = @status_window.y + @status_window.height
  1343.     @item_window = Window_ClassList.new(0, dy)
  1344.     @item_window.help_window = @help_window
  1345.     @item_window.command_window = @command_window
  1346.     @item_window.status_window = @param_window
  1347.     @item_window.viewport = @viewport
  1348.     @item_window.actor = @actor
  1349.     @command_window.item_window = @item_window
  1350.     @item_window.set_handler(:ok,     method(:on_class_ok))
  1351.     @item_window.set_handler(:cancel, method(:on_class_cancel))
  1352.   end
  1353.  
  1354.   #--------------------------------------------------------------------------
  1355.   # relocate_windows
  1356.   #--------------------------------------------------------------------------
  1357.   def relocate_windows
  1358.     return unless $imported["YEA-AceMenuEngine"]
  1359.     case Menu.help_window_location
  1360.     when 0 # Top
  1361.       @help_window.y = 0
  1362.       @command_window.y = @help_window.height
  1363.       @param_window.y = @command_window.y + @command_window.height
  1364.     when 1 # Middle
  1365.       @command_window.y = 0
  1366.       @help_window.y = @command_window.height
  1367.       @param_window.y = @help_window.y + @help_window.height
  1368.     else # Bottom
  1369.       @command_window.y = 0
  1370.       @param_window.y = @command_window.height
  1371.       @help_window.y = @param_window.y + @param_window.height
  1372.     end
  1373.     @status_window.y = @command_window.y
  1374.     @item_window.y = @param_window.y
  1375.   end
  1376.  
  1377.   #--------------------------------------------------------------------------
  1378.   # on_actor_change
  1379.   #--------------------------------------------------------------------------
  1380.   def on_actor_change
  1381.     @command_window.actor = @actor
  1382.     @status_window.actor = @actor
  1383.     @param_window.actor = @actor
  1384.     @item_window.actor = @actor
  1385.     @command_window.activate
  1386.   end
  1387.  
  1388.   #--------------------------------------------------------------------------
  1389.   # command_class_change
  1390.   #--------------------------------------------------------------------------
  1391.   def command_class_change
  1392.     @item_window.activate
  1393.     @item_window.select_last
  1394.   end
  1395.  
  1396.   #--------------------------------------------------------------------------
  1397.   # on_class_cancel
  1398.   #--------------------------------------------------------------------------
  1399.   def on_class_cancel
  1400.     @item_window.unselect
  1401.     @command_window.activate
  1402.     @param_window.set_temp_actor(nil)
  1403.   end
  1404.  
  1405.   #--------------------------------------------------------------------------
  1406.   # on_class_ok
  1407.   #--------------------------------------------------------------------------
  1408.   def on_class_ok
  1409.     Sound.play_equip
  1410.     class_id = @item_window.item.id
  1411.     maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  1412.     hp = @actor.hp * 1.0 / @actor.mhp
  1413.     mp = @actor.mp * 1.0 / [@actor.mmp, 1].max
  1414.     case @command_window.current_symbol
  1415.     when :primary
  1416.       @actor.change_class(class_id, maintain)
  1417.     when :subclass
  1418.       @actor.change_subclass(class_id)
  1419.     else
  1420.       @item_window.activate
  1421.       return
  1422.     end
  1423.     @actor.hp = (@actor.mhp * hp).to_i
  1424.     @actor.mp = (@actor.mmp * mp).to_i
  1425.     @status_window.refresh
  1426.     @item_window.update_class
  1427.   end
  1428.  
  1429.   #--------------------------------------------------------------------------
  1430.   # new method: command_learn_skill
  1431.   #--------------------------------------------------------------------------
  1432.   def command_learn_skill
  1433.     return unless $imported["YEA-LearnSkillEngine"]
  1434.     SceneManager.call(Scene_LearnSkill)
  1435.   end
  1436.  
  1437.   #--------------------------------------------------------------------------
  1438.   # command_name1
  1439.   #--------------------------------------------------------------------------
  1440.   def command_name1
  1441.     # Do nothing.
  1442.   end
  1443.  
  1444.   #--------------------------------------------------------------------------
  1445.   # command_name2
  1446.   #--------------------------------------------------------------------------
  1447.   def command_name2
  1448.     # Do nothing.
  1449.   end
  1450.  
  1451. end # Scene_Class
  1452.  
  1453. #==============================================================================
  1454. #
  1455. # ▼ End of File
  1456. #
  1457. #==============================================================================
  1458. 职业解锁系统:
  1459. #==============================================================================
  1460. #
  1461. # ▼ Yanfly Engine Ace - Class System Add-On: Class Unlock Level v1.00
  1462. # -- Last Updated: 2011.12.20
  1463. # -- Level: Normal
  1464. # -- Requires: YEA - Class System v1.01+
  1465. #
  1466. #==============================================================================
  1467.  
  1468. $imported = {} if $imported.nil?
  1469. $imported["YEA-ClassUnlockLevel"] = true
  1470.  
  1471. #==============================================================================
  1472. # ▼ Updates
  1473. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1474. # 2011.12.20 - Started Script and Finished.
  1475. #
  1476. #==============================================================================
  1477. # ▼ Introduction
  1478. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1479. # This script allows for classes to be unlocked after a class reaches a certain
  1480. # level. Note that this script is made for the Class System script and not
  1481. # using the MAINTAIN_LEVELS feature. Requirements for unlocking a class can be
  1482. # multiple level requirements as well.
  1483. #
  1484. #==============================================================================
  1485. # ▼ Instructions
  1486. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1487. # To install this script, open up your script editor and copy/paste this script
  1488. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  1489. #
  1490. # -----------------------------------------------------------------------------
  1491. # Class Notetags - These notetags go in the class notebox in the database.
  1492. # -----------------------------------------------------------------------------
  1493. # <level unlock requirements>
  1494. #   class x: level y
  1495. #   class x: level y
  1496. # </level unlock requirements>
  1497. # Sets the requirements for unlocking that particular class. The unlocking of
  1498. # the class will require classes x to be at level y. Insert multiple of the
  1499. # strings in between the two opening and closing notetags to require all of the
  1500. # class levels to be met.
  1501. #
  1502. #==============================================================================
  1503. # ▼ Compatibility
  1504. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1505. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1506. # it will run with RPG Maker VX without adjusting.
  1507. #
  1508. # This script requires Yanfly Engine Ace - Class System v1.01+.
  1509. #
  1510. #==============================================================================
  1511. # ▼ Editting anything past this point may potentially result in causing
  1512. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1513. # halitosis so edit at your own risk.
  1514. #==============================================================================
  1515.  
  1516. if $imported["YEA-ClassSystem"] && !YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  1517.  
  1518. module YEA
  1519.   module REGEXP
  1520.   module CLASS
  1521.  
  1522.     LV_UNLOCK_ON =
  1523.       /<(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  1524.     LV_UNLOCK_OFF =
  1525.       /<\/(?:LEVEL_UNLOCK_REQUIREMENTS|level unlock requirements)>/i
  1526.     LV_UNLOCK_STR = /CLASS[ ](\d+): LEVEL[ ](\d+)/i
  1527.  
  1528.   end # CLASS
  1529.   end # REGEXP
  1530. end # YEA
  1531.  
  1532. #==============================================================================
  1533. # ■ DataManager
  1534. #==============================================================================
  1535.  
  1536. module DataManager
  1537.  
  1538.   #--------------------------------------------------------------------------
  1539.   # alias method: load_database
  1540.   #--------------------------------------------------------------------------
  1541.   class <<self; alias load_database_cul load_database; end
  1542.   def self.load_database
  1543.     load_database_cul
  1544.     load_notetags_cul
  1545.   end
  1546.  
  1547.   #--------------------------------------------------------------------------
  1548.   # new method: load_notetags_cul
  1549.   #--------------------------------------------------------------------------
  1550.   def self.load_notetags_cul
  1551.     for obj in $data_classes
  1552.       next if obj.nil?
  1553.       obj.load_notetags_cul
  1554.     end
  1555.   end
  1556.  
  1557. end # DataManager
  1558.  
  1559. #==============================================================================
  1560. # ■ RPG::Class
  1561. #==============================================================================
  1562.  
  1563. class RPG::Class < RPG::BaseItem
  1564.  
  1565.   #--------------------------------------------------------------------------
  1566.   # public instance variables
  1567.   #--------------------------------------------------------------------------
  1568.   attr_accessor :level_unlock
  1569.  
  1570.   #--------------------------------------------------------------------------
  1571.   # common cache: load_notetags_cul
  1572.   #--------------------------------------------------------------------------
  1573.   def load_notetags_cul
  1574.     @level_unlock = {}
  1575.     @level_unlock_on = false
  1576.     #---
  1577.     self.note.split(/[\r\n]+/).each { |line|
  1578.       case line
  1579.       #---
  1580.       when YEA::REGEXP::CLASS::LV_UNLOCK_ON
  1581.         @level_unlock_on = true
  1582.       when YEA::REGEXP::CLASS::LV_UNLOCK_OFF
  1583.         @level_unlock_on = false
  1584.       when YEA::REGEXP::CLASS::LV_UNLOCK_STR
  1585.         next unless @level_unlock_on
  1586.         @level_unlock[$1.to_i] = $2.to_i
  1587.       end
  1588.     } # self.note.split
  1589.     #---
  1590.   end
  1591.  
  1592. end # RPG::Class
  1593.  
  1594. #==============================================================================
  1595. # ■ Game_Actor
  1596. #==============================================================================
  1597.  
  1598. class Game_Actor < Game_Battler
  1599.  
  1600.   #--------------------------------------------------------------------------
  1601.   # check_level_unlocked_classes
  1602.   #--------------------------------------------------------------------------
  1603.   def check_level_unlocked_classes
  1604.     for item in $data_classes
  1605.       next if item.nil?
  1606.       next if unlocked_classes.include?(item.id)
  1607.       next if item.level_unlock == {}
  1608.       next unless class_unlock_level_requirements_met?(item)
  1609.       unlock_class(item.id)
  1610.     end
  1611.   end
  1612.  
  1613.   #--------------------------------------------------------------------------
  1614.   # class_unlock_level_requirements_met?
  1615.   #--------------------------------------------------------------------------
  1616.   def class_unlock_level_requirements_met?(item)
  1617.     for key in item.level_unlock
  1618.       class_id = key[0]
  1619.       level_req = key[1]
  1620.       return false if class_level(class_id) < level_req
  1621.     end
  1622.     return true
  1623.   end
  1624.  
  1625. end # Game_Actor
  1626.  
  1627. #==============================================================================
  1628. # ■ Window_ClassList
  1629. #==============================================================================
  1630.  
  1631. class Window_ClassList < Window_Selectable
  1632.  
  1633.   #--------------------------------------------------------------------------
  1634.   # alias method: actor=
  1635.   #--------------------------------------------------------------------------
  1636.   alias window_classlist_actor_equals_cul actor=
  1637.   def actor=(actor)
  1638.     return if @actor == actor
  1639.     actor.check_level_unlocked_classes
  1640.     window_classlist_actor_equals_cul(actor)
  1641.   end
  1642.  
  1643. end # Window_ClassList
  1644.  
  1645. end # $imported["YEA-ClassSystem"] && !YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  1646.  
  1647. #==============================================================================
  1648. #
  1649. # ▼ End of File
  1650. #
  1651. #==============================================================================
  1652. 主要次要职业系统:
  1653. #==============================================================================
  1654. #
  1655. # ▼ Yanfly Engine Ace - Class Specifics v1.00
  1656. # -- Last Updated: 2011.12.23
  1657. # -- Level: Normal
  1658. # -- Requires: YEA - Class System v1.03+
  1659. #
  1660. #==============================================================================
  1661.  
  1662. $imported = {} if $imported.nil?
  1663. $imported["YEA-ClassSpecifics"] = true
  1664.  
  1665. #==============================================================================
  1666. # ▼ Updates
  1667. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1668. # 2011.12.23 - Started Script and Finished.
  1669. #
  1670. #==============================================================================
  1671. # ▼ Introduction
  1672. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1673. # This script allows for certain classes to be primary-only or sublcass-only.
  1674. # In addition to that, subclasses can require certain classes to be primary
  1675. # classes in order to be applied.
  1676. #
  1677. #==============================================================================
  1678. # ▼ Instructions
  1679. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1680. # To install this script, open up your script editor and copy/paste this script
  1681. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  1682. #
  1683. # -----------------------------------------------------------------------------
  1684. # Class Notetags - These notetags go in the class notebox in the database.
  1685. # -----------------------------------------------------------------------------
  1686. # <primary only>
  1687. # Makes this class equippable only if it's the primary class.
  1688. #
  1689. # <subclass only>
  1690. # Makes this class equippable only if it's the subclass class.
  1691. #
  1692. # <subclass to: x>
  1693. # <subclass to: x, x>
  1694. # This makes the class subclass only and only equippable if the primary class
  1695. # is one of the listed x classes.
  1696. #
  1697. #==============================================================================
  1698. # ▼ Compatibility
  1699. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  1700. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  1701. # it will run with RPG Maker VX without adjusting.
  1702. #
  1703. # This script requires Yanfly Engine Ace - Class System v1.03+.
  1704. #
  1705. #==============================================================================
  1706. # ▼ Editting anything past this point may potentially result in causing
  1707. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  1708. # halitosis so edit at your own risk.
  1709. #==============================================================================
  1710.  
  1711. if $imported["YEA-ClassSystem"]
  1712.  
  1713. module YEA
  1714.   module REGEXP
  1715.   module CLASS
  1716.  
  1717.     PRIMARY_ONLY  = /<(?:PRIMARY_ONLY|primary only)>/i
  1718.     SUBCLASS_ONLY = /<(?:SUBCLASS_ONLY|subclass only)>/i
  1719.     SUBCLASS_TO = /<(?:SUBCLASS_TO|subclass to):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  1720.  
  1721.   end # CLASS
  1722.   end # REGEXP
  1723. end # YEA
  1724.  
  1725. #==============================================================================
  1726. # ■ DataManager
  1727. #==============================================================================
  1728.  
  1729. module DataManager
  1730.  
  1731.   #--------------------------------------------------------------------------
  1732.   # alias method: load_database
  1733.   #--------------------------------------------------------------------------
  1734.   class <<self; alias load_database_csp load_database; end
  1735.   def self.load_database
  1736.     load_database_csp
  1737.     load_notetags_csp
  1738.   end
  1739.  
  1740.   #--------------------------------------------------------------------------
  1741.   # new method: load_notetags_csp
  1742.   #--------------------------------------------------------------------------
  1743.   def self.load_notetags_csp
  1744.     for obj in $data_classes
  1745.       next if obj.nil?
  1746.       obj.load_notetags_csp
  1747.     end
  1748.   end
  1749.  
  1750. end # DataManager
  1751.  
  1752. #==============================================================================
  1753. # ■ RPG::Class
  1754. #==============================================================================
  1755.  
  1756. class RPG::Class < RPG::BaseItem
  1757.  
  1758.   #--------------------------------------------------------------------------
  1759.   # public instance variables
  1760.   #--------------------------------------------------------------------------
  1761.   attr_accessor :primary_only
  1762.   attr_accessor :subclass_only
  1763.   attr_accessor :subclass_to
  1764.  
  1765.   #--------------------------------------------------------------------------
  1766.   # common cache: load_notetags_csp
  1767.   #--------------------------------------------------------------------------
  1768.   def load_notetags_csp
  1769.     @primary_only = false
  1770.     @subclass_only = false
  1771.     @subclass_to = []
  1772.     #---
  1773.     self.note.split(/[\r\n]+/).each { |line|
  1774.       case line
  1775.       #---
  1776.       when YEA::REGEXP::CLASS::PRIMARY_ONLY
  1777.         @primary_only = true
  1778.         @subclass_only = false
  1779.         @subclass_to = []
  1780.       when YEA::REGEXP::CLASS::SUBCLASS_ONLY
  1781.         @primary_only = false
  1782.         @subclass_only = true
  1783.       when YEA::REGEXP::CLASS::SUBCLASS_TO
  1784.         @primary_only = false
  1785.         @subclass_only = true
  1786.         $1.scan(/\d+/).each { |num|
  1787.         @subclass_to.push(num.to_i) if num.to_i > 0 }
  1788.       end
  1789.     } # self.note.split
  1790.     #---
  1791.   end
  1792.  
  1793. end # RPG::Class
  1794.  
  1795. #==============================================================================
  1796. # ■ Game_Actor
  1797. #==============================================================================
  1798.  
  1799. class Game_Actor < Game_Battler
  1800.  
  1801.   #--------------------------------------------------------------------------
  1802.   # alias method: change_class
  1803.   #--------------------------------------------------------------------------
  1804.   alias game_actor_change_class_csp change_class
  1805.   def change_class(class_id, keep_exp = false)
  1806.     return if $data_classes[class_id].subclass_only
  1807.     game_actor_change_class_csp(class_id, keep_exp)
  1808.     correct_subclass
  1809.   end
  1810.  
  1811.   #--------------------------------------------------------------------------
  1812.   # alias method: change_subclass
  1813.   #--------------------------------------------------------------------------
  1814.   alias game_actor_change_subclass_csp change_subclass
  1815.   def change_subclass(class_id)
  1816.     return unless subclass_requirements_met?(class_id)
  1817.     game_actor_change_subclass_csp(class_id)
  1818.   end
  1819.  
  1820.   #--------------------------------------------------------------------------
  1821.   # new method: subclass_requirements_met?
  1822.   #--------------------------------------------------------------------------
  1823.   def subclass_requirements_met?(class_id)
  1824.     subclass = $data_classes[class_id]
  1825.     return false if subclass.primary_only
  1826.     return subclass_to?(class_id) if subclass.subclass_to != []
  1827.     return true
  1828.   end
  1829.  
  1830.   #--------------------------------------------------------------------------
  1831.   # new method: subclass_to?
  1832.   #--------------------------------------------------------------------------
  1833.   def subclass_to?(class_id)
  1834.     return true if class_id == 0
  1835.     subclass = $data_classes[class_id]
  1836.     return false if subclass.nil?
  1837.     for class_id in subclass.subclass_to
  1838.       return true if class_id == self.class.id
  1839.     end
  1840.     return false
  1841.   end
  1842.  
  1843.   #--------------------------------------------------------------------------
  1844.   # new method: correct_subclass
  1845.   #--------------------------------------------------------------------------
  1846.   def correct_subclass
  1847.     return if @subclass_id == 0
  1848.     subclass = $data_classes[@subclass_id]
  1849.     return if subclass.nil?
  1850.     return if subclass.subclass_to == []
  1851.     @subclass_id = 0 if !subclass_to?(@subclass_id)
  1852.   end
  1853.  
  1854. end # Game_Actor
  1855.  
  1856. #==============================================================================
  1857. # ■ Window_ClassList
  1858. #==============================================================================
  1859.  
  1860. class Window_ClassList < Window_Selectable
  1861.  
  1862.   #--------------------------------------------------------------------------
  1863.   # alias method: enable?
  1864.   #--------------------------------------------------------------------------
  1865.   alias window_classlist_enable_csp enable?
  1866.   def enable?(item)
  1867.     case @command_window.current_symbol
  1868.     when :primary
  1869.       return false if item.subclass_only
  1870.     when :subclass
  1871.       return false if item.primary_only
  1872.       return @actor.subclass_to?(item.id) if item.subclass_to != []
  1873.     end
  1874.     return window_classlist_enable_csp(item)
  1875.   end
  1876.  
  1877. end # Window_ClassList
  1878.  
  1879. end # $imported["YEA-ClassSystem"]
  1880.  
  1881. #==============================================================================
  1882. #
  1883. # ▼ End of File
  1884. #
  1885. #==============================================================================

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

Lv3.寻梦者

唯一的信徒

梦石
0
星屑
1665
在线时间
1357 小时
注册时间
2013-1-29
帖子
1637
来自 2楼
发表于 2013-2-15 06:34:13 | 只看该作者
整 合 害 人!这个是Yanfly的脚本。。多拉菌在搞的时候没有把原来的使用说明搞到= =鄙视多拉菌
以下均来自Yanfly的博客

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.

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


【图片文字:这个系统可以通过一个开关来解锁】
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,这样的话,菜单将会一直出现在系统里。


【图片文字:无论是副职还是主职,都可以被更改。获得一个副职可以对角色的能力造成影响。】
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会让脚本忽略开关,并让这个指令永远显示。


【图片文字:副职可以增加角色技能种类,使角色领悟更多技能】
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.

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


【图片文字:副职可以影响角色的装备种类,让角色装备自己本来不能装备的道具】
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.

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


【图片文字:在角色初始化时决定他已经解锁的职业】
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)可能会在将来的脚本中设置这个功能。现在而言,这些是唯一的方法来设置角色可转职业(译者注:= =)。

RUBY 代码复制
  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,使得该职业在切换进入或离开职业选单时被解锁(译者注:好难翻译= =)

RUBY 代码复制
  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,那么这个副职将会被解除。


【图片文字:图标可以通过备注栏设置并帮助完善职业。】
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 精品文章

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
211 小时
注册时间
2011-10-2
帖子
35
3
 楼主| 发表于 2013-2-15 18:11:36 | 只看该作者
谢谢!!!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-26 12:13

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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