Substitue trait taking heal ?

Hi,


I've recently tested the substitute trait and I found out that when an actor with low HP try to use a spell to heal himself, my tank with Substitute trait will get healed instead ?


Is there a way to avoid that ?
Hi,


By default, skills/items with "Certain Hit" as their hit type are not affected by substitute.


If you want to change the condition under which a battler is substituted you can copy this method (line 2210-2212 in rpg_managers.js) into a new plugin and modify it depending on what you want:


BattleManager.checkSubstitute = function(target) {
    return target.isDying() && !this._action.isCertainHit();
};
Oh, that's why it happened!


When I tried that trait I putted it directly in the class trait but now I putted as a skill with "Certain Hit" my tank doesn't take anymore the heal instead.


Thank you a bunch 😀

Original thread: https://forums.rpgmakerweb.com/threads/substitue-trait-taking-heal.60791/