From 8efdda85284d9ed2cdc5e4a5c57632dd4d276623 Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:11:35 -0400 Subject: [PATCH] Revert "Reapply "Merge branch 'main' of https://github.com/PokeRogue-Projects/Pathing-Tool"" This reverts commit c122d417cfb81cdeaf59559f95a284aae9d626b5. --- .github/workflows/auto-update.yml | 31 ------------ src/logger.ts | 78 ++++++++----------------------- src/ui/battle-info.ts | 28 +++++------ 3 files changed, 31 insertions(+), 106 deletions(-) delete mode 100644 .github/workflows/auto-update.yml diff --git a/.github/workflows/auto-update.yml b/.github/workflows/auto-update.yml deleted file mode 100644 index 6f5cfd5ef46..00000000000 --- a/.github/workflows/auto-update.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Update Fork - -on: - schedule: - - cron: '0 0 * * *' # Runs every day at midnight - push: - branches: - - main - -jobs: - update-fork: - runs-on: ubuntu-latest - - steps: - - name: Checkout fork - uses: actions/checkout@v2 - with: - repository: PokeRogue-Projects/Pathing-Tool - ref: Automerge - - - name: Add upstream - run: git remote add upstream https://github.com/pagefaultgames/pokerogue.git - - - name: Fetch upstream - run: git fetch upstream - - - name: Merge upstream changes - run: | - git checkout main - git merge upstream/main - git push origin Automerge diff --git a/src/logger.ts b/src/logger.ts index 06321628659..cbba195bee3 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -721,21 +721,6 @@ export function getWave(drpd: DRPD, floor: integer, scene: BattleScene): Wave { } } if (wv == undefined) { - if (scene.gameMode.modeId != GameModes.DAILY) { - drpd.waves.push({ - id: floor, - reload: false, - //type: floor % 10 == 0 ? "boss" : (floor % 10 == 5 ? "trainer" : "wild"), - type: floor % 10 == 0 ? "boss" : "wild", - double: scene.currentBattle.double, - actions: [], - shop: "", - biome: getBiomeName(scene.arena.biomeType), - clearActionsFlag: false, - //pokemon: [] - }) - return drpd.waves[drpd.waves.length - 1] - } console.error("Out of wave slots??") scene.ui.showText("Out of wave slots!\nClearing duplicates...", null, () => { for (var i = 0; i < drpd.waves.length - 1; i++) { @@ -1404,7 +1389,7 @@ export function generateEditHandler(scene: BattleScene, logId: string, callback: export function logActions(scene: BattleScene, floor: integer, action: string) { if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd = getDRPD(scene) - console.log(`Logging an action: "${action}"`) + console.log("Log Action", drpd) var wv: Wave = getWave(drpd, floor, scene) if (wv.double == undefined) wv.double = false @@ -1414,7 +1399,7 @@ export function logActions(scene: BattleScene, floor: integer, action: string) { wv.actions = [] } wv.actions.push(action) - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** @@ -1428,43 +1413,18 @@ export function logActions(scene: BattleScene, floor: integer, action: string) { export function appendAction(scene: BattleScene, floor: integer, action: string) { if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd = getDRPD(scene) + console.log("Append to Action", drpd) var wv: Wave = getWave(drpd, floor, scene) + if (wv.double == undefined) + wv.double = false if (wv.clearActionsFlag) { console.log("Triggered clearActionsFlag") wv.clearActionsFlag = false wv.actions = [] } - console.log(`Appending to an action: "${wv.actions[wv.actions.length - 1]}" + "${action}"`) - if (wv.double == undefined) - wv.double = false wv.actions[wv.actions.length - 1] = wv.actions[wv.actions.length - 1] + action - console.log("--> ", drpd) - localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) -} -/** - * Logs the actions that the player took. - * - * This includes attacks you perform, items you transfer during the shop, Poke Balls you throw, running from battl, (or attempting to), and switching (including pre-switches). - * @param scene The BattleScene. Used to get the log ID. - * @param floor The wave index to write to. - * @param action The text you want to add to the actions list. - * - * @see resetWaveActions - */ -export function getActionCount(scene: BattleScene, floor: integer) { - if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) - var drpd = getDRPD(scene) - console.log(`Checking action count`) console.log(drpd) - var wv: Wave = getWave(drpd, floor, scene) - if (wv.double == undefined) - wv.double = false - if (wv.clearActionsFlag) { - console.log("Triggered clearActionsFlag") - wv.clearActionsFlag = false - wv.actions = [] - } - return (wv.actions.length) + localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** * Logs that a Pokémon was captured. @@ -1475,11 +1435,11 @@ export function getActionCount(scene: BattleScene, floor: integer) { export function logCapture(scene: BattleScene, floor: integer, target: EnemyPokemon) { //if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd = getDRPD(scene) - console.log(`Logging successful capture: ${target.name}`) + console.log("Log Capture", drpd) var wv: Wave = getWave(drpd, floor, scene) var pkslot = target.partyslot wv.pokemon[pkslot].captured = true; - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** @@ -1491,12 +1451,12 @@ export function logCapture(scene: BattleScene, floor: integer, target: EnemyPoke export function logPlayerTeam(scene: BattleScene) { if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd = getDRPD(scene) - console.log(`Logging player starters: ${scene.getParty().map(p => p.name).join(", ")}`) + console.log("Log Player Starters", drpd) var P = scene.getParty() for (var i = 0; i < P.length; i++) { drpd.starters[i] = exportPokemon(P[i]) } - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** @@ -1511,7 +1471,7 @@ export function logPokemon(scene: BattleScene, floor: integer = undefined, slot: if (floor == undefined) floor = scene.currentBattle.waveIndex if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd = getDRPD(scene) - console.log(`Logging opposing team member: ${pokemon.name}`) + console.log("Log Enemy Pokemon", drpd) var wv: Wave = getWave(drpd, floor, scene) var pk: PokeData = exportPokemon(pokemon, encounterRarity) pk.source = pokemon @@ -1578,7 +1538,7 @@ export function logPokemon(scene: BattleScene, floor: integer = undefined, slot: //wv.actions = [] wv.clearActionsFlag = false; wv.shop = "" - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** @@ -1590,10 +1550,10 @@ export function logPokemon(scene: BattleScene, floor: integer = undefined, slot: export function logShop(scene: BattleScene, floor: integer, action: string) { if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd = getDRPD(scene) - console.log(`Logging shop result: "${action}"`) + console.log("Log Shop Item", drpd) var wv: Wave = getWave(drpd, floor, scene) wv.shop = action - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** @@ -1606,12 +1566,12 @@ export function logTrainer(scene: BattleScene, floor: integer = undefined) { if (localStorage.getItem(getLogID(scene)) == null) localStorage.setItem(getLogID(scene), JSON.stringify(newDocument(getMode(scene) + " Run"))) var drpd: DRPD = JSON.parse(localStorage.getItem(getLogID(scene))) as DRPD; drpd = updateLog(drpd); - console.log(`Logging trainer: ${scene.currentBattle.trainer.getTitleOnly()} ${scene.currentBattle.trainer.getNameOnly()}`) + console.log("Log Trainer", drpd) var wv: Wave = getWave(drpd, floor, scene) var t: TrainerData = exportTrainer(scene.currentBattle.trainer) wv.trainer = t wv.type = "trainer" - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } @@ -1633,7 +1593,7 @@ export function flagReset(scene: BattleScene, floor: integer = undefined) { console.log("Flag Reset", drpd) var wv = getWave(drpd, floor, scene) wv.reload = true; - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } /** @@ -1662,7 +1622,7 @@ export function flagResetIfExists(scene: BattleScene, floor: integer = undefined console.log("Flag reset as wave was already played before", drpd) var wv = getWave(drpd, floor, scene) wv.reload = true; - console.log("--> ", drpd) + console.log(drpd) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } @@ -1687,7 +1647,7 @@ export function resetWaveActions(scene: BattleScene, floor: integer = undefined, } else { wv.actions = [] } - console.log("--> ", drpd) + console.log(drpd, wv) localStorage.setItem(getLogID(scene), JSON.stringify(drpd)) } //#endregion diff --git a/src/ui/battle-info.ts b/src/ui/battle-info.ts index 0d0e0558a4d..59b8e8c86ae 100644 --- a/src/ui/battle-info.ts +++ b/src/ui/battle-info.ts @@ -551,20 +551,18 @@ export default class BattleInfo extends Phaser.GameObjects.Container { } var total_visible = 0 for (var i = 0; i < P.length; i++) { - if (P[i] != undefined) { - states[i] = "ball" - if (!party[i].hp) { - states[i] = "faint" - } else if (party[i].status) { - states[i] = (this.scene as BattleScene).showTeamSprites ? "ball" : "status" - } - if (P[i].isOnField()) { - //console.log(P[i].name + " is in battle; set it as seen") - P[i].usedInBattle = true - } - if (P[i].usedInBattle) total_visible++; - //console.log(P[i].name, P[i].getIconAtlasKey(true)) + states[i] = "ball" + if (!party[i].hp) { + states[i] = "faint" + } else if (party[i].status) { + states[i] = (this.scene as BattleScene).showTeamSprites ? "ball" : "status" } + if (P[i].isOnField()) { + //console.log(P[i].name + " is in battle; set it as seen") + P[i].usedInBattle = true + } + if (P[i].usedInBattle) total_visible++; + //console.log(P[i].name, P[i].getIconAtlasKey(true)) } console.log("Updating ball icons for party (" + P.length + ")") if (staticparty.length > 0) { @@ -715,7 +713,6 @@ export default class BattleInfo extends Phaser.GameObjects.Container { if (this.lastStatus !== StatusEffect.NONE) { this.statusIndicator.setFrame(StatusEffect[this.lastStatus].toLowerCase()); - this.statusIndicator.setVisible(!!this.lastStatus); } else if (this.player) { this.statusIndicator.setVisible(!!this.lastStatus); } else { @@ -990,9 +987,8 @@ export default class BattleInfo extends Phaser.GameObjects.Container { targets: this.statusIndicator, duration: Utils.fixedInt(125), ease: "Sine.easeInOut", - alpha: visible && this.iconsActive ? 0 : (this.lastStatus == 0 ? 0 : 1) + alpha: visible && this.iconsActive ? 0 : (!!this.lastStatus ? 1 : 0) }); - console.log(this.iconsActive, this.lastStatus, this.statusIndicator.visible, this.statusIndicator.alpha) } /**