I’m looking for a plugin that will slow down the game or temporarily freeze the game when an enemy is hit.
To be more precise, during or after an actor’s attack animation is complete I want the game screen to slow down.
An example of what I am looking for is done through this plugin - Except I want the game to slow down for a moment instead of shaking the screen.
So far I haven’t seen Google, Reddit, or Steam posts with this topic so I thought to ask here. Does anyone know of plugins or code that temporarily “freezes” the game when an actor attacks?
I couldn’t find one made for this either, so here’s a small plugin you could try as a starting point. Save it as HitStop.js in your js/plugins folder (the name matters, since that’s how it reads its parameter) and turn it on in the Plugin Manager:
/*:
* @plugindesc Briefly freezes the battle when an enemy takes damage.
* @param Frames
* @desc How many frames to freeze (60 = 1 second)
* @default 10
*/
(function() {
var frames = Number(PluginManager.parameters('HitStop')['Frames'] || 10);
var hitStop = 0;
var _Game_Enemy_performDamage = Game_Enemy.prototype.performDamage;
Game_Enemy.prototype.performDamage = function() {
_Game_Enemy_performDamage.call(this);
hitStop = frames;
};
var _Scene_Battle_update = Scene_Battle.prototype.update;
Scene_Battle.prototype.update = function() {
if (hitStop > 0) {
hitStop--;
return;
}
_Scene_Battle_update.call(this);
};
})();
It freezes the whole battle scene for a few frames whenever an enemy takes HP damage. In the default battle system the damage is applied after the attack animation finishes, so I think that should land right where you want it.
If you’d rather it slow down instead of fully stopping, try changing return; to if (hitStop % 2) return; so it only updates every other frame. I’m not sure how it plays with Yanfly’s Battle Engine Core or other action sequence plugins, the timing could be different there.