Template:Skills and States Core Passive States Clarification

From Yanfly.moe Wiki
Jump to navigation Jump to search

---

For those using the code "a.isStateAffected(10)" to check if a target is affected by a state or not, this does NOT check passive states. This only checks for states that were directly applied to the target.

This is NOT a bug.

Instead, use "a.states().includes($dataStates[10])" to check for them. This code will search for both directly applied states and passive states alike.

---

As passive states are NOT considered directly applied to, they do NOT match a Conditional Branch's state check as well. The Conditional Branch effect checks for an affected state.

---

Because passive states are NOT directly applied to a battler, the functions of "addNewState", "addState", "eraseState", "removeState" do NOT apply to passive states either. This means that any of the related JS notetags tied to those functions will not occur either.

---

Why are passive states not considered affected by? Let's look at it differently. There are two ways to grant skills to actors. They can acquire skills by levels/items/events or they can equip gear that temporarily grants the skill in question.

Learning the skill is direct. Temporarily granting the skill is indirect. These two factors have mechanical importance and require differentiation.

Regular states and passive states are the same way. Regular states are directly applied, therefore, need to be distinguished in order for things like state turns and steps, removal conditionals, and similar to matter at all. Passive states are indirect and are therefore, unaffected by state turns, steps, and removal conditions. These mechanical differences are important for how RPG Maker works.

---

Once again, it is NOT a bug that when using "a.isStateAffected(10)" to check if a target has a passive state will return false.

---