Dororo

Gespenst MKII pilot
Veteran
Joined
May 24, 2020
Messages
262
Reaction score
934
First Language
Italian
Primarily Uses
RMMV
I'm hitting a wall when inspecting the core scripts and so I can't quite progress into writing a plugin.

The informations I need are where TPBS functions are, as apparently they are somehow "entwined" inside default turn based combat and sparse around.
For example, I can't find where the timer for each battler reset to 0 after taking an action (or stop growing when full), or the global timer that determine the relative speeds.

Please direct me in the right way.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,832
Reaction score
980
First Language
Chinese
Primarily Uses
N/A
For example, I can't find where the timer for each battler reset to 0 after taking an action (or stop growing when full), or the global timer that determine the relative speeds.

Timer for each battler reset to 0:
Code:
BattleManager.endBattlerActions = function(battler) {
    battler.setActionState(this.isTpb() ? "undecided" : "done");
    battler.onAllActionsEnd();
    battler.clearTpbChargeTime();
    this.displayBattlerStatus(battler, true);
};

Game_Battler.prototype.clearTpbChargeTime = function() {
    this._tpbState = "charging";
    this._tpbChargeTime = 0;
};

Stop growing when full:
Code:
Game_Battler.prototype.updateTpbChargeTime = function() {
    if (this._tpbState === "charging") {
        this._tpbChargeTime += this.tpbAcceleration();
        if (this._tpbChargeTime >= 1) {
            this._tpbChargeTime = 1;
            this.onTpbCharged();
        }
    }
};

Game_Battler.prototype.onTpbCharged = function() {
    if (!this.shouldDelayTpbCharge()) {
        this.finishTpbCharge();
    }
};

Game_Battler.prototype.finishTpbCharge = function() {
    this._tpbState = "charged";
    this._tpbTurnEnd = true;
    this._tpbIdleTime = 0;
};

Global timer that determine the relative speeds:
Code:
Game_Battler.prototype.tpbAcceleration = function() {
    const speed = this.tpbRelativeSpeed();
    const referenceTime = $gameParty.tpbReferenceTime();
    return speed / referenceTime;
};

Game_Battler.prototype.tpbRelativeSpeed = function() {
    return this.tpbSpeed() / $gameParty.tpbBaseSpeed();
};

Game_Battler.prototype.tpbSpeed = function() {
    return Math.sqrt(this.agi) + 1;
};

Game_Battler.prototype.tpbBaseSpeed = function() {
    const baseAgility = this.paramBasePlus(6);
    return Math.sqrt(baseAgility) + 1;
};

Game_Unit.prototype.tpbBaseSpeed = function() {
    const members = this.members();
    return Math.max(...members.map(member => member.tpbBaseSpeed()));
};

Game_Unit.prototype.tpbReferenceTime = function() {
    return BattleManager.isActiveTpb() ? 240 : 60;
};

In short, you can try to search tpb(case-insensitive) in BattleManager, Game_Battler and Game_Unit :)
 

Dororo

Gespenst MKII pilot
Veteran
Joined
May 24, 2020
Messages
262
Reaction score
934
First Language
Italian
Primarily Uses
RMMV
Thank you @DoubleX , that's exactly what I asked for.
There's any award or medal that can be granted for such a complete and quick reply?

(and bash me hard to have miss that!)
 

Latest Threads

Latest Posts

Latest Profile Posts

 …I think I might need to switch from standard ATK/DEF up/down buffs to parameter altering states. I just had an actor whose usual attack against an enemy does ~25 do a buffed attack against a debuffed enemy for ~600…
just saw that titan quest is free on steam until the 23rd
Zombie status is now complete. I didn't have to do much in the way of changing how healing is applied to undead targets, was just a simple 3 line code. I thought I had to overhaul Game_Action lol. Everything else was doable by events. So.. Zombie: You turn undead. Your element changes to darkness. You're weak to light, you're strong to physical attacks and healing hurts you and revival items will kill you.
My Overworld might be a mix of inspiration from 2D Final Fantasy games, Breath of Fire, Battlechasers: Nightwar, Super Mario World, and Pillars of Eternity. If I can make it more in-depth than just walking from point A to point B, that might do a lot for the gameplay experience. Hmm...

Forum statistics

Threads
115,225
Messages
1,088,218
Members
149,815
Latest member
MaeBski
Top