Script needed to turn back time in a battle

Depends on where Sarlecc insert the restore code (before or after the formula).

And like what Sarlecc said, can't do it before, or there will be a chance that you will end up with a dead castor before the restore happens.

So restore, and let the damage formula do the calculation and damage after that.

If you are doing something like take 30% hp from caster. It won't matter what the current hp is since you will be calculating based on max hp. But if you try to calculate it using % of current hp, then there will be a difference.

But i bet Sarlecc will want to know if you will be using a separate animation for restore, and another for the damage part. The damage part should trigger along with the skill damage, but you might want the restore part to have its own set of animation.
The sprite animations occur automatically when damage is taken so there's not really a need for a separate animation.

So when the damage is calculated Character A will show the animation for damage, or a set pose.

The only animation that would need to be shown would be the restore animation.
Here's an update on the script progress:

Health can be returned to the last saved health.

Mana can be returned to the last saved mana.

TP can be returned to the last saved TP.

Will probably change it some to make it more flexible and allow for different turns to be loaded.

States:

If a state was saved on a turn and doesn't exist when the saved turn gets loaded that state will be re-added.

If a state doesn't exist in the saved turn but does on the turn that the turn gets loaded that state will be removed.

Still working on returning state turn information back to normal.

Things that need to get done:

Animation stuff.

Damage application to the user of the skill.

Probably some other tidbits I am forgetting.

Original thread: https://forums.rpgmakerweb.com/threads/script-needed-to-turn-back-time-in-a-battle.44889/