Merge branch 'beta' into rage-fist-implementation

This commit is contained in:
geeilhan 2025-01-19 05:06:49 +01:00 committed by GitHub
commit 57bd047d6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -112,7 +112,7 @@ import { ExpGainsSpeed } from "#enums/exp-gains-speed";
import { BattlerTagType } from "#enums/battler-tag-type"; import { BattlerTagType } from "#enums/battler-tag-type";
import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters"; import { FRIENDSHIP_GAIN_FROM_BATTLE } from "#app/data/balance/starters";
import { StatusEffect } from "#enums/status-effect"; import { StatusEffect } from "#enums/status-effect";
import { globalScene, initGlobalScene } from "#app/global-scene"; import { initGlobalScene } from "#app/global-scene";
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1"; export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
@ -394,10 +394,10 @@ export default class BattleScene extends SceneBase {
const originalRealInRange = Phaser.Math.RND.realInRange; const originalRealInRange = Phaser.Math.RND.realInRange;
Phaser.Math.RND.realInRange = function (min: number, max: number): number { Phaser.Math.RND.realInRange = function (min: number, max: number): number {
const ret = originalRealInRange.apply(this, [ min, max ]); const ret = originalRealInRange.apply(this, [ min, max ]);
const args = [ "RNG", ++globalScene.rngCounter, ret / (max - min), `min: ${min} / max: ${max}` ]; const args = [ "RNG", ++this.rngCounter, ret / (max - min), `min: ${min} / max: ${max}` ];
args.push(`seed: ${globalScene.rngSeedOverride || globalScene.waveSeed || globalScene.seed}`); args.push(`seed: ${this.rngSeedOverride || this.waveSeed || this.seed}`);
if (globalScene.rngOffset) { if (this.rngOffset) {
args.push(`offset: ${globalScene.rngOffset}`); args.push(`offset: ${this.rngOffset}`);
} }
console.log(...args); console.log(...args);
return ret; return ret;
@ -410,7 +410,7 @@ export default class BattleScene extends SceneBase {
} }
create() { create() {
globalScene.scene.remove(LoadingScene.KEY); this.scene.remove(LoadingScene.KEY);
initGameSpeed.apply(this); initGameSpeed.apply(this);
this.inputController = new InputsController(); this.inputController = new InputsController();
this.uiInputs = new UiInputs(this.inputController); this.uiInputs = new UiInputs(this.inputController);
@ -2954,7 +2954,7 @@ export default class BattleScene extends SceneBase {
*/ */
applyShuffledModifiers<T extends PersistentModifier>(modifierType: Constructor<T>, player: boolean = true, ...args: Parameters<T["apply"]>): T[] { applyShuffledModifiers<T extends PersistentModifier>(modifierType: Constructor<T>, player: boolean = true, ...args: Parameters<T["apply"]>): T[] {
let modifiers = (player ? this.modifiers : this.enemyModifiers).filter((m): m is T => m instanceof modifierType && m.shouldApply(...args)); let modifiers = (player ? this.modifiers : this.enemyModifiers).filter((m): m is T => m instanceof modifierType && m.shouldApply(...args));
globalScene.executeWithSeedOffset(() => { this.executeWithSeedOffset(() => {
const shuffleModifiers = mods => { const shuffleModifiers = mods => {
if (mods.length < 1) { if (mods.length < 1) {
return mods; return mods;
@ -2963,7 +2963,7 @@ export default class BattleScene extends SceneBase {
return [ mods[rand], ...shuffleModifiers(mods.filter((_, i) => i !== rand)) ]; return [ mods[rand], ...shuffleModifiers(mods.filter((_, i) => i !== rand)) ];
}; };
modifiers = shuffleModifiers(modifiers); modifiers = shuffleModifiers(modifiers);
}, globalScene.currentBattle.turn << 4, globalScene.waveSeed); }, this.currentBattle.turn << 4, this.waveSeed);
return this.applyModifiersInternal(modifiers, player, args); return this.applyModifiersInternal(modifiers, player, args);
} }