Hi, as you may (not) remember I made small plugin that allows you to change max TP for players.
I decided to improve it a little bit more further making maxTP value different for each party member e.g
Hero #1 - Lv. 3 will have max tp 130
Hero #2 - Lv. 2 will have max tp 90
Hero #3 - Lv. 1 will have max tp 50
and I got an idea, quite brilliant and simple idea that I store MaxTP values in array and return specific index of array using hero level. Function goes like this
And you know what? IT WORKS! But... There is only one little problem with that approach...
All enemies in battle just stand and they don't do anything with only exception, when I force them to attack via eventing.
I wanted to ask more advanced JS scripters how to fix that problem. I already know it's inside my function (for 99.99% its Lv variable) but I can't find how to get another way each party member level.
I decided to improve it a little bit more further making maxTP value different for each party member e.g
Hero #1 - Lv. 3 will have max tp 130
Hero #2 - Lv. 2 will have max tp 90
Hero #3 - Lv. 1 will have max tp 50
and I got an idea, quite brilliant and simple idea that I store MaxTP values in array and return specific index of array using hero level. Function goes like this
Code:
(function() {
Game_BattlerBase.prototype.maxTp = function() {
var Lv = this._level;
var ValuePerLevel = [0, 25, 60, 90, 125, 155, 200, 235, 260, 300, 350];
return ValuePerLevel[Lv];
};
})();
All enemies in battle just stand and they don't do anything with only exception, when I force them to attack via eventing.
I wanted to ask more advanced JS scripters how to fix that problem. I already know it's inside my function (for 99.99% its Lv variable) but I can't find how to get another way each party member level.