Help with states in battle Poison=/=Death

Discussion in 'JS Plugin Requests' started by Riku_Masamune, Feb 20, 2017.

  1. Riku_Masamune

    Riku_Masamune Villager Member

    Messages:
    18
    Likes Received:
    3
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Well, I tried searching in Google to see if this question had been answered, but no I couldn't find anything... BUT! Onto the question... Well, from the title it has to deal with enemies dying from poison. But is there a way to fix it to were enemies actually fade out when they die from poison, instead of just standing there like they had a heart attack then going into victory screen?

    I tried finding my own way through the problem, but couldn't figure it out. So, does anyone have an idea?
     
    #1
  2. Fugama

    Fugama Means well, but messes up sometimes. Veteran

    Messages:
    158
    Likes Received:
    89
    Location:
    California City, CA
    First Language:
    Fake English
    Primarily Uses:
    RMMV
    I can't seem to make the poison effect be lethal in the first place, care to share that accomplishment? Did you edit this function to not use the if branch, or do you use a different method of poison than the default?

    Code:
    Game_Battler.prototype.regenerateHp = function() {
        var value = Math.floor(this.mhp * this.hrg);
        value = Math.max(value, -this.maxSlipDamage());
        if (value !== 0) {
            this.gainHp(value);
        }
    };
    
     
    Last edited: Feb 20, 2017
    #2
  3. Riku_Masamune

    Riku_Masamune Villager Member

    Messages:
    18
    Likes Received:
    3
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Setting the Ex-Parameter to a negative value. It's all in software by default. But if you just guard the whole time the enemy looses x%b.hp, on a turn it looses the remainder of it's HP, it just has a "heart attack" and just stop whilst the actors do their victory dance.
     

    Attached Files:

    #3
  4. Fugama

    Fugama Means well, but messes up sometimes. Veteran

    Messages:
    158
    Likes Received:
    89
    Location:
    California City, CA
    First Language:
    Fake English
    Primarily Uses:
    RMMV
    I tried that but it seems like it gets down to 1hp and just doesn't take anymore damage. But since yours apparently does, and you're using the -hp regeneration thing just toss this into a .js file and add it as a plugin and you should be good, lemme know if it doesn't work

    Code:
    (function(){
    Fugama = Fugama || {}
    Fugama.Pfix = Fugama.Pfix || {}
    
    Fugama.Pfix.Game_Battler_prototype_onTurnEnd = Game_Battler.prototype.onTurnEnd;
    Game_Battler.prototype.onTurnEnd = function(){
        Fugama.Pfix.Game_Battler_prototype_onTurnEnd.call(this);
        if (this.hp <== 0){
            this.performCollapse();
        }
    }
    })();
     
    #4
  5. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,783
    Likes Received:
    11,821
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Fugama : If poison isn't KO'ing your enemies, that means you didn't turn on KO by slip damage (under system settings). If you don't do that, no one will ever die from poison (players or enemies), barring some custom code.

    I've moved this thread to Plug-In Requests. Please be sure to post your threads in the correct forum next time. Thank you.

     
    #5
    Fugama likes this.
  6. Riku_Masamune

    Riku_Masamune Villager Member

    Messages:
    18
    Likes Received:
    3
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Nope, thanks for the effort though. Still has a "heart attack".
     
    #6
  7. Fugama

    Fugama Means well, but messes up sometimes. Veteran

    Messages:
    158
    Likes Received:
    89
    Location:
    California City, CA
    First Language:
    Fake English
    Primarily Uses:
    RMMV
    I can't seem to replicate the effect in a project with no plugins, the enemies collapse (shake and fade out) as per usual when they die by poison
     
    #7
    Riku_Masamune likes this.
  8. Riku_Masamune

    Riku_Masamune Villager Member

    Messages:
    18
    Likes Received:
    3
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Guess I'll just thumb through my plugins then. I know a friend is also having this problem on VX Ace. Thanks for trying to help.
     
    #8
    Fugama likes this.
  9. Riku_Masamune

    Riku_Masamune Villager Member

    Messages:
    18
    Likes Received:
    3
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    Admin can close the thread: It was a simple overlook with Yanfly's ATB plugin. Which since it's discontinued, can't write a bug report on.
     
    #9
  10. Fugama

    Fugama Means well, but messes up sometimes. Veteran

    Messages:
    158
    Likes Received:
    89
    Location:
    California City, CA
    First Language:
    Fake English
    Primarily Uses:
    RMMV
    Code:
    Game_Battler.prototype.regenerateHp = function() {
        var value = Math.floor(this.mhp * this.hrg);
        value = Math.max(value, -this.maxSlipDamage());
        if (value >= this.hp && !this.isActor){
            this.performCollapse();
    } else {
        if (value !== 0) {
            this.gainHp(value);
        }
    }
    };
    That's the last thing I can think of, it makes it so it'll collapse instead of applying damage if the damage is greater than the enemy's HP (sideview actors will still just display the death motion)
     
    #10
    Riku_Masamune likes this.
  11. Riku_Masamune

    Riku_Masamune Villager Member

    Messages:
    18
    Likes Received:
    3
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    RMMV
    I'll test that out with the ATB Plugin. Thanks for your effort.
     
    #11
    Fugama likes this.

Share This Page