I need some help...
How do I auto revive entire party when all of the party member dies?
I need some help with the code.
I am using a state on all the party members. Not sure if I am doing this correctly
I am using Yanfly plugins.
The code below, had some problems when i am testing it
- I think AOE/Certain Hit Attacks would not trigger the auto revive
- Some situation cause the one of the party member to get revive and then receive the damage later. This could not fully heal that member.
How do I auto revive entire party when all of the party member dies?
I need some help with the code.
I am using a state on all the party members. Not sure if I am doing this correctly
I am using Yanfly plugins.
The code below, had some problems when i am testing it
- I think AOE/Certain Hit Attacks would not trigger the auto revive
- Some situation cause the one of the party member to get revive and then receive the damage later. This could not fully heal that member.
Code:
<Category: Bypass Death Removal>
<Custom Deselect Effect>
var members = $gameParty.members();
if(target.friendsUnit().aliveMembers().length<=1){
if (target.hp <= 0 || target.isDead()){
for (var i = 0; i < members.length; ++i) {
var member = members[i];
member.startAnimation(49);
var heal = Math.floor(member.mhp );
var healmp = Math.floor(member.mmp);
member.gainHp(heal);
member.gainMp(healmp);
member.startDamagePopup();
member.clearResult();
}
}
}
</Custom Deselect Effect>