- 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:
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.
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.