From 5766e63272c0b0f60b30779f0c10225d1d88c2dc Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 27 Feb 2024 21:34:21 -0500 Subject: [PATCH] Fix various bugs --- src/data/egg.ts | 3 ++- src/phases.ts | 4 ++-- src/pokemon.ts | 14 +++++--------- src/ui/summary-ui-handler.ts | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/data/egg.ts b/src/data/egg.ts index d59b13091bc..9e38db09395 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -105,7 +105,8 @@ export function getLegendaryGachaSpeciesForTimestamp(scene: BattleScene, timesta } export function getTypeGachaTypeForTimestamp(scene: BattleScene, timestamp: integer): Type { - const types = Utils.getEnumValues(Type).slice(1); + const allTypes = Utils.getEnumValues(Type); + const types = allTypes.slice(1, allTypes.length - 1); let ret: Type; scene.executeWithSeedOffset(() => { diff --git a/src/phases.ts b/src/phases.ts index aacdf2fe60a..8b6ca8f2fd3 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2091,11 +2091,11 @@ export class MoveEffectPhase extends PokemonPhase { Utils.executeIf(!isProtected && !chargeEffect, () => applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.HIT, user, target, this.move.getMove()).then(() => { return Utils.executeIf(!target.isFainted(), () => applyPostDefendAbAttrs(PostDefendAbAttr, target, user, this.move, hitResult).then(() => { - if (!user.isPlayer() && this.move instanceof AttackMove) + if (!user.isPlayer() && this.move.getMove() instanceof AttackMove) user.scene.applyModifiers(EnemyAttackStatusEffectChanceModifier, false, target); })).then(() => { applyPostAttackAbAttrs(PostAttackAbAttr, user, target, this.move, hitResult).then(() => { - if (this.move instanceof AttackMove) + if (this.move.getMove() instanceof AttackMove) this.scene.applyModifiers(ContactHeldItemTransferChanceModifier, this.player, user, target.getFieldIndex()); resolve(); }); diff --git a/src/pokemon.ts b/src/pokemon.ts index 1fe8f7dbc12..8117f9bf105 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -2038,15 +2038,11 @@ export class PlayerPokemon extends Pokemon { fuse(pokemon: PlayerPokemon): Promise { return new Promise(resolve => { - if (this.species.speciesId === Species.KYUREM && (pokemon.species.speciesId === Species.RESHIRAM || pokemon.species.speciesId === Species.ZEKROM)) - this.formIndex = pokemon.species.speciesId === Species.RESHIRAM ? 1 : 2; - else { - this.fusionSpecies = pokemon.species; - this.fusionFormIndex = pokemon.formIndex; - this.fusionAbilityIndex = pokemon.abilityIndex; - this.fusionShiny = pokemon.shiny; - this.fusionGender = pokemon.gender; - } + this.fusionSpecies = pokemon.species; + this.fusionFormIndex = pokemon.formIndex; + this.fusionAbilityIndex = pokemon.abilityIndex; + this.fusionShiny = pokemon.shiny; + this.fusionGender = pokemon.gender; this.scene.validateAchv(achvs.SPLICE); this.scene.gameData.gameStats.pokemonFused++; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index 664ea3816ae..c6d2a65ab6e 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -565,7 +565,7 @@ export default class SummaryUiHandler extends UiHandler { const natureStatMultiplier = getNatureStatMultiplier(this.pokemon.nature, s); - const statLabel = addTextObject(this.scene, 27 + 115 * colIndex, 56 + 16 * rowIndex, statName, natureStatMultiplier === 1 ? TextStyle.SUMMARY : natureStatMultiplier > 1 ? TextStyle.SUMMARY_BLUE : TextStyle.SUMMARY_PINK); + const statLabel = addTextObject(this.scene, 27 + 115 * colIndex, 56 + 16 * rowIndex, statName, natureStatMultiplier === 1 ? TextStyle.SUMMARY : natureStatMultiplier > 1 ? TextStyle.SUMMARY_PINK : TextStyle.SUMMARY_BLUE); statLabel.setOrigin(0.5, 0); statsContainer.add(statLabel);