Checking if an actor used an attack action before hit confirmation

Fugama

Means well, but messes up sometimes.
Veteran
Joined
Jun 7, 2014
Messages
158
Reaction score
90
First Language
Fake English
Primarily Uses
RMMV
So as per the usual I'm using Yanfly's Battle engine including buffs and states, skill core, etc. If there a way I can check if something is making an attack before it determines hit/miss on a buff? I decided to recreate Jhin's passive from League of legends for fun, got everything working but I'd really like to make it so a missed hit still costs a bullet. Here's the code I've thrown together 

Code:
<custom apply effect>
// set ammo
target._ammo = 4;
// display counter
target.setStateCounter(19, target._ammo);
</custom apply effect>

<custom remove effect>
// reset ammo value
target._ammo = undefined;
// reset state counter
target.setStateCounter(19, 0);
</custom remove effect>

<Custom Confirm Effect>
// Check if affected battler is attacking
if (this.isHpEffect() && value > 0) {
// if so, deduct the ammo count
	user._ammo -= 1;
// also update the counter
	user.setStateCounter(19, user._ammo);  
}
// check if that was the last bullet
if (user._ammo === 0) {
// set up the new value	
var change = (value * 2);
//apply the new value
value = change;
	
}
</Custom Confirm Effect>

<Custom Conclude Effect>
//check if out of ammo
if (user._ammo === 0){
// if so remove the buff
	user.removeState(19);
}
</Custom Conclude Effect>
 

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

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