This script allows you to add "feature conditions" to any objects that hold
features. These conditions are used to control whether the features from an
object are applied to your actor or not.
For example, suppose you have shield equips that have special elemental
immunities when the "guard" state is applied. You can add these features to
the shield and then use feature conditions to indicate that the "guard" state
must be applied before the features are transferred.
All feature conditions must be met in order for the features to be applied.
If no feature conditions are specified, then the features are applied by
default.
Note that feature conditions are applied to all features in an object and
currently cannot be applied to specific features within an object.
Download
Get it at
Hime Works!
Installation
Place this script below Materials and above Main
Usage
To add a feature condition, use the notetag for any objects with features, such as Actors, Classes, Weapons, Armors, Enemies, or States. If you are using my Feature Manager, then it will be applied to skills and items as well.
<feature condition>FORMULA</feature condition>For any valid ruby formula that returns true or false. Three variables are available for your convenience:
a - subject the feature applies tos - game switchesv - game variablesBy "subject" I refer to "actor" or "enemy". For example, a state can be applied
to both actors or enemies, so if the enemy has the state, then that enemy is
the subject. If the actor has the state, then that actor is the subject. Be
careful when writing your formulas.
Examples
Here are some quick examples of some conditions you might have
* Party has more than 5000 gold
$game_party.gold > 5000* Actor's level is between 20 and 40 (inclusively), if the subject is an actor
a.actor? && a.level => 20 && a.level <= 40* State 23 is applied
Code:
本贴来自国际rpgmaker官方论坛作者:Tsukihime处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/feature-conditions.15444/