- Joined
- Jun 16, 2020
- Messages
- 540
- Reaction score
- 131
- First Language
- English
- Primarily Uses
- RMMZ
Hi all, so, I'm trying to do a Time Stop skill (you know, ala D&D) but I'm having trouble getting it to work how I want with the non-standard battle systems and I am positive it can be optimised to work better. I'm also trying to make it work for non-standard battle systems, such as CTB and OTB.
First, I made a Time Stop State (state: X), Priority to 100, Removal Conditions to "None", and Restriction to "None"
Then, I made a Time Stopped Status (state: Y), Priority to 99, Removal Conditions to "None", and Restriction to "Cannot Move"
This is the notetag that goes in the actual time stop skill I think
This is instead the code that goes into time Stop status
Basically, the idea is that the user should get 2-5 extra turns, while the others (allies included, because that's how nasty Time Stop is in D&D) are stopped in time (heh).
As usual, your feedback is greatly appreciated.
First, I made a Time Stop State (state: X), Priority to 100, Removal Conditions to "None", and Restriction to "None"
Then, I made a Time Stopped Status (state: Y), Priority to 99, Removal Conditions to "None", and Restriction to "Cannot Move"
This is the notetag that goes in the actual time stop skill I think
JavaScript:
<JS Pre-Start Action>
// Set the number of extra turns.
const minTurns = 2;
const maxTurns = 5;
const extraTurns = Math.floor(Math.random() * (maxTurns - minTurns + 1)) + minTurns;
// Apply Time Stop state to the user.
user.addState(X);
// Store the number of extra turns in a variable.
user.setStateCounter(X, extraTurns);
</JS Pre-Start Action>
This is instead the code that goes into time Stop status
JavaScript:
<JS Pre-Start Turn>
// Check if the state counter is greater than 0.
if (user.getStateCounter(X) > 0) {
// Reduce the state counter by 1.
user.setStateCounter(X, user.getStateCounter(X) - 1);
// Set up the Time Stop effect.
for (let battler of BattleManager.allBattleMembers()) {
if (battler !== user) {
// Apply a custom state Y that prevents actions.
battler.addState(Y);
}
}
// Apply an extra turn for the user.
user._actionState = 'undecided';
user.makeActions();
BattleManager.forceAction(user);
} else {
// Remove the Time Stop state and custom state Y from all battlers.
user.removeState(X);
for (let battler of BattleManager.allBattleMembers()) {
battler.removeState(Y);
}
}
</JS Pre-Start Turn>
Basically, the idea is that the user should get 2-5 extra turns, while the others (allies included, because that's how nasty Time Stop is in D&D) are stopped in time (heh).
As usual, your feedback is greatly appreciated.