From 81536e7e8e6dcc6f7a53ee8f17a0a061775525a1 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 10 Apr 2024 20:31:52 -0400 Subject: [PATCH 1/3] Ignore fusion species generation on egg hatch --- src/egg-hatch-phase.ts | 4 ++-- src/field/pokemon.ts | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index cfeb4749a33..f485d5b75f5 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -351,7 +351,7 @@ export class EggHatchPhase extends Phase { if (speciesOverride) { const pokemonSpecies = getPokemonSpecies(speciesOverride); - ret = this.scene.addPlayerPokemon(pokemonSpecies, 5, undefined, undefined, undefined, false); + ret = this.scene.addPlayerPokemon(pokemonSpecies, 1, undefined, undefined, undefined, false); } else { let minStarterValue: integer; let maxStarterValue: integer; @@ -405,7 +405,7 @@ export class EggHatchPhase extends Phase { const pokemonSpecies = getPokemonSpecies(species); - ret = this.scene.addPlayerPokemon(pokemonSpecies, 5, undefined, undefined, undefined, false); + ret = this.scene.addPlayerPokemon(pokemonSpecies, 1, undefined, undefined, undefined, false); } ret.trySetShiny(this.egg.gachaType === GachaType.SHINY ? 1024 : 512); diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 60c0b4abc9c..6f4d09ea7a2 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -165,13 +165,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { this.metBiome = scene.currentBattle ? scene.arena.biomeType : -1; this.pokerus = false; - const fused = new Utils.BooleanHolder(scene.gameMode.isSplicedOnly); - if (!fused.value && !this.isPlayer() && !this.hasTrainer()) - this.scene.applyModifier(EnemyFusionChanceModifier, false, fused); + if (level > 1) { + const fused = new Utils.BooleanHolder(scene.gameMode.isSplicedOnly); + if (!fused.value && !this.isPlayer() && !this.hasTrainer()) + this.scene.applyModifier(EnemyFusionChanceModifier, false, fused); - if (fused.value) { - this.calculateStats(); - this.generateFusionSpecies(); + if (fused.value) { + this.calculateStats(); + this.generateFusionSpecies(); + } } } @@ -706,7 +708,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { return allAbilities[ABILITY_OVERRIDE]; if (OPP_ABILITY_OVERRIDE && !this.isPlayer()) return allAbilities[OPP_ABILITY_OVERRIDE]; - if (this.fusionSpecies) + if (this.isFusion()) return allAbilities[this.getFusionSpeciesForm().getAbility(this.fusionAbilityIndex)]; let abilityId = this.getSpeciesForm().getAbility(this.abilityIndex); if (abilityId === Abilities.NONE) From f418fe294aa812f0198d34951f4d012a1e5a479f Mon Sep 17 00:00:00 2001 From: Stophles <71789013+Stophles@users.noreply.github.com> Date: Wed, 10 Apr 2024 19:23:19 -0500 Subject: [PATCH 2/3] Rapid Spin now removes traps/seeds, added (P) back on Rapid Spin now removes the tags for trapping moves and seeds rather than having them lapse. Re-added the (P) to the move since clearing arena hazards hasn't been implemented yet. --- src/data/move.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index b3a1902b086..a296e3b4884 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3562,9 +3562,9 @@ export function initMoves() { .attr(AddBattlerTagAttr, BattlerTagType.ENCORE, false, true) .condition((user, target, move) => new EncoreTag(user.id).canAdd(target)), new AttackMove(Moves.PURSUIT, "Pursuit (P)", Type.DARK, MoveCategory.PHYSICAL, 40, 100, 20, "The power of this attack move is doubled if it's used on a target that's switching out of battle.", -1, 0, 2), - new AttackMove(Moves.RAPID_SPIN, "Rapid Spin", Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, "A spin attack that can also eliminate such moves as Bind, Wrap, and Leech Seed. This also raises the user's Speed stat.", 100, 0, 2) + new AttackMove(Moves.RAPID_SPIN, "Rapid Spin (P)", Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, "A spin attack that can also eliminate such moves as Bind, Wrap, and Leech Seed. This also raises the user's Speed stat.", 100, 0, 2) .attr(StatChangeAttr, BattleStat.SPD, 1, true) - .attr(LapseBattlerTagAttr, [ BattlerTagType.BIND, BattlerTagType.WRAP, BattlerTagType.FIRE_SPIN, BattlerTagType.WHIRLPOOL, BattlerTagType.CLAMP, BattlerTagType.SAND_TOMB, BattlerTagType.MAGMA_STORM, BattlerTagType.THUNDER_CAGE, BattlerTagType.SEEDED ], true), + .attr(RemoveBattlerTagAttr, [ BattlerTagType.BIND, BattlerTagType.WRAP, BattlerTagType.FIRE_SPIN, BattlerTagType.WHIRLPOOL, BattlerTagType.CLAMP, BattlerTagType.SAND_TOMB, BattlerTagType.MAGMA_STORM, BattlerTagType.THUNDER_CAGE, BattlerTagType.SEEDED ], true), new StatusMove(Moves.SWEET_SCENT, "Sweet Scent", Type.NORMAL, 100, 20, "A sweet scent that harshly lowers opposing Pokémon's evasiveness.", -1, 0, 2) .attr(StatChangeAttr, BattleStat.EVA, -1) .target(MoveTarget.ALL_NEAR_ENEMIES), From 8dc96c0070378777a5aea51c745f4f876015b96e Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 10 Apr 2024 20:57:22 -0400 Subject: [PATCH 3/3] Fix triggering summon ability on load --- src/phases.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/phases.ts b/src/phases.ts index b8414e6b77f..8c983317239 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -326,9 +326,9 @@ export class TitlePhase extends Phase { if (this.loaded) { const availablePartyMembers = this.scene.getParty().filter(p => !p.isFainted()).length; - this.scene.pushPhase(new SummonPhase(this.scene, 0)); + this.scene.pushPhase(new SummonPhase(this.scene, 0, true, true)); if (this.scene.currentBattle.double && availablePartyMembers > 1) - this.scene.pushPhase(new SummonPhase(this.scene, 1)); + this.scene.pushPhase(new SummonPhase(this.scene, 1, true, true)); if (this.scene.currentBattle.waveIndex > 1 && this.scene.currentBattle.battleType !== BattleType.TRAINER) { this.scene.pushPhase(new CheckSwitchPhase(this.scene, 0, this.scene.currentBattle.double)); if (this.scene.currentBattle.double && availablePartyMembers > 1) @@ -1074,8 +1074,12 @@ export class SwitchBiomePhase extends BattlePhase { } export class SummonPhase extends PartyMemberPokemonPhase { - constructor(scene: BattleScene, fieldIndex: integer, player?: boolean) { - super(scene, fieldIndex, player !== undefined ? player : true); + private loaded: boolean; + + constructor(scene: BattleScene, fieldIndex: integer, player: boolean = true, loaded: boolean = false) { + super(scene, fieldIndex, player); + + this.loaded = loaded; } start() { @@ -1203,9 +1207,11 @@ export class SummonPhase extends PartyMemberPokemonPhase { pokemon.resetTurnData(); - this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); + if (!this.loaded) { + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); - this.queuePostSummon(); + this.queuePostSummon(); + } } queuePostSummon(): void {