Reaction skills

Is there a way to have the healer character heal a teammate as a reaction to the teammate taking damage? Or perhaps react when the teammate hits half HP or such?

Along the same lines, is there a way I can have someone counter attack in response to an ally being harmed?
I can think of 3 different ways to do the healing thing that will all pose slightly different results, but all would be interesting in their own right.

Method 1: Have the healer auto-heal anyone who is guarding. Have the guard skill call a common event, the common event will check the guarding character's HP level is below 50%, and also if the healer is in the party, then force the healing action.

Method 2: Apply the above common event to EVERY action possible. This would guarantee that it happens whenever you're below 50%, but also you could tie it to an acessory. Check if the auto-heal accessory is equipped and then do the action.

Method 3: Do the following in every troop.
heal example.png


For the Revenge attacks, you can have enemy attacks apply a hidden State (Call it revenge or something) then have a common event run in the enemy troop events that checks if a character has Revenge applied, Force an attack, then remove the state from the character after. You can also make it so you have like a 50% chance or 25% chance or something, I can elaborate more if needed, but it shouldn't be too hard to figure out.
Say, those are all great suggestions! Thank you so much! I'll have to try them out! 😀
Do the following in every troop.
more to the point, you can wrap all potential "do this for every troop" under a common event.... checks and validations included.
and with that, the way to make that the correct way, would be to take that construct and move it over to the code, to be run automatically, as part of the battle system.

find out how to optimize the "do for every troop" first, and then we'll take it from there.
because "for every troop" means *for every troop*, and you'll have to copy-paste them manually and configure them manually every time.
Here is my setup so far. I have a common event that memorizes the location of the player and which slot in the formation a given party member is. (I made this common event long ago and it has many uses)

1693269759897.png


I can use those variables for a number of things, but for this topic, I am using them for the counter-heal.

The test battle seems to work fine, but there are some problems. First, here is what I have in the troop event:

1693270000426.png


And finally, here is what I have in the Counterheal common event:

1693270034316.png


The variable "Tim Reactiveheal" is just to acknowledge that he has reactive healing unlocked and currently at level 1 (you can improve it with talent points and such). That part works perfectly. He won't reactively heal if he hasn't unlocked reactive healing.

Now... the healer heals the correct character, but ignores the battle event condition ("Emerald is at 70% HP or less"), healing obsessively even at the start of battle and on everyone's turn. It doesn't matter if I have the condition set to "Battle", "Turn" or "Moment"

I do have a couple of battle scripts;
-YanPac Battle HUD (but it is just Pacman having taken the hud part of Yanfly's Ace Battle System, so I don't see how that would effect it?)
-Level Up System by Imyooni. He custom made this script for me. It shows a level-up screen with a randomly chosen quote, sound, and a graphic shown. Again, not sure how that would effect a battle event condition.

Any suggestions on how to make this work appreciated.

EDIT: I found a solution to the problem. I have a state called "got hit" that all enemy attacks will apply to their target. It lasts 1 round, and the common event checks for if the character has that state. Seems to work and the healer only reactively heals ONCE per character per round. While this still means he is able to heal up to 3 times in a single round, I did purposefully make the reactive heal very weak.

That said, I am still very interested in gstv87's idea on how to minimize copy-pasting and such?

Original thread: https://forums.rpgmakerweb.com/threads/reaction-skills.160505/