Skill Conditions

Hi everyone!


So, this seems like it's got to be way easier than I think, but I can't seem to figure out how to do it. I have a skill that I only want to have a success rate if the enemy is at, let's say, 25% health.


Think Sailor Moon's "Moon Healing Escalation" or something like that. It does no damage, but certain enemies are automatically affected by a "rage"-esque state at the beginning of battle, and the character's goal is to heal them (also there are neat drops involved yay) with this skill, but it can only be done when they are weakened. Is there anyone who knows how to make this happen?


Thanks in advance! 🙂
That should be done in the damage formula, however after a quick search I couldn't find the proper syntax for if b.hp is <25%, you may want to ask this in the damage formula thread.
Okay, thanks for the tip! I don't know much about how the damage formula thing works, so I'll take a look at some videos before diving into the damage formula thread.Thank you!
Perhaps you can try:


(b.hpRate() <= 0.25) ? (formula if true); : (formula if false);
Ah! It's working! Thank you tons, it's just what I wanted! 😀


Right now, when it works, it just says "0" since it does no damage - which makes perfect sense, but I'd rather it say "failed" or something like that. Would I put JS in the notes to change that, or is there definitely a plug-in I can find that would let me do that?
Not sure how to control pop-up texts though. D:
Ah no worries! I'll figure it out eventually lol.
Use something like this on the skill notebox

Code:
<hit formula>
 if (b .hpRate() <= 0.25) {
     result = 100;
 } else {
     result = 0;
 }
</hit formula>

The skill will miss automatically if the condition is not met, and hit if the condition is met.
Ah, that's fantastic!


I have a bit of debugging to do now because the battle doesn't seem to ever end (enemy doesn't die yikes), but I don't know if that's because of what I put in the notebox or not. It is most likely just something that I screwed up eventing.


Thank you guys for all your help, I appreciate it! 😀


Update: the bug is not because of the notebox (you guys probably already knew that 😉  ). The "knockout" state just refuses to kick in on my enemy if I have the player use the skill through a force action in battle. Otherwise it works perfectly. So, my initial question was solved! You guys are great!

Original thread: https://forums.rpgmakerweb.com/threads/skill-conditions.59742/