I've looked around but all I could find were some scripts for VXAce. I don't know if this can be done though eventing somehow or if I would need a plugin. To be clear, if the title weren't enough, I want states that inflict slip HP damage such as Poison to result in death in battles, but only result in reducing to 1 HP on field maps. There doesn't seem to be a happy medium.
Death from slip damage in battle but not field
RPG Maker MZ SupportThere is already a setting for this in the database on System 1. It literally says "Death by Slip Damage", if you have it set on, any state that reduces HP and remains after battle, will reduce HP to 0 and apply KO State. If you set it as false, any state that remains after battle, will not apply KO status to the character and will leave HP to 1. So all that remains is that you set your state to remain even outside of battle, which is also a default setting on the engine, you just have to select it.
I don't think you're understanding me. I know about that setting. I want it to be able to reduce to 0 HP in battle but NOT outside of battle. With that setting it's either all or none - either it can reduce to 0 HP or it can only reduce to 1 HP, regardless of whether it's a battle or not.
JavaScript:
const noDeathBySlipOnMap = Game_Battler.prototype.maxSlipDamage;
Game_Battler.prototype.maxSlipDamage = function() {
return !$gameParty.inBattle() ? Math.max(this.hp - 1, 0) : noDeathBySlipOnMap.apply(this);
}
The database option will still be obeyed during battle.
Works great, thank you!
Ok, sorry, I misunderstood.
Another solution different from @Kenen. You could use Visustella's SkillsStatesCore plugin. Set the following on the Note section of the state with slip damage:
Code:
<JS Slip Refresh>
<JS HP Slip Damage>
let totalDamage = Math.floor(target.mhp * 0.1);
if (!$gameParty.inBattle()) {
if (target.hp <= totalDamage) {
totalDamage = target.hp - 1;
}
}
damage = totalDamage;
</JS HP Slip Damage>
and also set the "Death by Slip Damage" option to true on System 1 tab.
With this, you will make the character only die on battle by slip damage but not on field map.
A possible downside to this approach is that any other state that doesn't have this code, will apply the death by slip damage to characters
Thanks I'll try it out!
Original thread: https://forums.rpgmakerweb.com/threads/death-from-slip-damage-in-battle-but-not-field.167888/