Hey folks,
So, I'm quite stumped about a specific state atm. It's a bleed state that has both a duration and state counters, and what I'm trying to do atm is to make it so when the enemy with the state dies, the character that applies the state gains TP. Here's the last iteration of the notetags I've tried:
However, neither the respond effect nor the deselect effect works when killed through an ability that deals damage the usual way. My first thought was that, because the target dies, it is no longer the target and/or the state is removed and so the respond and deselect effects do not trigger. I tested this by putting console.log(target) in both notetags and there was nothing on the console which I assume supports my theory of what's going on.
But here's where it gets confusing/interesting for me. While some of the abilities in my project deal damage through the usual way, some more complex ones deal their damage through script, using the gainHp function. And when I tested an ability that works through that function, the respond effect once again did not work. However, the deselect effect did. I tested with console.log(target) once again and the response effect wrote no target to the console when killed through gainHp function, but the deselect effect did. And this is where I'm quite confused.
As it stands, I can make the state work through the deselect effect IF the enemy is killed through the gainHp function. But I can't make it work at all if it is killed the usual way. And so, I'm here to see if anyone can elucidate me on what's going on here, and how I can actually make this work.
So, I'm quite stumped about a specific state atm. It's a bleed state that has both a duration and state counters, and what I'm trying to do atm is to make it so when the enemy with the state dies, the character that applies the state gains TP. Here's the last iteration of the notetags I've tried:
JavaScript:
<Reapply Ignore Turns>
<Custom Regenerate Effect>
var bleed = target.getStateCounter(56);
if (bleed >= target.hp) {
$gameActors.actor(4).gainTp(Math.floor(bleed / 2));
$gameActors.actor(4).startAnimation(160);
}
target.gainHp(-bleed);
target.startAnimation(155);
</Custom Regenerate Effect>
<Custom Respond Effect>
if (target.hp <= 0) {
$gameActors.actor(4).gainTp(target.getStateCounter(56) / 2);
$gameActors.actor(4).startAnimation(160);
}
</Custom Respond Effect>
<Custom Deselect Effect>
if (target.hp <= 0) {
$gameActors.actor(4).gainTp(target.getStateCounter(56) / 2);
$gameActors.actor(4).startAnimation(160);
}
</Custom Deselect Effect>
However, neither the respond effect nor the deselect effect works when killed through an ability that deals damage the usual way. My first thought was that, because the target dies, it is no longer the target and/or the state is removed and so the respond and deselect effects do not trigger. I tested this by putting console.log(target) in both notetags and there was nothing on the console which I assume supports my theory of what's going on.
But here's where it gets confusing/interesting for me. While some of the abilities in my project deal damage through the usual way, some more complex ones deal their damage through script, using the gainHp function. And when I tested an ability that works through that function, the respond effect once again did not work. However, the deselect effect did. I tested with console.log(target) once again and the response effect wrote no target to the console when killed through gainHp function, but the deselect effect did. And this is where I'm quite confused.
As it stands, I can make the state work through the deselect effect IF the enemy is killed through the gainHp function. But I can't make it work at all if it is killed the usual way. And so, I'm here to see if anyone can elucidate me on what's going on here, and how I can actually make this work.