Hello, everyone!
As the title says, I have certain problems with that skill made by Yanfly. "Death nova" works like this: if a character that has the death nova state dies, it immediately damages and poisons all the enemies. So you have to create a death nova state that bypasses death, then paste a code into the k.o. state that will damage and poison the enemies if the dying unit has the death nova state. This is the code that goes into the k.o. state:
<Custom Apply Effect>
var deathNovaId = 271;
if (target.isDead() && target.isStateAffected(deathNovaId)) {
var poisonId = 37;
var caster = target.stateOrigin(deathNovaId);
var dmg = caster.mat * 6;
var foes = target.opponentsUnit().aliveMembers();
for (var i = 0; i < foes.length; ++i) {
var foe = foes;
if (foe) {
foe.gainHp(-dmg);
foe.addState(poisonId);
foe.startDamagePopup();
if (foe.isDead()) {
foe.performCollapse();
}
foe.clearResult();
}
}
target.startAnimation(109);
target.removeState(deathNovaId);
}
</Custom Apply Effect>
Obviously I edited the fields that checks the "death nova" state and applies the poison to the enemies. The problem is that after the unit with the death nova state dies, nothing happens. The state bypasses death, so there problem occurs when trying to target the enemies.
This ability is made by using three different plugins; battle engine core, buffs & states core and state categories. (All of those plugins are working as intended, so that's not causing my problem.)
Thanks for reading!
As the title says, I have certain problems with that skill made by Yanfly. "Death nova" works like this: if a character that has the death nova state dies, it immediately damages and poisons all the enemies. So you have to create a death nova state that bypasses death, then paste a code into the k.o. state that will damage and poison the enemies if the dying unit has the death nova state. This is the code that goes into the k.o. state:
<Custom Apply Effect>
var deathNovaId = 271;
if (target.isDead() && target.isStateAffected(deathNovaId)) {
var poisonId = 37;
var caster = target.stateOrigin(deathNovaId);
var dmg = caster.mat * 6;
var foes = target.opponentsUnit().aliveMembers();
for (var i = 0; i < foes.length; ++i) {
var foe = foes;
if (foe) {
foe.gainHp(-dmg);
foe.addState(poisonId);
foe.startDamagePopup();
if (foe.isDead()) {
foe.performCollapse();
}
foe.clearResult();
}
}
target.startAnimation(109);
target.removeState(deathNovaId);
}
</Custom Apply Effect>
Obviously I edited the fields that checks the "death nova" state and applies the poison to the enemies. The problem is that after the unit with the death nova state dies, nothing happens. The state bypasses death, so there problem occurs when trying to target the enemies.
This ability is made by using three different plugins; battle engine core, buffs & states core and state categories. (All of those plugins are working as intended, so that's not causing my problem.)
Thanks for reading!