RPG Maker Forums

http://yanfly.moe/2015/10/17/yep-13-auto-passive-states/


I'm trying to add a passive state to a hero that increases his attack when there are more enemies. I know I need to use a conditional state, but I don't know how to code it.


So, if I want to create a passive state that doubles his attack when there are two enemies, I would use this actor notetag:

<Passive State: x> 


where x is the state ID. Then, I would add conditional js to the state notetag. This is the example code from Yanfly's website:

<Custom Passive Condition>
if (user.hp / user.mhp <= 0.25) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>


What do I change "user.hp / user.mhp <= 0.25" to in order to have the code check the number of enemies, returning true if it equals 2?

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,048
Messages
1,018,545
Members
137,834
Latest member
EverNoir
Top