From 789df4467dc08d6386c6b51b61f82f95b2b7c155 Mon Sep 17 00:00:00 2001 From: RedstonewolfX <108761527+RedstonewolfX@users.noreply.github.com> Date: Sat, 20 Jul 2024 09:08:24 -0400 Subject: [PATCH] Change shiny luck Disabling shiny luck now only disables your starters' shiny luck Changed wording for the logger in some places --- src/data/pokemon-species.ts | 1 + src/field/pokemon.ts | 13 ++++++++++++- src/modifier/modifier-type.ts | 6 +++--- src/phases.ts | 13 +++++-------- src/ui/starter-select-ui-handler.ts | 3 +++ src/ui/summary-ui-handler.ts | 2 +- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 2b488f330c4..df44eb28981 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -564,6 +564,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali public genderDiffs: boolean; public canChangeForm: boolean; public forms: PokemonForm[]; + public luckOverride: integer; constructor(id: Species, generation: integer, subLegendary: boolean, legendary: boolean, mythical: boolean, species: string, type1: Type, type2: Type, height: number, weight: number, ability1: Abilities, ability2: Abilities, abilityHidden: Abilities, diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 99ff0bd633f..a9cd46e242d 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -826,7 +826,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { } getLuck(): integer { - return this.luck + (this.isFusion() ? this.fusionLuck : 0); + var L1 = this.luck + var L2 = 0 + if (this.species.luckOverride) { + L1 = this.species.luckOverride + } + if (this.isFusion()) { + L2 = this.fusionLuck + if (this.fusionSpecies.luckOverride) { + L2 = this.fusionSpecies.luckOverride + } + } + return L1 + L2; } isFusion(): boolean { diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 09748ad4906..cc951262720 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -2082,7 +2082,7 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType, if (player && tierValue) { var partyLuckValue = getPartyLuckValue(party); if (scene) { - if (scene.gameMode.modeId == GameModes.DAILY && scene.disableDailyShinies) { + if (scene.gameMode.modeId == GameModes.DAILY && scene.disableDailyShinies && false) { partyLuckValue = 0 } } @@ -2110,9 +2110,9 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType, } else if (upgradeCount === undefined && player) { upgradeCount = 0; if (tier < ModifierTier.MASTER) { - var partyShinyCount = party.filter(p => p.isShiny() && !p.isFainted()).length; + var partyShinyCount = party.filter(p => p.isShiny() && !p.isFainted() && (!this.scene.disableDailyShinies || p.species.luckOverride != 0)).length; if (scene) { - if (scene.gameMode.modeId == GameModes.DAILY && scene.disableDailyShinies) { + if (scene.gameMode.modeId == GameModes.DAILY && scene.disableDailyShinies && false) { partyShinyCount = 0 } } diff --git a/src/phases.ts b/src/phases.ts index e72af27ea62..92c64545c5f 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -3193,12 +3193,7 @@ export class TurnStartPhase extends FieldPhase { //this.scene.unshiftPhase(new AttemptCapturePhase(this.scene, turnCommand.targets[0] % 2, turnCommand.cursor)); break; case Command.POKEMON: - if (this.scene.currentBattle.double) { - LoggerTools.Actions[pokemon.getBattlerIndex()] = ((turnCommand.args[0] as boolean) ? "Baton" : "Switch") + " " + LoggerTools.playerPokeName(this.scene, pokemon) + " to " + LoggerTools.playerPokeName(this.scene, turnCommand.cursor) - } else { - //LoggerTools.Actions[pokemon.getBattlerIndex()] = ((turnCommand.args[0] as boolean) ? "Baton" : "Switch") + " " + LoggerTools.playerPokeName(this.scene, pokemon) + " to " + LoggerTools.playerPokeName(this.scene, turnCommand.cursor) - LoggerTools.Actions[pokemon.getBattlerIndex()] = ((turnCommand.args[0] as boolean) ? "Baton" : "Switch") + " to " + LoggerTools.playerPokeName(this.scene, turnCommand.cursor) - } + LoggerTools.Actions[pokemon.getBattlerIndex()] = ((turnCommand.args[0] as boolean) ? "Baton" : "Switch") break; case Command.RUN: LoggerTools.Actions[pokemon.getBattlerIndex()] = "Run" @@ -3385,7 +3380,7 @@ export class TurnStartPhase extends FieldPhase { if (LoggerTools.Actions.length > 1 && (LoggerTools.Actions[0] == "" || LoggerTools.Actions[0] == undefined || LoggerTools.Actions[0] == null)) LoggerTools.Actions.shift() // If the left slot isn't doing anything, delete its entry - LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, LoggerTools.Actions.join(" | ")) + LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, LoggerTools.Actions.join(" & ")) LoggerTools.logEnemyAction(this.scene, this.scene.currentBattle.waveIndex, LoggerTools.EnemyActions.join(" | ")) this.end(); @@ -5682,7 +5677,9 @@ export class SwitchPhase extends BattlePhase { LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, "Pre-switch " + (option == PartyOption.PASS_BATON ? "+ Baton" : "") + " " + LoggerTools.playerPokeName(this.scene, fieldIndex) + " to " + LoggerTools.playerPokeName(this.scene, slotIndex)) } if (LoggerTools.isFaintSwitch.value) { - LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, (option == PartyOption.PASS_BATON ? "Baton" : "Send") + " out " + LoggerTools.playerPokeName(this.scene, slotIndex)) + LoggerTools.logActions(this.scene, this.scene.currentBattle.waveIndex, (option == PartyOption.PASS_BATON ? "Baton" : "Send") + " in " + LoggerTools.playerPokeName(this.scene, slotIndex)) + } else { + LoggerTools.Actions[this.scene.getParty()[fieldIndex].getBattlerIndex()] += " to " + LoggerTools.playerPokeName(this.scene, slotIndex) } this.scene.unshiftPhase(new SwitchSummonPhase(this.scene, fieldIndex, slotIndex, this.doReturn, option === PartyOption.PASS_BATON)); } diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 0caf9ef6fa6..14b72f73be5 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -2593,6 +2593,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.starterSelectCallback = null; originalStarterSelectCallback(new Array(this.starterGens.length).fill(0).map(function (_, i) { const starterSpecies = thisObj.genSpecies[thisObj.starterGens[i]][thisObj.starterCursors[i]]; + if (this.scene.disableDailyShinies) { + starterSpecies.luckOverride = 0; + } return { species: starterSpecies, dexAttr: thisObj.starterAttr[i], diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index ae94951bc4c..e5bf2ab3eb1 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -721,7 +721,7 @@ export default class SummaryUiHandler extends UiHandler { luckLabelText.setOrigin(0, 0); profileContainer.add(luckLabelText); - const luckText = addTextObject(this.scene, 141 + luckLabelText.displayWidth + 2, 28, this.pokemon.getLuck().toString(), TextStyle.SUMMARY); + const luckText = addTextObject(this.scene, 141 + luckLabelText.displayWidth + 2, 28, this.pokemon.species.luckOverride ? `(${this.pokemon.species.luckOverride.toString()})` : this.pokemon.getLuck().toString(), TextStyle.SUMMARY); luckText.setOrigin(0, 0); luckText.setTint(getVariantTint((Math.min(this.pokemon.getLuck() - 1, 2)) as Variant)); profileContainer.add(luckText);