[Dev] Sessions will now sync with the server at the start of every 5 waves (#4808)

* Replaced conditional with `true` so that sync-to-server occurs at the start of every wave.

* Update src/phases/encounter-phase.ts

Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>

* Fixed errors from previous commit.

* Revised condition to include the first wave of a run.

* Apply suggestions from code review

Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>

---------

Co-authored-by: frutescens <info@laptop>
Co-authored-by: Frederico Santos <frederico.f.santos@tecnico.ulisboa.pt>
Co-authored-by: Moka <54149968+MokaStitcher@users.noreply.github.com>
This commit is contained in:
Mumble 2024-11-16 15:30:47 -08:00 committed by GitHub
parent 77b94bf45d
commit 4aff2ffa1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -225,7 +225,8 @@ export class EncounterPhase extends BattlePhase {
this.scene.ui.setMode(Mode.MESSAGE).then(() => {
if (!this.loaded) {
this.trySetWeatherIfNewBiome(); // Set weather before session gets saved
this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 10 === 1 || (this.scene.lastSavePlayTime ?? 0) >= 300).then(success => {
// Game syncs to server on waves X1 and X6 (As of 1.2.0)
this.scene.gameData.saveAll(this.scene, true, battle.waveIndex % 5 === 1 || (this.scene.lastSavePlayTime ?? 0) >= 300).then(success => {
this.scene.disableMenu = false;
if (!success) {
return this.scene.reset(true);