Joined
Aug 5, 2021
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMZ
hi there, curenntly trying to modifie max hp values throught the use of states. I want to have my character loses 20% max hp per turn when the status is applied and stops when the status when removed. i am using mz with the base vizustella plugins, any help is realty appreciated
 

Arctica

Veteran
Veteran
Joined
Jul 19, 2021
Messages
64
Reaction score
58
First Language
English
Primarily Uses
RMMZ
If you're looking to reduce the max HP by 20% per turn, you'll have to change how HP regeneration works, as it's coded to give a value based on max HP. Currently it can restore or 'damage' based on max HP but it doesn't change the max HP value, if that makes sense.

I don't know how it looks in visustella since I don't use it, but the vanilla method is:

JavaScript:
Game_Battler.prototype.regenerateHp = function() {
    const minRecover = -this.maxSlipDamage();
    const value = Math.max(Math.floor(this.mhp * this.hrg), minRecover);
    if (value !== 0) {
        this.gainHp(value);
    }
};
 
Joined
Aug 5, 2021
Messages
2
Reaction score
0
First Language
english
Primarily Uses
RMMZ
If you're looking to reduce the max HP by 20% per turn, you'll have to change how HP regeneration works, as it's coded to give a value based on max HP. Currently it can restore or 'damage' based on max HP but it doesn't change the max HP value, if that makes sense.

I don't know how it looks in visustella since I don't use it, but the vanilla method is:

JavaScript:
Game_Battler.prototype.regenerateHp = function() {
    const minRecover = -this.maxSlipDamage();
    const value = Math.max(Math.floor(this.mhp * this.hrg), minRecover);
    if (value !== 0) {
        this.gainHp(value);
    }
};
Sweet thanks for your help.
 

Arctica

Veteran
Veteran
Joined
Jul 19, 2021
Messages
64
Reaction score
58
First Language
English
Primarily Uses
RMMZ
You may also need to work with mhp. The script call for that is param(0).

A state as you may or may not know can further affect the maximum value(actually change it), and thats done by Traits -> Parameter: Max HP. With the new maximum being the result of MaxHP * Pct(Ex. 1900 x 0.5 = 950). I've no way of knowing how to make it turn based, turns are only duration. This is why that code I supplied above might be the right direction. Regeneration applies at every turn.

One last thing you need to be aware of incase you've tried setHp(). Under the hood it restricts changes to the maximum(you can't set hp higher than the maximum) but it doesn't lower the maximum, only the current HP.
 

Latest Threads

Latest Profile Posts

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.
finally got footage of my main character running around the main hub world. I've fixed a few things tho even since this video unsurprisingly lol.
 …I think I might need to switch from standard ATK/DEF up/down buffs to parameter altering states. I just had an actor whose usual attack against an enemy does ~25 do a buffed attack against a debuffed enemy for ~600…
just saw that titan quest is free on steam until the 23rd

Forum statistics

Threads
115,228
Messages
1,088,245
Members
149,822
Latest member
ddkovi
Top