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

Project1

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

[已经解决] 如何对角色进行角色、种族及职业的合并

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-1-20
帖子
21
跳转到指定楼层
1
发表于 2015-1-20 20:18:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 雪之夜粒 于 2015-1-21 19:21 编辑

像图中这样,在VA的职业栏中分别输入名字、种族和职业,但却能够造成这三者共存于一个角色,并且拥有各自的经验值,请问这个要如何做到?

Lv3.寻梦者

闇吼者の災悪眷族
不気味存在締造者

梦石
0
星屑
1366
在线时间
2881 小时
注册时间
2014-7-29
帖子
6491
2
发表于 2015-1-20 21:00:37 | 只看该作者
这个就是额外做了一个“种族”并且设置了三套经验值吧。

需要自己写一套符合需求的脚本,现成的脚本大概是没有的。
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
116 小时
注册时间
2009-7-17
帖子
139
3
发表于 2015-1-21 10:40:06 | 只看该作者
参考外站YEA的CLASS脚本,我记得貌似他那里有一个类似这方面功能的脚本,应该是职业熟练度
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-1-20
帖子
21
4
 楼主| 发表于 2015-1-21 19:17:05 | 只看该作者
morningboo 发表于 2015-1-21 10:40
参考外站YEA的CLASS脚本,我记得貌似他那里有一个类似这方面功能的脚本,应该是职业熟练度 ...

能告诉我YEA站的地址吗?QWQ找不到
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
116 小时
注册时间
2009-7-17
帖子
139
5
发表于 2015-1-22 21:10:56 | 只看该作者
雪之夜粒 发表于 2015-1-21 19:17
能告诉我YEA站的地址吗?QWQ找不到

http://yanflychannel.wordpress.com/
我也记不清了,你可以去看看,请自备翻墙软件
还有这个地址,里面脚本多,可以搜索看看
http://rmvxace.wikia.com/wiki/RPG_Maker_VX_Ace_Master_Script_List
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

6
发表于 2015-1-23 18:43:45 | 只看该作者
morningboo 发表于 2015-1-22 04:10
http://yanflychannel.wordpress.com/
我也记不清了,你可以去看看,请自备翻墙软件
还有这个地址,里面 ...

