From 0758c44670a9df84a80bf5b52333a6d3e258d3c7 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Tue, 16 Apr 2024 18:26:10 -0400 Subject: [PATCH 01/17] Add types to move translations --- src/locales/en/move.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/locales/en/move.ts b/src/locales/en/move.ts index c111fcc45b6..b17d1ef3755 100644 --- a/src/locales/en/move.ts +++ b/src/locales/en/move.ts @@ -1,4 +1,13 @@ -export const move = { +interface MoveTranslationEntry { + name: string, + effect: string +} + +interface MoveTranslations { + [key: string]: MoveTranslationEntry +} + +export const move: MoveTranslations = { "pound": { name: "Pound", effect: "The target is physically pounded with a long tail, a foreleg, or the like." From 5d1cd974112800b6d2e3762ba6c4925768d85a7a Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Wed, 17 Apr 2024 00:01:28 -0500 Subject: [PATCH 02/17] Add G-Max move strings to the move locale file Also a minor fix to decapitalize Mud and Water Sport's fade out messages. --- src/data/arena-tag.ts | 4 +- src/data/biomes.ts | 4 +- src/locales/en/move.ts | 132 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 4 deletions(-) diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index 2f6305862d8..642cc72404a 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -175,7 +175,7 @@ class MudSportTag extends WeakenMoveTypeTag { } onRemove(arena: Arena): void { - arena.scene.queueMessage('The effects of MUD SPORT\nhave faded.'); + arena.scene.queueMessage('The effects of Mud Sport\nhave faded.'); } } @@ -189,7 +189,7 @@ class WaterSportTag extends WeakenMoveTypeTag { } onRemove(arena: Arena): void { - arena.scene.queueMessage('The effects of WATER SPORT\nhave faded.'); + arena.scene.queueMessage('The effects of Water Sport\nhave faded.'); } } diff --git a/src/data/biomes.ts b/src/data/biomes.ts index e440321c73f..1bea78f3e50 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -4144,7 +4144,7 @@ export const biomeTrainerPools: BiomeTrainerPools = { ], [ Species.MIME_JR, Type.PSYCHIC, Type.FAIRY, [ ] ], - [ Species.HAPPINY, Type.NORMAL, -1, [] + [ Species.HAPPINY, Type.NORMAL, -1, [ ] ], [ Species.CHATOT, Type.NORMAL, Type.FLYING, [ [ Biome.JUNGLE, BiomePoolTier.SUPER_RARE ] @@ -6057,7 +6057,7 @@ export const biomeTrainerPools: BiomeTrainerPools = { [ Biome.SEABED, BiomePoolTier.BOSS ] ] ], - [ Species.TOXEL, Type.ELECTRIC, Type.POISON, [] + [ Species.TOXEL, Type.ELECTRIC, Type.POISON, [ ] ], [ Species.TOXTRICITY, Type.ELECTRIC, Type.POISON, [ [ Biome.SLUM, BiomePoolTier.RARE, [ TimeOfDay.DUSK, TimeOfDay.NIGHT ] ], diff --git a/src/locales/en/move.ts b/src/locales/en/move.ts index b17d1ef3755..c8a527a4eb0 100644 --- a/src/locales/en/move.ts +++ b/src/locales/en/move.ts @@ -3408,6 +3408,138 @@ export const move: MoveTranslations = { name: "Take Heart", effect: "The user lifts its spirits, curing its own status conditions and boosting its Sp. Atk and Sp. Def stats." }, + "gMaxWildfire": { + name: "G-Max Wildfire", + effect: "A Fire-type attack that Gigantamax Charizard use. This move continues to deal damage to opponents for four turns." + }, + "gMaxBefuddle": { + name: "G-Max Befuddle", + effect: "A Bug-type attack that Gigantamax Butterfree use. This move inflicts the poisoned, paralyzed, or asleep status condition on opponents." + }, + "gMaxVoltCrash": { + name: "G-Max Volt Crash", + effect: "An Electric-type attack that Gigantamax Pikachu use. This move paralyzes opponents." + }, + "gMaxGoldRush": { + name: "G-Max Gold Rush", + effect: "A Normal-type attack that Gigantamax Meowth use. This move confuses opponents and also earns extra money." + }, + "gMaxChiStrike": { + name: "G-Max Chi Strike", + effect: "A Fighting-type attack that Gigantamax Machamp use. This move raises the chance of critical hits." + }, + "gMaxTerror": { + name: "G-Max Terror", + effect: "A Ghost-type attack that Gigantamax Gengar use. This Pokémon steps on the opposing Pokémon's shadow to prevent them from escaping." + }, + "gMaxResonance": { + name: "G-Max Resonance", + effect: "An Ice-type attack that Gigantamax Lapras use. This move reduces the damage received for five turns." + }, + "gMaxCuddle": { + name: "G-Max Cuddle", + effect: "A Normal-type attack that Gigantamax Eevee use. This move infatuates opponents." + }, + "gMaxReplenish": { + name: "G-Max Replenish", + effect: "A Normal-type attack that Gigantamax Snorlax use. This move restores Berries that have been eaten." + }, + "gMaxMalodor": { + name: "G-Max Malodor", + effect: "A Poison-type attack that Gigantamax Garbodor use. This move poisons opponents." + }, + "gMaxStonesurge": { + name: "G-Max Stonesurge", + effect: "A Water-type attack that Gigantamax Drednaw use. This move scatters sharp rocks around the field." + }, + "gMaxWindRage": { + name: "G-Max Wind Rage", + effect: "A Flying-type attack that Gigantamax Corviknight use. This move removes the effects of moves like Reflect and Light Screen." + }, + "gMaxStunShock": { + name: "G-Max Stun Shock", + effect: "An Electric-type attack that Gigantamax Toxtricity use. This move poisons or paralyzes opponents." + }, + "gMaxFinale": { + name: "G-Max Finale", + effect: "A Fairy-type attack that Gigantamax Alcremie use. This move heals the HP of allies." + }, + "gMaxDepletion": { + name: "G-Max Depletion", + effect: "A Dragon-type attack that Gigantamax Duraludon use. Reduces the PP of the last move used." + }, + "gMaxGravitas": { + name: "G-Max Gravitas", + effect: "A Psychic-type attack that Gigantamax Orbeetle use. This move changes gravity for five turns." + }, + "gMaxVolcalith": { + name: "G-Max Volcalith", + effect: "A Rock-type attack that Gigantamax Coalossal use. This move continues to deal damage to opponents for four turns." + }, + "gMaxSandblast": { + name: "G-Max Sandblast", + effect: "A Ground-type attack that Gigantamax Sandaconda use. Opponents are trapped in a raging sandstorm for four to five turns." + }, + "gMaxSnooze": { + name: "G-Max Snooze", + effect: "A Dark-type attack that Gigantamax Grimmsnarl use. The user lets loose a huge yawn that lulls the targets into falling asleep on the next turn." + }, + "gMaxTartness": { + name: "G-Max Tartness", + effect: "A Grass-type attack that Gigantamax Flapple use. This move reduces the opponents' evasiveness." + }, + "gMaxSweetness": { + name: "G-Max Sweetness", + effect: "A Grass-type attack that Gigantamax Appletun use. This move heals the status conditions of allies." + }, + "gMaxSmite": { + name: "G-Max Smite", + effect: "A Fairy-type attack that Gigantamax Hatterene use. This move confuses opponents." + }, + "gMaxSteelsurge": { + name: "G-Max Steelsurge", + effect: "A Steel-type attack that Gigantamax Copperajah use. This move scatters sharp spikes around the field." + }, + "gMaxMeltdown": { + name: "G-Max Meltdown", + effect: "A Steel-type attack that Gigantamax Melmetal use. This move makes opponents incapable of using the same move twice in a row." + }, + "gMaxFoamBurst": { + name: "G-Max Foam Burst", + effect: "A Water-type attack that Gigantamax Kingler use. This move harshly lowers the Speed of opponents." + }, + "gMaxCentiferno": { + name: "G-Max Centiferno", + effect: "A Fire-type attack that Gigantamax Centiskorch use. This move traps opponents in flames for four to five turns." + }, + "gMaxVineLash": { + name: "G-Max Vine Lash", + effect: "A Grass-type attack that Gigantamax Venusaur use. This move continues to deal damage to opponents for four turns." + }, + "gMaxCannonade": { + name: "G-Max Cannonade", + effect: "A Water-type attack that Gigantamax Blastoise use. This move continues to deal damage to opponents for four turns." + }, + "gMaxDrumSolo": { + name: "G-Max Drum Solo", + effect: "A Grass-type attack that Gigantamax Rillaboom use. This move can be used on the target regardless of its Abilities." + }, + "gMaxFireball": { + name: "G-Max Fireball", + effect: "A Fire-type attack that Gigantamax Cinderace use. This move can be used on the target regardless of its Abilities." + }, + "gMaxHydrosnipe": { + name: "G-Max Hydrosnipe", + effect: "A Water-type attack that Gigantamax Inteleon use. This move can be used on the target regardless of its Abilities." + }, + "gMaxOneBlow": { + name: "G-Max One Blow", + effect: "A Dark-type attack that Gigantamax Urshifu use. This single-strike move can ignore Max Guard." + }, + "gMaxRapidFlow": { + name: "G-Max Rapid Flow", + effect: "A Water-type attack that Gigantamax Urshifu use. This rapid-strike move can ignore Max Guard." + }, "teraBlast": { name: "Tera Blast", effect: "If the user has Terastallized, it unleashes energy of its Tera Type. This move inflicts damage using the Attack or Sp. Atk stat-whichever is higher for the user." From db92663daa97e3367ba95f34ee21c5422609e35e Mon Sep 17 00:00:00 2001 From: Robert Antonius <40657895+roberika@users.noreply.github.com> Date: Wed, 17 Apr 2024 09:56:13 +0700 Subject: [PATCH 03/17] Fixed switch out attacks trigger contact for the replacement pokemon Changed force switch out attribute to be applied after the move is done. Additionally manually typed switch out attacks to be non baton pass moves. --- src/data/move.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 938a911f057..2e5ab23cb26 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2676,7 +2676,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr { private batonPass: boolean; constructor(user?: boolean, batonPass?: boolean) { - super(false, MoveEffectTrigger.HIT, true); + super(false, MoveEffectTrigger.POST_APPLY, true); this.user = !!user; this.batonPass = !!batonPass; } @@ -4491,7 +4491,7 @@ export function initMoves() { .makesContact(false) .target(MoveTarget.ATTACKER), new AttackMove(Moves.U_TURN, Type.BUG, MoveCategory.PHYSICAL, 70, 100, 20, -1, 0, 4) - .attr(ForceSwitchOutAttr, true), + .attr(ForceSwitchOutAttr, true, false), new AttackMove(Moves.CLOSE_COMBAT, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, 100, 0, 4) .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true), new AttackMove(Moves.PAYBACK, Type.DARK, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 4) @@ -4895,7 +4895,7 @@ export function initMoves() { new AttackMove(Moves.GRASS_PLEDGE, Type.GRASS, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 5) .partial(), new AttackMove(Moves.VOLT_SWITCH, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 5) - .attr(ForceSwitchOutAttr, true), + .attr(ForceSwitchOutAttr, true, false), new AttackMove(Moves.STRUGGLE_BUG, Type.BUG, MoveCategory.SPECIAL, 50, 100, 20, 100, 0, 5) .attr(StatChangeAttr, BattleStat.SPATK, -1) .target(MoveTarget.ALL_NEAR_ENEMIES), @@ -5041,7 +5041,7 @@ export function initMoves() { .target(MoveTarget.ALL_NEAR_ENEMIES), new StatusMove(Moves.PARTING_SHOT, Type.DARK, 100, 20, 100, 0, 6) .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.SPATK ], -1) - .attr(ForceSwitchOutAttr, true) + .attr(ForceSwitchOutAttr, true, false) .soundBased(), new StatusMove(Moves.TOPSY_TURVY, Type.DARK, -1, 20, -1, 0, 6) .attr(InvertStatsAttr), @@ -5665,7 +5665,7 @@ export function initMoves() { .attr(StatChangeAttr, [ BattleStat.ATK, BattleStat.DEF ], 1) .target(MoveTarget.NEAR_ALLY), new AttackMove(Moves.FLIP_TURN, Type.WATER, MoveCategory.PHYSICAL, 60, 100, 20, -1, 0, 8) - .attr(ForceSwitchOutAttr, true), + .attr(ForceSwitchOutAttr, true, false), new AttackMove(Moves.TRIPLE_AXEL, Type.ICE, MoveCategory.PHYSICAL, 20, 90, 10, -1, 0, 8) .attr(MultiHitAttr, MultiHitType._3_INCR) .attr(MissEffectAttr, (user: Pokemon, move: Move) => { From cf2bd4d3dac48ae4ba5456ecc1208a7ea66bba3c Mon Sep 17 00:00:00 2001 From: Tempoanon <163687446+TempsRay@users.noreply.github.com> Date: Wed, 17 Apr 2024 01:09:15 -0400 Subject: [PATCH 04/17] Implement Charge and more abilities (#163) * Implement Rivalry * Implement Quick Feet, Liquid Voice, and Normalize * Forgot paralysis is half speed instead of a quarter * Remove log statements * Fix minor edge case in rivalry for gendered vs genderless * Add wind abilities and charge * Implement Charge and more abilities * Add i18n support and Beedrill fury cutter * Fix merge conflict in taunt * More English strings removed --- src/data/ability.ts | 61 ++++++++++++++++++++++++++---- src/data/battler-tags.ts | 10 ++++- src/data/enums/battler-tag-type.ts | 5 ++- src/data/move.ts | 3 +- src/data/pokemon-level-moves.ts | 1 + src/field/pokemon.ts | 9 ++++- 6 files changed, 74 insertions(+), 15 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index e130af716a4..7eecc4f26e7 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -429,6 +429,26 @@ export class MoveImmunityAbAttr extends PreDefendAbAttr { } } +export class MoveImmunityStatChangeAbAttr extends MoveImmunityAbAttr { + private stat: BattleStat; + private levels: integer; + + constructor(immuneCondition: PreDefendAbAttrCondition, stat: BattleStat, levels: integer) { + super(immuneCondition); + this.stat = stat; + this.levels = levels; + } + + applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { + const ret = super.applyPreDefend(pokemon, passive, attacker, move, cancelled, args) + if (ret) { + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + } + + return ret; + } +} + export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { private condition: PokemonDefendCondition; private stat: BattleStat; @@ -454,6 +474,25 @@ export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { } } +export class PostDefendApplyBattlerTagAbAttr extends PostDefendAbAttr { + private condition: PokemonDefendCondition; + private tagType: BattlerTagType; + constructor(condition: PokemonDefendCondition, tagType: BattlerTagType) { + super(true); + + this.condition = condition; + this.tagType = tagType; + } + + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { + if (this.condition(pokemon, attacker, move.getMove())) { + pokemon.addTag(this.tagType, undefined, undefined, pokemon.id); + return true; + } + return false; + } +} + export class PostDefendTypeChangeAbAttr extends PostDefendAbAttr { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (hitResult < HitResult.NO_EFFECT) { @@ -2535,7 +2574,9 @@ export function initAbilities() { .attr(PostVictoryStatChangeAbAttr, BattleStat.ATK, 1), new Ability(Abilities.JUSTIFIED, "Justified", "Being hit by a Dark-type move boosts the Attack stat of the Pokémon, for justice.", 5) .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.type === Type.DARK && move.category !== MoveCategory.STATUS, BattleStat.ATK, 1), - new Ability(Abilities.RATTLED, "Rattled (N)", "Dark-, Ghost-, and Bug-type moves scare the Pokémon and boost its Speed stat.", 5), + new Ability(Abilities.RATTLED, "Rattled (P)", "Intimidate or being hit by a Dark-, Ghost-, or Bug-type move will scare the Pokémon and boost its Speed stat.", 5) + .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS && (move.type === Type.DARK || move.type === Type.BUG || + move.type === Type.GHOST), BattleStat.SPD, 1), new Ability(Abilities.MAGIC_BOUNCE, "Magic Bounce (N)", "Reflects status moves instead of getting hit by them.", 5) .ignorable(), new Ability(Abilities.SAP_SIPPER, "Sap Sipper", "Boosts the Attack stat if hit by a Grass-type move instead of taking damage.", 5) @@ -2559,7 +2600,8 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr), - new Ability(Abilities.VICTORY_STAR, "Victory Star (N)", "Boosts the accuracy of its allies and itself.", 5), + new Ability(Abilities.VICTORY_STAR, "Victory Star (P)", "Boosts the accuracy of its allies and itself.", 5) + .attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 1.1), new Ability(Abilities.TURBOBLAZE, "Turboblaze", "Moves can be used on the target regardless of its Abilities.", 5) .attr(PostSummonMessageAbAttr, (pokemon: Pokemon) => getPokemonMessage(pokemon, ' is radiating a blazing aura!')) .attr(MoveAbilityBypassAbAttr), @@ -2586,7 +2628,9 @@ export function initAbilities() { .attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.BITING_MOVE), 1.5), new Ability(Abilities.REFRIGERATE, "Refrigerate", "Normal-type moves become Ice-type moves. The power of those moves is boosted a little.", 6) .attr(MoveTypeChangePowerMultiplierAbAttr, Type.NORMAL, Type.ICE, 1.2), - new Ability(Abilities.SWEET_VEIL, "Sweet Veil (N)", "Prevents itself and ally Pokémon from falling asleep.", 6) + new Ability(Abilities.SWEET_VEIL, "Sweet Veil (P)", "Prevents itself and ally Pokémon from falling asleep.", 6) + .attr(StatusEffectImmunityAbAttr, StatusEffect.SLEEP) + .attr(BattlerTagImmunityAbAttr, BattlerTagType.DROWSY) .ignorable(), new Ability(Abilities.STANCE_CHANGE, "Stance Change", "The Pokémon changes its form to Blade Forme when it uses an attack move and changes to Shield Forme when it uses King's Shield.", 6) .attr(UncopiableAbilityAbAttr) @@ -2833,7 +2877,7 @@ export function initAbilities() { new Ability(Abilities.SEED_SOWER, "Seed Sower", "Turns the ground into Grassy Terrain when the Pokémon is hit by an attack.", 9) .attr(PostDefendTerrainChangeAbAttr, TerrainType.GRASSY), new Ability(Abilities.THERMAL_EXCHANGE, "Thermal Exchange", "Boosts the Attack stat when the Pokémon is hit by a Fire-type move. The Pokémon also cannot be burned.", 9) - .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.type === Type.FIRE, BattleStat.ATK, 1) + .attr(PostDefendStatChangeAbAttr, (target, user, move) => move.type === Type.FIRE && move.category !== MoveCategory.STATUS, BattleStat.ATK, 1) .attr(StatusEffectImmunityAbAttr, StatusEffect.BURN) .ignorable(), new Ability(Abilities.ANGER_SHELL, "Anger Shell (N)", "When an attack causes its HP to drop to half or less, the Pokémon gets angry. This lowers its Defense and Sp. Def stats but boosts its Attack, Sp. Atk, and Speed stats.", 9), @@ -2844,13 +2888,15 @@ export function initAbilities() { new Ability(Abilities.WELL_BAKED_BODY, "Well-Baked Body", "The Pokémon takes no damage when hit by Fire-type moves. Instead, its Defense stat is sharply boosted.", 9) .attr(TypeImmunityStatChangeAbAttr, Type.FIRE, BattleStat.DEF, 2) .ignorable(), - new Ability(Abilities.WIND_RIDER, "Wind Rider (N)", "Boosts the Pokémon's Attack stat if Tailwind takes effect or if the Pokémon is hit by a wind move. The Pokémon also takes no damage from wind moves.", 9) + new Ability(Abilities.WIND_RIDER, "Wind Rider (P)", "Boosts the Pokémon's Attack stat if Tailwind takes effect or if the Pokémon is hit by a wind move. The Pokémon also takes no damage from wind moves.", 9) + .attr(MoveImmunityStatChangeAbAttr, (pokemon, attacker, move) => pokemon !== attacker && move.getMove().hasFlag(MoveFlags.WIND_MOVE), BattleStat.ATK, 1) .ignorable(), new Ability(Abilities.GUARD_DOG, "Guard Dog (N)", "Boosts the Pokémon's Attack stat if intimidated. Moves and items that would force the Pokémon to switch out also fail to work.", 9) .ignorable(), new Ability(Abilities.ROCKY_PAYLOAD, "Rocky Payload", "Powers up Rock-type moves.", 9) .attr(MoveTypePowerBoostAbAttr, Type.ROCK), - new Ability(Abilities.WIND_POWER, "Wind Power (N)", "The Pokémon becomes charged when it is hit by a wind move, boosting the power of the next Electric-type move the Pokémon uses.", 9), + new Ability(Abilities.WIND_POWER, "Wind Power (P)", "The Pokémon becomes charged when it is hit by a wind move, boosting the power of the next Electric-type move the Pokémon uses.", 9) + .attr(PostDefendApplyBattlerTagAbAttr, (target, user, move) => move.hasFlag(MoveFlags.WIND_MOVE), BattlerTagType.CHARGED), new Ability(Abilities.ZERO_TO_HERO, "Zero to Hero (N)", "The Pokémon transforms into its Hero Form when it switches out.", 9) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) @@ -2859,7 +2905,8 @@ export function initAbilities() { new Ability(Abilities.COMMANDER, "Commander (N)", "When the Pokémon enters a battle, it goes inside the mouth of an ally Dondozo if one is on the field. The Pokémon then issues commands from there.", 9) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr), - new Ability(Abilities.ELECTROMORPHOSIS, "Electromorphosis (N)", "The Pokémon becomes charged when it takes damage, boosting the power of the next Electric-type move the Pokémon uses.", 9), + new Ability(Abilities.ELECTROMORPHOSIS, "Electromorphosis", "The Pokémon becomes charged when it takes damage, boosting the power of the next Electric-type move the Pokémon uses.", 9) + .attr(PostDefendApplyBattlerTagAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, BattlerTagType.CHARGED), new Ability(Abilities.PROTOSYNTHESIS, "Protosynthesis", "Boosts the Pokémon's most proficient stat in harsh sunlight or if the Pokémon is holding Booster Energy.", 9) .conditionalAttr(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN), PostSummonAddBattlerTagAbAttr, BattlerTagType.PROTOSYNTHESIS, 0, true) .attr(PostWeatherChangeAddBattlerTagAttr, BattlerTagType.PROTOSYNTHESIS, 0, WeatherType.SUNNY, WeatherType.HARSH_SUN) diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 15dc357a4c3..d8ad6bb85be 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -922,11 +922,15 @@ export class HideSpriteTag extends BattlerTag { export class TypeBoostTag extends BattlerTag { public boostedType: Type; + public boostValue: number; + public oneUse: boolean; - constructor(tagType: BattlerTagType, sourceMove: Moves, boostedType: Type) { + constructor(tagType: BattlerTagType, sourceMove: Moves, boostedType: Type, boostValue: number, oneUse: boolean) { super(tagType, BattlerTagLapseType.TURN_END, 1, sourceMove); this.boostedType = boostedType; + this.boostValue = boostValue; + this.oneUse = oneUse; } lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { @@ -1081,7 +1085,7 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc case BattlerTagType.HIDDEN: return new HideSpriteTag(tagType, turnCount, sourceMove); case BattlerTagType.FIRE_BOOST: - return new TypeBoostTag(tagType, sourceMove, Type.FIRE); + return new TypeBoostTag(tagType, sourceMove, Type.FIRE, 1.5, false); case BattlerTagType.CRIT_BOOST: return new CritBoostTag(tagType, sourceMove); case BattlerTagType.ALWAYS_CRIT: @@ -1098,6 +1102,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount - 1, sourceMove); case BattlerTagType.SALT_CURED: return new SaltCuredTag(sourceId); + case BattlerTagType.CHARGED: + return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true); case BattlerTagType.NONE: default: return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId); diff --git a/src/data/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts index b5cae5b8459..e07019f6947 100644 --- a/src/data/enums/battler-tag-type.ts +++ b/src/data/enums/battler-tag-type.ts @@ -47,6 +47,7 @@ export enum BattlerTagType { IGNORE_ACCURACY = "IGNORE_ACCURACY", BYPASS_SLEEP = "BYPASS_SLEEP", IGNORE_FLYING = "IGNORE_FLYING", - GROUNDED = "GROUNDED", - SALT_CURED = "SALT_CURED" + SALT_CURED = "SALT_CURED", + CHARGED = "CHARGED", + GROUNDED = "GROUNDED" } diff --git a/src/data/move.ts b/src/data/move.ts index 2e5ab23cb26..bfbf21450f6 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4038,7 +4038,6 @@ export function initMoves() { .target(MoveTarget.RANDOM_NEAR_ENEMY), new StatusMove(Moves.SANDSTORM, Type.ROCK, -1, 10, -1, 0, 2) .attr(WeatherChangeAttr, WeatherType.SANDSTORM) - .windMove() .target(MoveTarget.BOTH_SIDES), new AttackMove(Moves.GIGA_DRAIN, Type.GRASS, MoveCategory.SPECIAL, 75, 100, 10, -1, 0, 2) .attr(HitHealAttr) @@ -4224,7 +4223,7 @@ export function initMoves() { .ignoresVirtual(), new SelfStatusMove(Moves.CHARGE, Type.ELECTRIC, -1, 20, -1, 0, 3) .attr(StatChangeAttr, BattleStat.SPDEF, 1, true) - .partial(), + .attr(AddBattlerTagAttr, BattlerTagType.CHARGED, true, true), new StatusMove(Moves.TAUNT, Type.DARK, 100, 20, -1, 0, 3) .unimplemented(), new StatusMove(Moves.HELPING_HAND, Type.NORMAL, -1, 20, -1, 5, 3) diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 81fb79660fe..4fcff144d02 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -203,6 +203,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [Species.BEEDRILL]: [ [ 0, Moves.TWINEEDLE ], [ 1, Moves.FURY_ATTACK ], + [ 11, Moves.FURY_CUTTER ], [ 14, Moves.RAGE ], [ 17, Moves.PURSUIT ], [ 20, Moves.FOCUS_ENERGY ], diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 61f1db67243..19774d7df54 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1183,8 +1183,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { if (cancelled.value) result = HitResult.NO_EFFECT; else { - if (source.findTag(t => t instanceof TypeBoostTag && (t as TypeBoostTag).boostedType === type)) - power.value *= 1.5; + let typeBoost = source.findTag(t => t instanceof TypeBoostTag && (t as TypeBoostTag).boostedType === type) as TypeBoostTag; + if (typeBoost) { + power.value *= typeBoost.boostValue; + if (typeBoost.oneUse) { + this.removeTag(typeBoost.tagType); + } + } const arenaAttackTypeMultiplier = this.scene.arena.getAttackTypeMultiplier(type, source.isGrounded()); if (this.scene.arena.getTerrainType() === TerrainType.GRASSY && this.isGrounded() && type === Type.GROUND && move.moveTarget === MoveTarget.ALL_NEAR_OTHERS) power.value /= 2; From 7a6307d200f2b89374b566da555d08da6a8e2e6e Mon Sep 17 00:00:00 2001 From: NxKarim Date: Wed, 17 Apr 2024 02:59:25 -0600 Subject: [PATCH 05/17] Implemented Disguise Somehow it works. --- public/images/pokemon/icons/778-busted.png | Bin 0 -> 283 bytes public/images/pokemon/icons/778s-busted.png | Bin 0 -> 333 bytes public/images/pokemon_icons_7.json | 42 +++++ src/data/ability.ts | 190 ++++++++++++-------- src/data/pokemon-forms.ts | 4 + 5 files changed, 160 insertions(+), 76 deletions(-) create mode 100644 public/images/pokemon/icons/778-busted.png create mode 100644 public/images/pokemon/icons/778s-busted.png diff --git a/public/images/pokemon/icons/778-busted.png b/public/images/pokemon/icons/778-busted.png new file mode 100644 index 0000000000000000000000000000000000000000..6f66946e1045f498a1197a336a5917e223d68d74 GIT binary patch literal 283 zcmV+$0p$LPP)X0002uNkl_L61nT)%dZz<2xsX0003LNklIf?bTx;#*&*IHBRrmJ;bCq7-@hK3~j` zQW{#WVFj+h9)YzhgiwE|E_0yZx&Z!)bOFW~+X23x_fmqoUQW5>H$OwU0g>Ds&KpuBV(_qkq=TPa4#JvI+R{|@ArYv5EdP|5^&J{~d<2w7$guFXa>Ag2VJ zl6KpH#k7qZyB_2j$jdCLB3Yy+IFu=nQv_5}L~rK%FO1VOO%O9s z_aft5<{&2rq#oEv&HPKkn*;q<+Z=jn%@fp6o_}r$^7(J+>*0D>&^vhQyXyv=I_fub f { return false; } @@ -166,8 +166,8 @@ export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr { constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean) { super(); - this.stats = typeof(stats) === 'number' - ? [ stats as BattleStat ] + this.stats = typeof (stats) === 'number' + ? [stats as BattleStat] : stats as BattleStat[]; this.levels = levels; this.selfTarget = !!selfTarget; @@ -189,7 +189,7 @@ export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr { else pokemon.scene.unshiftPhase(statChangePhase); } - + return true; } } @@ -214,7 +214,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { export class BlockItemTheftAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { cancelled.value = true; - + return true; } @@ -229,13 +229,13 @@ export class StabBoostAbAttr extends AbAttr { (args[0] as Utils.NumberHolder).value += 0.5; return true; } - + return false; } } export class ReceivedMoveDamageMultiplierAbAttr extends PreDefendAbAttr { - private condition: PokemonDefendCondition; + protected condition: PokemonDefendCondition; private powerMultiplier: number; constructor(condition: PokemonDefendCondition, powerMultiplier: number) { @@ -261,6 +261,21 @@ export class ReceivedTypeDamageMultiplierAbAttr extends ReceivedMoveDamageMultip } } +export class SetMovePowerToOneAbAttr extends ReceivedMoveDamageMultiplierAbAttr { + constructor(condition: PokemonDefendCondition) { + super(condition, 1); + } + + applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { + if (this.condition(pokemon, attacker, move.getMove())) { + (args[0] as Utils.NumberHolder).value = 0.001; + return true; + } + + return false; + } +} + export class TypeImmunityAbAttr extends PreDefendAbAttr { private immuneType: Type; private condition: AbAttrCondition; @@ -305,7 +320,7 @@ export class TypeImmunityHealAbAttr extends TypeImmunityAbAttr { } return true; } - + return false; } } @@ -328,9 +343,9 @@ class TypeImmunityStatChangeAbAttr extends TypeImmunityAbAttr { cancelled.value = true; const simulated = args.length > 1 && args[1]; if (!simulated) - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [this.stat], this.levels)); } - + return ret; } } @@ -355,7 +370,7 @@ class TypeImmunityAddBattlerTagAbAttr extends TypeImmunityAbAttr { if (!simulated) pokemon.addTag(this.tagType, this.turnCount, undefined, pokemon.id); } - + return ret; } } @@ -386,16 +401,36 @@ export class PostDefendAbAttr extends AbAttr { } } +export class PostDefendDisguiseAbAttr extends PostDefendAbAttr { + + constructor(damageRatio?: number) { + super(true); + } + + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { + if (pokemon.formIndex == 0 && pokemon.battleData.hitCount != 0 && (move.getMove().category == MoveCategory.SPECIAL || move.getMove().category == MoveCategory.PHYSICAL)) { + const recoilDamage = Math.ceil((pokemon.getMaxHp() / 8) - attacker.turnData.damageDealt); + if (!recoilDamage) + return false; + pokemon.damageAndUpdate(recoilDamage, HitResult.OTHER); + pokemon.scene.queueMessage(getPokemonMessage(pokemon, '\'s disguise was busted!')); + return true; + } + + return false; + } +} + export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { - const attackPriority = new Utils.IntegerHolder(move.getMove().priority); - applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority); - - if(attackPriority.value > 0 && !move.getMove().isMultiTarget()) { - cancelled.value = true; - return true; - } - + const attackPriority = new Utils.IntegerHolder(move.getMove().priority); + applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority); + + if (attackPriority.value > 0 && !move.getMove().isMultiTarget()) { + cancelled.value = true; + return true; + } + return false; } } @@ -446,7 +481,7 @@ export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (this.condition(pokemon, attacker, move.getMove())) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), true, [this.stat], this.levels)); return true; } @@ -460,7 +495,7 @@ export class PostDefendTypeChangeAbAttr extends PostDefendAbAttr { const type = move.getMove().type; const pokemonTypes = pokemon.getTypes(true); if (pokemonTypes.length !== 1 || pokemonTypes[0] !== type) { - pokemon.summonData.types = [ type ]; + pokemon.summonData.types = [type]; return true; } } @@ -544,8 +579,8 @@ export class PostDefendCritStatChangeAbAttr extends PostDefendAbAttr { } applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); - + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [this.stat], this.levels)); + return true; } @@ -562,13 +597,13 @@ export class PostDefendContactDamageAbAttr extends PostDefendAbAttr { this.damageRatio = damageRatio; } - + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER); return true; } - + return false; } @@ -598,7 +633,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr { constructor() { super(); } - + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnswappableAbilityAbAttr)) { const tempAbilityId = attacker.getAbility().id; @@ -606,7 +641,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr { pokemon.summonData.ability = tempAbilityId; return true; } - + return false; } @@ -619,14 +654,14 @@ export class PostDefendAbilityGiveAbAttr extends PostDefendAbAttr { constructor() { super(); } - + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnsuppressableAbilityAbAttr) && !attacker.getAbility().hasAttr(PostDefendAbilityGiveAbAttr)) { attacker.summonData.ability = pokemon.getAbility().id; return true; } - + return false; } @@ -674,7 +709,7 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr { export class VariableMoveTypeAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { //const power = args[0] as Utils.IntegerHolder; - return false; + return false; } } @@ -683,7 +718,7 @@ export class MoveTypeChangePowerMultiplierAbAttr extends VariableMoveTypeAbAttr private newType: Type; private powerMultiplier: number; - constructor(matchType: Type, newType: Type, powerMultiplier: number){ + constructor(matchType: Type, newType: Type, powerMultiplier: number) { super(true); this.matchType = matchType; this.newType = newType; @@ -697,7 +732,7 @@ export class MoveTypeChangePowerMultiplierAbAttr extends VariableMoveTypeAbAttr (args[1] as Utils.NumberHolder).value *= this.powerMultiplier; return true; } - + return false; } } @@ -707,7 +742,7 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr { private powerMultiplier: number; private condition: PokemonAttackCondition; - constructor(newType: Type, powerMultiplier: number, condition: PokemonAttackCondition){ + constructor(newType: Type, powerMultiplier: number, condition: PokemonAttackCondition) { super(true); this.newType = newType; this.powerMultiplier = powerMultiplier; @@ -766,7 +801,7 @@ export class LowHpMoveTypePowerBoostAbAttr extends MoveTypePowerBoostAbAttr { export class FieldVariableMovePowerAbAttr extends AbAttr { applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean { //const power = args[0] as Utils.NumberHolder; - return false; + return false; } } @@ -940,8 +975,8 @@ class PostVictoryStatChangeAbAttr extends PostVictoryAbAttr { const stat = typeof this.stat === 'function' ? this.stat(pokemon) : this.stat; - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); - + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [stat], this.levels)); + return true; } } @@ -967,8 +1002,8 @@ export class PostKnockOutStatChangeAbAttr extends PostKnockOutAbAttr { const stat = typeof this.stat === 'function' ? this.stat(pokemon) : this.stat; - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); - + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [stat], this.levels)); + return true; } } @@ -984,7 +1019,7 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr { pokemon.scene.queueMessage(getPokemonMessage(knockedOut, `'s ${allAbilities[knockedOut.getAbility().id].name} was taken over!`)); return true; } - + return false; } } @@ -1047,8 +1082,8 @@ export class PostSummonStatChangeAbAttr extends PostSummonAbAttr { constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean) { super(); - this.stats = typeof(stats) === 'number' - ? [ stats as BattleStat ] + this.stats = typeof (stats) === 'number' + ? [stats as BattleStat] : stats as BattleStat[]; this.levels = levels; this.selfTarget = !!selfTarget; @@ -1070,7 +1105,7 @@ export class PostSummonStatChangeAbAttr extends PostSummonAbAttr { else pokemon.scene.unshiftPhase(statChangePhase); } - + return true; } } @@ -1083,12 +1118,12 @@ export class DownloadAbAttr extends PostSummonAbAttr { applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { this.enemyDef = 0; this.enemySpDef = 0; - + for (let opponent of pokemon.getOpponents()) { this.enemyDef += opponent.stats[BattleStat.DEF]; this.enemySpDef += opponent.stats[BattleStat.SPDEF]; } - + if (this.enemyDef < this.enemySpDef) this.stats = [BattleStat.ATK]; else @@ -1098,7 +1133,7 @@ export class DownloadAbAttr extends PostSummonAbAttr { pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1)); return true; } - + return false; } } @@ -1193,11 +1228,11 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr { pokemon.summonData.ability = target.getAbility().id; pokemon.summonData.gender = target.getGender(); pokemon.summonData.fusionGender = target.getFusionGender(); - pokemon.summonData.stats = [ pokemon.stats[Stat.HP] ].concat(target.stats.slice(1)); + pokemon.summonData.stats = [pokemon.stats[Stat.HP]].concat(target.stats.slice(1)); pokemon.summonData.battleStats = target.summonData.battleStats.slice(0); pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m.moveId, m.ppUsed, m.ppUp)); pokemon.summonData.types = target.getTypes(); - + pokemon.scene.playSound('PRSFX- Transform'); pokemon.loadAssets(false).then(() => pokemon.playAnim()); @@ -1232,7 +1267,7 @@ export class PreSwitchOutResetStatusAbAttr extends PreSwitchOutAbAttr { export class PreSwitchOutHealAbAttr extends PreSwitchOutAbAttr { applyPreSwitchOut(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise { - if (pokemon.getHpRatio() < 1 ) { + if (pokemon.getHpRatio() < 1) { const healAmount = Math.floor(pokemon.getMaxHp() * 0.33); pokemon.heal(healAmount); pokemon.updateInfo(); @@ -1263,7 +1298,7 @@ export class ProtectStatAbAttr extends PreStatChangeAbAttr { cancelled.value = true; return true; } - + return false; } @@ -1372,7 +1407,7 @@ export class IncrementMovePriorityAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (!this.moveIncrementFunc(pokemon, args[0] as Move)) return false; - + (args[1] as Utils.IntegerHolder).value += this.increaseAmount; return true; } @@ -1484,7 +1519,7 @@ export class PostWeatherLapseHealAbAttr extends PostWeatherLapseAbAttr { constructor(healFactor: integer, ...weatherTypes: WeatherType[]) { super(...weatherTypes); - + this.healFactor = healFactor; } @@ -1506,7 +1541,7 @@ export class PostWeatherLapseDamageAbAttr extends PostWeatherLapseAbAttr { constructor(damageFactor: integer, ...weatherTypes: WeatherType[]) { super(...weatherTypes); - + this.damageFactor = damageFactor; } @@ -1566,13 +1601,13 @@ export class PostTurnAbAttr extends AbAttr { export class PostTurnResetStatusAbAttr extends PostTurnAbAttr { applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { if (pokemon.status) { - + pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status?.effect))); pokemon.resetStatus(); pokemon.updateInfo(); return true; } - + return false; } } @@ -1586,7 +1621,7 @@ export class PostTurnStatChangeAbAttr extends PostTurnAbAttr { this.stats = Array.isArray(stats) ? stats - : [ stats ]; + : [stats]; this.levels = levels; } @@ -1719,7 +1754,7 @@ export class CheckTrappedAbAttr extends AbAttr { constructor() { super(false); } - + applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, args: any[]): boolean | Promise { return false; } @@ -1778,7 +1813,7 @@ export class PostFaintAbAttr extends AbAttr { export class PostFaintContactDamageAbAttr extends PostFaintAbAttr { private damageRatio: integer; - + constructor(damageRatio: integer) { super(); @@ -1812,10 +1847,10 @@ export class RedirectMoveAbAttr extends AbAttr { return false; } - + canRedirect(moveId: Moves): boolean { const move = allMoves[moveId]; - return !![ MoveTarget.NEAR_OTHER, MoveTarget.OTHER ].find(t => move.moveTarget === t); + return !![MoveTarget.NEAR_OTHER, MoveTarget.OTHER].find(t => move.moveTarget === t); } } @@ -1866,7 +1901,7 @@ export class FlinchStatChangeAbAttr extends FlinchEffectAbAttr { this.stats = Array.isArray(stats) ? stats - : [ stats ]; + : [stats]; this.levels = levels; } @@ -2060,7 +2095,7 @@ export function applyPostAttackAbAttrs(attrType: { new(...args: any[]): PostAtta export function applyPostKnockOutAbAttrs(attrType: { new(...args: any[]): PostKnockOutAbAttr }, pokemon: Pokemon, knockedOut: Pokemon, ...args: any[]): Promise { return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyPostKnockOut(pokemon, passive, knockedOut, args), args); -} +} export function applyPostVictoryAbAttrs(attrType: { new(...args: any[]): PostVictoryAbAttr }, pokemon: Pokemon, ...args: any[]): Promise { @@ -2148,7 +2183,7 @@ function queueShowAbility(pokemon: Pokemon, passive: boolean): void { pokemon.scene.clearPhaseQueueSplice(); } -export const allAbilities = [ new Ability(Abilities.NONE, "-", "", 3) ]; +export const allAbilities = [new Ability(Abilities.NONE, "-", "", 3)]; export function initAbilities() { allAbilities.push( @@ -2161,7 +2196,7 @@ export function initAbilities() { new Ability(Abilities.BATTLE_ARMOR, "Battle Armor", "Hard armor protects the Pokémon from critical hits.", 3) .attr(BlockCritAbAttr) .ignorable(), - new Ability(Abilities.STURDY, "Sturdy", "It cannot be knocked out with one hit. One-hit KO moves cannot knock it out, either.", 3) + new Ability(Abilities.STURDY, "Sturdy", "It cannot be knocked out with one hit. One-hit KO moves cannot knock it out, either.", 3) .attr(PreDefendFullHpEndureAbAttr) .attr(BlockOneHitKOAbAttr) .ignorable(), @@ -2401,8 +2436,8 @@ export function initAbilities() { .conditionalAttr(pokemon => pokemon.status.effect === StatusEffect.PARALYSIS, BattleStatMultiplierAbAttr, BattleStat.SPD, 2) .conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5), new Ability(Abilities.NORMALIZE, "Normalize", "All the Pokémon's moves become Normal type. The power of those moves is boosted a little.", 4) - .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL && - move.id !== Moves.NATURAL_GIFT && move.id !== Moves.JUDGMENT && move.id !== Moves.TECHNO_BLAST), + .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL && + move.id !== Moves.NATURAL_GIFT && move.id !== Moves.JUDGMENT && move.id !== Moves.TECHNO_BLAST), new Ability(Abilities.SNIPER, "Sniper (N)", "Powers up moves if they become critical hits when attacking.", 4), new Ability(Abilities.MAGIC_GUARD, "Magic Guard", "The Pokémon only takes damage from attacks.", 4) .attr(BlockNonDirectDamageAbAttr), @@ -2421,7 +2456,7 @@ export function initAbilities() { new Ability(Abilities.SUPER_LUCK, "Super Luck (P)", "The Pokémon is so lucky that the critical-hit ratios of its moves are boosted.", 4) .attr(BonusCritAbAttr), new Ability(Abilities.AFTERMATH, "Aftermath", "Damages the attacker if it contacts the Pokémon with a finishing hit.", 4) - .attr(PostFaintContactDamageAbAttr,4) + .attr(PostFaintContactDamageAbAttr, 4) .bypassFaint(), new Ability(Abilities.ANTICIPATION, "Anticipation (N)", "The Pokémon can sense an opposing Pokémon's dangerous moves.", 4), new Ability(Abilities.FOREWARN, "Forewarn (N)", "When it enters a battle, the Pokémon can tell one of the moves an opposing Pokémon has.", 4), @@ -2431,7 +2466,7 @@ export function initAbilities() { new Ability(Abilities.TINTED_LENS, "Tinted Lens", "The Pokémon can use \"not very effective\" moves to deal regular damage.", 4) .attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) <= 0.5, 2), new Ability(Abilities.FILTER, "Filter", "Reduces the power of supereffective attacks taken.", 4) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) .ignorable(), new Ability(Abilities.SLOW_START, "Slow Start", "For five turns, the Pokémon's Attack and Speed stats are halved.", 4) .attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.SLOW_START, 5), @@ -2444,7 +2479,7 @@ export function initAbilities() { .attr(BlockWeatherDamageAttr, WeatherType.HAIL) .attr(PostWeatherLapseHealAbAttr, 1, WeatherType.HAIL, WeatherType.SNOW), new Ability(Abilities.SOLID_ROCK, "Solid Rock", "Reduces the power of supereffective attacks taken.", 4) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) .ignorable(), new Ability(Abilities.SNOW_WARNING, "Snow Warning", "The Pokémon makes it snow when it enters a battle.", 4) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW) @@ -2491,7 +2526,7 @@ export function initAbilities() { .attr(WeightMultiplierAbAttr, 0.5) .ignorable(), new Ability(Abilities.MULTISCALE, "Multiscale", "Reduces the amount of damage the Pokémon takes while its HP is full.", 5) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getHpRatio() === 1, 0.5) + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getHpRatio() === 1, 0.5) .ignorable(), new Ability(Abilities.TOXIC_BOOST, "Toxic Boost", "Powers up physical attacks when the Pokémon is poisoned.", 5) .attr(MovePowerBoostAbAttr, (user, target, move) => move.category === MoveCategory.PHYSICAL && (user.status?.effect === StatusEffect.POISON || user.status?.effect === StatusEffect.TOXIC), 1.5), @@ -2510,7 +2545,7 @@ export function initAbilities() { new Ability(Abilities.POISON_TOUCH, "Poison Touch", "May poison a target when the Pokémon makes contact.", 5) .attr(PostAttackContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON), new Ability(Abilities.REGENERATOR, "Regenerator", "Restores a little HP when withdrawn from battle.", 5) - .attr(PreSwitchOutHealAbAttr), + .attr(PreSwitchOutHealAbAttr), new Ability(Abilities.BIG_PECKS, "Big Pecks", "Protects the Pokémon from Defense-lowering effects.", 5) .attr(ProtectStatAbAttr, BattleStat.DEF) .ignorable(), @@ -2669,7 +2704,10 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr), - new Ability(Abilities.DISGUISE, "Disguise (N)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7) + new Ability(Abilities.DISGUISE, "Disguise (T)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7) + .attr(SetMovePowerToOneAbAttr, (target, user, move) => target.formIndex == 0) + .attr(PostTurnFormChangeAbAttr, pokemon => pokemon.battleData.hitCount === 0 ? 0 : 1) + .attr(PostDefendDisguiseAbAttr) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr) @@ -2744,9 +2782,9 @@ export function initAbilities() { new Ability(Abilities.FULL_METAL_BODY, "Full Metal Body", "Prevents other Pokémon's moves or Abilities from lowering the Pokémon's stats.", 7) .attr(ProtectStatAbAttr), new Ability(Abilities.SHADOW_SHIELD, "Shadow Shield", "Reduces the amount of damage the Pokémon takes while its HP is full.", 7) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getHpRatio() === 1, 0.5), + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getHpRatio() === 1, 0.5), new Ability(Abilities.PRISM_ARMOR, "Prism Armor", "Reduces the power of supereffective attacks taken.", 7) - .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75), + .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75), new Ability(Abilities.NEUROFORCE, "Neuroforce", "Powers up moves that are super effective.", 7) .attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 1.25), new Ability(Abilities.INTREPID_SWORD, "Intrepid Sword", "Boosts the Pokémon's Attack stat when the Pokémon enters a battle.", 8) @@ -2899,7 +2937,7 @@ export function initAbilities() { new Ability(Abilities.COSTAR, "Costar (N)", "When the Pokémon enters a battle, it copies an ally's stat changes.", 9), new Ability(Abilities.TOXIC_DEBRIS, "Toxic Debris (N)", "Scatters poison spikes at the feet of the opposing team when the Pokémon takes damage from physical moves.", 9), new Ability(Abilities.ARMOR_TAIL, "Armor Tail", "The mysterious tail covering the Pokémon's head makes opponents unable to use priority moves against the Pokémon or its allies.", 9) - .attr(FieldPriorityMoveImmunityAbAttr) + .attr(FieldPriorityMoveImmunityAbAttr) .ignorable(), new Ability(Abilities.EARTH_EATER, "Earth Eater", "If hit by a Ground-type move, the Pokémon has its HP restored instead of taking damage.", 9) .attr(TypeImmunityHealAbAttr, Type.GROUND) diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index bb22f985976..7f62c10c782 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -565,6 +565,10 @@ export const pokemonFormChanges: PokemonFormChanges = { new SpeciesFormChange(Species.MINIOR, 'violet-meteor', 'violet', new SpeciesFormChangeManualTrigger(), true), new SpeciesFormChange(Species.MINIOR, 'violet', 'violet-meteor', new SpeciesFormChangeManualTrigger(), true) ], + [Species.MIMIKYU]: [ + new SpeciesFormChange(Species.MIMIKYU, 'disguised', 'busted', new SpeciesFormChangeManualTrigger(), true), + new SpeciesFormChange(Species.MIMIKYU, 'busted', 'disquised', new SpeciesFormChangeManualTrigger(), true) + ], [Species.NECROZMA]: [ new SpeciesFormChange(Species.NECROZMA, '', 'dawn-wings', new SpeciesFormChangeItemTrigger(FormChangeItem.N_LUNARIZER)), new SpeciesFormChange(Species.NECROZMA, '', 'dusk-mane', new SpeciesFormChangeItemTrigger(FormChangeItem.N_SOLARIZER)) From a3f3058873fb5969cd3c7e37129a6496f0054047 Mon Sep 17 00:00:00 2001 From: NxKarim Date: Wed, 17 Apr 2024 03:17:22 -0600 Subject: [PATCH 06/17] Update ability.ts --- src/data/ability.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 4cf1e8ac894..af8357a7052 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2704,7 +2704,7 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr), - new Ability(Abilities.DISGUISE, "Disguise (T)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7) + new Ability(Abilities.DISGUISE, "Disguise (P)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7) .attr(SetMovePowerToOneAbAttr, (target, user, move) => target.formIndex == 0) .attr(PostTurnFormChangeAbAttr, pokemon => pokemon.battleData.hitCount === 0 ? 0 : 1) .attr(PostDefendDisguiseAbAttr) From 55cce8ce0d41720ddb4d03eeecbf08a6e6ae1b02 Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Wed, 17 Apr 2024 10:47:41 -0500 Subject: [PATCH 07/17] Update Gen 4 egg moves This time they have been thoroughly looked over before being submitted. --- src/data/egg-moves.ts | 118 +++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/src/data/egg-moves.ts b/src/data/egg-moves.ts index 1413bc4bf41..5cbf7f14eff 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -26,7 +26,7 @@ export const speciesEggMoves = { [Species.MEOWTH]: [ Moves.COVET, Moves.HAPPY_HOUR, Moves.PARTING_SHOT, Moves.MAKE_IT_RAIN ], [Species.PSYDUCK]: [ Moves.MYSTICAL_POWER, Moves.AQUA_STEP, Moves.PSYCHIC, Moves.MIND_BLOWN ], [Species.MANKEY]: [ Moves.BEAT_UP, Moves.PLAY_ROUGH, Moves.TAUNT, Moves.CLOSE_COMBAT ], - [Species.GROWLITHE]: [ Moves.THUNDER_FANG, Moves.HYPER_VOICE, Moves.NOBLE_ROAR, Moves.RAGING_FURY ], + [Species.GROWLITHE]: [ Moves.TRAILBLAZE, Moves.U_TURN, Moves.MORNING_SUN, Moves.V_CREATE ], [Species.POLIWAG]: [ Moves.BOUNCY_BUBBLE, Moves.AURORA_BEAM, Moves.ZEN_HEADBUTT, Moves.SURGING_STRIKES ], [Species.ABRA]: [ Moves.MYSTICAL_FIRE, Moves.HEX, Moves.MAGICAL_LEAF, Moves.MYSTICAL_POWER ], [Species.MACHOP]: [ Moves.BULLET_PUNCH, Moves.KNOCK_OFF, Moves.COACHING, Moves.CLOSE_COMBAT ], @@ -41,7 +41,7 @@ export const speciesEggMoves = { [Species.SEEL]: [ Moves.FREEZE_DRY, Moves.CHILLING_WATER, Moves.ENCORE, Moves.RECOVER ], [Species.GRIMER]: [ Moves.SHADOW_SNEAK, Moves.CURSE, Moves.CORROSIVE_GAS, Moves.PAIN_SPLIT ], [Species.SHELLDER]: [ Moves.BODY_PRESS, Moves.WATER_SHURIKEN, Moves.BANEFUL_BUNKER, Moves.RECOVER ], - [Species.GASTLY]: [ Moves.CLEAR_SMOG, Moves.THIEF, Moves.NASTY_PLOT, Moves.SPECTRAL_THIEF ], + [Species.GASTLY]: [ Moves.CLEAR_SMOG, Moves.NIGHT_DAZE, Moves.NASTY_PLOT, Moves.SPECTRAL_THIEF ], [Species.ONIX]: [ Moves.SHORE_UP, Moves.DRAGON_TAIL, Moves.HEAD_SMASH, Moves.BODY_PRESS ], [Species.DROWZEE]: [ Moves.DREAM_EATER, Moves.METRONOME, Moves.NIGHTMARE, Moves.SYNCHRONOISE ], [Species.KRABBY]: [ Moves.CRUSH_GRIP, Moves.CEASELESS_EDGE, Moves.SHORE_UP, Moves.SHELL_SMASH ], @@ -72,7 +72,7 @@ export const speciesEggMoves = { [Species.DRATINI]: [ Moves.SCALE_SHOT, Moves.AQUA_JET, Moves.WHIRLWIND, Moves.SHED_TAIL ], [Species.MEWTWO]: [ Moves.PSYBLADE, Moves.POLTERGEIST, Moves.ARMOR_CANNON, Moves.PSYCHO_BOOST ], [Species.MEW]: [ Moves.PSYSTRIKE, Moves.DECORATE, Moves.REVIVAL_BLESSING, Moves.SKETCH ], - [Species.CHIKORITA]: [ Moves.ROCK_SLIDE, Moves.LUNGE, Moves.DRAGON_DANCE, Moves.SAPPY_SEED ], + [Species.CHIKORITA]: [ Moves.ROCK_SLIDE, Moves.PLAY_ROUGH, Moves.DRAGON_DANCE, Moves.SAPPY_SEED ], [Species.CYNDAQUIL]: [ Moves.EXTRASENSORY, Moves.SCORCHING_SANDS, Moves.FIERY_DANCE, Moves.NASTY_PLOT ], [Species.TOTODILE]: [ Moves.AQUA_JET, Moves.DRAGON_DANCE, Moves.ICE_PUNCH, Moves.WAVE_CRASH ], [Species.SENTRET]: [ Moves.TIDY_UP, Moves.TAIL_SLAP, Moves.ENCORE, Moves.EXTREME_SPEED ], @@ -149,7 +149,7 @@ export const speciesEggMoves = { [Species.MAWILE]: [ Moves.SPIRIT_BREAK, Moves.JAW_LOCK, Moves.HYPER_FANG, Moves.HARD_PRESS ], [Species.ARON]: [ Moves.HEAD_SMASH, Moves.BODY_PRESS, Moves.SHORE_UP, Moves.BEHEMOTH_BASH ], [Species.MEDITITE]: [ Moves.TRAILBLAZE, Moves.FAKE_OUT, Moves.BULLET_PUNCH, Moves.PSYBLADE ], - [Species.ELECTRIKE]: [ Moves.NUZZLE, Moves.JAW_LOCK, Moves.FLAME_CHARGE, Moves.WILDBOLT_STORM ], + [Species.ELECTRIKE]: [ Moves.NUZZLE, Moves.TEMPER_FLARE, Moves.TRAILBLAZE, Moves.WILDBOLT_STORM ], [Species.PLUSLE]: [ Moves.FLAMETHROWER, Moves.PARABOLIC_CHARGE, Moves.ALLURING_VOICE, Moves.TAIL_GLOW ], [Species.MINUN]: [ Moves.ICE_BEAM, Moves.PARABOLIC_CHARGE, Moves.ALLURING_VOICE, Moves.TAIL_GLOW ], [Species.VOLBEAT]: [ Moves.FLAME_CHARGE, Moves.LUNGE, Moves.ACROBATICS, Moves.VICTORY_DANCE ], @@ -198,66 +198,66 @@ export const speciesEggMoves = { [Species.RAYQUAZA]: [ Moves.OBLIVION_WING, Moves.DRAGON_DARTS, Moves.SUPERCELL_SLAM, Moves.V_CREATE ], [Species.JIRACHI]: [ Moves.IRON_HEAD, Moves.TRI_ATTACK, Moves.EERIE_SPELL, Moves.TAKE_HEART ], [Species.DEOXYS]: [ Moves.CLOSE_COMBAT, Moves.METEOR_BEAM, Moves.NIGHT_DAZE, Moves.PHOTON_GEYSER ], - [Species.TURTWIG]: [ Moves.HEADLONG_RUSH, Moves.SHELTER, Moves.BODY_PRESS, Moves.FRENZY_PLANT ], - [Species.CHIMCHAR]: [ Moves.RAGING_FURY, Moves.BURN_UP, Moves.WORK_UP, Moves.WICKED_BLOW ], - [Species.PIPLUP]: [ Moves.KINGS_SHIELD, Moves.FLIP_TURN, Moves.NOBLE_ROAR, Moves.SUNSTEEL_STRIKE ], - [Species.STARLY]: [ Moves.SWORDS_DANCE, Moves.OUTRAGE, Moves.FLAME_CHARGE, Moves.COLLISION_COURSE ], - [Species.BIDOOF]: [ Moves.SUPER_FANG, Moves.LIQUIDATION, Moves.BODY_PRESS, Moves.NO_RETREAT ], - [Species.KRICKETOT]: [ Moves.BOOMBURST, Moves.ALLURING_VOICE, Moves.SPARKLING_ARIA, Moves.QUIVER_DANCE ], - [Species.SHINX]: [ Moves.PSYCHIC_FANGS, Moves.JAW_LOCK, Moves.FACADE, Moves.VOLT_TACKLE ], - [Species.BUDEW]: [ Moves.FLORAL_HEALING, Moves.ACID_SPRAY, Moves.SPORE, Moves.SEED_FLARE ], - [Species.CRANIDOS]: [ Moves.STONE_AXE, Moves.DRAGON_RUSH, Moves.SUPERPOWER, Moves.ROCK_WRECKER ], - [Species.SHIELDON]: [ Moves.COSMIC_POWER, Moves.BODY_PRESS, Moves.KINGS_SHIELD, Moves.BEHEMOTH_BASH ], - [Species.BURMY]: [ Moves.BODY_PRESS, Moves.TOXIC, Moves.RECOVER, Moves.SHELTER ], - [Species.COMBEE]: [ Moves.TWINEEDLE, Moves.AIR_SLASH, Moves.KINGS_SHIELD, Moves.SPORE ], - [Species.PACHIRISU]: [ Moves.SUPER_FANG, Moves.EXTREME_SPEED, Moves.SUPERPOWER, Moves.VOLT_TACKLE ], - [Species.BUIZEL]: [ Moves.JET_PUNCH, Moves.ICE_PUNCH, Moves.HIGH_HORSEPOWER, Moves.SURGING_STRIKES ], - [Species.CHERUBI]: [ Moves.FLOWER_SHIELD, Moves.GRASSY_TERRAIN, Moves.GRASSY_GLIDE, Moves.SPORE ], - [Species.SHELLOS]: [ Moves.LIFE_DEW, Moves.BOUNCY_BUBBLE, Moves.FREEZE_DRY, Moves.FREEZY_FROST ], - [Species.DRIFLOON]: [ Moves.THIEF, Moves.ACUPRESSURE, Moves.WILL_O_WISP, Moves.HURRICANE ], - [Species.BUNEARY]: [ Moves.TRIPLE_AXEL, Moves.TROP_KICK, Moves.FAKE_OUT, Moves.SWORDS_DANCE ], - [Species.GLAMEOW]: [ Moves.U_TURN, Moves.STOMPING_TANTRUM, Moves.COVET, Moves.WICKED_BLOW ], - [Species.CHINGLING]: [ Moves.BUZZY_BUZZ, Moves.BOOMBURST, Moves.TORCH_SONG, Moves.EERIE_SPELL ], - [Species.STUNKY]: [ Moves.CORROSIVE_GAS, Moves.BURNING_JEALOUSY, Moves.SUPER_FANG, Moves.WICKED_BLOW ], - [Species.BRONZOR]: [ Moves.PSYSHIELD_BASH, Moves.COSMIC_POWER, Moves.MIRROR_COAT, Moves.TACHYON_CUTTER ], - [Species.BONSLY]: [ Moves.INGRAIN, Moves.GRASSY_GLIDE, Moves.EXTREME_SPEED, Moves.HEAD_SMASH ], - [Species.MIME_JR]: [ Moves.CALM_MIND, Moves.ATTRACT, Moves.TAUNT, Moves.GLITZY_GLOW ], - [Species.HAPPINY]: [ Moves.HAPPY_HOUR, Moves.SEISMIC_TOSS, Moves.STEALTH_ROCK, Moves.INSTRUCT ], - [Species.CHATOT]: [ Moves.SPARKLING_ARIA, Moves.BOOMBURST, Moves.TAUNT, Moves.TORCH_SONG ], - [Species.SPIRITOMB]: [ Moves.POLTERGEIST, Moves.PAIN_SPLIT, Moves.BURNING_JEALOUSY, Moves.MAKE_IT_RAIN ], - [Species.GIBLE]: [ Moves.DRAGON_HAMMER, Moves.AQUA_JET, Moves.POISON_FANG, Moves.GLAIVE_RUSH ], - [Species.MUNCHLAX]: [ Moves.TEATIME, Moves.BODY_PRESS, Moves.HEAVY_SLAM, Moves.SLACK_OFF ], - [Species.RIOLU]: [ Moves.UPPER_HAND, Moves.ARM_THRUST, Moves.ICE_PUNCH, Moves.PLAY_ROUGH ], - [Species.HIPPOPOTAS]: [ Moves.BODY_PRESS, Moves.HARD_PRESS, Moves.SCORCHING_SANDS, Moves.LANDS_WRATH ], - [Species.SKORUPI]: [ Moves.COIL, Moves.DIRE_CLAW, Moves.PARTING_SHOT, Moves.WICKED_BLOW ], - [Species.CROAGUNK]: [ Moves.GUNK_SHOT, Moves.LASH_OUT, Moves.MACH_PUNCH, Moves.SWORDS_DANCE ], - [Species.CARNIVINE]: [ Moves.SNAP_TRAP, Moves.JAW_LOCK, Moves.RAGE_POWDER, Moves.FLOWER_TRICK ], - [Species.FINNEON]: [ Moves.QUIVER_DANCE, Moves.BOUNCY_BUBBLE, Moves.MOONBLAST, Moves.MOONGEIST_BEAM ], - [Species.MANTYKE]: [ Moves.BOUNCY_BUBBLE, Moves.ICY_WIND, Moves.TAILWIND, Moves.RECOVER ], - [Species.SNOVER]: [ Moves.DRUM_BEATING, Moves.ICE_HAMMER, Moves.AURORA_VEIL, Moves.IVY_CUDGEL ], - [Species.ROTOM]: [ Moves.FREEZE_DRY, Moves.FLAME_BURST, Moves.WATER_PULSE, Moves.AIR_SLASH ], - [Species.UXIE]: [ Moves.REVELATION_DANCE, Moves.TEETER_DANCE, Moves.DARK_PULSE, Moves.PRISMATIC_LASER ], - [Species.MESPRIT]: [ Moves.REVELATION_DANCE, Moves.LUNAR_DANCE, Moves.MOONBLAST, Moves.PRISMATIC_LASER ], - [Species.AZELF]: [ Moves.REVELATION_DANCE, Moves.DRAGON_DANCE, Moves.PHANTOM_FORCE, Moves.PRISMATIC_LASER ], - [Species.DIALGA]: [ Moves.SPACIAL_REND, Moves.EXTREME_SPEED, Moves.GEAR_GRIND, Moves.FREEZING_GLARE ], - [Species.PALKIA]: [ Moves.ROAR_OF_TIME, Moves.LIQUIDATION, Moves.AQUA_CUTTER, Moves.DRAGON_ENERGY ], - [Species.HEATRAN]: [ Moves.FIRE_LASH, Moves.HEAVY_SLAM, Moves.FIERY_DANCE, Moves.BEHEMOTH_BASH ], - [Species.REGIGIGAS]: [ Moves.MIGHTY_CLEAVE, Moves.PRECIPICE_BLADES, Moves.EXTREME_SPEED, Moves.SKILL_SWAP ], - [Species.GIRATINA]: [ Moves.DRAGON_HAMMER, Moves.SPACIAL_REND, Moves.SPIRIT_SHACKLE, Moves.ASTRAL_BARRAGE ], - [Species.CRESSELIA]: [ Moves.MIST_BALL, Moves.LUMINA_CRASH, Moves.INFERNAL_PARADE, Moves.HYPERSPACE_HOLE ], - [Species.PHIONE]: [ Moves.SPARKLING_ARIA, Moves.MAKE_IT_RAIN, Moves.TAIL_GLOW, Moves.LIGHT_OF_RUIN ], - [Species.MANAPHY]: [ Moves.BOUNCY_BUBBLE, Moves.RECOVER, Moves.MOONBLAST, Moves.QUIVER_DANCE ], - [Species.DARKRAI]: [ Moves.NIGHT_DAZE, Moves.KNOCK_OFF, Moves.BITTER_MALICE, Moves.SHADOW_FORCE ], - [Species.SHAYMIN]: [ Moves.FLOWER_SHIELD, Moves.FLOWER_TRICK, Moves.CHLOROBLAST, Moves.FLEUR_CANNON ], - [Species.ARCEUS]: [ Moves.SKETCH, Moves.ROAR_OF_TIME, Moves.SPACIAL_REND, Moves.GEOMANCY ], + [Species.TURTWIG]: [ Moves.SHELL_SMASH, Moves.SHELTER, Moves.BODY_PRESS, Moves.SAPPY_SEED ], + [Species.CHIMCHAR]: [ Moves.SWORDS_DANCE, Moves.THUNDEROUS_KICK, Moves.ICE_PUNCH, Moves.SACRED_FIRE ], + [Species.PIPLUP]: [ Moves.KINGS_SHIELD, Moves.FLASH_CANNON, Moves.ROOST, Moves.STEAM_ERUPTION ], + [Species.STARLY]: [ Moves.SWORDS_DANCE, Moves.EXTREME_SPEED, Moves.FLARE_BLITZ, Moves.HIGH_JUMP_KICK ], + [Species.BIDOOF]: [ Moves.EXTREME_SPEED, Moves.NO_RETREAT, Moves.BODY_PRESS, Moves.SURGING_STRIKES ], + [Species.KRICKETOT]: [ Moves.BONEMERANG, Moves.ROOST, Moves.ROCK_BLAST, Moves.VICTORY_DANCE ], + [Species.SHINX]: [ Moves.FIRE_LASH, Moves.TRIPLE_AXEL, Moves.FACADE, Moves.BOLT_STRIKE ], + [Species.BUDEW]: [ Moves.PARTING_SHOT, Moves.SPIKES, Moves.SPORE, Moves.MALIGNANT_CHAIN ], + [Species.CRANIDOS]: [ Moves.STONE_AXE, Moves.ACCELEROCK, Moves.HEADLONG_RUSH, Moves.DRAGON_DANCE ], + [Species.SHIELDON]: [ Moves.PAIN_SPLIT, Moves.BODY_PRESS, Moves.KINGS_SHIELD, Moves.DIAMOND_STORM ], + [Species.BURMY]: [ Moves.BODY_PRESS, Moves.TOXIC, Moves.RECOVER, Moves.DEFEND_ORDER ], + [Species.COMBEE]: [ Moves.SPORE, Moves.MYSTICAL_FIRE, Moves.KINGS_SHIELD, Moves.QUIVER_DANCE ], + [Species.PACHIRISU]: [ Moves.BADDY_BAD, Moves.BUZZY_BUZZ, Moves.U_TURN, Moves.SIZZLY_SLIDE ], + [Species.BUIZEL]: [ Moves.JET_PUNCH, Moves.TRIPLE_AXEL, Moves.THUNDER_PUNCH, Moves.SURGING_STRIKES ], + [Species.CHERUBI]: [ Moves.SPORE, Moves.STRENGTH_SAP, Moves.APPLE_ACID, Moves.FIERY_DANCE ], + [Species.SHELLOS]: [ Moves.SHORE_UP, Moves.SPIKES, Moves.FREEZE_DRY, Moves.STEAM_ERUPTION ], + [Species.DRIFLOON]: [ Moves.WILL_O_WISP, Moves.SHADOW_BONE, Moves.CALM_MIND, Moves.OBLIVION_WING ], + [Species.BUNEARY]: [ Moves.TRIPLE_AXEL, Moves.SWORDS_DANCE, Moves.THUNDEROUS_KICK, Moves.MULTI_ATTACK ], + [Species.GLAMEOW]: [ Moves.U_TURN, Moves.STOMPING_TANTRUM, Moves.BULK_UP, Moves.RAGING_BULL ], + [Species.CHINGLING]: [ Moves.BUZZY_BUZZ, Moves.COSMIC_POWER, Moves.TORCH_SONG, Moves.LUMINA_CRASH ], + [Species.STUNKY]: [ Moves.SPIKES, Moves.KNOCK_OFF, Moves.RECOVER, Moves.DIRE_CLAW ], + [Species.BRONZOR]: [ Moves.RECOVER, Moves.COSMIC_POWER, Moves.SPIKES, Moves.TACHYON_CUTTER ], + [Species.BONSLY]: [ Moves.STONE_AXE, Moves.LEAF_BLADE, Moves.STRENGTH_SAP, Moves.HEAD_SMASH ], + [Species.MIME_JR]: [ Moves.CALM_MIND, Moves.MOONBLAST, Moves.WILL_O_WISP, Moves.TWIN_BEAM ], + [Species.HAPPINY]: [ Moves.IRON_DEFENSE, Moves.SEISMIC_TOSS, Moves.STEALTH_ROCK, Moves.SIZZLY_SLIDE ], + [Species.CHATOT]: [ Moves.SPARKLING_ARIA, Moves.TORCH_SONG, Moves.BATON_PASS, Moves.BOOMBURST ], + [Species.SPIRITOMB]: [ Moves.PARTING_SHOT, Moves.FOUL_PLAY, Moves.RECOVER, Moves.POLTERGEIST ], + [Species.GIBLE]: [ Moves.DRAGON_HAMMER, Moves.LANDS_WRATH, Moves.SHORE_UP, Moves.BITTER_BLADE ], + [Species.MUNCHLAX]: [ Moves.IRON_DEFENSE, Moves.BODY_PRESS, Moves.HEAVY_SLAM, Moves.SLACK_OFF ], + [Species.RIOLU]: [ Moves.THUNDEROUS_KICK, Moves.BULLET_PUNCH, Moves.TRIPLE_AXEL, Moves.DOUBLE_IRON_BASH ], + [Species.HIPPOPOTAS]: [ Moves.BODY_PRESS, Moves.STONE_AXE, Moves.SALT_CURE, Moves.IRON_DEFENSE ], + [Species.SKORUPI]: [ Moves.CEASELESS_EDGE, Moves.DIRE_CLAW, Moves.PARTING_SHOT, Moves.WICKED_BLOW ], + [Species.CROAGUNK]: [ Moves.DIRE_CLAW, Moves.ICE_PUNCH, Moves.THUNDEROUS_KICK, Moves.VICTORY_DANCE ], + [Species.CARNIVINE]: [ Moves.SWORDS_DANCE, Moves.FIRE_LASH, Moves.MIGHTY_CLEAVE, Moves.FLOWER_TRICK ], + [Species.FINNEON]: [ Moves.QUIVER_DANCE, Moves.BOUNCY_BUBBLE, Moves.FREEZE_DRY, Moves.ORIGIN_PULSE ], + [Species.MANTYKE]: [ Moves.BOUNCY_BUBBLE, Moves.SPIKES, Moves.ROOST, Moves.STEAM_ERUPTION ], + [Species.SNOVER]: [ Moves.STOMPING_TANTRUM, Moves.ICE_HAMMER, Moves.AURORA_VEIL, Moves.IVY_CUDGEL ], + [Species.ROTOM]: [ Moves.RECOVER, Moves.FIERY_DANCE, Moves.SPLISHY_SPLASH, Moves.RISING_VOLTAGE ], + [Species.UXIE]: [ Moves.COSMIC_POWER, Moves.BODY_PRESS, Moves.RECOVER, Moves.LUMINA_CRASH ], + [Species.MESPRIT]: [ Moves.QUIVER_DANCE, Moves.AURA_SPHERE, Moves.RECOVER, Moves.LUMINA_CRASH ], + [Species.AZELF]: [ Moves.PHOTON_GEYSER, Moves.DRAGON_DANCE, Moves.RECOVER, Moves.LUMINA_CRASH ], + [Species.DIALGA]: [ Moves.CORE_ENFORCER, Moves.CALM_MIND, Moves.RECOVER, Moves.MAKE_IT_RAIN ], + [Species.PALKIA]: [ Moves.RECOVER, Moves.FREEZE_DRY, Moves.WATER_SPOUT, Moves.DRAGON_ENERGY ], + [Species.HEATRAN]: [ Moves.TORCH_SONG, Moves.SPIKES, Moves.FLASH_CANNON, Moves.RECOVER ], + [Species.REGIGIGAS]: [ Moves.MIGHTY_CLEAVE, Moves.SHORE_UP, Moves.EXTREME_SPEED, Moves.SKILL_SWAP ], + [Species.GIRATINA]: [ Moves.DRAGON_DANCE, Moves.GLAIVE_RUSH, Moves.RECOVER, Moves.ASTRAL_BARRAGE ], + [Species.CRESSELIA]: [ Moves.COSMIC_POWER, Moves.SECRET_SWORD, Moves.INFERNAL_PARADE, Moves.LUMINA_CRASH ], + [Species.PHIONE]: [ Moves.BOUNCY_BUBBLE, Moves.FREEZE_DRY, Moves.RECOVER, Moves.QUIVER_DANCE ], + [Species.MANAPHY]: [ Moves.BOUNCY_BUBBLE, Moves.FREEZE_DRY, Moves.RECOVER, Moves.QUIVER_DANCE ], + [Species.DARKRAI]: [ Moves.FIERY_WRATH, Moves.MOONBLAST, Moves.SEARING_SHOT, Moves.MALIGNANT_CHAIN ], + [Species.SHAYMIN]: [ Moves.MOONBLAST, Moves.HURRICANE, Moves.MATCHA_GOTCHA, Moves.SEARING_SHOT ], + [Species.ARCEUS]: [ Moves.QUIVER_DANCE, Moves.SPIRIT_SHACKLE, Moves.VICTORY_DANCE, Moves.COLLISION_COURSE ], [Species.VICTINI]: [ Moves.VICTORY_DANCE, Moves.FUSION_BOLT, Moves.GLACIATE, Moves.BLUE_FLARE ], [Species.SNIVY]: [ Moves.SYNTHESIS, Moves.SAPPY_SEED, Moves.POWER_GEM, Moves.DRACO_METEOR ], [Species.TEPIG]: [ Moves.SUCKER_PUNCH, Moves.SLACK_OFF, Moves.MACH_PUNCH, Moves.VICTORY_DANCE ], [Species.OSHAWOTT]: [ Moves.SECRET_SWORD, Moves.AQUA_CUTTER, Moves.NASTY_PLOT, Moves.BEHEMOTH_BLADE ], [Species.PATRAT]: [ Moves.COVET, Moves.EXTREME_SPEED, Moves.ACUPRESSURE, Moves.LAST_RESORT ], [Species.LILLIPUP]: [ Moves.COVET, Moves.LAST_RESPECTS, Moves.HIGH_HORSEPOWER, Moves.NO_RETREAT ], - [Species.PURRLOIN]: [ Moves.THIEF, Moves.SWORDS_DANCE, Moves.PARTING_SHOT, Moves.WICKED_BLOW ], - [Species.PANSAGE]: [ Moves.NASTY_PLOT, Moves.AURA_SPHERE, Moves.STRENGTH_SAP, Moves.FRENZY_PLANT ], + [Species.PURRLOIN]: [ Moves.PSYCHIC_FANGS, Moves.SWORDS_DANCE, Moves.PARTING_SHOT, Moves.WICKED_BLOW ], + [Species.PANSAGE]: [ Moves.NASTY_PLOT, Moves.AURA_SPHERE, Moves.TRAILBLAZE, Moves.FRENZY_PLANT ], [Species.PANSEAR]: [ Moves.NASTY_PLOT, Moves.AURA_SPHERE, Moves.SCORCHING_SANDS, Moves.BLAST_BURN ], [Species.PANPOUR]: [ Moves.NASTY_PLOT, Moves.AURA_SPHERE, Moves.FREEZE_DRY, Moves.HYDRO_CANNON ], [Species.MUNNA]: [ Moves.COSMIC_POWER, Moves.AURA_SPHERE, Moves.EARTH_POWER, Moves.MYSTICAL_POWER ], @@ -312,7 +312,7 @@ export const speciesEggMoves = { [Species.MIENFOO]: [ Moves.TIDY_UP, Moves.ICE_SPINNER, Moves.SUPERCELL_SLAM, Moves.BRAVE_BIRD ], [Species.DRUDDIGON]: [ Moves.SPIKY_SHIELD, Moves.STOMPING_TANTRUM, Moves.CLANGOROUS_SOUL, Moves.DIAMOND_STORM ], [Species.GOLETT]: [ Moves.BULK_UP, Moves.RAGE_FIST, Moves.HEADLONG_RUSH, Moves.DOUBLE_IRON_BASH ], - [Species.PAWNIARD]: [ Moves.ATTACK_ORDER, Moves.CEASELESS_EDGE, Moves.AQUA_CUTTER, Moves.PSYBLADE ], + [Species.PAWNIARD]: [ Moves.SUCKER_PUNCH, Moves.CEASELESS_EDGE, Moves.AQUA_CUTTER, Moves.PSYBLADE ], [Species.BOUFFALANT]: [ Moves.EARTHQUAKE, Moves.FLAME_CHARGE, Moves.IRON_HEAD, Moves.RAGING_BULL ], [Species.RUFFLET]: [ Moves.FLOATY_FALL, Moves.DAZZLING_GLEAM, Moves.HEAT_WAVE, Moves.BOLT_BEAK ], [Species.VULLABY]: [ Moves.RUINATION, Moves.BODY_PRESS, Moves.ROOST, Moves.BADDY_BAD ], From be7a0d9ca66aaccd89fd274db4040113b97c596e Mon Sep 17 00:00:00 2001 From: Madmadness65 Date: Wed, 17 Apr 2024 11:29:52 -0500 Subject: [PATCH 08/17] Minor change to Shaymin's egg moves --- src/data/egg-moves.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/egg-moves.ts b/src/data/egg-moves.ts index 5cbf7f14eff..9adfc3e17e7 100644 --- a/src/data/egg-moves.ts +++ b/src/data/egg-moves.ts @@ -248,7 +248,7 @@ export const speciesEggMoves = { [Species.PHIONE]: [ Moves.BOUNCY_BUBBLE, Moves.FREEZE_DRY, Moves.RECOVER, Moves.QUIVER_DANCE ], [Species.MANAPHY]: [ Moves.BOUNCY_BUBBLE, Moves.FREEZE_DRY, Moves.RECOVER, Moves.QUIVER_DANCE ], [Species.DARKRAI]: [ Moves.FIERY_WRATH, Moves.MOONBLAST, Moves.SEARING_SHOT, Moves.MALIGNANT_CHAIN ], - [Species.SHAYMIN]: [ Moves.MOONBLAST, Moves.HURRICANE, Moves.MATCHA_GOTCHA, Moves.SEARING_SHOT ], + [Species.SHAYMIN]: [ Moves.SPRINGTIDE_STORM, Moves.HEAT_WAVE, Moves.BLEAKWIND_STORM, Moves.MATCHA_GOTCHA ], [Species.ARCEUS]: [ Moves.QUIVER_DANCE, Moves.SPIRIT_SHACKLE, Moves.VICTORY_DANCE, Moves.COLLISION_COURSE ], [Species.VICTINI]: [ Moves.VICTORY_DANCE, Moves.FUSION_BOLT, Moves.GLACIATE, Moves.BLUE_FLARE ], [Species.SNIVY]: [ Moves.SYNTHESIS, Moves.SAPPY_SEED, Moves.POWER_GEM, Moves.DRACO_METEOR ], From 7155174d3ccc63626df4807a3dce291ee1ede19e Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 17 Apr 2024 14:49:18 -0400 Subject: [PATCH 09/17] Patch a certain bug --- src/ui/starter-select-ui-handler.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 6c589a1b2d7..2ed30a3be11 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -170,6 +170,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private starterSelectCallback: StarterSelectCallback; private gameMode: GameModes; + protected blockInput: boolean = false; + constructor(scene: BattleScene) { super(scene, Mode.STARTER_SELECT); } @@ -614,6 +616,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } processInput(button: Button): boolean { + if (this.blockInput) + return false; + const ui = this.getUi(); let success = false; @@ -633,6 +638,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { success = true; this.updateInstructions(); } else { + this.blockInput = true; this.scene.clearPhaseQueue(); this.scene.pushPhase(new TitlePhase(this.scene)); this.scene.getCurrentPhase().end(); @@ -1631,6 +1637,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { super.clear(); this.cursor = -1; this.starterSelectContainer.setVisible(false); + this.blockInput = false; while (this.starterCursors.length) this.popStarter(); From d210e3878e5681909617b4adb90156f12386a587 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 17 Apr 2024 15:56:29 -0400 Subject: [PATCH 10/17] Disable menu temporarily on receiving a voucher --- src/battle-scene.ts | 6 ++++++ src/data/pokemon-species.ts | 4 ++-- src/phases.ts | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c75e44bf694..9c30e03b765 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -132,6 +132,8 @@ export default class BattleScene extends SceneBase { public enableTouchControls: boolean = false; public enableVibration: boolean = false; + public disableMenu: boolean = false; + public gameData: GameData; public sessionSlotId: integer; @@ -733,6 +735,8 @@ export default class BattleScene extends SceneBase { this.setSeed(SEED_OVERRIDE || Utils.randomString(24)); console.log('Seed:', this.seed); + this.disableMenu = false; + this.score = 0; this.money = 0; @@ -1234,6 +1238,8 @@ export default class BattleScene extends SceneBase { inputSuccess = this.ui.processInput(Button.CANCEL); this.setLastProcessedMovementTime(Button.CANCEL); } else if (this.buttonJustPressed(Button.MENU)) { + if (this.disableMenu) + return; switch (this.ui?.getMode()) { case Mode.MESSAGE: if (!(this.ui.getHandler() as MessageUiHandler).pendingPrompt) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index e582fdfce1d..32d4b19b034 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -670,8 +670,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm { const legendary = this.legendary; const mythical = this.mythical; return species => { - return pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution - && pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution + return (pseudoLegendary || legendary || mythical || (!pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution + && pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution)) && species.pseudoLegendary === pseudoLegendary && species.legendary === legendary && species.mythical === mythical diff --git a/src/phases.ts b/src/phases.ts index 6ec1cfdf853..38a858fe05f 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -742,6 +742,7 @@ export class EncounterPhase extends BattlePhase { this.scene.ui.setMode(Mode.MESSAGE).then(() => { if (!this.loaded) { this.scene.gameData.saveSystem().then(success => { + this.scene.disableMenu = false; if (!success) return this.scene.reset(true); this.scene.gameData.saveSession(this.scene, true).then(() => this.doEncounter()); @@ -3304,6 +3305,7 @@ export class ModifierRewardPhase extends BattlePhase { doReward(): Promise { return new Promise(resolve => { + this.scene.disableMenu = true; const newModifier = this.modifierType.newModifier(); this.scene.addModifier(newModifier).then(() => { this.scene.playSound('item_fanfare'); From 6f3887a2ebab4ad28e6bd9358f331aa94dd374a1 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Wed, 17 Apr 2024 15:58:13 -0400 Subject: [PATCH 11/17] Remove unintended negative from fusion compatibility filter --- src/data/pokemon-species.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 32d4b19b034..7dec417876b 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -670,7 +670,8 @@ export default class PokemonSpecies extends PokemonSpeciesForm { const legendary = this.legendary; const mythical = this.mythical; return species => { - return (pseudoLegendary || legendary || mythical || (!pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution + return (pseudoLegendary || legendary || mythical || + (pokemonEvolutions.hasOwnProperty(species.speciesId) === hasEvolution && pokemonPrevolutions.hasOwnProperty(species.speciesId) === hasPrevolution)) && species.pseudoLegendary === pseudoLegendary && species.legendary === legendary From 4c128e9d268586169494689737c37a2aaba545a7 Mon Sep 17 00:00:00 2001 From: dpMelian Date: Wed, 17 Apr 2024 20:50:11 +0100 Subject: [PATCH 12/17] feat: correct typo in AttackTypeBoosterModifierType constructor Corrected "Inceases" to "Increases" in the description of the AttackTypeBoosterModifierType constructor to accurately reflect its functionality. --- src/modifier/modifier-type.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 8078a7c06b9..115c9bc23f3 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -400,7 +400,7 @@ export class AttackTypeBoosterModifierType extends PokemonHeldItemModifierType i public boostPercent: integer; constructor(moveType: Type, boostPercent: integer) { - super(getAttackTypeBoosterItemName(moveType), `Inceases the power of a Pokémon's ${Utils.toReadableString(Type[moveType])}-type moves by 20%`, + super(getAttackTypeBoosterItemName(moveType), `Increases the power of a Pokémon's ${Utils.toReadableString(Type[moveType])}-type moves by 20%`, (_type, args) => new Modifiers.AttackTypeBoosterModifier(this, (args[0] as Pokemon).id, moveType, boostPercent), `${getAttackTypeBoosterItemName(moveType).replace(/[ \-]/g, '_').toLowerCase()}`); From 0ddae73bf5298fd8ae15f61bccb2685d72bc4c8d Mon Sep 17 00:00:00 2001 From: serif <42188588+Natsumi-chanFE@users.noreply.github.com> Date: Wed, 17 Apr 2024 12:22:39 -0400 Subject: [PATCH 13/17] Update Pidgey, Rattata, and Spearow movesets to BDSP Will update others later --- src/data/pokemon-level-moves.ts | 35 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 4fcff144d02..8f325139282 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -228,7 +228,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 33, Moves.WING_ATTACK ], [ 37, Moves.ROOST ], [ 41, Moves.TAILWIND ], - [ 45, Moves.MIRROR_MOVE ], + [ 45, Moves.AERIAL_ACE ], [ 49, Moves.AIR_SLASH ], [ 53, Moves.HURRICANE ], ], @@ -236,6 +236,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.GUST ], [ 1, Moves.SAND_ATTACK ], [ 1, Moves.TACKLE ], + [ 5, Moves.SAND_ATTACK ], + [ 9, Moves.GUST ], [ 13, Moves.QUICK_ATTACK ], [ 17, Moves.WHIRLWIND ], [ 22, Moves.TWISTER ], @@ -244,7 +246,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 37, Moves.WING_ATTACK ], [ 42, Moves.ROOST ], [ 47, Moves.TAILWIND ], - [ 52, Moves.MIRROR_MOVE ], + [ 52, Moves.AERIAL_ACE ], [ 57, Moves.AIR_SLASH ], [ 62, Moves.HURRICANE ], ], @@ -254,6 +256,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.TACKLE ], [ 1, Moves.QUICK_ATTACK ], [ 1, Moves.HURRICANE ], + [ 5, Moves.SAND_ATTACK ], + [ 9, Moves.GUST ], [ 17, Moves.WHIRLWIND ], [ 22, Moves.TWISTER ], [ 27, Moves.FEATHER_DANCE ], @@ -261,8 +265,9 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 38, Moves.WING_ATTACK ], [ 44, Moves.ROOST ], [ 50, Moves.TAILWIND ], - [ 56, Moves.MIRROR_MOVE ], + [ 56, Moves.AERIAL_ACE ], [ 62, Moves.AIR_SLASH ], + [ 68, Moves.HURRICANE ], ], [Species.RATTATA]: [ [ 1, Moves.TACKLE ], @@ -270,8 +275,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 4, Moves.QUICK_ATTACK ], [ 7, Moves.FOCUS_ENERGY ], [ 10, Moves.BITE ], - [ 13, Moves.PURSUIT ], - [ 16, Moves.HYPER_FANG ], + [ 13, Moves.LASER_FOCUS ], + [ 16, Moves.TAKE_DOWN ], [ 19, Moves.ASSURANCE ], [ 22, Moves.CRUNCH ], [ 25, Moves.SUCKER_PUNCH ], @@ -287,8 +292,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.QUICK_ATTACK ], [ 1, Moves.FOCUS_ENERGY ], [ 10, Moves.BITE ], - [ 13, Moves.PURSUIT ], - [ 16, Moves.HYPER_FANG ], + [ 13, Moves.LASER_FOCUS ], + [ 16, Moves.TAKE_DOWN ], [ 19, Moves.ASSURANCE ], [ 24, Moves.CRUNCH ], [ 29, Moves.SUCKER_PUNCH ], @@ -300,11 +305,11 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.GROWL ], [ 1, Moves.PECK ], [ 4, Moves.LEER ], - [ 8, Moves.PURSUIT ], + [ 8, Moves.ASSURANCE ], [ 11, Moves.FURY_ATTACK ], [ 15, Moves.AERIAL_ACE ], - [ 18, Moves.MIRROR_MOVE ], - [ 22, Moves.ASSURANCE ], + [ 18, Moves.WING_ATTACK ], + [ 22, Moves.TAKE_DOWN ], [ 25, Moves.AGILITY ], [ 29, Moves.FOCUS_ENERGY ], [ 32, Moves.ROOST ], @@ -314,13 +319,15 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = { [ 1, Moves.LEER ], [ 1, Moves.GROWL ], [ 1, Moves.PECK ], - [ 1, Moves.PURSUIT ], + [ 1, Moves.ASSURANCE ], [ 1, Moves.PLUCK ], [ 1, Moves.DRILL_RUN ], + [ 4, Moves.LEER ], + [ 8, Moves.ASSURANCE ], [ 11, Moves.FURY_ATTACK ], [ 15, Moves.AERIAL_ACE ], - [ 18, Moves.MIRROR_MOVE ], - [ 23, Moves.ASSURANCE ], + [ 18, Moves.WING_ATTACK ], + [ 23, Moves.TAKE_DOWN ], [ 27, Moves.AGILITY ], [ 32, Moves.FOCUS_ENERGY ], [ 36, Moves.ROOST ], @@ -18599,4 +18606,4 @@ export const pokemonFormLevelMoves: PokemonSpeciesFormLevelMoves = { [ 60, Moves.CLOSE_COMBAT ], ] } -}; \ No newline at end of file +}; From 80673b14b14b3b7706c11fd1eca62027fb8f55e4 Mon Sep 17 00:00:00 2001 From: NxKarim Date: Wed, 17 Apr 2024 17:56:07 -0600 Subject: [PATCH 14/17] Update ability.ts --- src/data/ability.ts | 61 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 1ba2a8c979a..ab027e3db8d 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -202,6 +202,25 @@ export class PreDefendAbAttr extends AbAttr { } } +export class PreDefendFormChangeAbAttr extends PreDefendAbAttr { + private formFunc: (p: Pokemon) => integer; + + constructor(formFunc: ((p: Pokemon) => integer)) { + super(true); + + this.formFunc = formFunc; + } + + applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { + const formIndex = this.formFunc(pokemon); + if (formIndex !== pokemon.formIndex) { + pokemon.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeManualTrigger, false); + return true; + } + + return false; + } +} export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (pokemon.getHpRatio() < 1 || (args[0] as Utils.NumberHolder).value < pokemon.hp) @@ -261,14 +280,14 @@ export class ReceivedTypeDamageMultiplierAbAttr extends ReceivedMoveDamageMultip } } -export class SetMovePowerToOneAbAttr extends ReceivedMoveDamageMultiplierAbAttr { +export class PreDefendMovePowerToOneAbAttr extends ReceivedMoveDamageMultiplierAbAttr { constructor(condition: PokemonDefendCondition) { super(condition, 1); } applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (this.condition(pokemon, attacker, move.getMove())) { - (args[0] as Utils.NumberHolder).value = 0.001; + (args[0] as Utils.NumberHolder).value = 1; return true; } @@ -403,12 +422,9 @@ export class PostDefendAbAttr extends AbAttr { export class PostDefendDisguiseAbAttr extends PostDefendAbAttr { - constructor(damageRatio?: number) { - super(true); - } - applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (pokemon.formIndex == 0 && pokemon.battleData.hitCount != 0 && (move.getMove().category == MoveCategory.SPECIAL || move.getMove().category == MoveCategory.PHYSICAL)) { + const recoilDamage = Math.ceil((pokemon.getMaxHp() / 8) - attacker.turnData.damageDealt); if (!recoilDamage) return false; @@ -421,6 +437,26 @@ export class PostDefendDisguiseAbAttr extends PostDefendAbAttr { } } +export class PostDefendFormChangeAbAttr extends PostDefendAbAttr { + private formFunc: (p: Pokemon) => integer; + + constructor(formFunc: ((p: Pokemon) => integer)) { + super(true); + + this.formFunc = formFunc; + } + + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { + const formIndex = this.formFunc(pokemon); + if (formIndex !== pokemon.formIndex) { + pokemon.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeManualTrigger, false); + return true; + } + + return false; + } +} + export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { const attackPriority = new Utils.IntegerHolder(move.getMove().priority); @@ -477,7 +513,7 @@ export class MoveImmunityStatChangeAbAttr extends MoveImmunityAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { const ret = super.applyPreDefend(pokemon, passive, attacker, move, cancelled, args) if (ret) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [this.stat], this.levels)); } return ret; @@ -2472,7 +2508,7 @@ export function initAbilities() { .attr(BattleStatMultiplierAbAttr, BattleStat.SPATK, 1.5) .condition(getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)), new Ability(Abilities.QUICK_FEET, "Quick Feet", "Boosts the Speed stat if the Pokémon has a status condition.", 4) - .conditionalAttr(pokemon => pokemon.status.effect === StatusEffect.PARALYSIS, BattleStatMultiplierAbAttr, BattleStat.SPD, 2) + .conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, BattleStatMultiplierAbAttr, BattleStat.SPD, 2) .conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5), new Ability(Abilities.NORMALIZE, "Normalize", "All the Pokémon's moves become Normal type. The power of those moves is boosted a little.", 4) .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL && @@ -2749,8 +2785,11 @@ export function initAbilities() { .attr(UnswappableAbilityAbAttr) .attr(UnsuppressableAbilityAbAttr), new Ability(Abilities.DISGUISE, "Disguise (P)", "Once per battle, the shroud that covers the Pokémon can protect it from an attack.", 7) - .attr(SetMovePowerToOneAbAttr, (target, user, move) => target.formIndex == 0) - .attr(PostTurnFormChangeAbAttr, pokemon => pokemon.battleData.hitCount === 0 ? 0 : 1) + .attr(PreDefendMovePowerToOneAbAttr, (target, user, move) => target.formIndex == 0 && target.getAttackTypeEffectiveness(move.type) > 0) + .attr(PostSummonFormChangeAbAttr, p => p.battleData.hitCount === 0 ? 0 : 1) + .attr(PostBattleInitFormChangeAbAttr, p => p.battleData.hitCount === 0 ? 0 : 1) + .attr(PostDefendFormChangeAbAttr, p => p.battleData.hitCount === 0 ? 0 : 1) + .attr(PreDefendFormChangeAbAttr, p => p.battleData.hitCount === 0 ? 0 : 1) .attr(PostDefendDisguiseAbAttr) .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) @@ -3033,4 +3072,4 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) ); -} +} \ No newline at end of file From c866cecca4f441231a2dd92a10fc29961635bb04 Mon Sep 17 00:00:00 2001 From: NxKarim Date: Wed, 17 Apr 2024 18:14:40 -0600 Subject: [PATCH 15/17] Update ability.ts --- src/data/ability.ts | 144 ++++++++++++++++++++++---------------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index ab027e3db8d..4bea64a7404 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -52,10 +52,10 @@ export class Ability { const attr = new AttrType(...args); attr.addCondition(condition); this.attrs.push(attr); - + return this; } - + hasAttr(attrType: { new(...args: any[]): AbAttr }): boolean { return !!this.getAttrs(attrType).length; } @@ -91,7 +91,7 @@ export abstract class AbAttr { constructor(showAbility: boolean = true) { this.showAbility = showAbility; } - + apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise { return false; } @@ -189,7 +189,7 @@ export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr { else pokemon.scene.unshiftPhase(statChangePhase); } - + return true; } } @@ -233,7 +233,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr { export class BlockItemTheftAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { cancelled.value = true; - + return true; } @@ -248,7 +248,7 @@ export class StabBoostAbAttr extends AbAttr { (args[0] as Utils.NumberHolder).value += 0.5; return true; } - + return false; } } @@ -339,7 +339,7 @@ export class TypeImmunityHealAbAttr extends TypeImmunityAbAttr { } return true; } - + return false; } } @@ -362,9 +362,9 @@ class TypeImmunityStatChangeAbAttr extends TypeImmunityAbAttr { cancelled.value = true; const simulated = args.length > 1 && args[1]; if (!simulated) - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [this.stat], this.levels)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); } - + return ret; } } @@ -389,7 +389,7 @@ class TypeImmunityAddBattlerTagAbAttr extends TypeImmunityAbAttr { if (!simulated) pokemon.addTag(this.tagType, this.turnCount, undefined, pokemon.id); } - + return ret; } } @@ -459,14 +459,14 @@ export class PostDefendFormChangeAbAttr extends PostDefendAbAttr { export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { - const attackPriority = new Utils.IntegerHolder(move.getMove().priority); - applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority); - - if (attackPriority.value > 0 && !move.getMove().isMultiTarget()) { - cancelled.value = true; - return true; - } - + const attackPriority = new Utils.IntegerHolder(move.getMove().priority); + applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority); + + if(attackPriority.value > 0 && !move.getMove().isMultiTarget()) { + cancelled.value = true; + return true; + } + return false; } } @@ -513,7 +513,7 @@ export class MoveImmunityStatChangeAbAttr extends MoveImmunityAbAttr { applyPreDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, cancelled: Utils.BooleanHolder, args: any[]): boolean { const ret = super.applyPreDefend(pokemon, passive, attacker, move, cancelled, args) if (ret) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [this.stat], this.levels)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); } return ret; @@ -537,7 +537,7 @@ export class PostDefendStatChangeAbAttr extends PostDefendAbAttr { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (this.condition(pokemon, attacker, move.getMove())) { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), true, [this.stat], this.levels)); + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, (this.selfTarget ? pokemon : attacker).getBattlerIndex(), true, [ this.stat ], this.levels)); return true; } @@ -570,7 +570,7 @@ export class PostDefendTypeChangeAbAttr extends PostDefendAbAttr { const type = move.getMove().type; const pokemonTypes = pokemon.getTypes(true); if (pokemonTypes.length !== 1 || pokemonTypes[0] !== type) { - pokemon.summonData.types = [type]; + pokemon.summonData.types = [ type ]; return true; } } @@ -672,13 +672,13 @@ export class PostDefendContactDamageAbAttr extends PostDefendAbAttr { this.damageRatio = damageRatio; } - + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER); return true; } - + return false; } @@ -708,7 +708,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr { constructor() { super(); } - + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnswappableAbilityAbAttr)) { const tempAbilityId = attacker.getAbility().id; @@ -716,7 +716,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr { pokemon.summonData.ability = tempAbilityId; return true; } - + return false; } @@ -729,14 +729,14 @@ export class PostDefendAbilityGiveAbAttr extends PostDefendAbAttr { constructor() { super(); } - + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnsuppressableAbilityAbAttr) && !attacker.getAbility().hasAttr(PostDefendAbilityGiveAbAttr)) { attacker.summonData.ability = pokemon.getAbility().id; return true; } - + return false; } @@ -784,7 +784,7 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr { export class VariableMoveTypeAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { //const power = args[0] as Utils.IntegerHolder; - return false; + return false; } } @@ -793,7 +793,7 @@ export class MoveTypeChangePowerMultiplierAbAttr extends VariableMoveTypeAbAttr private newType: Type; private powerMultiplier: number; - constructor(matchType: Type, newType: Type, powerMultiplier: number) { + constructor(matchType: Type, newType: Type, powerMultiplier: number){ super(true); this.matchType = matchType; this.newType = newType; @@ -807,7 +807,7 @@ export class MoveTypeChangePowerMultiplierAbAttr extends VariableMoveTypeAbAttr (args[1] as Utils.NumberHolder).value *= this.powerMultiplier; return true; } - + return false; } } @@ -817,7 +817,7 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr { private powerMultiplier: number; private condition: PokemonAttackCondition; - constructor(newType: Type, powerMultiplier: number, condition: PokemonAttackCondition) { + constructor(newType: Type, powerMultiplier: number, condition: PokemonAttackCondition){ super(true); this.newType = newType; this.powerMultiplier = powerMultiplier; @@ -876,7 +876,7 @@ export class LowHpMoveTypePowerBoostAbAttr extends MoveTypePowerBoostAbAttr { export class FieldVariableMovePowerAbAttr extends AbAttr { applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean { //const power = args[0] as Utils.NumberHolder; - return false; + return false; } } @@ -1050,8 +1050,8 @@ class PostVictoryStatChangeAbAttr extends PostVictoryAbAttr { const stat = typeof this.stat === 'function' ? this.stat(pokemon) : this.stat; - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [stat], this.levels)); - + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); + return true; } } @@ -1077,8 +1077,8 @@ export class PostKnockOutStatChangeAbAttr extends PostKnockOutAbAttr { const stat = typeof this.stat === 'function' ? this.stat(pokemon) : this.stat; - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [stat], this.levels)); - + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); + return true; } } @@ -1094,7 +1094,7 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr { pokemon.scene.queueMessage(getPokemonMessage(knockedOut, `'s ${allAbilities[knockedOut.getAbility().id].name} was taken over!`)); return true; } - + return false; } } @@ -1157,8 +1157,8 @@ export class PostSummonStatChangeAbAttr extends PostSummonAbAttr { constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean) { super(); - this.stats = typeof (stats) === 'number' - ? [stats as BattleStat] + this.stats = typeof(stats) === 'number' + ? [ stats as BattleStat ] : stats as BattleStat[]; this.levels = levels; this.selfTarget = !!selfTarget; @@ -1180,7 +1180,7 @@ export class PostSummonStatChangeAbAttr extends PostSummonAbAttr { else pokemon.scene.unshiftPhase(statChangePhase); } - + return true; } } @@ -1193,12 +1193,12 @@ export class DownloadAbAttr extends PostSummonAbAttr { applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { this.enemyDef = 0; this.enemySpDef = 0; - + for (let opponent of pokemon.getOpponents()) { this.enemyDef += opponent.stats[BattleStat.DEF]; this.enemySpDef += opponent.stats[BattleStat.SPDEF]; } - + if (this.enemyDef < this.enemySpDef) this.stats = [BattleStat.ATK]; else @@ -1208,7 +1208,7 @@ export class DownloadAbAttr extends PostSummonAbAttr { pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1)); return true; } - + return false; } } @@ -1303,11 +1303,11 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr { pokemon.summonData.ability = target.getAbility().id; pokemon.summonData.gender = target.getGender(); pokemon.summonData.fusionGender = target.getFusionGender(); - pokemon.summonData.stats = [pokemon.stats[Stat.HP]].concat(target.stats.slice(1)); + pokemon.summonData.stats = [ pokemon.stats[Stat.HP] ].concat(target.stats.slice(1)); pokemon.summonData.battleStats = target.summonData.battleStats.slice(0); pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m.moveId, m.ppUsed, m.ppUp)); pokemon.summonData.types = target.getTypes(); - + pokemon.scene.playSound('PRSFX- Transform'); pokemon.loadAssets(false).then(() => pokemon.playAnim()); @@ -1342,7 +1342,7 @@ export class PreSwitchOutResetStatusAbAttr extends PreSwitchOutAbAttr { export class PreSwitchOutHealAbAttr extends PreSwitchOutAbAttr { applyPreSwitchOut(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise { - if (pokemon.getHpRatio() < 1) { + if (pokemon.getHpRatio() < 1 ) { const healAmount = Math.floor(pokemon.getMaxHp() * 0.33); pokemon.heal(healAmount); pokemon.updateInfo(); @@ -1373,7 +1373,7 @@ export class ProtectStatAbAttr extends PreStatChangeAbAttr { cancelled.value = true; return true; } - + return false; } @@ -1482,7 +1482,7 @@ export class IncrementMovePriorityAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { if (!this.moveIncrementFunc(pokemon, args[0] as Move)) return false; - + (args[1] as Utils.IntegerHolder).value += this.increaseAmount; return true; } @@ -1594,7 +1594,7 @@ export class PostWeatherLapseHealAbAttr extends PostWeatherLapseAbAttr { constructor(healFactor: integer, ...weatherTypes: WeatherType[]) { super(...weatherTypes); - + this.healFactor = healFactor; } @@ -1616,7 +1616,7 @@ export class PostWeatherLapseDamageAbAttr extends PostWeatherLapseAbAttr { constructor(damageFactor: integer, ...weatherTypes: WeatherType[]) { super(...weatherTypes); - + this.damageFactor = damageFactor; } @@ -1676,13 +1676,13 @@ export class PostTurnAbAttr extends AbAttr { export class PostTurnResetStatusAbAttr extends PostTurnAbAttr { applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { if (pokemon.status) { - + pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status?.effect))); pokemon.resetStatus(); pokemon.updateInfo(); return true; } - + return false; } } @@ -1696,7 +1696,7 @@ export class PostTurnStatChangeAbAttr extends PostTurnAbAttr { this.stats = Array.isArray(stats) ? stats - : [stats]; + : [ stats ]; this.levels = levels; } @@ -1829,7 +1829,7 @@ export class CheckTrappedAbAttr extends AbAttr { constructor() { super(false); } - + applyCheckTrapped(pokemon: Pokemon, passive: boolean, trapped: Utils.BooleanHolder, args: any[]): boolean | Promise { return false; } @@ -1888,7 +1888,7 @@ export class PostFaintAbAttr extends AbAttr { export class PostFaintContactDamageAbAttr extends PostFaintAbAttr { private damageRatio: integer; - + constructor(damageRatio: integer) { super(); @@ -1922,10 +1922,10 @@ export class RedirectMoveAbAttr extends AbAttr { return false; } - + canRedirect(moveId: Moves): boolean { const move = allMoves[moveId]; - return !![MoveTarget.NEAR_OTHER, MoveTarget.OTHER].find(t => move.moveTarget === t); + return !![ MoveTarget.NEAR_OTHER, MoveTarget.OTHER ].find(t => move.moveTarget === t); } } @@ -1976,7 +1976,7 @@ export class FlinchStatChangeAbAttr extends FlinchEffectAbAttr { this.stats = Array.isArray(stats) ? stats - : [stats]; + : [ stats ]; this.levels = levels; } @@ -2170,7 +2170,7 @@ export function applyPostAttackAbAttrs(attrType: { new(...args: any[]): PostAtta export function applyPostKnockOutAbAttrs(attrType: { new(...args: any[]): PostKnockOutAbAttr }, pokemon: Pokemon, knockedOut: Pokemon, ...args: any[]): Promise { return applyAbAttrsInternal(attrType, pokemon, (attr, passive) => attr.applyPostKnockOut(pokemon, passive, knockedOut, args), args); -} +} export function applyPostVictoryAbAttrs(attrType: { new(...args: any[]): PostVictoryAbAttr }, pokemon: Pokemon, ...args: any[]): Promise { @@ -2258,7 +2258,7 @@ function queueShowAbility(pokemon: Pokemon, passive: boolean): void { pokemon.scene.clearPhaseQueueSplice(); } -export const allAbilities = [new Ability(Abilities.NONE, "-", "", 3)]; +export const allAbilities = [ new Ability(Abilities.NONE, "-", "", 3) ]; export function initAbilities() { allAbilities.push( @@ -2271,7 +2271,7 @@ export function initAbilities() { new Ability(Abilities.BATTLE_ARMOR, "Battle Armor", "Hard armor protects the Pokémon from critical hits.", 3) .attr(BlockCritAbAttr) .ignorable(), - new Ability(Abilities.STURDY, "Sturdy", "It cannot be knocked out with one hit. One-hit KO moves cannot knock it out, either.", 3) + new Ability(Abilities.STURDY, "Sturdy", "It cannot be knocked out with one hit. One-hit KO moves cannot knock it out, either.", 3) .attr(PreDefendFullHpEndureAbAttr) .attr(BlockOneHitKOAbAttr) .ignorable(), @@ -2511,8 +2511,8 @@ export function initAbilities() { .conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, BattleStatMultiplierAbAttr, BattleStat.SPD, 2) .conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5), new Ability(Abilities.NORMALIZE, "Normalize", "All the Pokémon's moves become Normal type. The power of those moves is boosted a little.", 4) - .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL && - move.id !== Moves.NATURAL_GIFT && move.id !== Moves.JUDGMENT && move.id !== Moves.TECHNO_BLAST), + .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL && + move.id !== Moves.NATURAL_GIFT && move.id !== Moves.JUDGMENT && move.id !== Moves.TECHNO_BLAST), new Ability(Abilities.SNIPER, "Sniper (N)", "Powers up moves if they become critical hits when attacking.", 4), new Ability(Abilities.MAGIC_GUARD, "Magic Guard", "The Pokémon only takes damage from attacks.", 4) .attr(BlockNonDirectDamageAbAttr), @@ -2531,7 +2531,7 @@ export function initAbilities() { new Ability(Abilities.SUPER_LUCK, "Super Luck (P)", "The Pokémon is so lucky that the critical-hit ratios of its moves are boosted.", 4) .attr(BonusCritAbAttr), new Ability(Abilities.AFTERMATH, "Aftermath", "Damages the attacker if it contacts the Pokémon with a finishing hit.", 4) - .attr(PostFaintContactDamageAbAttr, 4) + .attr(PostFaintContactDamageAbAttr,4) .bypassFaint(), new Ability(Abilities.ANTICIPATION, "Anticipation (N)", "The Pokémon can sense an opposing Pokémon's dangerous moves.", 4), new Ability(Abilities.FOREWARN, "Forewarn (N)", "When it enters a battle, the Pokémon can tell one of the moves an opposing Pokémon has.", 4), @@ -2541,7 +2541,7 @@ export function initAbilities() { new Ability(Abilities.TINTED_LENS, "Tinted Lens", "The Pokémon can use \"not very effective\" moves to deal regular damage.", 4) .attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) <= 0.5, 2), new Ability(Abilities.FILTER, "Filter", "Reduces the power of supereffective attacks taken.", 4) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) .ignorable(), new Ability(Abilities.SLOW_START, "Slow Start", "For five turns, the Pokémon's Attack and Speed stats are halved.", 4) .attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.SLOW_START, 5), @@ -2554,7 +2554,7 @@ export function initAbilities() { .attr(BlockWeatherDamageAttr, WeatherType.HAIL) .attr(PostWeatherLapseHealAbAttr, 1, WeatherType.HAIL, WeatherType.SNOW), new Ability(Abilities.SOLID_ROCK, "Solid Rock", "Reduces the power of supereffective attacks taken.", 4) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) + .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75) .ignorable(), new Ability(Abilities.SNOW_WARNING, "Snow Warning", "The Pokémon makes it snow when it enters a battle.", 4) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW) @@ -2601,7 +2601,7 @@ export function initAbilities() { .attr(WeightMultiplierAbAttr, 0.5) .ignorable(), new Ability(Abilities.MULTISCALE, "Multiscale", "Reduces the amount of damage the Pokémon takes while its HP is full.", 5) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getHpRatio() === 1, 0.5) + .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getHpRatio() === 1, 0.5) .ignorable(), new Ability(Abilities.TOXIC_BOOST, "Toxic Boost", "Powers up physical attacks when the Pokémon is poisoned.", 5) .attr(MovePowerBoostAbAttr, (user, target, move) => move.category === MoveCategory.PHYSICAL && (user.status?.effect === StatusEffect.POISON || user.status?.effect === StatusEffect.TOXIC), 1.5), @@ -2620,7 +2620,7 @@ export function initAbilities() { new Ability(Abilities.POISON_TOUCH, "Poison Touch", "May poison a target when the Pokémon makes contact.", 5) .attr(PostAttackContactApplyStatusEffectAbAttr, 30, StatusEffect.POISON), new Ability(Abilities.REGENERATOR, "Regenerator", "Restores a little HP when withdrawn from battle.", 5) - .attr(PreSwitchOutHealAbAttr), + .attr(PreSwitchOutHealAbAttr), new Ability(Abilities.BIG_PECKS, "Big Pecks", "Protects the Pokémon from Defense-lowering effects.", 5) .attr(ProtectStatAbAttr, BattleStat.DEF) .ignorable(), @@ -2865,9 +2865,9 @@ export function initAbilities() { new Ability(Abilities.FULL_METAL_BODY, "Full Metal Body", "Prevents other Pokémon's moves or Abilities from lowering the Pokémon's stats.", 7) .attr(ProtectStatAbAttr), new Ability(Abilities.SHADOW_SHIELD, "Shadow Shield", "Reduces the amount of damage the Pokémon takes while its HP is full.", 7) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getHpRatio() === 1, 0.5), + .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getHpRatio() === 1, 0.5), new Ability(Abilities.PRISM_ARMOR, "Prism Armor", "Reduces the power of supereffective attacks taken.", 7) - .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75), + .attr(ReceivedMoveDamageMultiplierAbAttr,(target, user, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 0.75), new Ability(Abilities.NEUROFORCE, "Neuroforce", "Powers up moves that are super effective.", 7) .attr(MovePowerBoostAbAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) >= 2, 1.25), new Ability(Abilities.INTREPID_SWORD, "Intrepid Sword", "Boosts the Pokémon's Attack stat when the Pokémon enters a battle.", 8) @@ -3023,7 +3023,7 @@ export function initAbilities() { new Ability(Abilities.COSTAR, "Costar (N)", "When the Pokémon enters a battle, it copies an ally's stat changes.", 9), new Ability(Abilities.TOXIC_DEBRIS, "Toxic Debris (N)", "Scatters poison spikes at the feet of the opposing team when the Pokémon takes damage from physical moves.", 9), new Ability(Abilities.ARMOR_TAIL, "Armor Tail", "The mysterious tail covering the Pokémon's head makes opponents unable to use priority moves against the Pokémon or its allies.", 9) - .attr(FieldPriorityMoveImmunityAbAttr) + .attr(FieldPriorityMoveImmunityAbAttr) .ignorable(), new Ability(Abilities.EARTH_EATER, "Earth Eater", "If hit by a Ground-type move, the Pokémon has its HP restored instead of taking damage.", 9) .attr(TypeImmunityHealAbAttr, Type.GROUND) @@ -3072,4 +3072,4 @@ export function initAbilities() { .attr(UncopiableAbilityAbAttr) .attr(UnswappableAbilityAbAttr) ); -} \ No newline at end of file +} From 2629d51af8217e59b11ccbb25c5d7d2bbc4fecb4 Mon Sep 17 00:00:00 2001 From: NxKarim Date: Wed, 17 Apr 2024 18:21:16 -0600 Subject: [PATCH 16/17] whitespace pain --- src/data/ability.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 4bea64a7404..b30104e4b65 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -166,8 +166,8 @@ export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr { constructor(stats: BattleStat | BattleStat[], levels: integer, selfTarget?: boolean) { super(); - this.stats = typeof (stats) === 'number' - ? [stats as BattleStat] + this.stats = typeof(stats) === 'number' + ? [ stats as BattleStat ] : stats as BattleStat[]; this.levels = levels; this.selfTarget = !!selfTarget; @@ -654,8 +654,8 @@ export class PostDefendCritStatChangeAbAttr extends PostDefendAbAttr { } applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { - pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [this.stat], this.levels)); - + pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); + return true; } From 4f188d7b32e761b97527c78a722a63b00149e068 Mon Sep 17 00:00:00 2001 From: NxKarim <43686802+NxKarim@users.noreply.github.com> Date: Wed, 17 Apr 2024 20:02:58 -0600 Subject: [PATCH 17/17] Form name typo Co-authored-by: Samuel H --- src/data/pokemon-forms.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 7f62c10c782..4bf7b7ac875 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -567,7 +567,7 @@ export const pokemonFormChanges: PokemonFormChanges = { ], [Species.MIMIKYU]: [ new SpeciesFormChange(Species.MIMIKYU, 'disguised', 'busted', new SpeciesFormChangeManualTrigger(), true), - new SpeciesFormChange(Species.MIMIKYU, 'busted', 'disquised', new SpeciesFormChangeManualTrigger(), true) + new SpeciesFormChange(Species.MIMIKYU, 'busted', 'disguised', new SpeciesFormChangeManualTrigger(), true) ], [Species.NECROZMA]: [ new SpeciesFormChange(Species.NECROZMA, '', 'dawn-wings', new SpeciesFormChangeItemTrigger(FormChangeItem.N_LUNARIZER)),