YEP_ItemCore to display also TP healing?

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
I'm talking about this specifically:

TP.png

Since items can restore TP too, why is this omitted? And more importantly, has anybody made a fix?
Like adding "TP Heal" below "MP Heal" (and adjusting the window sizes in consequence)?
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
1,970
Reaction score
846
First Language
French
Nobody for this?

I think this is the part where "everything" happens in YEP_ItemCore:


Window_ItemStatus.prototype.getItemInfoCategory = function(i) {
var fmt = Yanfly.Param.ItemRecoverFmt;
if (i === 0) return fmt.format(TextManager.param(0));
if (i === 1) return fmt.format(TextManager.hp);
if (i === 2) return fmt.format(TextManager.param(1));
if (i === 3) return fmt.format(TextManager.mp);
if (i === 4) return Yanfly.Param.ItemAddState;
if (i === 5) return Yanfly.Param.ItemRemoveState;
if (i === 6) return Yanfly.Param.ItemAddBuff;
if (i === 7) return Yanfly.Param.ItemRemoveBuff;
return '';
};

Window_ItemStatus.prototype.drawItemData = function(i, dx, dy, dw) {
if (!this._item) return;
var effect;
var value = '---';
var pre = '';
var text = '';
var icons = [];
if (i === 0) {
effect = this.getEffect(Game_Action.EFFECT_RECOVER_HP);
value = (effect) ? effect.value1 : '---';
if (value === 0) value = '---';
if (value !== '---' && value !== 0) value *= 100;
}
if (i === 1) {
effect = this.getEffect(Game_Action.EFFECT_RECOVER_HP);
value = (effect) ? effect.value2 : '---';
if (value === 0) value = '---';
}
if (i === 2) {
effect = this.getEffect(Game_Action.EFFECT_RECOVER_MP);
value = (effect) ? effect.value1 : '---';
if (value === 0) value = '---';
if (value !== '---' && value !== 0) value *= 100;
}
if (i === 3) {
effect = this.getEffect(Game_Action.EFFECT_RECOVER_MP);
value = (effect) ? effect.value2 : '---';
if (value === 0) value = '---';
}
if (i >= 4) {
icons = this.getItemIcons(i, icons);
}
this.changeTextColor(this.normalColor());
if (value === '---') {
this.changePaintOpacity(false);
} else if (i < 4) {
if (value > 0) pre = '+';
value = Yanfly.Util.toGroup(parseInt(value));
if ([0, 2].contains(i)) text = '%';
}
if (icons.length > 0) {
this.changePaintOpacity(true);
dx = dx + dw - icons.length * Window_Base._iconWidth;
dx += this.textPadding() - 2;
for (var j = 0; j < icons.length; ++j) {
var icon = icons[j];
this.drawIcon(icon, dx, dy + 2);
dx += Window_Base._iconWidth;
}
} else {
text = pre + value + text;
this.drawText(text, dx, dy, dw, 'right');
this.changePaintOpacity(true);
}

Window_ItemStatus.prototype.getEffect = function(code) {
var targetEffect;
this._item.effects.forEach(function(effect) {
if (effect.code === code) targetEffect = effect;
}, this);
return targetEffect;
};

Window_ItemStatus.prototype.getItemIcons = function(i, array) {
this._item.effects.forEach(function(effect) {
if (i === 4 && effect.code === Game_Action.EFFECT_ADD_STATE) {
var state = $dataStates[effect.dataId];
if (state && state.iconIndex !== 0) array.push(state.iconIndex);
}
if (i === 5 && effect.code === Game_Action.EFFECT_REMOVE_STATE) {
var state = $dataStates[effect.dataId];
if (state && state.iconIndex !== 0) array.push(state.iconIndex);
}
if (i === 6 && effect.code === Game_Action.EFFECT_ADD_BUFF) {
var icon = Game_BattlerBase.ICON_BUFF_START + effect.dataId;
array.push(icon);
}
if (i === 6 && effect.code === Game_Action.EFFECT_ADD_DEBUFF) {
var icon = Game_BattlerBase.ICON_DEBUFF_START + effect.dataId;
array.push(icon);
}
if (i === 7 && effect.code === Game_Action.EFFECT_REMOVE_BUFF) {
var icon = Game_BattlerBase.ICON_BUFF_START + effect.dataId;
array.push(icon);
}
if (i === 7 && effect.code === Game_Action.EFFECT_REMOVE_DEBUFF) {
var icon = Game_BattlerBase.ICON_DEBUFF_START + effect.dataId;
array.push(icon);
}
}, this);
array = array.slice(0, Yanfly.Param.ItemMaxIcons);
return array;
};



With my very modest understanding, I'm able to make "TP" appear by using fmt.format(TextManager.mp);
But the problem is that I don't know how to automatically add the amount of TP it restores.
If I had this then I could just replace one of the 8 lines with the TP information instead, for instance the i=8 which I think I don't need.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,037
Messages
1,018,464
Members
137,821
Latest member
Capterson
Top