Auto-Life is a tips a tricks video that requires 3 different plugins
http://yanfly.moe/2016/05/28/tips-tricks-auto-life-rpg-maker-mv/
Here are the pugins:
Battle engine core
http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
buffs and states core
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
State Categories
http://yanfly.moe/2016/04/03/yep-89-state-categories/
Yanfly's Absorbtion Barrier
http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/
Here is the code suggested to make auto-life work which goes into the notetag of a state.
<Category: Bypass Death Removal>
<Custom Deselect Effect>
// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Play the auto-life animation on target.
target.startAnimation(49);
// Set the amount of HP recovered to 10%.
var rate = 0.10;
// Calculate the HP healed.
var heal = Math.floor(target.mhp * rate);
// Remove the Auto-Life state.
target.removeState(stateId);
// Heal the target.
target.gainHp(heal);
// Make the damage popup show for the heal.
target.startDamagePopup();
// Clear the target's results.
target.clearResult();
}
</Custom Deselect Effect>
If possible, I'd like to adjust this code to for use with 2 different skills. If anyone knows a better way I can do either of these 2 skills, please let me know.
I would like auto life to work in conjunction with absorbtion barrier. For the actor to come back to life with 1 hp and then with an absorbtion barrier of variable amount. I am able to adjust the code for the 1 hp part, but I am struggling to add the barrier.
Since the absorbtion plugin requires it's own notetag code
<custom target barrier>
value = target.mhp*0.1
</custom target barrier>
I am not sure if it's possible to add code within code like this. I tested adding the barrier code before the </Custom Deselect Effect> part of the auto-life code, but that doesn't work.
Secondly, I would like to turn the code into a 'final attack' instead of bringing the actor back to life. Which seems like it should be simple, make it do damage instead of heal?, but it's not working. Here is what I tried.
<Category: Bypass Death Removal>
<Custom Deselect Effect>
var rand = this.opponentsUnit().randomTarget();
// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Remove the Auto-Life state.
target.removeState(123);
// Heal the target.
rand.gainHp(-500);
rand.startDamagePopup();
// Clear the target's results.
target.clearResult();
}
</Custom Deselect Effect>
Thanks in advance for any help
Edit: After some testing, it looks like my 'final attack' attempt is doing damage to random party member. I am still not sure how to fix it, though.
http://yanfly.moe/2016/05/28/tips-tricks-auto-life-rpg-maker-mv/
Here are the pugins:
Battle engine core
http://yanfly.moe/2015/10/10/yep-3-battle-engine-core/
buffs and states core
http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
State Categories
http://yanfly.moe/2016/04/03/yep-89-state-categories/
Yanfly's Absorbtion Barrier
http://yanfly.moe/2016/02/13/yep-70-absorption-barrier-rpg-maker-mv/
Here is the code suggested to make auto-life work which goes into the notetag of a state.
<Category: Bypass Death Removal>
<Custom Deselect Effect>
// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Play the auto-life animation on target.
target.startAnimation(49);
// Set the amount of HP recovered to 10%.
var rate = 0.10;
// Calculate the HP healed.
var heal = Math.floor(target.mhp * rate);
// Remove the Auto-Life state.
target.removeState(stateId);
// Heal the target.
target.gainHp(heal);
// Make the damage popup show for the heal.
target.startDamagePopup();
// Clear the target's results.
target.clearResult();
}
</Custom Deselect Effect>
If possible, I'd like to adjust this code to for use with 2 different skills. If anyone knows a better way I can do either of these 2 skills, please let me know.
I would like auto life to work in conjunction with absorbtion barrier. For the actor to come back to life with 1 hp and then with an absorbtion barrier of variable amount. I am able to adjust the code for the 1 hp part, but I am struggling to add the barrier.
Since the absorbtion plugin requires it's own notetag code
<custom target barrier>
value = target.mhp*0.1
</custom target barrier>
I am not sure if it's possible to add code within code like this. I tested adding the barrier code before the </Custom Deselect Effect> part of the auto-life code, but that doesn't work.
Secondly, I would like to turn the code into a 'final attack' instead of bringing the actor back to life. Which seems like it should be simple, make it do damage instead of heal?, but it's not working. Here is what I tried.
<Category: Bypass Death Removal>
<Custom Deselect Effect>
var rand = this.opponentsUnit().randomTarget();
// Check if the target's HP is 0 or is currently in the death state.
if (target.hp <= 0 || target.isDead()) {
// Remove the Auto-Life state.
target.removeState(123);
// Heal the target.
rand.gainHp(-500);
rand.startDamagePopup();
// Clear the target's results.
target.clearResult();
}
</Custom Deselect Effect>
Thanks in advance for any help
Edit: After some testing, it looks like my 'final attack' attempt is doing damage to random party member. I am still not sure how to fix it, though.