Sturdy (Pokemon)

Just curious, is there someway to replicate the Pokemon ability sturdy using Yanfly's Passive States Plugin (or any combinations of his plugins)?


For those that don't know, story essentially means if you are at MAX HP, you cannot be reduced below 1 HP in a single blow. If someone makes multiple attacks against you in a single attack, that will still result in your death.


ADDITIONALLY:


I am also curious to know if there is someway to extend the duration of Immortality by a round or 2 when used under specific circumstances. For example, how would I make a Racial Passive Ability that increased magical healing by 50% and extended the duration of the Immortal Status by 2 rounds?


Can it be done?
I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.
I've moved this thread to Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.



I didn't know if it was a plugin or if it could be done in the builder or if it was an evening thing or what. Which is what I was asking. No one is going to make a yanfly compatible plugin for me for sturdy out of the kindness of their heart. lol
I may have slightly misread and thought you were requesting for a plugin/plugins that would do the job. However, your whole question revolves around how to accomplish it with plugins and not how to do it without a plugin, so it should either be here or plugin support.


Even asking for existing plugins is something that would go in plugin requests. However, you never know, depending on the complexity of this, there are people who may be willing to do it for you.


I'm going to leave this here at the moment and see how the topic develops before moving it. If it turns out there are ways to do with eventing, it can be moved back.
Truthfully, I dont care where the topic goes at the end of the day... or even how its done... I just have certain mechanics I want to be able to implement and do not know how to do so. ^_^
Just curious, is there someway to replicate the Pokemon ability sturdy using Yanfly's Passive States Plugin (or any combinations of his plugins)?


For those that don't know, story essentially means if you are at MAX HP, you cannot be reduced below 1 HP in a single blow. If someone makes multiple attacks against you in a single attack, that will still result in your death.





 






2



You need Yanfly Buff & States Core and Yanlfy Auto-Passive States for this code to work, It's based on Yanfly Second Chance Tips & Trick video, I just altered some things.


<Custom React Effect>
// Check to see if the party is in battle.
if ($gameParty.inBattle()) {
// Sets the flag if the target has all of his/her HP at the time of death.
target._Sturdy = target.hp === target.mhp;
}
</Custom React Effect>

<Custom Respond Effect>
// Check to see if the party is in battle, has the Sturdy flag, and if the target is dead with 0 HP.
if ($gameParty.inBattle() && target._Sturdy && target.hp <= 0) {
// Play the revival animation, this can be delete without repercutions
target.startAnimation(49);
// Set the target's HP to 1.
target.setHp(1);
}
</Custom Respond Effect>


The second can be done easily using this code in a skill that targets someone already affected by immortal. Thinking that Immortal is the default one(State ID 3 in the database)


<State 3 Turns: +1>


or +2 depending on what you want.


If you want to make a passive that increases healing then you can use this code in the state note tag.


<Custom Confirm Effect>
// Check if the action heals HP.
if (this.isHpEffect() && value < 0) {
// Then increase the healing to 150%.
value = Math.ceil(value * 1.50);
} else {
}
</Custom Confirm Effect>


This will make it.
A simplier version would be something like l made in my games for bosses phases, expect l reduced it to 1%


You can add target.removeState(X) whereever you want.


Regenerate are for DoTs if you have any.


<Custom Respond Effect>


var hprate = (target.hp / target.mhp);


if (hprate < 0.01) {


target.setHp(Math.floor(target.mhp * 0.01))


}


</Custom Respond Effect>


<Custom Regenerate Effect>


var hprate = (target.hp / target.mhp);


if (hprate < 0.01) {


target.setHp(Math.floor(target.mhp * 0.01))


}


</Custom Regenerate Effect>


1 life instead of 1% life


<Custom Respond Effect>


var hprate = (target.hp);


if (hprate <= 1) {


target.setHp(1)


}


</Custom Respond Effect>


<Custom Regenerate Effect>


var hprate = (target.hp);


if (hprate <= 1) {


target.setHp(1)


}


</Custom Regenerate Effect>
You need Yanfly Buff & States Core and Yanlfy Auto-Passive States for this code to work, It's based on Yanfly Second Chance Tips & Trick video, I just altered some things.



This is exactly what I needed, thank you Emelian -- now my question is (its going to seem silly) but how do I set the flag or whatever?


Is it like, a state I apply or what?
@Diogonse the code sets the flag automatically as long as the party is in battle. So you don,t actually need to worry about it.
But will this apply to every Actor/Battler?


Because I actually only want it to apply to an Actor if they have acquired a specific passive skill?
But will this apply to every Actor/Battler?


Because I actually only want it to apply to an Actor if they have acquired a specific passive skill?

 Only if they have the state as passive.
Thank you so much mate, you're a champ. I really appreciate you taking the time to help.

Original thread: https://forums.rpgmakerweb.com/threads/sturdy-pokemon.72522/