From bb28d3599e5b141cf2dde4c24672da3086dac839 Mon Sep 17 00:00:00 2001 From: Jeremy B Date: Wed, 8 May 2024 00:32:38 -0500 Subject: [PATCH 1/4] fix scrappy and mindseye working as passive ability (#567) * fix scrappy and mindseye working as passive ability * update apply for ignoretypeimmunityabattr * simplify logic for ignoretypeimmunityabattr --------- Co-authored-by: contra1337 --- src/data/ability.ts | 11 ++++++----- src/field/pokemon.ts | 16 +++++++++------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 88cf2d10b97..0d2c0cc27f5 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2496,11 +2496,11 @@ export class IgnoreTypeImmunityAbAttr extends AbAttr { } apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { - if (this.defenderType !== (args[1] as Type)) { - return false; + if (this.defenderType === (args[1] as Type) && this.allowedMoveTypes.includes(args[0] as Type)) { + cancelled.value = true; + return true; } - - return this.allowedMoveTypes.some(type => type === (args[0] as Type)); + return false; } } @@ -3606,7 +3606,8 @@ export function initAbilities() { .partial(), new Ability(Abilities.MINDS_EYE, 9) .attr(IgnoreTypeImmunityAbAttr, Type.GHOST, [Type.NORMAL, Type.FIGHTING]) - .ignorable(), // TODO: evasiveness bypass should not be ignored, but accuracy immunity should + .ignorable() // TODO: evasiveness bypass should not be ignored, but accuracy immunity should + .partial(), new Ability(Abilities.SUPERSWEET_SYRUP, 9) .attr(PostSummonStatChangeAbAttr, BattleStat.EVA, -1) .condition(getOncePerBattleCondition(Abilities.SUPERSWEET_SYRUP)), diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 9ac3aec53ac..8110bf96bfd 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -908,14 +908,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return this.isTerastallized() ? 2 : 1; const types = this.getTypes(true, true); - const ignorableImmunities = source?.getAbility()?.getAttrs(IgnoreTypeImmunityAbAttr) || []; - const cancelled = new Utils.BooleanHolder(false); + let multiplier = types.map(defType => { + if (source) { + const ignoreImmunity = new Utils.BooleanHolder(false); + applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType); + if (ignoreImmunity.value) + return 1; + } - let multiplier = types.map(defType => - ignorableImmunities.some(attr => attr.apply(source, false, cancelled, [moveType, defType])) - ? 1 - : getTypeDamageMultiplier(moveType, defType) - ).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier; + return getTypeDamageMultiplier(moveType, defType); + }).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier; // Handle strong winds lowering effectiveness of types super effective against pure flying if (this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && multiplier >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(moveType, Type.FLYING) === 2) From b6692e42b2dc6bec3b4a3f1b6dafef777e9873e6 Mon Sep 17 00:00:00 2001 From: Gray <78218921+Cargney@users.noreply.github.com> Date: Wed, 8 May 2024 17:25:47 +0200 Subject: [PATCH 2/4] Fix Flare Blitz in Gravity (#637) This condition is out of place since Flare Blitz is not supposed to fail if used in Gravity. --- src/data/move.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 17c37df0860..455c1bc29be 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5132,7 +5132,6 @@ export function initMoves() { .attr(RecoilAttr, false, 0.33) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.BURN) - .condition(failOnGravityCondition) .recklessMove(), new AttackMove(Moves.FORCE_PALM, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 100, 10, 30, 0, 4) .attr(StatusEffectAttr, StatusEffect.PARALYSIS), From 662319e9ac8cbd2e2e24a2cd70c671d69548d16b Mon Sep 17 00:00:00 2001 From: Akuma-Reiki <66755974+Akuma-Reiki@users.noreply.github.com> Date: Wed, 8 May 2024 12:01:05 -0500 Subject: [PATCH 3/4] Candy/Ribbon UI Improvement (#622) * Candy/Ribbon UI Update * Removes the overrides No level 2000000000000000 runs for you * checks for all root species --- src/ui/starter-select-ui-handler.ts | 5 ++--- src/ui/summary-ui-handler.ts | 34 ++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 0de2ba9ac98..087f24362ed 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -414,7 +414,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.classicWinIcons = new Array(81).fill(null).map((_, i) => { const x = (i % 9) * 18; const y = Math.floor(i / 9) * 18; - const ret = this.scene.add.image(x + 152, y + 16, 'champion_ribbon'); + const ret = this.scene.add.image(x + 153, y + 21, 'champion_ribbon'); ret.setOrigin(0, 0); ret.setScale(0.5); ret.setVisible(false); @@ -462,7 +462,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.pokemonCandyDarknessOverlay.setScale(0.5); this.pokemonCandyDarknessOverlay.setOrigin(0, 0); this.pokemonCandyDarknessOverlay.setTint(0x000000); - this.pokemonCandyDarknessOverlay.setAlpha(0.5); + this.pokemonCandyDarknessOverlay.setAlpha(0.50); this.pokemonCandyDarknessOverlay.setInteractive(new Phaser.Geom.Rectangle(0, 0, 16, 16), Phaser.Geom.Rectangle.Contains); this.starterSelectContainer.add(this.pokemonCandyDarknessOverlay); @@ -1332,7 +1332,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } this.pokemonCandyDarknessOverlay.setCrop(0,0,16, candyCropY); - this.pokemonCandyDarknessOverlay.setCrop(0,0,16, candyCropY); } this.iconAnimHandler.addOrUpdate(this.starterSelectGenIconContainers[species.generation - 1].getAt(this.genSpecies[species.generation - 1].indexOf(species)) as Phaser.GameObjects.Sprite, PokemonIconAnimMode.PASSIVE); diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index ac04d41be5f..0865cba4859 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -50,6 +50,8 @@ export default class SummaryUiHandler extends UiHandler { private candyShadow: Phaser.GameObjects.Sprite; private candyIcon: Phaser.GameObjects.Sprite; private candyOverlay: Phaser.GameObjects.Sprite; + private candyCountText: Phaser.GameObjects.Text; + private championRibbon: Phaser.GameObjects.Image; private statusContainer: Phaser.GameObjects.Container; private status: Phaser.GameObjects.Image; private summaryPageContainer: Phaser.GameObjects.Container; @@ -142,12 +144,6 @@ export default class SummaryUiHandler extends UiHandler { this.pokeball.setOrigin(0, 1); this.summaryContainer.add(this.pokeball); - this.candyShadow = this.scene.add.sprite(13, -140, 'candy'); - this.candyShadow.setTint(0x141414) - this.candyShadow.setScale(0.8); - this.candyShadow.setInteractive(new Phaser.Geom.Rectangle(0, 0, 16, 16), Phaser.Geom.Rectangle.Contains); - this.summaryContainer.add(this.candyShadow); - this.candyIcon = this.scene.add.sprite(13, -140, 'candy'); this.candyIcon.setScale(0.8); this.summaryContainer.add(this.candyIcon); @@ -156,6 +152,24 @@ export default class SummaryUiHandler extends UiHandler { this.candyOverlay.setScale(0.8); this.summaryContainer.add(this.candyOverlay); + this.candyShadow = this.scene.add.sprite(13, -140, 'candy'); + this.candyShadow.setTint(0x000000); + this.candyShadow.setAlpha(0.50); + this.candyShadow.setScale(0.8); + this.candyShadow.setInteractive(new Phaser.Geom.Rectangle(0, 0, 16, 16), Phaser.Geom.Rectangle.Contains); + this.summaryContainer.add(this.candyShadow); + + this.candyCountText = addTextObject(this.scene, 20, -146, 'x0', TextStyle.WINDOW_ALT, { fontSize: '76px' }); + this.candyCountText.setOrigin(0, 0); + this.summaryContainer.add(this.candyCountText); + + this.championRibbon = this.scene.add.image(88, -146, 'champion_ribbon'); + this.championRibbon.setOrigin(0, 0); + //this.championRibbon.setScale(0.8); + this.championRibbon.setScale(1.25); + this.summaryContainer.add(this.championRibbon); + this.championRibbon.setVisible(false); + this.levelText = addTextObject(this.scene, 36, -17, '', TextStyle.SUMMARY_ALT); this.levelText.setOrigin(0, 1); this.summaryContainer.add(this.levelText); @@ -275,6 +289,9 @@ export default class SummaryUiHandler extends UiHandler { this.splicedIcon.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip()); } + if(this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].classicWinCount > 0 && this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId(true)].classicWinCount > 0) + this.championRibbon.setVisible(true); + var currentFriendship = this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].friendship; if (!currentFriendship || currentFriendship === undefined) currentFriendship = 0; @@ -287,8 +304,9 @@ export default class SummaryUiHandler extends UiHandler { this.candyShadow.on('pointerout', () => (this.scene as BattleScene).ui.hideTooltip()); } - this.candyIcon.setCrop(0,candyCropY,16, 16); - this.candyOverlay.setCrop(0,candyCropY,16, 16); + this.candyCountText.setText(`x${this.scene.gameData.starterData[this.pokemon.species.getRootSpeciesId()].candyCount}`); + + this.candyShadow.setCrop(0,0,16, candyCropY); const doubleShiny = isFusion && this.pokemon.shiny && this.pokemon.fusionShiny; const baseVariant = !doubleShiny ? this.pokemon.getVariant() : this.pokemon.variant; From e93777e52a9d4c53dd0bbd7d966593e40d24b363 Mon Sep 17 00:00:00 2001 From: Lugiad Date: Wed, 8 May 2024 19:08:34 +0200 Subject: [PATCH 4/4] Names of the languages in their respectives languages (#635) * Names of the languages in their respectives languages in settings * Names of the languages in their respectives languages --- src/system/settings.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/system/settings.ts b/src/system/settings.ts index 3805a35bb95..054bdc9fc9c 100644 --- a/src/system/settings.ts +++ b/src/system/settings.ts @@ -183,19 +183,19 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer) handler: () => changeLocaleHandler('en') }, { - label: 'Spanish', + label: 'Español', handler: () => changeLocaleHandler('es') }, { - label: 'Italian', + label: 'Italiano', handler: () => changeLocaleHandler('it') }, { - label: 'French', + label: 'Français', handler: () => changeLocaleHandler('fr') }, { - label: 'German', + label: 'Deutsch', handler: () => changeLocaleHandler('de') }, {