下载链接失效的···
楼主用这个,然后在角色备注写<unlocked classes: x, y>,x和y就是新增的职业的编号···这样备注可以让角色同时选择2个职业
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - Class System v1.10
  4. # -- Last Updated: 2012.01.29
  5. # -- Level: Normal, Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

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

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

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

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

  230. #==============================================================================
  231. # ■ Switch
  232. #==============================================================================

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

  284. #==============================================================================
  285. # ■ Numeric
  286. #==============================================================================

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

  297. #==============================================================================
  298. # ■ DataManager
  299. #==============================================================================

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

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

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

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

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

  391. #==============================================================================
  392. # ■ Game_Temp
  393. #==============================================================================

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

  403. #==============================================================================
  404. # ■ Game_Action
  405. #==============================================================================

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

  430. #==============================================================================
  431. # ■ Game_BattlerBase
  432. #==============================================================================

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

  484. #==============================================================================
  485. # ■ Game_Actor
  486. #==============================================================================

  487. class Game_Actor < Game_Battler
  488.   
  489.   #--------------------------------------------------------------------------
  490.   # alias method: setup
  491.   #--------------------------------------------------------------------------
  492.   alias game_actor_setup_cs setup
  493.   def setup(actor_id)
  494.     game_actor_setup_cs(actor_id)
  495.     init_unlocked_classes
  496.     init_subclass
  497.   end
  498.   
  499.   #--------------------------------------------------------------------------
  500.   # new method: init_unlocked_classes
  501.   #--------------------------------------------------------------------------
  502.   def init_unlocked_classes
  503.     @unlocked_classes = actor.unlocked_classes.clone
  504.     @unlocked_classes.push(@class_id) if !@unlocked_classes.include?(@class_id)
  505.     @unlocked_classes.sort!
  506.   end
  507.   
  508.   #--------------------------------------------------------------------------
  509.   # new method: init_subclass
  510.   #--------------------------------------------------------------------------
  511.   def init_subclass
  512.     @subclass_id = 0
  513.   end
  514.   
  515.   #--------------------------------------------------------------------------
  516.   # new method: unlocked_classes
  517.   #--------------------------------------------------------------------------
  518.   def unlocked_classes
  519.     init_unlocked_classes if @unlocked_classes.nil?
  520.     return @unlocked_classes
  521.   end
  522.   
  523.   #--------------------------------------------------------------------------
  524.   # new method: unlock_class
  525.   #--------------------------------------------------------------------------
  526.   def unlock_class(class_id)
  527.     init_unlocked_classes if @unlocked_classes.nil?
  528.     return if @unlocked_classes.include?(class_id)
  529.     @unlocked_classes.push(class_id)
  530.     learn_class_skills(class_id)
  531.   end
  532.   
  533.   #--------------------------------------------------------------------------
  534.   # new method: remove_class
  535.   #--------------------------------------------------------------------------
  536.   def remove_class(class_id)
  537.     init_unlocked_classes if @unlocked_classes.nil?
  538.     return if class_id == @class_id
  539.     @unlocked_classes.delete(class_id)
  540.     @subclass_id = 0 if class_id == @subclass_id
  541.     refresh
  542.   end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # new method: subclass
  546.   #--------------------------------------------------------------------------
  547.   def subclass
  548.     init_subclass if @subclass_id.nil?
  549.     return $data_classes[@subclass_id]
  550.   end
  551.   
  552.   #--------------------------------------------------------------------------
  553.   # alias method: change_class
  554.   #--------------------------------------------------------------------------
  555.   alias game_actor_change_class_cs change_class
  556.   def change_class(class_id, keep_exp = false)
  557.     @subclass_id = 0 if @subclass_id == class_id
  558.     game_actor_change_class_cs(class_id, keep_exp)
  559.     learn_class_skills(class_id)
  560.     unlock_class(class_id)
  561.   end
  562.   
  563.   #--------------------------------------------------------------------------
  564.   # new method: learn_class_skills
  565.   #--------------------------------------------------------------------------
  566.   def learn_class_skills(class_id)
  567.     return if class_id <= 0
  568.     return if $data_classes[class_id].nil?
  569.     $data_classes[class_id].learnings.each do |learning|
  570.       learn_skill(learning.skill_id) if learning.level == class_level(class_id)
  571.     end
  572.   end
  573.   
  574.   #--------------------------------------------------------------------------
  575.   # new method: change_subclass
  576.   #--------------------------------------------------------------------------
  577.   def change_subclass(class_id)
  578.     return if class_id == @class_id
  579.     unlock_class(class_id)
  580.     @subclass_id = @subclass_id == class_id ? 0 : class_id
  581.     learn_class_skills(@subclass_id)
  582.     refresh
  583.   end
  584.         #————————————————————————–
  585.         # new method: class_level Edited by DisturbedInside
  586.         #————————————————————————–
  587.         def class_level(class_id)
  588.                 return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  589.                         temp_class = $data_classes[class_id]
  590.                         @exp[class_id] = 0 if @exp[class_id].nil?
  591.                         #declare a max level (using EXP)
  592.                         #If you can’t find it, go to the class database and select exp curve
  593.                         #then switch view to total at the top
  594.                         @exp[max_level] = 2547133 #This is the value to change. It declares a max level
  595.                         #You need to calculate how much exp for max level
  596.                         #Do it manually if using Yanfly-Adjusting Limits
  597.                         #To calculate max level exp if using Yanfly-adjusting limits is all math!!

  598.                         # Level 99 = 2547133
  599.                         # to calculate past there…. have to add on multiples of 50744
  600.                         # Level 110 = 3156061
  601.                         # To go from 99 -> 110 have to add on 12 multiples of 50744.
  602.                         n = 1                       
  603.                         loop do
  604.                                 break if temp_class.exp_for_level(n+1) > @exp[class_id]
  605.                                 n += 1
  606.                                 #add a restriction to “kick out” of loop if exp exceeds max level exp
  607.                                 break if temp_class.exp_for_level(n+1) > @exp[max_level]
  608.                         end
  609.                 return n
  610.         end
  611.   
  612.   #--------------------------------------------------------------------------
  613.   # new method: subclass_level
  614.   #--------------------------------------------------------------------------
  615.   def subclass_level
  616.     return 0 if @subclass_id == 0
  617.     return @level if YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  618.     return class_level(@subclass_id)
  619.   end
  620.   
  621.   #--------------------------------------------------------------------------
  622.   # alias method: param_base
  623.   #--------------------------------------------------------------------------
  624.   alias game_actor_param_base_cs param_base
  625.   def param_base(param_id)
  626.     result = game_actor_param_base_cs(param_id)
  627.     unless subclass.nil?
  628.       subclass_rate = YEA::CLASS_SYSTEM::SUBCLASS_STAT_RATE
  629.       slevel = subclass_level
  630.       result += subclass.params[param_id, slevel] * subclass_rate
  631.     end
  632.     return result.to_i
  633.   end
  634.   
  635.   #--------------------------------------------------------------------------
  636.   # new method: subclass_skill_types
  637.   #--------------------------------------------------------------------------
  638.   def subclass_skill_types
  639.     return [] unless YEA::CLASS_SYSTEM::SUBCLASS_SKILL_TYPES
  640.     return [] if subclass.nil?
  641.     array = []
  642.     for feature in subclass.features
  643.       next unless feature.code == FEATURE_STYPE_ADD
  644.       next if features_set(FEATURE_STYPE_ADD).include?(feature.data_id)
  645.       array.push(feature.data_id)
  646.     end
  647.     return array
  648.   end
  649.   
  650.   #--------------------------------------------------------------------------
  651.   # new method: subclass_equip_wtype?
  652.   #--------------------------------------------------------------------------
  653.   def subclass_equip_wtype?(wtype_id)
  654.     return false unless YEA::CLASS_SYSTEM::SUBCLASS_WEAPON_TYPES
  655.     return false if subclass.nil?
  656.     for feature in subclass.features
  657.       next unless feature.code == FEATURE_EQUIP_WTYPE
  658.       return true if wtype_id == feature.data_id
  659.     end
  660.     return super
  661.   end
  662.   
  663.   #--------------------------------------------------------------------------
  664.   # new method: subclass_equip_atype?
  665.   #--------------------------------------------------------------------------
  666.   def subclass_equip_atype?(atype_id)
  667.     return false unless YEA::CLASS_SYSTEM::SUBCLASS_ARMOUR_TYPES
  668.     return false if subclass.nil?
  669.     for feature in subclass.features
  670.       next unless feature.code == FEATURE_EQUIP_ATYPE
  671.       return true if atype_id == feature.data_id
  672.     end
  673.     return super
  674.   end
  675.   
  676.   #--------------------------------------------------------------------------
  677.   # alias method: release_unequippable_items
  678.   #--------------------------------------------------------------------------
  679.   alias game_actor_release_unequippable_items_cs release_unequippable_items
  680.   def release_unequippable_items(item_gain = true)
  681.     item_gain = false if @temp_flag
  682.     game_actor_release_unequippable_items_cs(item_gain)
  683.   end
  684.   
  685. end # Game_Actor

  686. #==============================================================================
  687. # ■ Game_Interpreter
  688. #==============================================================================

  689. class Game_Interpreter
  690.   
  691.   #--------------------------------------------------------------------------
  692.   # overwrite method: command_321
  693.   #--------------------------------------------------------------------------
  694.   def command_321
  695.     actor = $game_actors[@params[0]]
  696.     if actor && $data_classes[@params[1]]
  697.       maintain = YEA::CLASS_SYSTEM::MAINTAIN_LEVELS
  698.       actor.change_class(@params[1], maintain)
  699.     end
  700.   end
  701.   
  702. end # Game_Interpreter

  703. #==============================================================================
  704. # ■ Window_Base
  705. #==============================================================================

  706. class Window_Base < Window
  707.   
  708.   #--------------------------------------------------------------------------
  709.   # overwrite method: draw_actor_class
  710.   #--------------------------------------------------------------------------
  711.   def draw_actor_class(actor, x, y, width = 112)
  712.     change_color(normal_color)
  713.     if actor.subclass.nil?
  714.       text = actor.class.name
  715.     else
  716.       fmt = YEA::CLASS_SYSTEM::SUBCLASS_TEXT
  717.       text = sprintf(fmt, actor.class.name, actor.subclass.name)
  718.     end
  719.     draw_text(x, y, width, line_height, text)
  720.   end
  721.   
  722. end # Window_Base

  723. #==============================================================================
  724. # ■ Window_MenuCommand
  725. #==============================================================================

  726. class Window_MenuCommand < Window_Command
  727.   
  728.   #--------------------------------------------------------------------------
  729.   # alias method: add_formation_command
  730.   #--------------------------------------------------------------------------
  731.   alias window_menucommand_add_formation_command_cs add_formation_command
  732.   def add_formation_command
  733.     add_class_command unless $imported["YEA-AceMenuEngine"]
  734.     window_menucommand_add_formation_command_cs
  735.   end
  736.   
  737.   #--------------------------------------------------------------------------
  738.   # new method: add_class_command
  739.   #--------------------------------------------------------------------------
  740.   def add_class_command
  741.     return unless Switch.class_show
  742.     text = YEA::CLASS_SYSTEM::CLASS_MENU_TEXT
  743.     add_command(text, :class, Switch.class_enable)
  744.   end
  745.   
  746. end # Window_MenuCommand

  747. #==============================================================================
  748. # ■ Window_ClassCommand
  749. #==============================================================================

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

  864. #==============================================================================
  865. # ■ Window_ClassStatus
  866. #==============================================================================

  867. class Window_ClassStatus < Window_Base
  868.   
  869.   #--------------------------------------------------------------------------
  870.   # initialize
  871.   #--------------------------------------------------------------------------
  872.   def initialize(dx, dy)
  873.     super(dx, dy, window_width, fitting_height(4))
  874.     @actor = nil
  875.   end
  876.   
  877.   #--------------------------------------------------------------------------
  878.   # window_width
  879.   #--------------------------------------------------------------------------
  880.   def window_width; Graphics.width - 160; end
  881.   
  882.   #--------------------------------------------------------------------------
  883.   # actor=
  884.   #--------------------------------------------------------------------------
  885.   def actor=(actor)
  886.     return if @actor == actor
  887.     @actor = actor
  888.     refresh
  889.   end
  890.   
  891.   #--------------------------------------------------------------------------
  892.   # refresh
  893.   #--------------------------------------------------------------------------
  894.   def refresh
  895.     contents.clear
  896.     return if @actor.nil?
  897.     draw_actor_face(@actor, 0, 0)
  898.     draw_actor_simple_status(@actor, 108, line_height / 2)
  899.   end
  900.   
  901. end # Window_ClassStatus

  902. #==============================================================================
  903. # ■ Window_ClassParam
  904. #==============================================================================

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

  1009. #==============================================================================
  1010. # ■ Window_ClassList
  1011. #==============================================================================

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

  1214. #==============================================================================
  1215. # ■ Scene_Menu
  1216. #==============================================================================

  1217. class Scene_Menu < Scene_MenuBase
  1218.   
  1219.   #--------------------------------------------------------------------------
  1220.   # alias method: create_command_window
  1221.   #--------------------------------------------------------------------------
  1222.   alias scene_menu_create_command_window_cs create_command_window
  1223.   def create_command_window
  1224.     scene_menu_create_command_window_cs
  1225.     @command_window.set_handler(:class, method(:command_personal))
  1226.   end
  1227.   
  1228.   #--------------------------------------------------------------------------
  1229.   # alias method: on_personal_ok
  1230.   #--------------------------------------------------------------------------
  1231.   alias scene_menu_on_personal_ok_cs on_personal_ok
  1232.   def on_personal_ok
  1233.     case @command_window.current_symbol
  1234.     when :class
  1235.       SceneManager.call(Scene_Class)
  1236.     else
  1237.       scene_menu_on_personal_ok_cs
  1238.     end
  1239.   end
  1240.   
  1241. end # Scene_Menu

  1242. #==============================================================================
  1243. # ■ Scene_Class
  1244. #==============================================================================

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

  1425. #==============================================================================
  1426. #
  1427. # ▼ End of File
  1428. #
  1429. #==============================================================================
