Project1

标题: 这两个脚本冲突了,要怎么改啊? [打印本页]

作者: Ayahiyano    时间: 2013-6-19 22:06
标题: 这两个脚本冲突了,要怎么改啊?
本帖最后由 Ayahiyano 于 2013-6-19 22:37 编辑

装备随即属性脚本跟性格脚本冲突了,要怎么改?他说这里错了
RUBY 代码复制
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ 装备说明增强
  4. #------------------------------------------------------------------------------
  5. #  修改了说明窗口,增强了装备的说明 作者:wyongcan  发布于66RPG   转载请注明
  6. #==============================================================================
  7. module Help
  8.   CODE ={
  9.     11 => "属性抗性",
  10.     12 => "弱化抗性",
  11.     13 => "状态抗性",
  12.     14 => "状态免疫",
  13.     21 => "普通能力",
  14.     22 => "添加能力",
  15.     23 => "特殊能力",
  16.     31 => "攻击附带属性",
  17.     32 => "攻击附带状态",
  18.     33 => "修正攻击速度",
  19.     34 => "添加攻击次数",
  20.     41 => "添加技能类型",
  21.     42 => "禁用技能类型",
  22.     43 => "添加技能",
  23.     44 => "禁用技能",
  24.     51 => "可装备武器类型",
  25.     52 => "可装备护甲类型",
  26.     53 => "固定装备",
  27.     54 => "禁用装备",
  28.     55 => "装备风格",
  29.     61 => "添加行动次数",
  30.     62 => "特殊标志",
  31.     63 => "消失效果",
  32.     64 => "队伍能力"}
  33.   #特殊标志
  34.   FLAG ={
  35.                 0 => "自动战斗",
  36.                 1 => "擅长防御",
  37.                 2 => "保护弱者",
  38.                 3 => "特技专注"}
  39.   #普通能力
  40.         PARAM ={
  41.                 0 => "最大HP",
  42.                 1 => "最大MP",
  43.                 2 => "物理攻击",
  44.                 3 => "物理防御",
  45.                 4 => "魔法攻击",
  46.                 5 => "魔法防御",
  47.                 6 => "敏 捷 值",
  48.                 7 => "幸 运 值"}
  49.   #添加能力
  50.         XPARAM ={
  51.                 0 => "物理命中几率:",
  52.                 1 => "物理闪避几率:",
  53.                 2 => "必杀几率:",
  54.                 3 => "必杀闪避几率:",
  55.                 4 => "魔法闪避几率:",
  56.                 5 => "魔法反射几率:",
  57.                 6 => "物理反击几率:",
  58.                 7 => "体力值再生速度:",
  59.                 8 => "魔力值再生速度:",
  60.                 9 => "特技值再生速度:"}
  61.   #特殊能力
  62.         SPARAM ={
  63.                 0 => "受到攻击的几率",
  64.                 1 => "防御效果比率",
  65.                 2 => "恢复效果比率",
  66.                 3 => "药理知识",
  67.                 4 => "MP消费率",
  68.                 5 => "TP消耗率",
  69.                 6 => "物理伤害加成",
  70.                 7 => "魔法伤害加成",
  71.                 8 => "地形伤害加成",
  72.                 9 => "经验获得加成"}
  73. #~   #效果范围
  74. #~         SCOPE ={
  75. #~                 0 => "特殊",
  76. #~                 1 => "单个敌人",
  77. #~                 2 => "全体敌人" ,
  78. #~                 3 => "一个随机敌人",
  79. #~                 4 => "两个随机敌人",
  80. #~                 5 => "三个随机敌人",
  81. #~                 6 => "四个随机敌人",
  82. #~                 7 => "单个队友",
  83. #~                 8 => "全体队友",
  84. #~                 9 => "单个队友(无法战斗)",
  85. #~                 10 => "全体队友(无法战斗)",
  86. #~                 11 => "使用者"}
  87.         @队伍能力 ={
  88.                 0 => "遇敌几率减半",
  89.                 1 => "随机遇敌无效",
  90.                 2 => "敌人偷袭无效",
  91.                 3 => "先制攻击几率上升",
  92.                 4 => "获得金钱数量双倍",
  93.                 5 => "物品掉落几率双倍"}
  94.   def self.ready
  95.     @状态 = {}
  96.     @武器类型 = {}
  97.     @防具类型 = {}
  98.     @属性 = {}
  99.     $data_states.each{|x| @状态[x.id] = x.name if x != nil}
  100.     elements = $data_system.elements
  101.     weapon_types = $data_system.weapon_types
  102.     armor_types = $data_system.armor_types
  103.     elements.each_with_index{|x,y| @属性[y] = x if x != ""}
  104.     weapon_types.each_with_index{|x,y| @武器类型[y] = x if x != ""}
  105.     armor_types.each_with_index{|x,y| @防具类型[y] = x if x != ""}
  106.   end
  107.   def self.getequiphelp(equip)
  108.     help = ""
  109.     param = []
  110.     equip.params.each_with_index{|x,y| param.push([PARAM[y],x])}
  111.     param = param.select{|x| x[1] != 0}
  112.     param.each{|x| help += x[0] + ":" + x[1].to_s + "\n"}
  113.     features = equip.features
  114.     features.select{|x| x.code == 55}.each{|x| help += CODE[x.code] + ":双持武器" + "\n"}
  115. #    features.select{|x| x.code == 11}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "*" + x.value.to_s + "\n"}
  116.     features.select{|x| x.code == 12}.each{|x| help += CODE[x.code] + ":" + PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
  117.     features.select{|x| x.code == 13}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "*" + x.value.to_s + "\n"}
  118.    # features.select{|x| x.code == 14}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "\n"}
  119. #    features.select{|x| x.code == 31}.each{|x| help += CODE[x.code] + ":" + @属性[x.data_id] + "\n"}
  120. #    features.select{|x| x.code == 32}.each{|x| help += CODE[x.code] + ":" + @状态[x.data_id] + "+" + x.value.to_s + "\n"}
  121.     features.select{|x| x.code == 33}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
  122.     features.select{|x| x.code == 34}.each{|x| help += CODE[x.code] + ":" + x.value.to_s + "\n"}
  123.     features.select{|x| x.code == 41}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
  124.     features.select{|x| x.code == 42}.each{|x| help += CODE[x.code] + ":" + (x.data_id == 1 ? "特技" : "魔法")  + "\n"}
  125.    features.select{|x| x.code == 43}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
  126.     features.select{|x| x.code == 44}.each{|x| help += CODE[x.code] + ":" + $data_skills[x.data_id].name  + "\n"}
  127.     features.select{|x| x.code == 51}.each{|x| help += CODE[x.code] + ":" + @武器类型[x.data_id]  + "\n"}
  128.     features.select{|x| x.code == 52}.each{|x| help += CODE[x.code] + ":" + @防具类型[x.data_id]  + "\n"}
  129.     features.select{|x| x.code == 61}.each{|x| help += CODE[x.code] + ":" + x.value.to_s  + "\n"}
  130.     features.select{|x| x.code == 62}.each{|x| help += CODE[x.code] + ":" + FLAG[x.data_id]  + "\n"}
  131.     features.select{|x| x.code == 64}.each{|x| help += CODE[x.code] + ":" + @队伍能力[x.data_id]  + "\n"}
  132.     featuresparam = []
  133.     featuresparam.push features.select{|x| x.code == 21}
  134.     featuresparam.push features.select{|x| x.code == 22}
  135.     featuresparam.push features.select{|x| x.code == 23}
  136.     featuresparam[0].each{|x| help += PARAM[x.data_id] + "*" + x.value.to_s + "\n"}
  137.     featuresparam[1].each{|x| help += XPARAM[x.data_id] + x.value.to_s + "\n"}
  138.     featuresparam[2].each{|x| help += SPARAM[x.data_id] + "*" + x.value.to_s + "\n"}
  139.     help
  140.   end
  141.   def self.getline(text,maxtext)
  142.     xtext = []
  143.     line = 0
  144.     text.each_line{|x| xtext.push x.sub(/\n/){}}
  145.     xtext.each{|x| x.size % maxtext != 0 ? line += x.size / maxtext + 1 : line += x.size / maxtext}
  146.     line
  147.   end
  148. end
  149. #==============================================================================
  150. # ■ Window_Help
  151. #------------------------------------------------------------------------------
  152. #  显示特技和物品等的说明、以及角色状态的窗口
  153. #==============================================================================
  154.  
  155. class Window_Help < Window_Base
  156.   #--------------------------------------------------------------------------
  157.   # ● 初始化对象
  158.   #--------------------------------------------------------------------------
  159.   def initialize(line_number = 0)
  160.     super(0, 0, 210, fitting_height(line_number))
  161.     self.z = 150
  162.     contents.font.size = 14
  163.     hide
  164.   end
  165.   #--------------------------------------------------------------------------
  166.   # ● 设置内容
  167.   #--------------------------------------------------------------------------
  168.   def set_text(text)
  169.     if text != @text
  170.       @text = text
  171.       refresh
  172.     end
  173.   end
  174.   #--------------------------------------------------------------------------
  175.   # ● 清除
  176.   #--------------------------------------------------------------------------
  177.   def clear
  178.     set_text("")
  179.   end
  180.   #--------------------------------------------------------------------------
  181.   # ● 更新帮助位置
  182.   #--------------------------------------------------------------------------
  183.   def uppos(index,rect,window)
  184.     self.height = fitting_height2(Help.getline(@xtext,13))
  185.     create_contents
  186.     contents.font.size = 14
  187.     rect.x -= window.ox
  188.     rect.y -= window.oy
  189.     ax = rect.x + rect.width + 10
  190.     ax = rect.x - self.width + 10 if ax + self.width > window.width + 10
  191.     ax += window.x
  192.     ax = 0 if ax < 0
  193.     ay = rect.y + rect.height
  194.     ay = rect.y - self.height if ay + self.height > window.height
  195.     ay += window.y
  196.     ay = 0 if ay < 0
  197.     self.x = ax
  198.     self.y = ay
  199.     set_text(@xtext)
  200.     show
  201.   end
  202.   #--------------------------------------------------------------------------
  203.   # ● 设置物品
  204.   #     item : 技能、物品等
  205.   #--------------------------------------------------------------------------
  206.   def set_item(item)
  207.     if item == nil
  208.       set_text("")
  209.       return
  210.     end
  211.     @xtext = ""
  212.     @xtext = "名称:" + item.name + "\n"
  213.     @xtext += "介绍:" + item.description + "\n"
  214.     @xtext += "价格:" + item.price.to_s + "\n" if item.is_a?(RPG::EquipItem) || item.is_a?(RPG::Item)
  215.     @xtext += Help.getequiphelp(item) if item.is_a?(RPG::EquipItem)
  216.     @xtext = @xtext[0,@text.size - 2] if @xtext[@xtext.size - 2,2] == "\n"
  217.   end
  218.   #--------------------------------------------------------------------------
  219.   # ● 刷新
  220.   #--------------------------------------------------------------------------
  221.   def refresh
  222.     contents.clear
  223.     hide if @text == ""
  224.     draw_text_ex(4, 0, @text,width,40,false)
  225.   end
  226. end
  227.  
  228. class Window_Base < Window
  229.   #--------------------------------------------------------------------------
  230.   # ● 计算窗口显示指定行数时的应用高度2*************************
  231.   #--------------------------------------------------------------------------
  232.   def fitting_height2(line_number)
  233.   line_number * contents.font.size + standard_padding * 2
  234.   end
  235. #~ draw_text_ex的增强,使其可以自动换行  原作者:叶子 修改:wyongcan
  236.   #--------------------------------------------------------------------------
  237.   # ● 绘制带有控制符的文本内容
  238.   #   如果传递了width参数的话,会自动换行
  239.   #--------------------------------------------------------------------------
  240.   def draw_text_ex(x, y, text, width = nil,textwidth = nil,normalfont = true)
  241.     reset_font_settings if normalfont == true
  242.     text = convert_escape_characters(text)
  243.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  244.     if width != nil
  245.       pos[:height] = contents.font.size
  246.       pos[:width] = width
  247.       pos[:textwidth] = textwidth
  248.     end
  249.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  250.   end
  251.   #--------------------------------------------------------------------------
  252.   # ● 文字的处理
  253.   #     c    : 文字
  254.   #     text : 绘制处理中的字符串缓存(字符串可能会被修改)
  255.   #     pos  : 绘制位置 {:x, :y, :new_x, :height}
  256.   #--------------------------------------------------------------------------
  257.   def process_character(c, text, pos)
  258.     case c
  259.     when "\r"   # 回车
  260.       return
  261.     when "\n"   # 换行
  262.       process_new_line(text, pos)
  263.     when "\f"   # 翻页
  264.       process_new_page(text, pos)
  265.     when "\e"   # 控制符
  266.       process_escape_character(obtain_escape_code(text), text, pos)
  267.     else        # 普通文字
  268.       pos[:textwidth] == nil ? text_width = text_size(c).width : text_width = pos[:textwidth]
  269.       if pos[:width] != nil && pos[:x] - pos[:new_x] + text_width > pos[:width]
  270.         process_new_line(text, pos)
  271.       end
  272.       process_normal_character(c, pos)
  273.     end
  274.   end
  275. end
  276.  
  277. class Window_ItemList < Window_Selectable
  278.   #--------------------------------------------------------------------------
  279.   # ● 更新帮助内容
  280.   #--------------------------------------------------------------------------
  281.   def update_help
  282.     @help_window.set_item(item)
  283.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  284.   end
  285. end
  286.  
  287. class Window_SkillList < Window_Selectable
  288.   #--------------------------------------------------------------------------
  289.   # ● 更新帮助内容
  290.   #--------------------------------------------------------------------------
  291.   def update_help
  292.     @help_window.set_item(item)
  293.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil
  294.   end
  295. end
  296.  
  297. class Window_ShopBuy < Window_Selectable
  298.   #--------------------------------------------------------------------------
  299.   # ● 更新帮助内容
  300.   #--------------------------------------------------------------------------
  301.   def update_help
  302.     @help_window.set_item(item) if @help_window
  303.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
  304.     @status_window.item = item if @status_window
  305.   end
  306. end
  307.  
  308. class Window_EquipSlot < Window_Selectable
  309.   #--------------------------------------------------------------------------
  310.   # ● 更新帮助内容
  311.   #--------------------------------------------------------------------------
  312.   def update_help
  313.     super
  314.     @help_window.set_item(item) if @help_window
  315.     @help_window.uppos(index,item_rect(index),self) if index != -1 && item != nil && @help_window
  316.     @status_window.set_temp_actor(nil) if @status_window
  317.   end
  318. end
  319.  
  320. class Scene_Shop < Scene_MenuBase
  321.         alias on_sell_ok_old on_sell_ok
  322.         def on_sell_ok
  323.                 on_sell_ok_old
  324.                 @help_window.hide
  325.         end
  326.         alias on_buy_ok_old on_buy_ok
  327.         def on_buy_ok
  328.                 on_buy_ok_old
  329.                 @help_window.hide
  330.         end
  331.         alias on_number_ok_old on_number_ok
  332.         def on_number_ok
  333.                 on_number_ok_old
  334.     @help_window.refresh
  335.                 @help_window.show
  336.         end
  337.         alias on_number_cancel_old on_number_cancel
  338.         def on_number_cancel
  339.                 on_number_cancel_old
  340.     @help_window.refresh
  341.                 @help_window.show
  342.         end
  343. end
  344.  
  345. class Scene_Title < Scene_Base
  346.   alias start_old start
  347.   def start
  348.     start_old
  349.     Help.ready
  350.   end
  351. end
  352. class Window_Base < Window
  353.         alias old_process_new_line process_new_line
  354.         def process_new_line(text, pos)
  355.     old_process_new_line(text, pos)
  356.                 pos[:height] = contents.font.size if pos[:width] != nil
  357.         end
  358. end
  359. class Scene_ItemBase < Scene_MenuBase
  360.         alias old_on_actor_cancel on_actor_cancel
  361.   def on_actor_cancel
  362.     old_on_actor_cancel
  363.         @help_window.refresh
  364.   end
  365.         alias old_on_actor_ok on_actor_ok
  366.   def on_actor_ok
  367.     old_on_actor_ok
  368.         @help_window.refresh
  369.   end
  370. end


RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - TP Manager v1.02
  4. # -- Last Updated: 2011.12.10
  5. # -- Level: Hard
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-TPManager"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2011.12.10 - Added <tp cost: x> notetag.
  17. # 2011.12.06 - Fixed an error in one of the formulas.
  18. # 2011.12.05 - Started Script and Finished.
  19. #
  20. #==============================================================================
  21. # ▼ Introduction
  22. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  23. # The TP system in RPG Maker VX Ace is actually rather limiting. A lot of the
  24. # system is hardcoded in giving Ace users very little control over how much TP
  25. # gain a battler can receive from particular actions and situations. This
  26. # script gives you the ability to adjust how much TP actors will acquire from
  27. # various actions, different TP modes, and letting players select and pick what
  28. # TP mode they want for each actor (akin to Final Fantasy X).
  29. #
  30. #==============================================================================
  31. # ▼ Instructions
  32. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  33. # To install this script, open up your script editor and copy/paste this script
  34. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  35. #
  36. # -----------------------------------------------------------------------------
  37. # Actor Notetags - These notetags go in the actors notebox in the database.
  38. # -----------------------------------------------------------------------------
  39. # <tp mode: x>
  40. # This sets the actor's default TP mode to x. If this tag isn't used, the
  41. # default TP mode will be set to whatever the module uses as default.
  42. #
  43. # <unlock tp: x>
  44. # <unlock tp: x, x>
  45. # This unlocks what TP modes the actor can use by default. If this tag isn't
  46. # used, the default unlocked TP modes will be whatever the module uses.
  47. #
  48. # -----------------------------------------------------------------------------
  49. # Item Notetags - These notetags go in the item notebox in the database.
  50. # -----------------------------------------------------------------------------
  51. # <unlock tp: x>
  52. # <unlock tp: x, x>
  53. # When this item is used upon an actor, that actor will learn TP Mode(s) x,
  54. # making it available to change in the TP Menu.
  55. #
  56. # -----------------------------------------------------------------------------
  57. # Skill Notetags - These notetags go in the skill notebox in the database.
  58. # -----------------------------------------------------------------------------
  59. # <unlock tp: x>
  60. # <unlock tp: x, x>
  61. # When this skill targets an actor, that actor will learn TP Mode(s) x thus,
  62. # making it available to change in the TP Menu.
  63. #
  64. # <learn unlock tp: x>
  65. # <learn unlock tp: x, x>
  66. # When an actor learns a skill with this notetag, that actor will learn
  67. # TP Mode(s) x making it available to change in the TP Menu.
  68. #
  69. # <tp cost: x>
  70. # When this notetag appears in a skill's notebox, the TP cost for that skill
  71. # becomes x. This notetag allows TP costs to surpass 100 TP, which is the max
  72. # TP cost in the RPG Maker VX Ace database editor.
  73. #
  74. # -----------------------------------------------------------------------------
  75. # Enemy Notetags - These notetags go in the enemy notebox in the database.
  76. # -----------------------------------------------------------------------------
  77. # <tp mode: x>
  78. # This sets the enemy's default TP mode to x. If this tag isn't used, the
  79. # default TP mode will be set to whatever the module uses as default.
  80. #
  81. # -----------------------------------------------------------------------------
  82. # Script Calls - These commands are used with script calls.
  83. # -----------------------------------------------------------------------------
  84. # change_tp_mode(x, y)
  85. # Replace x with the ID of the actor you want to change to the TP Mode y. This
  86. # will also unlock the TP mode for the actor, and make it available under the
  87. # skill menu for changing.
  88. #
  89. # unlock_tp_mode(x, y)
  90. # Replace x with the ID of the actor you want to learn for the TP Mode y. This
  91. # will cause the actor to learn the TP mode and have it accessible in the skill
  92. # menu for changing.
  93. #
  94. # remove_tp_mode(x, y)
  95. # Replace x with the ID of the actor you want to remove the TP Mode y. This
  96. # will cause the actor to forget the TP mode and no longer have it accessible
  97. # through the skill menu for changing.
  98. #
  99. # unlock_all_tp_modes(x)
  100. # Replace x with the ID of the actor you want to unlock all TP modes for. This
  101. # will make all the TP modes available to the actor from the skill menu.
  102. #
  103. # remove_all_tp_modes(x)
  104. # Removes all TP modes for actor x except for the actor's default TP mode.
  105. # This removes all TP modes from being available in the actor's skill menu.
  106. #
  107. #==============================================================================
  108. # ▼ Compatibility
  109. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  110. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  111. # it will run with RPG Maker VX without adjusting.
  112. #
  113. #==============================================================================
  114.  
  115. module YEA
  116.   module TP_MANAGER
  117.  
  118.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  119.     # - General TP Settings -
  120.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  121.     # Here, you can adjust global settings for TP including the maximum TP,
  122.     # whether or not you want the player to change TP modes, and more.
  123.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  124.     TP_LIMIT  = 100         # Sets the maximum TP. Default: 100
  125.     DEFAULT_TP_MODE = 0            # This is the TP mode everybody starts with
  126.                                    # unless changed through notetags.
  127.     DEFAULT_UNLOCKS = [0, 1, 2, 3,4,5,6,7,8,9,10,11,12,13,14,15,]
  128.     # These modes are unlocked for all actors
  129.                                    # unless changed through notetags.
  130.     LOW_HP = 0.25           # Percent for what is considered low HP.
  131.     LOW_MP = 0.25           # Percent for what is considered low MP.
  132.  
  133.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  134.     # - TP Mode Change Settings -
  135.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  136.     # Adjust the settings here for TP Mode Menu related items. Also, be sure
  137.     # to bind the TP_MODE_SWITCH to a switch ID. If that switch is on, the
  138.     # TP Mode item will appear in the skill menu. If off, it won't appear.
  139.     # If you set it to 0, then TP mode will always be enabled.
  140.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  141.     MENU_NAME = "性格"   # The displayed name for the TP Menu.
  142.     TP_MODE_SWITCH  = 0     # Switch ID used for enabling TP Mode menu.
  143.     DEFAULT_ENABLE  = true  # Enable switch by default?
  144.     CHANGE_TP_RESET = true  # Reset TP to 0 whenever a mode is changed?
  145.     EQUIPPED_COLOUR = 17    # Window text colour used for equipped TP mode.
  146.  
  147.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  148.     # - TP Modes -
  149.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  150.     # TP modes have a number of things that can change the way actors gain TP.
  151.     # Adjust the settings below to change how much gain and loss incurs per
  152.     # each of the different actions.
  153.     #
  154.     # Setting        Description
  155.     # -------------------------------------------------------------------------
  156.     # - :name        - Name that appears in the TP Mode menu.
  157.     # - :icon        - Icon used for the TP Mode menu.
  158.     # - :description - Help window description. Use \n for line breaks.
  159.     # - :preserve_tp - Carry over TP from last battle to next battle?
  160.     # - :init_tp     - TP at the start of each battle if no TP preservation.
  161.     # - :regen_tp    - TP regenerated each turn. Uses a formula.
  162.     # - :take_hp_dmg - TP charged by receiving HP damage. Uses a formula.
  163.     # - :deal_hp_dmg - TP gained by dealing HP damage. Uses a formula.
  164.     # - :heal_hp_dmg - TP gained through healing HP damage. Uses a formula.
  165.     # - :ally_hp_dmg - TP gained when allies take HP damage. Uses a formula.
  166.     # - :take_mp_dmg - TP charged by receiving MP damage. Uses a formula.
  167.     # - :deal_mp_dmg - TP gained by dealing MP damage. Uses a formula.
  168.     # - :heal_mp_dmg - TP gained through healing MP damage. Uses a formula.
  169.     # - :ally_mp_dmg - TP gained when allies take MP damage. Uses a formula.
  170.     # - :deal_state  - TP gained when user inflicts a state to a foe. Formula.
  171.     # - :gain_state  - TP gained when user gains a state from a foe. Formula.
  172.     # - :kill_ally   - TP gained when an ally is killed. Uses a formula.
  173.     # - :kill_enemy  - TP gained when killing an enemy. Uses a formula.
  174.     # - :win_battle  - TP gained whenever a battle is won. Uses a formula.
  175.     # - :flee_battle - TP gained whenever party escapes. Uses a formula.
  176.     # - :lose_battle - TP gained whenever a battle is lost. Uses a formula.
  177.     # - :low_hp_turn - TP gained at the end of a turn with user at low HP.
  178.     # - :low_mp_turn - TP gained at the end of a turn with user at low MP.
  179.     # - :only_ally   - TP gained when user is only ally alive.
  180.     # - :evasion     - TP gained when user evades an attack.
  181.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  182.     TP_MODES ={
  183.     # TP Mode => { Settings }
  184.     # -------------------------------------------------------------------------
  185.       0 => { # This is the default mode.
  186.       # :setting     => Adjust settings as you see fit.
  187.         :name        => "苦行僧",
  188.         :icon        => 121,
  189.         :description => "在等待或者受到攻击时增加TP.",
  190.         :preserve_tp => false,
  191.         :init_tp     => "rand * 25",
  192.         :regen_tp    => "100 * trg",
  193.         :take_hp_dmg => "50 * damage_rate * tcr",
  194.         :deal_hp_dmg => "0",
  195.         :heal_hp_dmg => "0",
  196.         :ally_hp_dmg => "0",
  197.         :take_mp_dmg => "0",
  198.         :deal_mp_dmg => "0",
  199.         :heal_mp_dmg => "0",
  200.         :ally_mp_dmg => "0",
  201.         :deal_state  => "0",
  202.         :gain_state  => "0",
  203.         :kill_ally   => "0",
  204.         :kill_enemy  => "0",
  205.         :win_battle  => "0",
  206.         :flee_battle => "0",
  207.         :lose_battle => "0",
  208.         :low_hp_turn => "0",
  209.         :low_mp_turn => "0",
  210.         :only_alive  => "0",
  211.         :evasion     => "0",
  212.       }, # Do not remove this.
  213.     # -------------------------------------------------------------------------
  214.       1 => { # New TP mode!
  215.       # :setting     => Adjust settings as you see fit.
  216.         :name        => "难友",
  217.         :icon        => 122,
  218.         :description => "每当同伴受伤都增加TP.",
  219.         :preserve_tp => true,
  220.         :init_tp     => "0",
  221.         :regen_tp    => "0",
  222.         :take_hp_dmg => "0",
  223.         :deal_hp_dmg => "0",
  224.         :heal_hp_dmg => "0",
  225.         :ally_hp_dmg => "20 * tcr",
  226.         :take_mp_dmg => "0",
  227.         :deal_mp_dmg => "0",
  228.         :heal_mp_dmg => "0",
  229.         :ally_mp_dmg => "0",
  230.         :deal_state  => "0",
  231.         :gain_state  => "0",
  232.         :kill_ally   => "0",
  233.         :kill_enemy  => "0",
  234.         :win_battle  => "0",
  235.         :flee_battle => "0",
  236.         :lose_battle => "0",
  237.         :low_hp_turn => "0",
  238.         :low_mp_turn => "0",
  239.         :only_alive  => "0",
  240.         :evasion     => "0",
  241.       }, # Do not remove this.
  242.     # -------------------------------------------------------------------------
  243.       2 => { # New TP mode!
  244.       # :setting     => Adjust settings as you see fit.
  245.         :name        => "勇者",
  246.         :icon        => 116,
  247.         :description => "进攻和治疗时增加TP.",
  248.         :preserve_tp => true,
  249.         :init_tp     => "0",
  250.         :regen_tp    => "0",
  251.         :take_hp_dmg => "0",
  252.         :deal_hp_dmg => "[@result.hp_damage * 100 / mhp, 16].min * tcr",
  253.         :heal_hp_dmg => "0",
  254.         :ally_hp_dmg => "0",
  255.         :take_mp_dmg => "0",
  256.         :deal_mp_dmg => "0",
  257.         :heal_mp_dmg => "0",
  258.         :ally_mp_dmg => "0",
  259.         :deal_state  => "0",
  260.         :gain_state  => "0",
  261.         :kill_ally   => "0",
  262.         :kill_enemy  => "0",
  263.         :win_battle  => "0",
  264.         :flee_battle => "0",
  265.         :lose_battle => "0",
  266.         :low_hp_turn => "0",
  267.         :low_mp_turn => "0",
  268.         :only_alive  => "0",
  269.         :evasion     => "0",
  270.       }, # Do not remove this.
  271.     # -------------------------------------------------------------------------
  272.       3 => { # New TP mode!
  273.       # :setting     => Adjust settings as you see fit.
  274.         :name        => "守护者",
  275.         :icon        => 112,
  276.         :description => "治疗时增加TP.",
  277.         :preserve_tp => true,
  278.         :init_tp     => "0",
  279.         :regen_tp    => "0",
  280.         :take_hp_dmg => "0",
  281.         :deal_hp_dmg => "0",
  282.         :heal_hp_dmg => "[@result.hp_damage * -100 / mhp, 16].min * tcr",
  283.         :ally_hp_dmg => "0",
  284.         :take_mp_dmg => "0",
  285.         :deal_mp_dmg => "0",
  286.         :heal_mp_dmg => "0",
  287.         :ally_mp_dmg => "0",
  288.         :deal_state  => "0",
  289.         :gain_state  => "0",
  290.         :kill_ally   => "0",
  291.         :kill_enemy  => "0",
  292.         :win_battle  => "0",
  293.         :flee_battle => "0",
  294.         :lose_battle => "0",
  295.         :low_hp_turn => "0",
  296.         :low_mp_turn => "0",
  297.         :only_alive  => "0",
  298.         :evasion     => "0",
  299.       }, # Do not remove this.
  300.     # -------------------------------------------------------------------------
  301.       4 => { # New TP mode!
  302.       # :setting     => Adjust settings as you see fit.
  303.         :name        => "中断者",
  304.         :icon        => 215,
  305.         :description => "恢复MP损害受到MP损伤或者同伴受到损伤时提高TP.",
  306.         :preserve_tp => true,
  307.         :init_tp     => "0",
  308.         :regen_tp    => "0",
  309.         :take_hp_dmg => "0",
  310.         :deal_hp_dmg => "0",
  311.         :heal_hp_dmg => "0",
  312.         :ally_hp_dmg => "0",
  313.         :take_mp_dmg => "50 * damage_rate * tcr",
  314.         :deal_mp_dmg => "[@result.mp_damage / 4, 16].min * tcr",
  315.         :heal_mp_dmg => "0",
  316.         :ally_mp_dmg => "20 * tcr",
  317.         :deal_state  => "0",
  318.         :gain_state  => "0",
  319.         :kill_ally   => "0",
  320.         :kill_enemy  => "0",
  321.         :win_battle  => "0",
  322.         :flee_battle => "0",
  323.         :lose_battle => "0",
  324.         :low_hp_turn => "0",
  325.         :low_mp_turn => "0",
  326.         :only_alive  => "0",
  327.         :evasion     => "0",
  328.       }, # Do not remove this.
  329.     # -------------------------------------------------------------------------
  330.       5 => { # New TP mode!
  331.       # :setting     => Adjust settings as you see fit.
  332.         :name        => "炼金术士",
  333.         :icon        => 193,
  334.         :description => "恢复同伴MP时增加TP.",
  335.         :preserve_tp => true,
  336.         :init_tp     => "0",
  337.         :regen_tp    => "0",
  338.         :take_hp_dmg => "0",
  339.         :deal_hp_dmg => "0",
  340.         :heal_hp_dmg => "0",
  341.         :ally_hp_dmg => "0",
  342.         :take_mp_dmg => "0",
  343.         :deal_mp_dmg => "0",
  344.         :heal_mp_dmg => "[@result.mp_damage / -4, 16].min * tcr",
  345.         :ally_mp_dmg => "0",
  346.         :deal_state  => "0",
  347.         :gain_state  => "0",
  348.         :kill_ally   => "0",
  349.         :kill_enemy  => "0",
  350.         :win_battle  => "0",
  351.         :flee_battle => "0",
  352.         :lose_battle => "0",
  353.         :low_hp_turn => "0",
  354.         :low_mp_turn => "0",
  355.         :only_alive  => "0",
  356.         :evasion     => "0",
  357.       }, # Do not remove this.
  358.     # -------------------------------------------------------------------------
  359.       6 => { # New TP mode!
  360.       # :setting     => Adjust settings as you see fit.
  361.         :name        => "杀手",
  362.         :icon        => 115,
  363.         :description => "当同伴死亡时增加TP.",
  364.         :preserve_tp => true,
  365.         :init_tp     => "0",
  366.         :regen_tp    => "0",
  367.         :take_hp_dmg => "0",
  368.         :deal_hp_dmg => "0",
  369.         :heal_hp_dmg => "0",
  370.         :ally_hp_dmg => "0",
  371.         :take_mp_dmg => "0",
  372.         :deal_mp_dmg => "0",
  373.         :heal_mp_dmg => "0",
  374.         :ally_mp_dmg => "0",
  375.         :deal_state  => "0",
  376.         :gain_state  => "0",
  377.         :kill_ally   => "0",
  378.         :kill_enemy  => "25 * tcr",
  379.         :win_battle  => "0",
  380.         :flee_battle => "0",
  381.         :lose_battle => "0",
  382.         :low_hp_turn => "0",
  383.         :low_mp_turn => "0",
  384.         :only_alive  => "0",
  385.         :evasion     => "0",
  386.       }, # Do not remove this.
  387.     # -------------------------------------------------------------------------
  388.       7 => { # New TP mode!
  389.       # :setting     => Adjust settings as you see fit.
  390.         :name        => "复仇者",
  391.         :icon        => 1,
  392.         :description => "当同伴死亡时增加TP.",
  393.         :preserve_tp => true,
  394.         :init_tp     => "0",
  395.         :regen_tp    => "0",
  396.         :take_hp_dmg => "0",
  397.         :deal_hp_dmg => "0",
  398.         :heal_hp_dmg => "0",
  399.         :ally_hp_dmg => "0",
  400.         :take_mp_dmg => "0",
  401.         :deal_mp_dmg => "0",
  402.         :heal_mp_dmg => "0",
  403.         :ally_mp_dmg => "0",
  404.         :deal_state  => "0",
  405.         :gain_state  => "0",
  406.         :kill_ally   => "50 * tcr",
  407.         :kill_enemy  => "0",
  408.         :win_battle  => "0",
  409.         :flee_battle => "0",
  410.         :lose_battle => "0",
  411.         :low_hp_turn => "0",
  412.         :low_mp_turn => "0",
  413.         :only_alive  => "0",
  414.         :evasion     => "0",
  415.       }, # Do not remove this.
  416.     # -------------------------------------------------------------------------
  417.       8 => { # New TP mode!
  418.       # :setting     => Adjust settings as you see fit.
  419.         :name        => "胜利者",
  420.         :icon        => 113,
  421.         :description => "不管是否战斗都增加TP.",
  422.         :preserve_tp => true,
  423.         :init_tp     => "0",
  424.         :regen_tp    => "0",
  425.         :take_hp_dmg => "0",
  426.         :deal_hp_dmg => "0",
  427.         :heal_hp_dmg => "0",
  428.         :ally_hp_dmg => "0",
  429.         :take_mp_dmg => "0",
  430.         :deal_mp_dmg => "0",
  431.         :heal_mp_dmg => "0",
  432.         :ally_mp_dmg => "0",
  433.         :deal_state  => "0",
  434.         :gain_state  => "0",
  435.         :kill_ally   => "0",
  436.         :kill_enemy  => "0",
  437.         :win_battle  => "20 * tcr",
  438.         :flee_battle => "0",
  439.         :lose_battle => "0",
  440.         :low_hp_turn => "0",
  441.         :low_mp_turn => "0",
  442.         :only_alive  => "0",
  443.         :evasion     => "0",
  444.       }, # Do not remove this.
  445.     # -------------------------------------------------------------------------
  446.       9 => { # New TP mode!
  447.       # :setting     => Adjust settings as you see fit.
  448.         :name        => "胆小鬼",
  449.         :icon        => 114,
  450.         :description => "不管是否逃跑都增加TP.",
  451.         :preserve_tp => true,
  452.         :init_tp     => "0",
  453.         :regen_tp    => "0",
  454.         :take_hp_dmg => "0",
  455.         :deal_hp_dmg => "0",
  456.         :heal_hp_dmg => "0",
  457.         :ally_hp_dmg => "0",
  458.         :take_mp_dmg => "0",
  459.         :deal_mp_dmg => "0",
  460.         :heal_mp_dmg => "0",
  461.         :ally_mp_dmg => "0",
  462.         :deal_state  => "0",
  463.         :gain_state  => "0",
  464.         :kill_ally   => "0",
  465.         :kill_enemy  => "0",
  466.         :win_battle  => "0",
  467.         :flee_battle => "0",
  468.         :lose_battle => "20 * tcr",
  469.         :low_hp_turn => "0",
  470.         :low_mp_turn => "0",
  471.         :only_alive  => "0",
  472.         :evasion     => "0",
  473.       }, # Do not remove this.
  474.     # -------------------------------------------------------------------------
  475.       10 => { # New TP mode!
  476.       # :setting     => Adjust settings as you see fit.
  477.         :name        => "狂人",
  478.         :icon        => 48,
  479.         :description => "不管战斗结束后多少TP都增加.",
  480.         :preserve_tp => true,
  481.         :init_tp     => "0",
  482.         :regen_tp    => "0",
  483.         :take_hp_dmg => "0",
  484.         :deal_hp_dmg => "0",
  485.         :heal_hp_dmg => "0",
  486.         :ally_hp_dmg => "0",
  487.         :take_mp_dmg => "0",
  488.         :deal_mp_dmg => "0",
  489.         :heal_mp_dmg => "0",
  490.         :ally_mp_dmg => "0",
  491.         :deal_state  => "0",
  492.         :gain_state  => "0",
  493.         :kill_ally   => "0",
  494.         :kill_enemy  => "0",
  495.         :win_battle  => "0",
  496.         :flee_battle => "0",
  497.         :lose_battle => "0",
  498.         :low_hp_turn => "16 * tcr",
  499.         :low_mp_turn => "0",
  500.         :only_alive  => "0",
  501.         :evasion     => "0",
  502.       }, # Do not remove this.
  503.     # -------------------------------------------------------------------------
  504.       11 => { # New TP mode!
  505.       # :setting     => Adjust settings as you see fit.
  506.         :name        => "调剂师",
  507.         :icon        => 49,
  508.         :description => "不管战斗结束后多少MP都增加TP.",
  509.         :preserve_tp => true,
  510.         :init_tp     => "0",
  511.         :regen_tp    => "0",
  512.         :take_hp_dmg => "0",
  513.         :deal_hp_dmg => "0",
  514.         :heal_hp_dmg => "0",
  515.         :ally_hp_dmg => "0",
  516.         :take_mp_dmg => "0",
  517.         :deal_mp_dmg => "0",
  518.         :heal_mp_dmg => "0",
  519.         :ally_mp_dmg => "0",
  520.         :deal_state  => "0",
  521.         :gain_state  => "0",
  522.         :kill_ally   => "0",
  523.         :kill_enemy  => "0",
  524.         :win_battle  => "0",
  525.         :flee_battle => "0",
  526.         :lose_battle => "0",
  527.         :low_hp_turn => "0",
  528.         :low_mp_turn => "16 * tcr",
  529.         :only_alive  => "0",
  530.         :evasion     => "0",
  531.       }, # Do not remove this.
  532.     # -------------------------------------------------------------------------
  533.       12 => { # New TP mode!
  534.       # :setting     => Adjust settings as you see fit.
  535.         :name        => "战略家",
  536.         :icon        => 10,
  537.         :description => "每当使敌人状态受到攻击提高TP.",
  538.         :preserve_tp => true,
  539.         :init_tp     => "0",
  540.         :regen_tp    => "0",
  541.         :take_hp_dmg => "0",
  542.         :deal_hp_dmg => "0",
  543.         :heal_hp_dmg => "0",
  544.         :ally_hp_dmg => "0",
  545.         :take_mp_dmg => "0",
  546.         :deal_mp_dmg => "0",
  547.         :heal_mp_dmg => "0",
  548.         :ally_mp_dmg => "0",
  549.         :deal_state  => "16 * tcr",
  550.         :gain_state  => "0",
  551.         :kill_ally   => "0",
  552.         :kill_enemy  => "0",
  553.         :win_battle  => "0",
  554.         :flee_battle => "0",
  555.         :lose_battle => "0",
  556.         :low_hp_turn => "0",
  557.         :low_mp_turn => "0",
  558.         :only_alive  => "0",
  559.         :evasion     => "0",
  560.       }, # Do not remove this.
  561.     # -------------------------------------------------------------------------
  562.       13 => { # New TP mode!
  563.       # :setting     => Adjust settings as you see fit.
  564.         :name        => "病人",
  565.         :icon        => 3,
  566.         :description => "每当状态受到攻击提高TP.",
  567.         :preserve_tp => true,
  568.         :init_tp     => "0",
  569.         :regen_tp    => "0",
  570.         :take_hp_dmg => "0",
  571.         :deal_hp_dmg => "0",
  572.         :heal_hp_dmg => "0",
  573.         :ally_hp_dmg => "0",
  574.         :take_mp_dmg => "0",
  575.         :deal_mp_dmg => "0",
  576.         :heal_mp_dmg => "0",
  577.         :ally_mp_dmg => "0",
  578.         :deal_state  => "0",
  579.         :gain_state  => "16 * tcr",
  580.         :kill_ally   => "0",
  581.         :kill_enemy  => "0",
  582.         :win_battle  => "0",
  583.         :flee_battle => "0",
  584.         :lose_battle => "0",
  585.         :low_hp_turn => "0",
  586.         :low_mp_turn => "0",
  587.         :only_alive  => "0",
  588.         :evasion     => "0",
  589.       }, # Do not remove this.
  590.     # -------------------------------------------------------------------------
  591.       14 => { # New TP mode!
  592.       # :setting     => Adjust settings as you see fit.
  593.         :name        => "舞者",
  594.         :icon        => 12,
  595.         :description => "每当成功地逃避攻击提高TP.",
  596.         :preserve_tp => true,
  597.         :init_tp     => "0",
  598.         :regen_tp    => "0",
  599.         :take_hp_dmg => "0",
  600.         :deal_hp_dmg => "0",
  601.         :heal_hp_dmg => "0",
  602.         :ally_hp_dmg => "0",
  603.         :take_mp_dmg => "0",
  604.         :deal_mp_dmg => "0",
  605.         :heal_mp_dmg => "0",
  606.         :ally_mp_dmg => "0",
  607.         :deal_state  => "0",
  608.         :gain_state  => "0",
  609.         :kill_ally   => "0",
  610.         :kill_enemy  => "0",
  611.         :win_battle  => "0",
  612.         :flee_battle => "0",
  613.         :lose_battle => "0",
  614.         :low_hp_turn => "0",
  615.         :low_mp_turn => "0",
  616.         :only_alive  => "0",
  617.         :evasion     => "16 * tcr",
  618.       }, # Do not remove this.
  619.     # -------------------------------------------------------------------------
  620.       15 => { # New TP mode!
  621.       # :setting     => Adjust settings as you see fit.
  622.         :name        => "独行侠",
  623.         :icon        => 14,
  624.         :description => "当只剩最后一人时增加TP.",
  625.         :preserve_tp => true,
  626.         :init_tp     => "0",
  627.         :regen_tp    => "0",
  628.         :take_hp_dmg => "0",
  629.         :deal_hp_dmg => "0",
  630.         :heal_hp_dmg => "0",
  631.         :ally_hp_dmg => "0",
  632.         :take_mp_dmg => "0",
  633.         :deal_mp_dmg => "0",
  634.         :heal_mp_dmg => "0",
  635.         :ally_mp_dmg => "0",
  636.         :deal_state  => "0",
  637.         :gain_state  => "0",
  638.         :kill_ally   => "0",
  639.         :kill_enemy  => "0",
  640.         :win_battle  => "0",
  641.         :flee_battle => "0",
  642.         :lose_battle => "0",
  643.         :low_hp_turn => "0",
  644.         :low_mp_turn => "0",
  645.         :only_alive  => "16 * tcr",
  646.         :evasion     => "0",
  647.       }, # Do not remove this.
  648.     # -------------------------------------------------------------------------
  649.     } # Do not remove this.
  650.  
  651.   end # TP_MANAGER
  652. end # YEA
  653.  
  654. #==============================================================================
  655. # ▼ Editting anything past this point may potentially result in causing
  656. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  657. # halitosis so edit at your own risk.
  658. #==============================================================================
  659.  
  660. module YEA
  661.   module REGEXP
  662.   module ACTOR
  663.  
  664.     TP_MODE   = /<(?:TP_MODE|tp mode):[ ](\d+)>/i
  665.     UNLOCK_TP = /<(?:UNLOCK_TP|unlock tp):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  666.  
  667.   end # ACTOR
  668.   module ENEMY
  669.  
  670.     TP_MODE   = /<(?:TP_MODE|tp mode):[ ](\d+)>/i
  671.  
  672.   end # ENEMY
  673.   module BASEITEM
  674.  
  675.     UNLOCK_TP = /<(?:UNLOCK_TP|unlock tp):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  676.     LEARN_TP = /<(?:LEARN_UNLOCK_TP|learn unlock tp):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  677.     TP_COST  = /<(?:TP_COST|tp cost):[ ](\d+)>/i
  678.  
  679.   end # BASEITEM
  680.   end # REGEXP
  681. end # YEA
  682.  
  683. #==============================================================================
  684. # ■ Switch
  685. #==============================================================================
  686.  
  687. module Switch
  688.  
  689.   #--------------------------------------------------------------------------
  690.   # self.tp_mode
  691.   #--------------------------------------------------------------------------
  692.   def self.tp_mode
  693.     return true if YEA::TP_MANAGER::TP_MODE_SWITCH <= 0
  694.     return $game_switches[YEA::TP_MANAGER::TP_MODE_SWITCH]
  695.   end
  696.  
  697.   #--------------------------------------------------------------------------
  698.   # self.tp_mode_set
  699.   #--------------------------------------------------------------------------
  700.   def self.tp_mode_set(item)
  701.     return if YEA::TP_MANAGER::TP_MODE_SWITCH <= 0
  702.     $game_switches[YEA::TP_MANAGER::TP_MODE_SWITCH] = item
  703.   end
  704.  
  705. end # Switch
  706.  
  707. #==============================================================================
  708. # ■ Numeric
  709. #==============================================================================
  710.  
  711. class Numeric
  712.  
  713.   #--------------------------------------------------------------------------
  714.   # new method: group_digits
  715.   #--------------------------------------------------------------------------
  716.   unless $imported["YEA-CoreEngine"]
  717.   def group; return self.to_s; end
  718.   end # $imported["YEA-CoreEngine"]
  719.  
  720. end # Numeric
  721.  
  722. #==============================================================================
  723. # ■ DataManager
  724. #==============================================================================
  725.  
  726. module DataManager
  727.  
  728.   #--------------------------------------------------------------------------
  729.   # alias method: load_database
  730.   #--------------------------------------------------------------------------
  731.   class <<self; alias load_database_tpm load_database; end
  732.   def self.load_database
  733.     load_database_tpm
  734.     load_notetags_tpm
  735.   end
  736.  
  737.   #--------------------------------------------------------------------------
  738.   # new method: load_notetags_tpm
  739.   #--------------------------------------------------------------------------
  740.   def self.load_notetags_tpm
  741.     groups = [$data_actors, $data_enemies, $data_items, $data_skills]
  742.     for group in groups
  743.       for obj in group
  744.         next if obj.nil?
  745.         obj.load_notetags_tpm
  746.       end
  747.     end
  748.   end
  749.  
  750.   #--------------------------------------------------------------------------
  751.   # alias method: setup_new_game
  752.   #--------------------------------------------------------------------------
  753.   class <<self; alias setup_new_game_tpm setup_new_game; end
  754.   def self.setup_new_game
  755.     setup_new_game_tpm
  756.     Switch.tp_mode_set(YEA::TP_MANAGER::DEFAULT_ENABLE)
  757.   end
  758.  
  759. end # DataManager
  760.  
  761. #==============================================================================
  762. # ■ RPG::Actor
  763. #==============================================================================
  764.  
  765. class RPG::Actor < RPG::BaseItem
  766.  
  767.   #--------------------------------------------------------------------------
  768.   # public instance variables
  769.   #--------------------------------------------------------------------------
  770.   attr_accessor :tp_mode
  771.   attr_accessor :unlocked_tp_modes
  772.  
  773.   #--------------------------------------------------------------------------
  774.   # common cache: load_notetags_tpm
  775.   #--------------------------------------------------------------------------
  776.   def load_notetags_tpm
  777.     @tp_mode = nil
  778.     @unlocked_tp_modes = []
  779.     #---
  780.     self.note.split(/[\r\n]+/).each { |line|
  781.       case line
  782.       #---
  783.       when YEA::REGEXP::ACTOR::TP_MODE
  784.         @tp_mode = $1.to_i
  785.       when YEA::REGEXP::ACTOR::UNLOCK_TP
  786.         $1.scan(/\d+/).each { |num|
  787.         @unlocked_tp_modes.push(num.to_i) if num.to_i > 0 }
  788.       #---
  789.       end
  790.     } # self.note.split
  791.     #---
  792.     @tp_mode = YEA::TP_MANAGER::DEFAULT_TP_MODE if @tp_mode.nil?
  793.     if @unlocked_tp_modes.empty?
  794.       @unlocked_tp_modes = YEA::TP_MANAGER::DEFAULT_UNLOCKS.clone
  795.     end
  796.     @unlocked_tp_modes.push(@tp_mode) if !@unlocked_tp_modes.include?(@tp_mode)
  797.     @unlocked_tp_modes.uniq!
  798.     @unlocked_tp_modes.sort!
  799.   end
  800.  
  801. end # RPG::Actor
  802.  
  803. #==============================================================================
  804. # ■ RPG::Enemy
  805. #==============================================================================
  806.  
  807. class RPG::Enemy < RPG::BaseItem
  808.  
  809.   #--------------------------------------------------------------------------
  810.   # public instance variables
  811.   #--------------------------------------------------------------------------
  812.   attr_accessor :tp_mode
  813.  
  814.   #--------------------------------------------------------------------------
  815.   # common cache: load_notetags_tpm
  816.   #--------------------------------------------------------------------------
  817.   def load_notetags_tpm
  818.     @tp_mode = YEA::TP_MANAGER::DEFAULT_TP_MODE
  819.     #---
  820.     self.note.split(/[\r\n]+/).each { |line|
  821.       case line
  822.       #---
  823.       when YEA::REGEXP::ENEMY::TP_MODE
  824.         @tp_mode = $1.to_i
  825.       #---
  826.       end
  827.     } # self.note.split
  828.     #---
  829.   end
  830.  
  831. end # RPG::Enemy
  832.  
  833. #==============================================================================
  834. # ■ RPG::BaseItem
  835. #==============================================================================
  836.  
  837. class RPG::BaseItem
  838.  
  839.   #--------------------------------------------------------------------------
  840.   # public instance variables
  841.   #--------------------------------------------------------------------------
  842.   attr_accessor :unlocked_tp_modes
  843.   attr_accessor :learn_tp_modes
  844.   attr_accessor :tp_cost
  845.  
  846.   #--------------------------------------------------------------------------
  847.   # common cache: load_notetags_tpm
  848.   #--------------------------------------------------------------------------
  849.   def load_notetags_tpm
  850.     @unlocked_tp_modes = []
  851.     @learn_tp_modes = []
  852.     #---
  853.     self.note.split(/[\r\n]+/).each { |line|
  854.       case line
  855.       #---
  856.       when YEA::REGEXP::BASEITEM::UNLOCK_TP
  857.         $1.scan(/\d+/).each { |num|
  858.         @unlocked_tp_modes.push(num.to_i) if num.to_i > 0 }
  859.       when YEA::REGEXP::BASEITEM::LEARN_TP
  860.         $1.scan(/\d+/).each { |num|
  861.         @learn_tp_modes.push(num.to_i) if num.to_i > 0 }
  862.       when YEA::REGEXP::BASEITEM::TP_COST
  863.         next unless self.is_a?(RPG::Skill)
  864.         @tp_cost = $1.to_i
  865.       #---
  866.       end
  867.     } # self.note.split
  868.     #---
  869.   end
  870.  
  871. end # RPG::BaseItem
  872.  
  873. #==============================================================================
  874. # ■ BattleManager
  875. #==============================================================================
  876.  
  877. module BattleManager
  878.   #--------------------------------------------------------------------------
  879.   # alias method: load_database
  880.   #--------------------------------------------------------------------------
  881.   class <<self; alias battle_end_tpm battle_end;end
  882.   def self.battle_end(result)
  883.     battle_end_tpm(result)
  884.     case result
  885.     when 0
  886.       for member in $game_party.alive_members
  887.         member.tp += eval(member.tp_setting(:win_battle))
  888.       end
  889.     when 1
  890.       for member in $game_party.alive_members
  891.         member.tp += eval(member.tp_setting(:flee_battle))
  892.       end
  893.     end
  894.   end
  895.  
  896.  
  897.  
  898. end # BattleManager
  899.  
  900. #==============================================================================
  901. # ■ Game_BattlerBase
  902. #==============================================================================
  903.  
  904. class Game_BattlerBase
  905.   #--------------------------------------------------------------------------
  906.   # public instance variables
  907.   #--------------------------------------------------------------------------
  908.   attr_accessor :tp_mode
  909.   attr_accessor :unlocked_tp_modes
  910.  
  911.   #--------------------------------------------------------------------------
  912.   # overwrite method: max_tp
  913.   #--------------------------------------------------------------------------
  914.   def max_tp; return YEA::TP_MANAGER::TP_LIMIT; end
  915.  
  916.   #--------------------------------------------------------------------------
  917.   # anti-crash methods: max_tp, unlocked_tp_modes
  918.   #--------------------------------------------------------------------------
  919.   def tp_mode; return 0; end
  920.   def unlocked_tp_modes; return [0]; end
  921.  
  922.   #--------------------------------------------------------------------------
  923.   # new method: tp_setting
  924.   #--------------------------------------------------------------------------
  925.   def tp_setting(setting)
  926.     return YEA::TP_MANAGER::TP_MODES[tp_mode][setting]
  927.   end
  928.  
  929.   #--------------------------------------------------------------------------
  930.   # alias method: preserve_tp?
  931.   #--------------------------------------------------------------------------
  932.   alias game_battlerbase_preserve_tp_tpm preserve_tp?
  933.   def preserve_tp?
  934.     return true if tp_setting(:preserve_tp)
  935.     return game_battlerbase_preserve_tp_tpm
  936.   end
  937.  
  938. end # Game_BattlerBase
  939.  
  940. #==============================================================================
  941. # ■ Game_Battler
  942. #==============================================================================
  943.  
  944. class Game_Battler < Game_BattlerBase
  945.  
  946.   #--------------------------------------------------------------------------
  947.   # overwrite method: init_tp
  948.   #--------------------------------------------------------------------------
  949.   def init_tp
  950.     self.tp = eval(tp_setting(:init_tp))
  951.   end
  952.  
  953.   #--------------------------------------------------------------------------
  954.   # overwrite method: charge_tp_by_damage
  955.   #--------------------------------------------------------------------------
  956.   def charge_tp_by_damage(damage_rate)
  957.     self.tp += eval(tp_setting(:take_hp_dmg))
  958.   end
  959.  
  960.   #--------------------------------------------------------------------------
  961.   # new method: charge_tp_by_mp_damage
  962.   #--------------------------------------------------------------------------
  963.   def charge_tp_by_mp_damage(damage_rate)
  964.     self.tp += eval(tp_setting(:take_mp_dmg))
  965.   end
  966.  
  967.   #--------------------------------------------------------------------------
  968.   # overwrite method:
  969.   #--------------------------------------------------------------------------
  970.   def regenerate_tp
  971.     self.tp += eval(tp_setting(:regen_tp))
  972.     self.tp += eval(tp_setting(:low_hp_turn)) if self.hp < tp_low_hp
  973.     self.tp += eval(tp_setting(:low_mp_turn)) if self.mp < tp_low_mp
  974.     if friends_unit.alive_members.size == 1
  975.       self.tp += eval(tp_setting(:only_alive))
  976.     end
  977.   end
  978.  
  979.   #--------------------------------------------------------------------------
  980.   # new method: tp_low_hp
  981.   #--------------------------------------------------------------------------
  982.   def tp_low_hp
  983.     return self.mhp * YEA::TP_MANAGER::LOW_HP
  984.   end
  985.  
  986.   #--------------------------------------------------------------------------
  987.   # new method: tp_low_mp
  988.   #--------------------------------------------------------------------------
  989.   def tp_low_mp
  990.     return self.mmp * YEA::TP_MANAGER::LOW_MP
  991.   end
  992.  
  993.   #--------------------------------------------------------------------------
  994.   # alias method: execute_damage
  995.   #--------------------------------------------------------------------------
  996.   alias game_battler_execute_damage_tpm execute_damage
  997.   def execute_damage(user)
  998.     game_battler_execute_damage_tpm(user)
  999.     return unless $game_party.in_battle
  1000.     if @result.hp_damage > 0
  1001.       user.tp += eval(user.tp_setting(:deal_hp_dmg))
  1002.       gain_tp_ally_hp_damage
  1003.     elsif @result.hp_damage < 0
  1004.       user.tp += eval(user.tp_setting(:heal_hp_dmg))
  1005.     end
  1006.     if @result.mp_damage > 0
  1007.       user.tp += eval(user.tp_setting(:deal_mp_dmg))
  1008.       gain_tp_ally_mp_damage
  1009.       charge_tp_by_mp_damage(@result.mp_damage)
  1010.     elsif @result.mp_damage < 0
  1011.       user.tp += eval(user.tp_setting(:heal_mp_dmg))
  1012.     end
  1013.     user.tp += eval(user.tp_setting(:kill_enemy)) if self.hp == 0
  1014.     gain_tp_kill_ally if self.hp == 0
  1015.   end
  1016.  
  1017.   #--------------------------------------------------------------------------
  1018.   # new method: gain_tp_ally_hp_damage
  1019.   #--------------------------------------------------------------------------
  1020.   def gain_tp_ally_hp_damage
  1021.     for member in friends_unit.alive_members
  1022.       next if member == self
  1023.       member.tp += eval(member.tp_setting(:ally_hp_dmg))
  1024.     end
  1025.   end
  1026.  
  1027.   #--------------------------------------------------------------------------
  1028.   # new method: gain_tp_ally_mp_damage
  1029.   #--------------------------------------------------------------------------
  1030.   def gain_tp_ally_mp_damage
  1031.     for member in friends_unit.alive_members
  1032.       next if member == self
  1033.       member.tp += eval(member.tp_setting(:ally_mp_dmg))
  1034.     end
  1035.   end
  1036.  
  1037.   #--------------------------------------------------------------------------
  1038.   # new method: gain_tp_kill_ally
  1039.   #--------------------------------------------------------------------------
  1040.   def gain_tp_kill_ally
  1041.     for member in friends_unit.alive_members
  1042.       next if member == self
  1043.       member.tp += eval(member.tp_setting(:kill_ally))
  1044.     end
  1045.   end
  1046.  
  1047.   #--------------------------------------------------------------------------
  1048.   # alias method: item_effect_add_state
  1049.   #--------------------------------------------------------------------------
  1050.   alias game_battler_item_effect_add_state_tpm item_effect_add_state
  1051.   def item_effect_add_state(user, item, effect)
  1052.     original_states = states.clone
  1053.     game_battler_item_effect_add_state_tpm(user, item, effect)
  1054.     return unless $game_party.in_battle
  1055.     if original_states != states && opponents_unit.members.include?(user)
  1056.       user.tp += eval(user.tp_setting(:deal_state))
  1057.       self.tp += eval(tp_setting(:gain_state))
  1058.     end
  1059.   end
  1060.  
  1061.   #--------------------------------------------------------------------------
  1062.   # alias method: item_apply
  1063.   #--------------------------------------------------------------------------
  1064.   alias game_battler_item_apply_tpm item_apply
  1065.   def item_apply(user, item)
  1066.     game_battler_item_apply_tpm(user, item)
  1067.     return unless $game_party.in_battle
  1068.     return if @result.hit?
  1069.     self.tp += eval(tp_setting(:evasion))
  1070.   end
  1071.  
  1072.   #--------------------------------------------------------------------------
  1073.   # alias method: item_test
  1074.   #--------------------------------------------------------------------------
  1075.   alias game_battler_item_test_tpm item_test
  1076.   def item_test(user, item)
  1077.     return false if item.for_dead_friend? != dead?
  1078.     return true if item.unlocked_tp_modes.size > 0
  1079.     return game_battler_item_test_tpm(user, item)
  1080.   end
  1081.  
  1082.   #--------------------------------------------------------------------------
  1083.   # alias method: item_user_effect
  1084.   #--------------------------------------------------------------------------
  1085.   alias game_battler_item_user_effect_tpm item_user_effect
  1086.   def item_user_effect(user, item)
  1087.     game_battler_item_user_effect_tpm(user, item)
  1088.     return unless actor?
  1089.     for mode in item.unlocked_tp_modes
  1090.       unlock_tp_mode(mode)
  1091.     end
  1092.   end
  1093.  
  1094. end # Game_Battler
  1095.  
  1096. #==============================================================================
  1097. # ■ Game_Actor
  1098. #==============================================================================
  1099.  
  1100. class Game_Actor < Game_Battler
  1101.  
  1102.   #--------------------------------------------------------------------------
  1103.   # alias method: setup
  1104.   #--------------------------------------------------------------------------
  1105.   alias game_actor_setup_tpm setup
  1106.   def setup(actor_id)
  1107.     game_actor_setup_tpm(actor_id)
  1108.     @tp_mode = actor.tp_mode
  1109.     @unlocked_tp_modes = actor.unlocked_tp_modes.clone
  1110.   end
  1111.  
  1112.   #--------------------------------------------------------------------------
  1113.   # new method: tp_mode
  1114.   #--------------------------------------------------------------------------
  1115.   def tp_mode
  1116.     @tp_mode = actor.tp_mode if @tp_mode.nil?
  1117.     return @tp_mode
  1118.   end
  1119.  
  1120.   #--------------------------------------------------------------------------
  1121.   # new method: unlocked_tp_modes
  1122.   #--------------------------------------------------------------------------
  1123.   def unlocked_tp_modes
  1124.     if @unlocked_tp_modes.empty?
  1125.       @unlocked_tp_modes = actor.unlocked_tp_modes.clone
  1126.     end
  1127.     return @unlocked_tp_modes.uniq
  1128.   end
  1129.  
  1130.   #--------------------------------------------------------------------------
  1131.   # new method: change_tp_mode
  1132.   #--------------------------------------------------------------------------
  1133.   def change_tp_mode(mode)
  1134.     @tp_mode = mode
  1135.     unlock_tp_mode(mode)
  1136.     self.tp = 0 if YEA::TP_MANAGER::CHANGE_TP_RESET
  1137.   end
  1138.  
  1139.   #--------------------------------------------------------------------------
  1140.   # new method: unlock_tp_mode
  1141.   #--------------------------------------------------------------------------
  1142.   def unlock_tp_mode(mode)
  1143.     if @unlocked_tp_modes.empty?
  1144.       @unlocked_tp_modes = actor.unlocked_tp_modes.clone
  1145.     end
  1146.     @unlocked_tp_modes.push(mode)
  1147.     @unlocked_tp_modes.uniq!
  1148.     @unlocked_tp_modes.sort!
  1149.   end
  1150.  
  1151.   #--------------------------------------------------------------------------
  1152.   # new method: remove_tp_mode
  1153.   #--------------------------------------------------------------------------
  1154.   def remove_tp_mode(mode)
  1155.     if @unlocked_tp_modes.empty?
  1156.       @unlocked_tp_modes = actor.unlocked_tp_modes.clone
  1157.     end
  1158.     @unlocked_tp_modes.delete(mode)
  1159.     @tp_mode = @unlocked_tp_modes[0] if @tp_mode == mode
  1160.   end
  1161.  
  1162.   #--------------------------------------------------------------------------
  1163.   # alias method: learn_skill
  1164.   #--------------------------------------------------------------------------
  1165.   alias game_actor_learn_skill_tpm learn_skill
  1166.   def learn_skill(skill_id)
  1167.     game_actor_learn_skill_tpm(skill_id)
  1168.     for mode in $data_skills[skill_id].learn_tp_modes
  1169.       unlock_tp_mode(mode)
  1170.     end
  1171.   end
  1172.  
  1173. end # Game_Actor
  1174.  
  1175. #==============================================================================
  1176. # ■ Game_Enemy
  1177. #==============================================================================
  1178.  
  1179. class Game_Enemy < Game_Battler
  1180.  
  1181.   #--------------------------------------------------------------------------
  1182.   # new method: tp_mode
  1183.   #--------------------------------------------------------------------------
  1184.   def tp_mode; return enemy.tp_mode; end
  1185.  
  1186. end # Game_Enemy
  1187.  
  1188. #==============================================================================
  1189. # ■ Game_Interpreter
  1190. #==============================================================================
  1191.  
  1192. class Game_Interpreter
  1193.  
  1194.   #--------------------------------------------------------------------------
  1195.   # new method: change_tp_mode
  1196.   #--------------------------------------------------------------------------
  1197.   def change_tp_mode(actor_id, mode)
  1198.     $game_actors[actor_id].change_tp_mode(mode)
  1199.   end
  1200.  
  1201.   #--------------------------------------------------------------------------
  1202.   # new method: unlock_tp_mode
  1203.   #--------------------------------------------------------------------------
  1204.   def unlock_tp_mode(actor_id, mode)
  1205.     $game_actors[actor_id].unlock_tp_mode(mode)
  1206.   end
  1207.  
  1208.   #--------------------------------------------------------------------------
  1209.   # new method: remove_tp_mode
  1210.   #--------------------------------------------------------------------------
  1211.   def remove_tp_mode(actor_id, mode)
  1212.     $game_actors[actor_id].remove_tp_mode(mode)
  1213.   end
  1214.  
  1215.   #--------------------------------------------------------------------------
  1216.   # new method: unlock_all_tp_modes
  1217.   #--------------------------------------------------------------------------
  1218.   def unlock_all_tp_modes(actor_id)
  1219.     for key in YEA::TP_MANAGER::TP_MODES
  1220.       $game_actors[actor_id].unlock_tp_mode(key[0])
  1221.     end
  1222.   end
  1223.  
  1224.   #--------------------------------------------------------------------------
  1225.   # new method: remove_all_tp_modes
  1226.   #--------------------------------------------------------------------------
  1227.   def remove_all_tp_modes(actor_id)
  1228.     for key in YEA::TP_MANAGER::TP_MODES
  1229.       next if key[0] == $data_actors[actor_id].tp_mode
  1230.       $game_actors[actor_id].remove_tp_mode(key[0])
  1231.     end
  1232.   end
  1233.  
  1234. end # Game_Interpreter
  1235.  
  1236. #==============================================================================
  1237. # ■ Window_SkillCommand
  1238. #==============================================================================
  1239.  
  1240. class Window_SkillCommand < Window_Command
  1241.  
  1242.   #--------------------------------------------------------------------------
  1243.   # alias method: make_command_list
  1244.   #--------------------------------------------------------------------------
  1245.   alias window_skillcommand_make_command_list_tpm make_command_list
  1246.   def make_command_list
  1247.     return unless @actor
  1248.     window_skillcommand_make_command_list_tpm
  1249.  
  1250.   end
  1251.  
  1252.   #--------------------------------------------------------------------------
  1253.   # new method: add_tp_modes
  1254.   #--------------------------------------------------------------------------
  1255.   def add_tp_modes
  1256.     return unless Switch.tp_mode
  1257.     add_command(YEA::TP_MANAGER::MENU_NAME, :tp_mode, true, :tp_mode)
  1258.   end
  1259.  
  1260. end # Window_SkillCommand
  1261.  
  1262. #==============================================================================
  1263. # ■ Window_SkillList
  1264. #==============================================================================
  1265.  
  1266. class Window_SkillList < Window_Selectable
  1267.  
  1268.   #--------------------------------------------------------------------------
  1269.   # new method: tp_mode?
  1270.   #--------------------------------------------------------------------------
  1271.   def tp_mode?; return @stype_id == :tp_mode; end
  1272.  
  1273.   #--------------------------------------------------------------------------
  1274.   # new method: tp_mode
  1275.   #--------------------------------------------------------------------------
  1276.   def tp_mode
  1277.     return nil unless tp_mode?
  1278.     return @data[index]
  1279.   end
  1280.  
  1281.   #--------------------------------------------------------------------------
  1282.   # alias method: make_item_list
  1283.   #--------------------------------------------------------------------------
  1284.   alias window_skilllist_make_item_list_tpm make_item_list
  1285.   def make_item_list
  1286.     if tp_mode?
  1287.       @data = @actor.unlocked_tp_modes
  1288.       @data.sort!
  1289.     else
  1290.       window_skilllist_make_item_list_tpm
  1291.     end
  1292.   end
  1293.  
  1294.   #--------------------------------------------------------------------------
  1295.   # alias method: draw_item
  1296.   #--------------------------------------------------------------------------
  1297.   alias window_skilllist_draw_item_tpm draw_item
  1298.   def draw_item(index)
  1299.     if tp_mode?
  1300.       draw_tp_mode_item(index)
  1301.     else
  1302.       window_skilllist_draw_item_tpm(index)
  1303.     end
  1304.   end
  1305.  
  1306.   #--------------------------------------------------------------------------
  1307.   # new method: draw_tp_mode_item
  1308.   #--------------------------------------------------------------------------
  1309.   def draw_tp_mode_item(index)
  1310.     tp_mode = @data[index]
  1311.     return unless YEA::TP_MANAGER::TP_MODES.include?(tp_mode)
  1312.     rect = item_rect(index)
  1313.     rect.width -= 4
  1314.     icon = YEA::TP_MANAGER::TP_MODES[tp_mode][:icon]
  1315.     draw_icon(icon, rect.x, rect.y)
  1316.     change_color(tp_mode_colour(tp_mode))
  1317.     name = YEA::TP_MANAGER::TP_MODES[tp_mode][:name]
  1318.     draw_text(rect.x+24, rect.y, rect.width-24, line_height, name)
  1319.   end
  1320.  
  1321.   #--------------------------------------------------------------------------
  1322.   # new method: tp_mode_colour
  1323.   #--------------------------------------------------------------------------
  1324.   def tp_mode_colour(mode)
  1325.     if @actor.tp_mode == mode
  1326.       return text_color(YEA::TP_MANAGER::EQUIPPED_COLOUR)
  1327.     else
  1328.       return normal_color
  1329.     end
  1330.   end
  1331.  
  1332.   #--------------------------------------------------------------------------
  1333.   # alias method: current_item_enabled?
  1334.   #--------------------------------------------------------------------------
  1335.   alias window_skilllist_current_item_enabled current_item_enabled?
  1336.   def current_item_enabled?
  1337.     if tp_mode?
  1338.       return @actor.tp_mode != @data[index]
  1339.     else
  1340.       return window_skilllist_current_item_enabled
  1341.     end
  1342.   end
  1343.  
  1344.   #--------------------------------------------------------------------------
  1345.   # alias method: update_help
  1346.   #--------------------------------------------------------------------------
  1347.   alias window_skilllist_update_help_tpm update_help
  1348.   def update_help
  1349.     if tp_mode?
  1350.       tp_mode = @data[index]
  1351.       if YEA::TP_MANAGER::TP_MODES.include?(tp_mode)
  1352.         text = YEA::TP_MANAGER::TP_MODES[tp_mode][:description]
  1353.       else
  1354.         text = ""
  1355.       end
  1356.       @help_window.set_text(text)
  1357.     else
  1358.       window_skilllist_update_help_tpm
  1359.     end
  1360.   end
  1361.  
  1362. end # Window_SkillList
  1363.  
  1364. #==============================================================================
  1365. # ■ Scene_Skill
  1366. #==============================================================================
  1367.  
  1368. class Scene_Skill < Scene_ItemBase
  1369.  
  1370.   #--------------------------------------------------------------------------
  1371.   # alias method: create_command_window
  1372.   #--------------------------------------------------------------------------
  1373.   alias scene_skill_create_command_window_tpm create_command_window
  1374.   def create_command_window
  1375.     scene_skill_create_command_window_tpm
  1376.     @command_window.set_handler(:tp_mode,    method(:command_skill))
  1377.   end
  1378.  
  1379.   #--------------------------------------------------------------------------
  1380.   # alias method: on_item_ok
  1381.   #--------------------------------------------------------------------------
  1382.   alias scene_skill_on_item_ok_tpm on_item_ok
  1383.   def on_item_ok
  1384.     if @item_window.tp_mode?
  1385.       Sound.play_equip
  1386.       user.change_tp_mode(@item_window.tp_mode)
  1387.       @status_window.refresh
  1388.       @item_window.refresh
  1389.       @item_window.activate
  1390.     else
  1391.       scene_skill_on_item_ok_tpm
  1392.     end
  1393.   end
  1394.  
  1395. end # Scene_Skill
  1396.  
  1397. #==============================================================================
  1398. #
  1399. # ▼ End of File
  1400. #
  1401. #==============================================================================

