Not sure if it is helpful, but anyways:
Kind of amazing how close something like that little line of code I started the post out with is so perfect, and yet to get the same thing from its cousin parameters is a n̶i̶g̶h̶t̶m̶a̶r̶e̶ bit more involved.
Actually, increasing x- and s-params shouldn't be inherently more difficult than normal parameters. However, while the
addParam function is utilized in growth effects in items/skills and the "Change Parameter" event command, there is no need for a similar function for the other parameter types by default, so there is none in the standard plugins.
I may overlook something here too, but if you just want to replicate addParam for the other parameters the result could look like this:
Spoiler
Code:
function() {
Game_BattlerBase.prototype.clearParamPlus_ILC_addSXParams =
Game_BattlerBase.prototype.clearParamPlus;
Game_BattlerBase.prototype.clearParamPlus = function() {
this.clearParamPlus_ILC_addSXParams();
this._xparamPlus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
this._sparamPlus = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
};
Game_BattlerBase.prototype.addXparam(paramId, value) {
this._xparamPlus[paramId] += value;
this.refresh();
};
Game_BattlerBase.prototype.addSparam(paramId, value) {
this._sparamPlus[paramId] += value;
this.refresh();
};
Game_BattlerBase.prototype.xparam_ILC_addSXParams =
Game_BattlerBase.prototype.xparam;
Game_BattlerBase.prototype.xparam = function(paramId) {
return this.xparam_ILC_addSXParams(paramId) + this._xparamPlus[paramId];
};
Game_BattlerBase.prototype.sparam_ILC_addSXParams =
Game_BattlerBase.prototype.sparam;
Game_BattlerBase.prototype.sparam = function(paramId) {
return this.sparam_ILC_addSXParams(paramId) + this._sparamPlus[paramId];
};
}();
This example would allow you to increase the other parameters by replacing
addParam by
addSparam or
addXparam (the values are added to the final parameter value in line 12 and 17 of the plugin. In case of sparams I don't know if that's that useful though).
For comparison, this is how the additional base parameters are implemented:
Spoiler
One function is used for initialization and reset of bonus parameter list. The list is stored as part of each particular battler and contains an entry for every parameter. The function is called on battler creation and when
(re-)setting up an actor
(when the "Initialize" option is checked in the "Change Party Member" event command):
Code:
Game_BattlerBase.prototype.clearParamPlus = function() {
this._paramPlus = [0,0,0,0,0,0,0,0];
};
Adding a parameter bonus: Increase the corresponding bonus parameter entry. refresh is supposed to be called whenever parameters or traits change to update things like HP, MP and remaining states of the battler.
Code:
Game_BattlerBase.prototype.addParam = function(paramId, value) {
this._paramPlus[paramId] += value;
this.refresh();
};
Utilizing bonus parameters: The entries from the bonus parameter list are added to the base parameter value in the calculation. Calls like
$gameActors.actor().atk will actually just delegate to that actors
param function.
Bonus parameters are increased by equipment bonuses for actors.
Code:
Game_BattlerBase.prototype.paramPlus = function(paramId) {
return this._paramPlus[paramId];
};
//...
Game_BattlerBase.prototype.param = function(paramId) {
var value = this.paramBase(paramId) + this.paramPlus(paramId);
value *= this.paramRate(paramId) * this.paramBuffRate(paramId);
var maxValue = this.paramMax(paramId);
var minValue = this.paramMin(paramId);
return Math.round(value.clamp(minValue, maxValue));
};
You can also look up these functions in the "rpg_objects.js" file in the "www/js" subfolder of your project.