As per the title. I'm trying to modify the Tips&Tricks entry (from here) to work as a passive and also to function with death from any source. For context, a phoenix-type summon has this ability; if it dies from anything (damaged, slip damage, during its own action as a result of an unrelated debuff state) it has a 20% chance to revive itself with a small amount of HP. Currently, this is what I have:
This will result in the battle freezing after it has died of slip damage or enemy attacks; I don't know if it was designed to work as a passive state or not, and I can see the Post-Regenerate part causing issues eventually (it is only supposed to gain a chance of revival upon death, not to keep checking every turn if it is still dead). Attempts to do it with VS Auto Skill Triggers (the Auto Trigger: Death note tag) result in no HP being restored and both animations constantly playing.
Trying to put the same code above (but with an actor ID check) in an On Add State within the Death state (I think) froze up the battle, too.
I haven't checked whether doing it through troop pages works or not, though, but I want to see if there is a better way of tying it to the passive state - pages are still limited after all, I think.
Could anyone help with accomplishing this? 😅
JavaScript:
<JS Post-Apply As User>
if (user.hp <= 0 || user.isDead()) {
if (Math.random() < 0.2) {
$gameTemp.requestAnimation([user], 364);
const rate = 0.25;
const heal = Math.floor(user.mhp * rate);
user.gainHp(heal);
user.startDamagePopup();
} else {
$gameTemp.requestAnimation([user], 365);
}
}
</JS Post-Apply As User>
<JS Post-Apply As Target>
if (user.hp <= 0 || user.isDead()) {
if (Math.random() < 0.2) {
$gameTemp.requestAnimation([user], 364);
const rate = 0.25;
const heal = Math.floor(user.mhp * rate);
user.gainHp(heal);
user.startDamagePopup();
} else {
$gameTemp.requestAnimation([user], 365);
}
}
</JS Post-Apply As Target>
<JS Post-Regenerate>
if (user.hp <= 0 || user.isDead()) {
if (Math.random() < 0.2) {
$gameTemp.requestAnimation([user], 364);
const rate = 0.25;
const heal = Math.floor(user.mhp * rate);
user.gainHp(heal);
user.startDamagePopup();
} else {
$gameTemp.requestAnimation([user], 365);
}
}
</JS Post-Regenerate>
This will result in the battle freezing after it has died of slip damage or enemy attacks; I don't know if it was designed to work as a passive state or not, and I can see the Post-Regenerate part causing issues eventually (it is only supposed to gain a chance of revival upon death, not to keep checking every turn if it is still dead). Attempts to do it with VS Auto Skill Triggers (the Auto Trigger: Death note tag) result in no HP being restored and both animations constantly playing.
Trying to put the same code above (but with an actor ID check) in an On Add State within the Death state (I think) froze up the battle, too.
I haven't checked whether doing it through troop pages works or not, though, but I want to see if there is a better way of tying it to the passive state - pages are still limited after all, I think.
Could anyone help with accomplishing this? 😅