condition if an attack has a certain target scope?

crustyclarinet

Villager
Member
Joined
May 8, 2017
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm using yanfly's "single target provoke" state from one of their tips and tricks videos, which uses the following code:

Code:
<Custom Action Start Effect>
// Get current action.
var action = user.currentAction();
// Check if action exists, for an opponent, and that the provoker isn't on the same team
if (action && action.isForOpponent() && origin.isActor() !== user.isActor()) {
  action.setTarget(origin.index());
}
</Custom Action Start Effect>
However, if an enemy under the effect of the "Provoked" state uses a move meant to hit all targets on the opposing side, that move will only hit the actor that provoked it. Is there any way to check if an action has a certain scope?

(this is my second lunatic mode-related question, apologies. surely there's gotta be a list of all these java conditions somewhere...)
 

shockra

Slightly Crazy Programmer
Veteran
Joined
Feb 16, 2016
Messages
444
Reaction score
208
First Language
English
Primarily Uses
RMMV
Try this:

action.isForAll();

This code is to check if the action is meant to hit all enemies (or allies, depending on what you're going for).
 

crustyclarinet

Villager
Member
Joined
May 8, 2017
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
it turns out that yanfly's original code does bypass area-of-effect attacks, and that the test skill i had the enemy use was set to "1 enemy" the whole time, and that i am also very, very stupid. thanks for this code though, it'll probably be useful to me in the future.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top