How to overwrite instant death on 0 hp

● ARCHIVED · READ-ONLY
Started by Crestfall9 3 posts View original ↗
  1. Hey, I'm the same guy thinking about adding a death's door mechanic.
    So I was looking through the codes and found this:

    Code:
    Game_Battler.prototype.refresh = function() {
        Game_BattlerBase.prototype.refresh.call(this);
        if (this.hp === 0) {
            this.addState(this.deathStateId());
        } else {
            this.removeState(this.deathStateId());
        }
    };

    I want to overwrite it so that this.hp will be -1.
    I'm very new to JavaScript (still haven't memorized all the operators) and I don't think I can just rewrite the function in my code.
  2. You want to change this.hp === 0 to check for -1 instead? just change it to this.hp === -1
  3. Just like that? Shouldn't there be conflicts, etc?