RMMZ Need help making a skill that affects enemies based on them having specific states

JadeTheurgist

Regular
Regular
Joined
Apr 19, 2020
Messages
37
Reaction score
4
First Language
English
Primarily Uses
RMMZ
I'm trying to make a series of skills that each perform a different effect based on whether the enemies are inflicted with a particular state. For those curious, I'm drawing inspiration from the Fortuner class from 7th Dragon III: Code VDF, specifically their Oracle skills. What I'm trying to accomplish is where the effects of the used skill will only take effect if a targeted enemy has the specified state(s). For example, a skill that will drain health only if the enemy is affected by an ailment that has a DoT effect (ie. Poison, Bleed, etc.) and if an enemy doesn't have those effects, it does nothing.

My problem comes into play when trying to get the skill to either only target or only apply its effects to the proper targets. I first tried using the <JS Targets> notetag from Visustella's Battle Core with something like this:

JavaScript:
<JS Targets>
//Make array for ailments to be checked for
var ailments = [27, 32, 35, 53];
//Make empty array for possible targets
var currTargets = [];
//Check all enemies for Damaging states
for(var i = 0; i < targets.length; ++i){
  for(var j = 0; i < ailments.length; ++j){
    var currAilment = ailments[j];
    if(targets[i].isStateAffected(currAilment)){
      currTargets.push(targets[i]);
    }
  }
}
targets = currTargets;
</JS Targets>

However upon testing, using the skill caused the playtest to freeze up and the only way to close the window was to either hit the close button and wait several minutes or close it via Task Manager.

I then figured I could make an Action Sequence that would cycle through all the enemies and check for the states on each one. Unfortunately, I don't know how to do that with Action Sequences and my attempt resulted in the effect either only applying to the first enemy in the troop's list, or applying to all based on the first enemy's status.

If anyone who knows Javascript better than me or has made something similar to this idea themselves could help me see what I'm doing wrong, I'd greatly appreciate it.
 

Latest Threads

Latest Profile Posts

Me: "Who the heck would play a game with no stakes, no enemies, and all you do is raise and breed bees?"
Later after playing it. - "Holy crap, I didn't know it was 1:30. Where'd my time go?"
The site is being slow and funky again. IS SOMEONE CRAFTING POEMS?!
So yeah, @TRIDIUM @TESTOSTERONE, I wuz like, "What do they mean by borderline and boundaries?"

And then, y'all know this girl?

actress1.png

alice_bikini.png

The clothes? They're just a, um, quick edit. :kaoswt:
I've uploaded the opening cutscene from my game to my channel. It basically introduces us to the first three characters, and what their relationships are:
Cosmic Inferno: Opening dialogue
I don't want to start a panic...but everyone, check the color of your milk!
IMG_20231002_082329.jpg

Forum statistics

Threads
135,021
Messages
1,253,018
Members
177,951
Latest member
DarkKing
Top