mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-26 09:19:31 +02:00
Reapply "Merge branch 'main' of https://github.com/PokeRogue-Projects/Pathing-Tool"
This reverts commit 722ed15017
.
This commit is contained in:
parent
708ae2699d
commit
c122d417cf
31
.github/workflows/auto-update.yml
vendored
Normal file
31
.github/workflows/auto-update.yml
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
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
|
@ -721,6 +721,21 @@ 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++) {
|
||||
@ -1389,7 +1404,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("Log Action", drpd)
|
||||
console.log(`Logging an action: "${action}"`)
|
||||
var wv: Wave = getWave(drpd, floor, scene)
|
||||
if (wv.double == undefined)
|
||||
wv.double = false
|
||||
@ -1399,7 +1414,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))
|
||||
}
|
||||
/**
|
||||
@ -1413,7 +1428,34 @@ 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.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
|
||||
@ -1422,9 +1464,7 @@ export function appendAction(scene: BattleScene, floor: integer, action: string)
|
||||
wv.clearActionsFlag = false
|
||||
wv.actions = []
|
||||
}
|
||||
wv.actions[wv.actions.length - 1] = wv.actions[wv.actions.length - 1] + action
|
||||
console.log(drpd)
|
||||
localStorage.setItem(getLogID(scene), JSON.stringify(drpd))
|
||||
return (wv.actions.length)
|
||||
}
|
||||
/**
|
||||
* Logs that a Pokémon was captured.
|
||||
@ -1435,11 +1475,11 @@ export function appendAction(scene: BattleScene, floor: integer, action: string)
|
||||
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("Log Capture", drpd)
|
||||
console.log(`Logging successful capture: ${target.name}`)
|
||||
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))
|
||||
}
|
||||
/**
|
||||
@ -1451,12 +1491,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("Log Player Starters", drpd)
|
||||
console.log(`Logging player starters: ${scene.getParty().map(p => p.name).join(", ")}`)
|
||||
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))
|
||||
}
|
||||
/**
|
||||
@ -1471,7 +1511,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("Log Enemy Pokemon", drpd)
|
||||
console.log(`Logging opposing team member: ${pokemon.name}`)
|
||||
var wv: Wave = getWave(drpd, floor, scene)
|
||||
var pk: PokeData = exportPokemon(pokemon, encounterRarity)
|
||||
pk.source = pokemon
|
||||
@ -1538,7 +1578,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))
|
||||
}
|
||||
/**
|
||||
@ -1550,10 +1590,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("Log Shop Item", drpd)
|
||||
console.log(`Logging shop result: "${action}"`)
|
||||
var wv: Wave = getWave(drpd, floor, scene)
|
||||
wv.shop = action
|
||||
console.log(drpd)
|
||||
console.log("--> ", drpd)
|
||||
localStorage.setItem(getLogID(scene), JSON.stringify(drpd))
|
||||
}
|
||||
/**
|
||||
@ -1566,12 +1606,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("Log Trainer", drpd)
|
||||
console.log(`Logging trainer: ${scene.currentBattle.trainer.getTitleOnly()} ${scene.currentBattle.trainer.getNameOnly()}`)
|
||||
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))
|
||||
}
|
||||
|
||||
@ -1593,7 +1633,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))
|
||||
}
|
||||
/**
|
||||
@ -1622,7 +1662,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))
|
||||
}
|
||||
|
||||
@ -1647,7 +1687,7 @@ export function resetWaveActions(scene: BattleScene, floor: integer = undefined,
|
||||
} else {
|
||||
wv.actions = []
|
||||
}
|
||||
console.log(drpd, wv)
|
||||
console.log("--> ", drpd)
|
||||
localStorage.setItem(getLogID(scene), JSON.stringify(drpd))
|
||||
}
|
||||
//#endregion
|
||||
|
@ -551,18 +551,20 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
||||
}
|
||||
var total_visible = 0
|
||||
for (var i = 0; i < P.length; i++) {
|
||||
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] != 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))
|
||||
}
|
||||
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) {
|
||||
@ -713,6 +715,7 @@ 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 {
|
||||
@ -987,8 +990,9 @@ 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 ? 1 : 0)
|
||||
alpha: visible && this.iconsActive ? 0 : (this.lastStatus == 0 ? 0 : 1)
|
||||
});
|
||||
console.log(this.iconsActive, this.lastStatus, this.statusIndicator.visible, this.statusIndicator.alpha)
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user