查看: 1810|回复: 2

[已经解决] 如何使一些装备可以增减tp上限?

[复制链接]
梦石
0
星屑
10510
在线时间
1118 小时
注册时间
2015-2-10
回帖
164
发表于 2020-8-31 11:59:02 | 显示全部楼层 |阅读模式
悬赏50星屑未解决
tp上限默认是100,虽然可以在脚本里直接修改上限,但我想制作的是可以增减tp上限的装备,这需要用到别的脚本了吧?本人脚本盲,完全不懂啊。请大佬们帮忙解决一下。

梦石
0
星屑
30103
在线时间
5741 小时
注册时间
2016-3-8
回帖
1662
发表于 2020-8-31 13:01:51 | 显示全部楼层
本帖最后由 alexncf125 于 2020-9-1 10:45 编辑

先插入Hime的Feature Manager和Max TP
http://himeworks.com/2012/10/feature-manager/
https://www.rpgmakercentral.com/topic/7649-max-tp/

之后在装备的备注栏写上
<ft: max_tp x>

P.S. 我没实际测试过, 不知是不是你要的效果, 也不知 x 能不能是负数

  1. =begin
  2. #===============================================================================
  3. ** Feature Manager
  4. Author: Hime
  5. Date: Oct 3, 2013
  6. --------------------------------------------------------------------------------
  7. ** Change log
  8. 2.0 Oct 3, 2013
  9.    - implemented the extended regex for feature note-tags
  10. 1.32 Nov 18, 2012
  11.    - added convenience wrapper for data elements
  12. 1.31 Nov 9, 2012
  13.    - fixed bug where item features didn't have conditions
  14. 1.3 Nov 8, 2012
  15.    - Added conditional features.
  16.    - Aliased default features for use with conditional features
  17. Oct 22, 2012
  18.    - No longer overwrites any methods
  19. Oct 21, 2012
  20.    - features_value_set should return set of values, not data_id's
  21. Oct 18, 2012
  22.    - added item_feature_set to collect all features for a given item
  23. Oct 14, 2012
  24.    - added max/min feature value collection
  25. Oct 13, 2012
  26.    - added some feature collection to check features of specific item
  27.    - re-wrote `equippable?` to do negative-checking
  28. Oct 12, 2012
  29.    - initial release
  30. --------------------------------------------------------------------------------  
  31. ** Terms of Use
  32. * Free to use in non-commercial projects
  33. * Contact me for commercial use
  34. * No real support. The script is provided as-is
  35. * Will do bug fixes, but no compatibility patches
  36. * Features may be requested but no guarantees, especially if it is non-trivial
  37. * Preserve this header
  38. --------------------------------------------------------------------------------
  39. ** Compatibility

  40. This script does not overwrite any methods and aliases one method.
  41. Most features should not have conflicts with the following systems

  42. -Tankentai SBS
  43. -Yanfly Ace Battle Engine
  44. --------------------------------------------------------------------------------
  45. ** Description

  46. This is a plugin-based feature system that allows you to define your own
  47. features easily and add them to database objects.

  48. Register a feature using an idstring to identify your feature. Recommended
  49. strings or symbols, but anything hashable is valid.

  50. You will use the idstring throughout your script, such as in notetags
  51. and also initializing the feature (optional).

  52. If your script will be using params, xparams, or sparams, you should use
  53. standard data ID's that the rest of the script uses. These are defined in
  54. the tables below.

  55. You should use data ID 0 for weapons, 1 for armors, and 2 for items.
  56. --------------------------------------------------------------------------------
  57. ** Usage

  58. To add a feature to a feature object, simply note-tag with a feature tag.
  59. The general syntax for a feature tag is

  60.     <ft: name arg1 arg2 ... >
  61.    
  62. Where
  63.    `name` is the name of the feature you wish to add
  64.    `arg1 arg2 ...` are a list of arguments that the plugin requires
  65.    
  66. You may specify conditional features as well, using the following note-tag

  67.     <cond_ft: name "cond" arg1 arg2 ... >
  68.    
  69. Where
  70.    `cond` is a ruby expression that evaluates to true or false. The condition
  71.           must be surrounded by quotation marks.
  72.          
  73. Conditional features can be applied to any feature that is supported by this
  74. system.

  75. If you need more control over the note-tag, you can use the extended note-tag

  76.    <ft: FEATURE_NAME>
  77.      option1: value1
  78.      option2: value2
  79.      ...
  80.    </ft>
  81.    
  82. You can define any option name that you want. All options will be passed to
  83. your `add_feature` method as a hash, where the keys are the option names and
  84. the values are the corresponding values. For example, the above example
  85. would create a hash that looks like

  86.    {
  87.      :option1 => value1,
  88.      :option2 => value2
  89.    }
  90.    
  91. Which you can then use to grab values.
  92. To work with your extended note-tag, you need to define the following method
  93. in BaseItem or its child classes:

  94.    def add_feature_FEATURE_NAME_ext(code, data_id, args)
  95.      
  96.      # do something with your args
  97.      value = ...
  98.      add_feature(code, data_id, value)
  99.    end

  100. #===============================================================================
  101. =end
  102. $imported = {} if $imported.nil?
  103. $imported["Feature_Manager"] = 2.0
  104. #===============================================================================
  105. # ** Rest of the script
  106. #===============================================================================
  107. module FeatureManager

  108.   # Format for all note tags
  109.   Feature_Regex = /<ft: (\w+)(.*)>/i
  110.   Cond_Feature_Regex = /<cond_ft: (\w+) ['"](.*)['"](.*)>/i
  111.   
  112.   Ext_Regex = /<feature: (\w+)>(.*?)<\/feature>/im
  113.   
  114.   # Default features.
  115.   FEATURE_ELEMENT_RATE  = 11              # Element Rate
  116.   FEATURE_DEBUFF_RATE   = 12              # Debuff Rate
  117.   FEATURE_STATE_RATE    = 13              # State Rate
  118.   FEATURE_STATE_RESIST  = 14              # State Resist
  119.   FEATURE_PARAM         = 21              # Parameter
  120.   FEATURE_XPARAM        = 22              # Ex-Parameter
  121.   FEATURE_SPARAM        = 23              # Sp-Parameter
  122.   FEATURE_ATK_ELEMENT   = 31              # Atk Element
  123.   FEATURE_ATK_STATE     = 32              # Atk State
  124.   FEATURE_ATK_SPEED     = 33              # Atk Speed
  125.   FEATURE_ATK_TIMES     = 34              # Atk Times+
  126.   FEATURE_STYPE_ADD     = 41              # Add Skill Type
  127.   FEATURE_STYPE_SEAL    = 42              # Disable Skill Type
  128.   FEATURE_SKILL_ADD     = 43              # Add Skill
  129.   FEATURE_SKILL_SEAL    = 44              # Disable Skill
  130.   FEATURE_EQUIP_WTYPE   = 51              # Equip Weapon
  131.   FEATURE_EQUIP_ATYPE   = 52              # Equip Armor
  132.   FEATURE_EQUIP_FIX     = 53              # Lock Equip
  133.   FEATURE_EQUIP_SEAL    = 54              # Seal Equip
  134.   FEATURE_SLOT_TYPE     = 55              # Slot Type
  135.   FEATURE_ACTION_PLUS   = 61              # Action Times+
  136.   FEATURE_SPECIAL_FLAG  = 62              # Special Flag
  137.   FEATURE_COLLAPSE_TYPE = 63              # Collapse Effect
  138.   FEATURE_PARTY_ABILITY = 64              # Party Ability
  139.   
  140.   # Data ID's for consistency with the rest of the scripts
  141.   Weapon_ID = 0
  142.   Armor_ID = 1
  143.   Item_ID = 2
  144.   
  145.   # Data ID's for basic parameters. Use this if you are going to
  146.   # use params in note tags
  147.   Param_Table = {
  148.     "mhp" => 0,
  149.     "mmp" => 1,
  150.     "atk" => 2,
  151.     "def" => 3,
  152.     "mat" => 4,
  153.     "mdf" => 5,
  154.     "agi" => 6,
  155.     "luk" => 7
  156.   }
  157.    
  158.   # Data ID's for extra parameters.
  159.   XParam_Table = {
  160.     "hit" => 0,
  161.     "eva" => 1,
  162.     "cri" => 2,
  163.     "cev" => 3,
  164.     "mev" => 4,
  165.     "mrf" => 5,
  166.     "cnt" => 6,
  167.     "hrg" => 7,
  168.     "mrg" => 8,
  169.     "trg" => 9
  170.   }
  171.   
  172.   # Data ID's for special parameters
  173.   SParam_Table = {
  174.     "tgr" => 0,
  175.     "grd" => 1,
  176.     "rec" => 2,
  177.     "pha" => 3,
  178.     "mcr" => 4,
  179.     "tcr" => 5,
  180.     "pdr" => 6,
  181.     "mdr" => 7,
  182.     "fdr" => 8,
  183.     "exr" => 9,
  184.   }
  185.   
  186.   def self.register(idstring, api_version=1.0)
  187.     idstring = idstring.to_s
  188.     key = idstring.to_sym
  189.     if $imported["Feature_Manager"] < api_version
  190.       outdated_api_warn(idstring, api_version)
  191.     elsif @feature_table.include?(key)
  192.       dupe_entry_warn(key, @feature_table[key])
  193.     else
  194.       @feature_table[key] = idstring
  195.     end
  196.   end
  197.   
  198.   def self.api_version(version)
  199.    
  200.   end
  201.   
  202.   # Each feature maps to a code, which is stored in the feature.
  203.   # It should be a symbol. Notice that this table is only used for
  204.   # mapping and is never referenced after an object has been setup.
  205.   def self.initialize_tables
  206.     @feature_table = {
  207.       FEATURE_ELEMENT_RATE  => 11,              # Element Rate
  208.       FEATURE_DEBUFF_RATE   => 12,              # Debuff Rate
  209.       FEATURE_STATE_RATE    => 13,              # State Rate
  210.       FEATURE_STATE_RESIST  => 14,              # State Resist
  211.       FEATURE_PARAM         => 21,              # Parameter
  212.       FEATURE_XPARAM        => 22,              # Ex-Parameter
  213.       FEATURE_SPARAM        => 23,              # Sp-Parameter
  214.       FEATURE_ATK_ELEMENT   => 31,              # Atk Element
  215.       FEATURE_ATK_STATE     => 32,              # Atk State
  216.       FEATURE_ATK_SPEED     => 33,              # Atk Speed
  217.       FEATURE_ATK_TIMES     => 34,              # Atk Times+
  218.       FEATURE_STYPE_ADD     => 41,              # Add Skill Type
  219.       FEATURE_STYPE_SEAL    => 42,              # Disable Skill Type
  220.       FEATURE_SKILL_ADD     => 43,              # Add Skill
  221.       FEATURE_SKILL_SEAL    => 44,              # Disable Skill
  222.       FEATURE_EQUIP_WTYPE   => 51,              # Equip Weapon
  223.       FEATURE_EQUIP_ATYPE   => 52,              # Equip Armor
  224.       FEATURE_EQUIP_FIX     => 53,              # Lock Equip
  225.       FEATURE_EQUIP_SEAL    => 54,              # Seal Equip
  226.       FEATURE_SLOT_TYPE     => 55,              # Slot Type
  227.       FEATURE_ACTION_PLUS   => 61,              # Action Times+
  228.       FEATURE_SPECIAL_FLAG  => 62,              # Special Flag
  229.       FEATURE_COLLAPSE_TYPE => 63,              # Collapse Effect
  230.       FEATURE_PARTY_ABILITY => 64,              # Party Ability
  231.       
  232.       # Aliasing the above features with custom names to support conditionals
  233.       :element_rate         => "element_rate",
  234.       :debuff_rate          => "debuff_rate",
  235.       :state_rate           => "state_rate",
  236.       :state_resist         => "state_resist",
  237.       :param                => "param",
  238.       :xparam               => "xparam",
  239.       :sparam               => "sparam",
  240.       :atk_element          => "atk_element",
  241.       :atk_state            => "atk_state",
  242.       :atk_speed            => "atk_speed",
  243.       :atk_times            => "atk_times",
  244.       :stype_add            => "stype_add",
  245.       :stype_seal           => "stype_seal",
  246.       :skill_add            => "skill_add",
  247.       :skill_seal           => "skill_seal",
  248.       :equip_wtype          => "equip_wtype",
  249.       :equip_atype          => "equip_atype",
  250.       :equip_fix            => "equip_fix",
  251.       :equip_seal           => "equip_seal",
  252.       :slot_type            => "slot_type",
  253.       :action_plus          => "action_plus",
  254.       :special_flag         => "special_flag",
  255.       :collapse_type        => "collapse_type",
  256.       :party_ability        => "party_ability"
  257.     }
  258.    
  259.     @element_tables = {}
  260.    
  261.   end
  262.   
  263.   # Returns the feature code for the particular string.
  264.   def self.get_feature_code(sym)
  265.     @feature_table[sym]
  266.   end
  267.   
  268.   def self.dupe_entry_warn(your_id, existing_name)
  269.     msgbox("Warning: %s has already been reserved" %[existing_name.to_s])
  270.   end
  271.   
  272.   def self.outdated_api_warn(idstring, version)
  273.     msgbox("Warning: `%s` feature requires version %.2f of the script" %[idstring, version])
  274.   end
  275.   
  276.   def self.feature_table
  277.     @feature_table
  278.   end
  279.   
  280.   # Table of elements, mapped to their ID's.
  281.   def self.element_table
  282.     return @element_table unless @element_table.nil?
  283.     @element_table = {}
  284.     $data_system.elements.each_with_index {|element, i|
  285.       next if element.empty?
  286.       @element_table[element.downcase] = i
  287.     }
  288.     return @element_table
  289.   end
  290.   
  291.   # start things up
  292.   initialize_tables
  293. end

  294. module RPG
  295.   
  296.   class BaseItem::Feature
  297.     attr_accessor :condition
  298.   end

  299.   class BaseItem
  300.     def features
  301.       load_notetag_feature_manager unless @feature_checked
  302.       return @features
  303.     end
  304.    
  305.     # Go through each line looking for custom features. Note that the data id
  306.     # is currently hardcoded to 0 since we don't really need it.
  307.     def load_notetag_feature_manager
  308.       @feature_checked = true
  309.       
  310.       #check for features
  311.       results = self.note.scan(FeatureManager::Feature_Regex)
  312.       results.each { |code, args|
  313.         code = FeatureManager.get_feature_code(code.to_sym)
  314.         if code
  315.           check_feature(code, args)
  316.         end
  317.       }
  318.       
  319.       # check for conditional features
  320.       results = self.note.scan(FeatureManager::Cond_Feature_Regex)
  321.       results.each {|code, cond, args|
  322.         code = FeatureManager.get_feature_code(code.to_sym)
  323.         if code
  324.           check_feature(code, args)
  325.           @features[-1].condition = cond
  326.         end
  327.       }
  328.       
  329.       # check for features using extended regex.
  330.       results = self.note.scan(FeatureManager::Ext_Regex)
  331.       results.each do |res|
  332.         args = {}
  333.         code = FeatureManager.get_feature_code(res[0].to_sym)
  334.         if code
  335.           data = res[1].strip.split("\r\n")
  336.           data.each do |option|
  337.             name, value = option.split(":")
  338.             args[name.strip.to_sym] = value.strip
  339.           end
  340.           check_feature_ext(code, args)
  341.         end
  342.       end
  343.     end
  344.    
  345.     def check_feature(code, args)
  346.       ft_code = code.is_a?(Fixnum) ? code : code.to_sym
  347.       if respond_to?("add_feature_#{code}")
  348.         send("add_feature_#{code}", ft_code, 0, args.split)
  349.       else
  350.         add_feature(ft_code, 0, args.split)
  351.       end
  352.     end
  353.    
  354.     def check_feature_ext(code, args)
  355.       ft_code = code.is_a?(Fixnum) ? code : code.to_sym
  356.       if respond_to?("add_feature_#{code}_ext")
  357.         send("add_feature_#{code}_ext", ft_code, 0, args)
  358.       else
  359.         add_feature(ft_code, 0, args)
  360.       end
  361.     end
  362.    
  363.     def add_feature(code, data_id, args)
  364.       @features.push(RPG::BaseItem::Feature.new(code, data_id, args))
  365.     end
  366.    
  367.     # Register default features. Redundant, but the editor hardcodes values
  368.     # so we must do the same
  369.    
  370.     # Args: element name (case-sensitive) or ID, float percentage
  371.     def add_feature_element_rate(code, data_id, args)
  372.       data_id = Integer(args[0]) rescue $data_system.elements.index(args[0])
  373.       add_feature(11, data_id, args[1].to_f)
  374.     end
  375.    
  376.     # Args: param name, float percentage
  377.     def add_feature_debuff_rate(code, data_id, args)
  378.       data_id = FeatureManager::Param_Table[args[0].downcase]
  379.       add_feature(12, data_id, args[1].to_f)
  380.     end
  381.    
  382.     # Args: state ID, float percentage
  383.     def add_feature_state_rate(code, data_id, args)
  384.       data_id = Integer(args[0])
  385.       add_feature(13, data_id, args[1].to_f)
  386.     end
  387.    
  388.     # Args: state ID, float percentage
  389.     def add_feature_state_resist(code, data_id, args)
  390.       data_id = Integer(args[0])
  391.       add_feature(14, data_id, args[1].to_f)
  392.     end
  393.    
  394.     # Args: param name, float percentage
  395.     def add_feature_param(code, data_id, args)
  396.       data_id = FeatureManager::Param_Table[args[0].downcase]
  397.       add_feature(21, data_id, args[1].to_f)
  398.     end
  399.    
  400.     # Args: sparam name, float percentage
  401.     def add_feature_xparam(code, data_id, args)
  402.       data_id = FeatureManager::XParam_Table[args[0].downcase]
  403.       add_feature(22, data_id, args[1].to_f)
  404.     end
  405.    
  406.     # Args: xparam name, float percentage
  407.     def add_feature_sparam(code, data_id, args)
  408.       data_id = FeatureManager::SParam_Table[args[0].downcase]
  409.       add_feature(23, data_id, args[1].to_f)
  410.     end
  411.    
  412.     # Args: param name, float percentage
  413.     def add_feature_atk_element(code, data_id, args)
  414.       data_id = Integer(args[0]) rescue $data_system.elements.index(args[0])
  415.       add_feature(31, data_id, args[1].to_f)
  416.     end
  417.    
  418.     # Args: state ID, float percentage
  419.     def add_feature_atk_state(code, data_id, args)
  420.       data_id = Integer(args[0])
  421.       add_feature(32, data_id, args[1].to_f)
  422.     end
  423.    
  424.     # Args: float attack speed
  425.     def add_feature_atk_speed(code, data_id, args)
  426.       add_feature(33, 0, args[1].to_f)
  427.     end

  428.     # Args: float attack times
  429.     def add_feature_atk_times(code, data_id, args)
  430.       add_feature(34, 0, args[1].to_f)
  431.     end
  432.    
  433.     # Args: stype ID or name
  434.     def add_feature_stype_add(code, data_id, args)
  435.       data_id = Integer(args[0]) rescue $data_system.skill_types.index(args[0])
  436.       add_feature(41, data_id, 0)
  437.     end
  438.    
  439.     def add_feature_stype_seal(code, data_id, args)
  440.       data_id = Integer(args[0]) rescue $data_system.skill_types.index(args[0])
  441.       add_feature(42, data_id, 0.0)
  442.     end
  443.       
  444.     def add_feature_skill_add(code, data_id, args)
  445.       add_feature(43, args[0].to_i, 0.0)
  446.     end
  447.    
  448.     def add_feature_skill_seal(code, data_id, args)
  449.       add_feature(44, args[0].to_i, 0.0)
  450.     end
  451.    
  452.     def add_feature_equip_wtype(code, data_id, args)
  453.       data_id = Integer(args[0]) rescue $data_system.weapon_types.index(args[0])
  454.       add_feature(51, data_id, 0)
  455.     end
  456.    
  457.     def add_feature_equip_atype(code, data_id, args)
  458.       data_id = Integer(args[0]) rescue $data_system.armor_types.index(args[0])
  459.       add_feature(52, data_id, 0)
  460.     end
  461.    
  462.     # args: etype_id
  463.     def add_feature_equip_fix(code, data_id, args)
  464.       add_feature(53, args[0].to_i, 0)
  465.     end
  466.    
  467.     # args: etype_id
  468.     def add_feature_equip_seal(code, data_id, args)
  469.       add_feature(54, args[0].to_i, 0)
  470.     end
  471.    
  472.     # args: slot type (1 for dual wield)
  473.     def add_feature_slot_type(code, data_id, args)
  474.       add_feature(55, args[0].to_i, 0)
  475.     end
  476.    
  477.     def add_feature_action_plus(code, data_id, args)
  478.       add_feature(61, 0, args[0].to_f)
  479.     end
  480.    
  481.     # args: flag_ID
  482.     def add_feature_special_flag(code, data_id, args)
  483.       add_feature(62, args[0].to_i, 0)
  484.     end
  485.    
  486.     # args: collapse type ID
  487.     def add_feature_collapse_type(code, data_id, args)
  488.       add_feature(63, args[0].to_i, 0)
  489.     end
  490.    
  491.     # args: party ability ID
  492.     def add_feature_party_ability(code, data_id, args)
  493.       add_feature(64, args[0].to_i, 0)
  494.     end
  495.   end
  496. end

  497. class Game_BattlerBase
  498.   
  499.   #-----------------------------------------------------------------------------
  500.   # * Feature collection methods
  501.   #-----------------------------------------------------------------------------
  502.   
  503.   def eval_feature_condition(condition, a, v=$game_variables, s=$game_switches)
  504.     eval(condition) rescue false
  505.   end
  506.   
  507.   def feature_condition_met?(ft)
  508.     return true unless ft.condition
  509.     eval_feature_condition(ft.condition, self)
  510.   end
  511.   
  512.   # May be inefficient since this method is called all the time
  513.   alias :th_feature_manager_all_features :all_features
  514.   def all_features
  515.     th_feature_manager_all_features.select {|ft| feature_condition_met?(ft)}
  516.   end
  517.   
  518.   # Returns features for item filtered by code
  519.   def item_features(item, code)
  520.     item.features.select {|ft| ft.code == code && feature_condition_met?(ft)}
  521.   end
  522.   
  523.   # Returns a set of all values for the given feature code
  524.   def features_value_set(code)
  525.     features(code).inject([]) {|r, ft| r |= [ft.value] }
  526.   end
  527.   
  528.   # Returns a set of all values for the given feature code, filtered by data ID
  529.   def features_value_set_with_id(code, data_id)
  530.     features_with_id(code, data_id).inject([]) {|r, ft| r |= [ft.value]}
  531.   end
  532.   
  533.   # Returns features for item filtered by code and data ID
  534.   def item_features_with_id(item, code, data_id)
  535.     item.features.select {|ft| ft.code == code && ft.data_id == data_id}
  536.   end
  537.   
  538.   def item_features_set(item, code, data_id)
  539.     item_features_with_id(item, code, data_id).inject([]) {|r, ft| r |= [ft.value]}
  540.   end
  541.   
  542.   # Returns sum of all features for item, by code and data ID
  543.   def item_features_sum(item, code, data_id)
  544.     item_features_with_id(item, code, data_id).inject(0.0) {|r, ft| r += ft.value }
  545.   end
  546.   
  547.   # Returns the max value for the code
  548.   def features_max(code)
  549.     features(code).collect {|ft| ft.value}.max
  550.   end
  551.   
  552.   # Returns the max value for the code, filtered by ID
  553.   def features_max_with_id(code, data_id)
  554.     features_with_id(code, data_id).collect {|ft| ft.value}.max
  555.   end
  556.   
  557.   # Returns the min value for the given code
  558.   def features_min(code)
  559.     features(code).collect {|ft| ft.value}.min
  560.   end
  561.   
  562.   # Returns the min value for the given code, filtered by ID
  563.   def features_min_with_id(code, data_id)
  564.     features_with_id(code, data_id).collect {|ft| ft.value}.min
  565.   end
  566.   
  567.   # Returns the max value of features for item, filtered by code and ID
  568.   def item_features_max(item, code, data_id)
  569.     item_features_with_id(item, code, data_id).collect {|ft| ft.value}.max
  570.   end
  571.   
  572.   # Returns the min value of features for item, filtered by code and ID
  573.   def item_features_min(item, code, data_id)
  574.     item_features_with_id(item, code, data_id).collect {|ft| ft.value}.min
  575.   end
  576.   #-----------------------------------------------------------------------------
  577.   # * Equip conditions
  578.   #-----------------------------------------------------------------------------
  579.   
  580.   alias :feature_manager_equippable? :equippable?
  581.   def equippable?(item)
  582.     return false unless feature_manager_equippable?(item)
  583.     return false if item.is_a?(RPG::Weapon) && !feature_equip_weapon_ok?(item)
  584.     return false if item.is_a?(RPG::Armor) && !feature_equip_armor_ok?(item)
  585.     return true
  586.   end
  587.    
  588.   def feature_equip_weapon_ok?(item)
  589.     return true
  590.   end
  591.   
  592.   def feature_equip_armor_ok?(item)
  593.     return true
  594.   end
  595. end

  596. class Game_Party
  597.   attr_accessor :actors
  598. end
复制代码
  1. =begin
  2. #==============================================================================
  3. ** Feature: Max TP
  4. Author: Hime
  5. Date: Oct 13, 2012
  6. ------------------------------------------------------------------------------
  7. ** Change log
  8. Oct 13, 2012
  9.    - initial release
  10. ------------------------------------------------------------------------------   
  11. ** Terms of Use
  12. * Free to use in non-commercial projects
  13. * Contact me for commercial use
  14. * No real support. The script is provided as-is
  15. * Will do bug fixes, but no compatibility patches
  16. * Features may be requested but no guarantees, especially if it is non-trivial
  17. * Preserve this header
  18. ------------------------------------------------------------------------------
  19. ** Required
  20. -Feature Manager
  21. ([url]http://xtsukihime.com/2012/10/13/feature-manager/[/url])

  22. -Core: Damage Processing
  23. ([url]http://xtsukihime.com/2012/10/13/core-damage-processing/[/url])
  24. ------------------------------------------------------------------------------
  25. Increases your max TP by some value

  26. Tag objects with
  27.     <ft: max_tp x>
  28.    
  29. For some integer x. Your max TP will be increased by x.
  30. #==============================================================================
  31. =end
  32. $imported = {} if $imported.nil?
  33. $imported["Feature_MaxTP"] = true
  34. #==============================================================================
  35. # ** Rest of the script
  36. #==============================================================================
  37. module Features
  38.   module Max_TP
  39.     FeatureManager.register(:max_tp)
  40.   end
  41. end

  42. class RPG::BaseItem
  43.   
  44.   def add_feature_max_tp(code, data_id, args)
  45.     data_id = 0
  46.     value = args[0].to_i
  47.     add_feature(code, data_id, value)
  48.   end
  49. end

  50. class Game_BattlerBase
  51.   
  52.   def tp_rate
  53.     #@tp.to_f / 100
  54.     max_tp > 0 ? @tp.to_f / max_tp : 0
  55.   end
  56.   
  57.   alias :ft_max_tp_max :max_tp
  58.   def max_tp
  59.     return [ft_max_tp_max + features_sum(:max_tp, 0), 0].max
  60.   end
  61. end
复制代码
回复

使用道具 举报

梦石
0
星屑
10510
在线时间
1118 小时
注册时间
2015-2-10
回帖
164
 楼主| 发表于 2020-9-1 09:11:15 | 显示全部楼层
alexncf125 发表于 2020-8-31 13:01
先插入Hime的Feature Manager和Max TP
http://himeworks.com/2012/10/feature-manager/
https://www.rpgmak ...

这两个网页我打不开啊。
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部