Trying to work on my first plugin. What I am creating is an auto state that happens at 25% or less hps. If hps go below 25% the state fatigue will be applied and if hps are above 25% the state will be removed. I believe i am not using the correct variables in this.fhp = HP / MHP, I have tried searching what to put here to make this work but none of my ideas have been correct. Due to this being my first attempt I may have this all wrong. Any advise would be amazing thanks in advance =)
/*:
*
*@plugindesc adds fatigue to characters below set amount of health.
*
*@author Skeezixs
*
*@param
*
*@help
*
*/
(function() {
Game_BattlerBase.prototype.fatigueStateId = function() {
return 12;
var Game_Battler_Fatigue = Game_Battler.prototype.refresh;
Game_Battler.prototype.refresh = function() {
Game_BattlerBase.prototype.refresh.call(this);
this.fhp = HP / MHP
if (this.fhp <= 0.25) {
this.addState(this.fatigueStateId());
} else {
this.removeState(this.fatigueStateId());
}();
/*:
*
*@plugindesc adds fatigue to characters below set amount of health.
*
*@author Skeezixs
*
*@param
*
*@help
*
*/
(function() {
Game_BattlerBase.prototype.fatigueStateId = function() {
return 12;
var Game_Battler_Fatigue = Game_Battler.prototype.refresh;
Game_Battler.prototype.refresh = function() {
Game_BattlerBase.prototype.refresh.call(this);
this.fhp = HP / MHP
if (this.fhp <= 0.25) {
this.addState(this.fatigueStateId());
} else {
this.removeState(this.fatigueStateId());
}();