Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Enable skill when state applied to enemy

Trumully

Cyborg Kiwi
I've replaced guard in my game with a skill called Obliterate. I want this skill to only be able to target enemies with a Staggered state and instantly kill them also regaining health (like the Glory Kill in DOOM 4).
I am currently using Yanfly's Auto Passive States to apply the Staggered state on enemies lower than 15% health and using Yanfly's Selection Control to only allow the Obliterate skill to target enemies with the Staggered state. I also want this skill to be greyed out if no enemy has the Staggered state.

However, I have run into a few problems:
  1. Enabling this skill when the Staggered state is applied to an enemy.
  2. Disabling this skill when there is no enemy with the Staggered state.
I must admit, I did tinker with troop events but I couldn't figure anything else. I'll keep tinkering but if there are any solutions you guys have, pray tell.
Thanks in advance.
 

IncPara

Villager
Xy$
0.00
Grabbed a bit of fancy code from Yanfly that makes the skill only allow Staggered enemies to be targeted.

Code:
<Custom Select Condition>
condition = target.isStateCategoryAffected('4');
</Custom Select Condition>
Just replace the "4" with whatever your Staggered is.

This doesn't enable or disable the skill, but it does affect what can be targeted by it, which I guess is the next best thing? You'll need the Target Core Yanfly script for this to work.

But beware! I'm pretty sure just replacing Guard without doing anything to the skill order will not allow you to select a target for the skill! When Obliterated is used with "1 Enemy" set as its target, it will target a random enemy without giving you the option to select. I'm pretty sure this can be circumvented just by using a plugin to change the skill order, but otherwise...



Fair word of warning, I don't always know what I'm doing. But I'm pretty sure this will work. Sorry if it doesn't! X3
 
Top