Hi, I'm working on my first plugin so I have very much to learn.
My idea is to modify battle scene since I only have one character to use.
This is what I have made untill now. There is a window close to the character one to show some of his main statistics, and based on buffs/debuffs that stats change turning green or red. I'm using "paramBasePlus" as reference to see if the vale of current "param" changes, this way i can use the right color (red for decrement, green for increment). My problem is that I have not found any "xparamBasePlus" or equivalent to do the same work with the Critic and Evasion rates. Could you suggest me any work around?
This is the part of code i'm actually using:
Thanks.
My idea is to modify battle scene since I only have one character to use.
This is what I have made untill now. There is a window close to the character one to show some of his main statistics, and based on buffs/debuffs that stats change turning green or red. I'm using "paramBasePlus" as reference to see if the vale of current "param" changes, this way i can use the right color (red for decrement, green for increment). My problem is that I have not found any "xparamBasePlus" or equivalent to do the same work with the Critic and Evasion rates. Could you suggest me any work around?
This is the part of code i'm actually using:
JavaScript:
// Update window's contents
Scene_Battle.prototype.refreshBattleActorStatsWindow = function () {
this._BattleActorStatsWindow.contents.clear();
var lineHeight = this._BattleActorStatsWindow.lineHeight();
// Statistiche del giocatore
var playerActor = $gameParty.leader();
var playerStatistics = [
{ name: "Attacco", value: $gameParty.members()[0].param(2) }, //ATK
{ name: "Difesa", value: $gameParty.members()[0].param(3) }, // DEF
{ name: "Critico", value: $gameParty.members()[0].xparam(1) }, // CRI
{ name: "Evasione", value: $gameParty.members()[0].xparam(3) }, // EVA
];
const playerStatisticsOriginal = [
{ name: "Attacco", value: $gameParty.members()[0].paramBasePlus(2) }, //ATK
{ name: "Difesa", value: $gameParty.members()[0].paramBasePlus(3) }, // DEF
//{ name: "Critico", value: $gameParty.members()[0].xparamBasePlus(1) }, // CRI
//{ name: "Evasione", value: $gameParty.members()[0].xparamBasePlus(3) }, // EVA
];
// Draw actor stats
this._BattleActorStatsWindow.drawText($gameParty.members()[0].name(), 0, 0, this._BattleActorStatsWindow.contentsWidth(), 'center');
// flat stats (ATK, DEF)
for (var i = 0; i < 2; i++) { //(var i = 0; i < playerStatistics.length; i++)
var stat = playerStatistics[i];
var statOriginal = playerStatisticsOriginal[i];
if (stat.value > statOriginal.value) { var text = stat.name + " -> " + "\\c[3]" + stat.value + "\\c[0]"; }
if (stat.value < statOriginal.value) { var text = stat.name + " -> " + "\\c[2]" + stat.value + "\\c[0]"; }
if (stat.value == statOriginal.value) { var text = stat.name + " -> " + stat.value; }
this._BattleActorStatsWindow.drawText(text, 0, lineHeight * (i + 1), this._BattleActorStatsWindow.contentsWidth(), 'left');
} // stats with % (CRI, EVA)
for (var i = 2; i < 4; i++) { //(var i = 0; i < playerStatistics.length; i++)
var stat = playerStatistics[i];
var text = stat.name + " -> " + stat.value + "%";
if (stat.value > statOriginal.value) { var text = stat.name + " -> " + "\\c[3]" + stat.value + "%\\c[0]"; }
if (stat.value < statOriginal.value) { var text = stat.name + " -> " + "\\c[2]" + stat.value + "%\\c[0]"; }
if (stat.value == statOriginal.value) { var text = stat.name + " -> " + stat.value + "%"; }
this._BattleActorStatsWindow.drawText(text, 0, lineHeight * (i + 1), this._BattleActorStatsWindow.contentsWidth(), 'left');
}
// Enemy stats -> to develope
Thanks.