复制代码

点评

范例工程的下载确实下不了啊- -|||这就是我翻过去找到的  发表于 2015-1-24 20:37
C神,你不要2好不好,我都说了要翻墙  发表于 2015-1-24 20:35
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22948
在线时间
8638 小时
注册时间
2011-12-31
帖子
3367
7
发表于 2015-1-23 20:42:04 | 只看该作者
RGSS3「サブ職業追加」
http://mitsu-evo.6.ql.bz/RGSS3_21.html

將副職業設定没有經験就可當种族了
再找個職業レベルシステム
http://blog.livedoor.jp/kurement ... chives/2018571.html
就可分開了人物職業种族

评分

参与人数 1梦石 +1 收起 理由
taroxd + 1 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-1-20
帖子
21
8
 楼主| 发表于 2015-1-24 16:10:49 | 只看该作者
谢谢各位大大!已经解决问题了!还有怎么把“有事请教”设置成“已经解决”?
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

9
发表于 2015-1-24 20:40:21 | 只看该作者
雪之夜粒 发表于 2015-1-23 23:10
谢谢各位大大!已经解决问题了!还有怎么把“有事请教”设置成“已经解决”? ...

@taroxd @VIPArcher 问题解决···

点评

0.0分类完还可以编辑?  发表于 2015-1-24 21:01
不能啊,是taroxd分类的。4个小时以前。  发表于 2015-1-24 20:59
没注意看0.0VA区楼主可以手动改分类?  发表于 2015-1-24 20:56
4个小时前就分了类,你这样水一发好玩么?  发表于 2015-1-24 20:50

评分

参与人数 1星屑 -1 收起 理由
VIPArcher -1 =。=

查看全部评分

[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-15 13:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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