YEP.136 – Item Requirements – RPG Maker MV
Introduction
This plugin requires YEP_ItemCore. Make sure this plugin is located under YEP_ItemCore in the plugin list.
这个插件需要 YEP_ItemCore.确保这个插件在 YEP_ItemCore列表下面
In RPG Maker MV, items only have a few restrictions on them by default, whether or not they can be used in or out of battle or never. There aren’t any other conditions that you can set that would otherwise determine if an item can or cannot be used. This plugin gives more ways to restrict item usage based on switches, variables, the actors using them, classes, state requirements, and more.
在RMMV里面,物品通常只有简单的限制来决定它们是否可以在战斗中使用,并没有其他可以自定义的情况来决定它们。因此,这个插件会提供给你物品使用的更多限制,例如开关、变量、职业等等
Notetags
Use the following notetags to enforce requirements for items before they can be used.
使用下面的备注栏来设置物品能否使用
Item Notetags:
<Enable Requirements>
condition
condition
</Enable Requirements>
– Replace ‘condition’ with the desired condition setup. You can insert any number of conditions inside the notetags. All of the conditions must be met before the item can be used. Look below for a list of the possible conditions that can be used.
你只需要设置condition为你需要的限制条件即可,下面是限制条件可使用的命令列表
Conditions:
Eval: code
– Replace ‘code’ with JavaScript code that you’d like to run a check against to enable the item. If the check returns false, the item will be disabled regardless of other conditions.
设置某变量是否和指定数值或文本相同
Examples:
Eval: $gameActors.actor(1).name() === ‘Harold’
Eval: $gameActors.leader().name() !== ‘Ralph’
Actor: x
Actor: x, x, x
– Requires actor(s) ID ‘x’ to use the item. If the actor isn’t the one using the said item, then the item is disabled and cannot be used regardless of other conditions.
设置可以使用的角色
Not Actor: x
Not Actor: x, x, x
– Requires the actor using the item to NOT be actor ID ‘x’. If the actor’s ID matches one of the listed ‘x’, then the item is disabled and cannot be used regardless of other conditions.
设置不可以使用的角色
Examples:
Actor: 1
Actor: 2, 3, 4, 5, 6
Not Actor: 7
Not Actor: 8, 9, 10
Armor: x
Armor: x, x, x
– Requires the actor to specifically have armor ID ‘x’ equipped to use the item. If multiple ‘x’ are used, the actor can have any of them equipped. If the actor does not have armor ‘x’ equipped, then the item is disabled and cannot be used regardless of other conditions.
装备指定护甲时可以使用
Not Armor: x
Not Armor: x, x, x
– Requires the actor to not have armor ID ‘x’ equipped to use the item. If multiple ‘x’ are used, the actor cannot have any of them equipped. If the actor does have armor ‘x’ equipped, then the item is disabled and cannot be used regardless of other conditions.
装备指定护甲时不可以使用
Examples:
Armor: 1
Armor: 2, 3, 4, 5, 6
Not Armor: 7
Not Armor: 8, 9, 10
Class: x
Class: x, x, x
– Requires class(es) ID ‘x’ to use the item. If the actor’s class doesn’t match the item requirement, then the item is disabled and cannot be used regardless of other conditions.
指定职业可以使用
Not Class: x
Not Class: x, x, x
– Requires the actor using the item to NOT be class ID ‘x’. If the actor’s class ID matches one of the listed ‘x’, then the item is disabled and cannot be used regardless of other conditions.
指定职业不可以使用
Examples:
Class: 1
Class: 2, 3, 4, 5, 6
Not Class: 7
Not Class: 8, 9, 10
Subclass: x
Subclass: x, x, x
– Requires YEP_X_Subclass.js
– Requires subclass(es) ID ‘x’ to use the item. If the actor’s class doesn’t match the item requirement, then the item is disabled and cannot be used regardless of other conditions.
需要YEP_X_Subclass插件支持
指定副职业可以使用
Not Subclass: x
Not Subclass: x, x, x
– Requires YEP_X_Subclass.js
– Requires the actor using the item to NOT be subclass ID ‘x’. If the actor’s subclass ID matches one of the listed ‘x’, then the item is disabled and cannot be used regardless of other conditions.
需要YEP_X_Subclass插件支持
指定副职业不可以使用
Examples:
Subclass: 1
Subclass: 2, 3, 4, 5, 6
Not Subclass: 7
Not Subclass: 8, 9, 10
Either Class: x
Either Class: x, x, x
– Requires YEP_X_Subclass.js
– The actor’s primary class or subclass ID has to match ‘x’. If at least one of them match, then the condition passes. Otherwise, the condition fails and the item is disabled and cannot be used regardless of other conditions.
需要YEP_X_Subclass插件支持
主职业或副职业满足一个即可使用
Neither Class: x
Neither Class: x, x, x
– Requires YEP_X_Subclass.js
– Requires YEP_X_Subclass.js
– The actor’s primary class or subclass ID has to NOT match ‘x’. If at least one of them match, then the condition fails and the item is disabled and cannot be used regardless of other conditions.
需要YEP_X_Subclass插件支持
主职业或副职业都不满足才可使用
Examples:
Either Class: 1
Either Class: 2, 3, 4, 5, 6
Neither Class: 7
Neither Class: 8, 9, 10
State: x
State: x, x, x
– Requires the actor using the item to be affected by state ‘x’. If multiple ‘x’ are used, the actor can be affected by any of them. If the actor is not affected by state ‘x’, then the condition fails and the item is disabled and cannot be used regardless of other conditions.
存在指定状态时可以使用
Not State: x
Not State: x, x, x
– Requires the actor using the item to be not affected by state ‘x’. If multiple ‘x’ are used, the actor cannot be affected by any of them. If the actor is not affected by state ‘x’, then the condition fails and the item is disabled and cannot be used regardless of other conditions.
存在指定状态时不可以使用
Examples:
State: 10
State: 11, 12, 13, 14, 15
Not State: 16
Not Stage: 17, 18, 19, 20
Switch Off: x
Switch Off: x, x, x
– Requires switch(es) x to be OFF before the item can be used. If the switch is ON, then the item is disabled and cannot be used regardless of other conditions.
指定开关关闭时才可以使用
Examples:
Switch Off: 1
Switch Off: 2, 3, 4, 5, 6
Switch On: x
Switch On: x, x, x
– Requires switch(es) x to be ON before the item can be used. If the switch is OFF, then the item is disabled and cannot be used regardless of other conditions.
指定开关关闭时才可以使用
Examples:
Switch On: 1
Switch On: 2, 3, 4, 5, 6
Variable x eval
– Makes a check against variable x. Replace ‘x’ with an integer value and ‘eval’ with the code check you wish to run it against.
指定变量满足条件是可以使用
Examples:
Variable 1 >= 5
Variable 2 < 6
Variable 3 === 7
Variable 4 !== 8
Weapon: x
Weapon: x, x, x
– Requires the actor to specifically have weapon ID ‘x’ equipped to use the item. If multiple ‘x’ are used, the actor can have any of them equipped. If the actor does not have weapon ‘x’ equipped, then the item is disabled and cannot be used regardless of other conditions.
装备指定武器时可以使用
Not Weapon: x
Not Weapon: x, x, x
– Requires the actor to not have weapon ID ‘x’ equipped to use the item. If multiple ‘x’ are used, the actor cannot have any of them equipped. If the actor does have weapon ‘x’ equipped, then the item is disabled and cannot be used regardless of other conditions.
装备指定武器时不可以使用
Examples:
Weapon: 1
Weapon: 2, 3, 4, 5, 6
Not Weapon: 7
Not Weapon: 8, 9, 10
Weapon Type: x
Weapon Type: x, x, x
– Requires the actor to have weapon type ‘x’ equipped. If multiple ‘x’ are used, the actor can have any of the ‘x’ weapon types equipped. If the actor does not have the matching weapon types, then the item is disabled and cannot be used regardless of other conditions.
装备指定武器类型时可以使用
Not Weapon Type: x
Not Weapon Type: x, x, x
– Requires the actor to not have weapon type ‘x’ equipped. If multiple ‘x’ are used, the actor cannot have any of the ‘x’ weapon types equipped. If the actor does have the matching weapon types, then the item is disabled and cannot be used regardless of other conditions.
装备指定武器类型时不可以使用
Examples:
Weapon Type: 1
Weapon Type: 2, 3, 4, 5, 6
Not Weapon Type: 7
Not Weapon Type: 8, 9, 10
Lunatic Mode – Custom Enable Requirements
For those with JavaScript experience, you can create your own custom requirements for whether or not items can be used using the following notetag setup:
对于熟练使用JS语言的人,你可以编程实现自己的需求
Item Notetags:
<Custom Enable Requirement>
condition = battler.level >= item.price;
</Custom Enable Requirement>
– The ‘condition’ variable will determine whether or not the item will be enabled/disabled. If the ‘condition’ variable returns true, then the item is enabled provided all other conditions (if any) are also met. Otherwise, the item is disabled and cannot be used. The ‘battler’ variable will refer to the battler using the item. The ‘item’ variable will refer to the item being checked.