I'm wondering if there is a way to make a skill that, when used on targets, instantly defeats them if their HP is under a certain percentage (for example, if the target is under 30% HP). Is there any way to do this?
An attack that K.O.s all targets under a certain percentage of health
RPG Maker MV SupportYes.
Just to elaborate...I think the easiest way to do this is with a plugin such as Yanfly's Skill Core.
You can put the following notetag on the skill:
You can put the following notetag on the skill:
Code:
<Post-Damage Eval>
if (target.hpRate()<=.3)
{
target.addState(1);
target.performCollapse();
}
</Post-Damage Eval>
Admittedly, I've felt some hesitation towards using Yanfly's and some other plugins, mostly due to me feeling unsure of how to give credit to the creators of said plugins within the game. I remember taking a look at at a plugin that I think had Yanfly's name on it, but I think I couldn't find where it might've mentioned crediting.
Don't get me wrong, there are a lot of plugins I've seen that I'd love to use and give credit for, and I'm absolutely willing to do so if I'm just missing something obvious in how to credit.
Most people don't some kind of special rules about giving credit...you create a credits screen in your game, or a text file in the base directory, and put their name in it. That's giving credit. There's not any kind of detailed process.
But every major plugin author I know of has a clearly labeled Terms of Use page on their Web site. If they don't have a Web site, the terms are in the forum thread where they posted the plugin.
As I said, however, those rarely have instructions on crediting.
If you really don't wanna use plugins, you can do it in the damage formula
Replace
Code:
b.hpRate() < 0.3 ? 9999 : a.atk - b.def
Replace
a.atk - b.def with whatever formula you want to use if the HP was NOT below 30% HP. 9999 is a high number that should instantly kill anyone, you may need to adjust it depending on your game.Thank you. I guess I guessed right when it comes to the "me not getting the obvious things", but I will absolutely keep all of this in mind for the future.
Thank you for this- I will try this to see if it works, though based on your description of it I do feel safe assuming it will.
Original thread: https://forums.rpgmakerweb.com/threads/an-attack-that-k-o-s-all-targets-under-a-certain-percentage-of-health.162506/