Reapply "Auto correct date"

This reverts commit 07593945ee.
This commit is contained in:
RedstonewolfX 2024-07-20 16:24:58 -04:00
parent a553b88a8a
commit b646995ad9
2 changed files with 18 additions and 3 deletions

View File

@ -348,6 +348,13 @@ export function enemyPokeName(scene: BattleScene, index: integer | Pokemon | Ene
* @see DRPD * @see DRPD
*/ */
function updateLog(drpd: DRPD): DRPD { function updateLog(drpd: DRPD): DRPD {
if (drpd.date[2] == "-") {
var date_month = drpd.date.substring(0, 2)
var date_day = drpd.date.substring(3, 5)
var date_year = drpd.date.substring(6, 10)
console.log(`Corrected date from ${drpd.date} to ${date_year}-${date_month}-${date_day}`)
drpd.date = `${date_year}-${date_month}-${date_day}`
}
if (drpd.version == "1.0.0") { if (drpd.version == "1.0.0") {
drpd.version = "1.0.0a" drpd.version = "1.0.0a"
console.log("Updated to 1.0.0a - changed item IDs to strings") console.log("Updated to 1.0.0a - changed item IDs to strings")
@ -1221,6 +1228,7 @@ export function setFileInfo(title: string, authors: string[]) {
console.log("Setting file " + rarityslot[1] + " to " + title + " / [" + authors.join(", ") + "]") console.log("Setting file " + rarityslot[1] + " to " + title + " / [" + authors.join(", ") + "]")
var fileID = rarityslot[1] as string var fileID = rarityslot[1] as string
var drpd = JSON.parse(localStorage.getItem(fileID)) as DRPD; var drpd = JSON.parse(localStorage.getItem(fileID)) as DRPD;
drpd = updateLog(drpd)
drpd.title = title; drpd.title = title;
for (var i = 0; i < authors.length; i++) { for (var i = 0; i < authors.length; i++) {
while (authors[i][0] == " ") { while (authors[i][0] == " ") {

View File

@ -1571,7 +1571,7 @@ export class EncounterPhase extends BattlePhase {
LoggerTools.resetWaveActions(this.scene, undefined, true) LoggerTools.resetWaveActions(this.scene, undefined, true)
if (LoggerTools.autoCheckpoints.includes(this.scene.currentBattle.waveIndex)) { if (LoggerTools.autoCheckpoints.includes(this.scene.currentBattle.waveIndex)) {
this.scene.gameData.saveGameToAuto(this.scene) //this.scene.gameData.saveGameToAuto(this.scene)
} }
if (this.scene.currentBattle.battleType === BattleType.WILD) { if (this.scene.currentBattle.battleType === BattleType.WILD) {
@ -2678,8 +2678,15 @@ export class TurnInitPhase extends FieldPhase {
}); });
var Pt = this.scene.getEnemyParty() var Pt = this.scene.getEnemyParty()
var Pt1 = [this.scene.getEnemyParty()[0], this.scene.getEnemyParty()[2], this.scene.getEnemyParty()[4]] var Pt1 = []
var Pt2 = [this.scene.getEnemyParty()[1], this.scene.getEnemyParty()[3], this.scene.getEnemyParty()[5]] var Pt2 = []
for (var i = 0; i < Pt.length; i++) {
if (i % 2 == 0) {
Pt1.push(Pt[i])
} else {
Pt2.push(Pt[i])
}
}
Pt.forEach((pokemon, i) => { Pt.forEach((pokemon, i) => {
if (pokemon != undefined) if (pokemon != undefined)
if (pokemon.hasTrainer() || true) { if (pokemon.hasTrainer() || true) {