QQ图片2013.jpg (15.95 KB, 下载次数: 19)

QQ图片2013.jpg

作者: LBQ    时间: 2013-6-20 08:41
需要说的就是在Yanfly的TP Manager中没有写重新定义有关 set_item 的内容,所以说理论上不是这两个脚本冲突,重新新建个工程插入两个脚本重试一下可以吗
作者: Ayahiyano    时间: 2013-6-20 18:00
LBQ 发表于 2013-6-20 08:41
需要说的就是在Yanfly的TP Manager中没有写重新定义有关 set_item 的内容,所以说理论上不是这两个脚本冲突 ...

还是一样不行
作者: billyxiang123    时间: 2013-6-20 18:37
Ayahiyano 发表于 2013-6-20 18:00
还是一样不行

我用了这两个脚本,怎么没冲突?
作者: Ayahiyano    时间: 2013-6-20 20:14
billyxiang123 发表于 2013-6-20 18:37
我用了这两个脚本,怎么没冲突?

我一打开状态看性格就出现错误了
作者: 圆寂丨不羁的风    时间: 2013-6-21 00:34
Ayahiyano 发表于 2013-6-20 20:14
我一打开状态看性格就出现错误了

把完整脚本贴出来或者把整个用例上传上来。不然很难调试。
作者: 圆寂丨不羁的风    时间: 2013-6-23 03:25
Ayahiyano 发表于 2013-6-20 20:14
我一打开状态看性格就出现错误了

魂淡,性格那个插件的代码少了一截,找完整版的吧。(731行前后,datamager到RPG::enemy间少了RPG::actor)




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1