From 3a6b4de685f3d09b33a4275d2a27381669790228 Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:03:24 -0700 Subject: [PATCH 01/13] first try addinng PreAttackChangeType class, put it on protean --- src/data/ability.ts | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 2ac7d6be1..c74ffb0d7 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -840,6 +840,33 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr { } } +export class PreAttackChangeType extends PreAttackAbAttr{ + + // private originalType: Type[]; + // private MoveType : Type; + private condition: PokemonAttackCondition; + + constructor(condition:PokemonAttackCondition){ + super(true); + // this.originalType = originalType; + // this.MoveType= moveType; + this.condition = condition; + } + + applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean | Promise { + if (this.condition(pokemon,defender,move.getMove())){ + const MoveType = move.getMove().type; + const originalType = pokemon.getTypes(); + + if (originalType.length !==1 || originalType[0] !== MoveType){ + pokemon.summonData.types = [MoveType]; + } + return true; + } + return false; + } +} + export class VariableMoveTypeAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { //const power = args[0] as Utils.IntegerHolder; @@ -2966,7 +2993,11 @@ export function initAbilities() { new Ability(Abilities.CHEEK_POUCH, 6) .unimplemented(), new Ability(Abilities.PROTEAN, 6) - .unimplemented(), + .attr(PostSummonMessageAbAttr,(pokemon: Pokemon) => getPokemonMessage(pokemon,' Testing out the text!')) + //.attr(,pokemon:Pokemon => getPokemonMessage(pokemon,' Testing out the text!')) + .attr(PreAttackChangeType, (target,user,move) => move.category !==MoveCategory.STATUS), + + //.unimplemented(), new Ability(Abilities.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5) .ignorable(), From aec0bae3666c70475d364c7d70470727cc69cb23 Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Tue, 30 Apr 2024 15:23:53 -0700 Subject: [PATCH 02/13] recomitting --- 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 c74ffb0d7..9b6d3fa75 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2995,7 +2995,7 @@ export function initAbilities() { new Ability(Abilities.PROTEAN, 6) .attr(PostSummonMessageAbAttr,(pokemon: Pokemon) => getPokemonMessage(pokemon,' Testing out the text!')) //.attr(,pokemon:Pokemon => getPokemonMessage(pokemon,' Testing out the text!')) - .attr(PreAttackChangeType, (target,user,move) => move.category !==MoveCategory.STATUS), + .attr(PreAttackChangeType, (target,user,move) => move.category === MoveCategory.SPECIAL), //.unimplemented(), new Ability(Abilities.FUR_COAT, 6) From ed08dc5d218bbba376ce338717ce80e29c2b608f Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Thu, 2 May 2024 13:57:53 -0700 Subject: [PATCH 03/13] 2nd try, current working using postattackchangetype it needs to be pre-. Need to find why it won't work in preattack --- src/data/ability.ts | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 9b6d3fa75..f1a76ff8b 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -841,31 +841,19 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr { } export class PreAttackChangeType extends PreAttackAbAttr{ - - // private originalType: Type[]; - // private MoveType : Type; - private condition: PokemonAttackCondition; - - constructor(condition:PokemonAttackCondition){ - super(true); - // this.originalType = originalType; - // this.MoveType= moveType; - this.condition = condition; - } - - applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean | Promise { - if (this.condition(pokemon,defender,move.getMove())){ + applyPreAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean { const MoveType = move.getMove().type; const originalType = pokemon.getTypes(); - if (originalType.length !==1 || originalType[0] !== MoveType){ + if (originalType.length > 1 || !pokemon.isOfType(MoveType)){ pokemon.summonData.types = [MoveType]; + pokemon.updateInfo(); + pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`)); + return true; } - return true; + return false; } - return false; } -} export class VariableMoveTypeAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { @@ -1151,6 +1139,21 @@ export class PostDefendStealHeldItemAbAttr extends PostDefendAbAttr { } } +export class PostAttackChangeType extends PostAttackAbAttr{ + applyPostAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean { + //if (this.condition(pokemon,defender,move.getMove())){ + const MoveType = move.getMove().type; + const originalType = pokemon.getTypes(); + + if (originalType.length > 1 || !pokemon.isOfType(MoveType)){ + pokemon.summonData.types = [MoveType]; + pokemon.updateInfo(); + pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`)); + return true; + } + return false; + } + } export class PostVictoryAbAttr extends AbAttr { applyPostVictory(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise { return false; @@ -2993,10 +2996,8 @@ export function initAbilities() { new Ability(Abilities.CHEEK_POUCH, 6) .unimplemented(), new Ability(Abilities.PROTEAN, 6) - .attr(PostSummonMessageAbAttr,(pokemon: Pokemon) => getPokemonMessage(pokemon,' Testing out the text!')) - //.attr(,pokemon:Pokemon => getPokemonMessage(pokemon,' Testing out the text!')) - .attr(PreAttackChangeType, (target,user,move) => move.category === MoveCategory.SPECIAL), - + //.attr(PostSummonMessageAbAttr,(pokemon: Pokemon) => getPokemonMessage(pokemon,' Testing out the text!')) + .attr(PreAttackChangeType), //.unimplemented(), new Ability(Abilities.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5) From a78186aa8c21dd5899771088fa3eed4b19b97cbb Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 00:42:58 -0700 Subject: [PATCH 04/13] Changing works, need to make 1 time use Now applies type change correctly, but need to find right condition to make it only apply once per switch. --- src/data/ability.ts | 40 ++++++++++++++++------------------------ src/field/pokemon.ts | 3 ++- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index f1a76ff8b..ba114495f 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -841,20 +841,27 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr { } export class PreAttackChangeType extends PreAttackAbAttr{ - applyPreAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean { - const MoveType = move.getMove().type; - const originalType = pokemon.getTypes(); - + private condition: PokemonAttackCondition; + constructor (condition:PokemonAttackCondition){ + super(true); + this.condition = condition; + } + applyPreAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean{ + console.log("Made it here within the function!!") + //console.log(pokemon.battleData.hitCount) + console.log(this.condition(pokemon,defender,move.getMove())) + const MoveType = move.getMove().type; + const originalType = pokemon.getTypes(); + if (this.condition(pokemon,defender,move.getMove())){ if (originalType.length > 1 || !pokemon.isOfType(MoveType)){ pokemon.summonData.types = [MoveType]; pokemon.updateInfo(); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`)); - return true; } - return false; } - } - + return false; + } + } export class VariableMoveTypeAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { //const power = args[0] as Utils.IntegerHolder; @@ -1139,21 +1146,6 @@ export class PostDefendStealHeldItemAbAttr extends PostDefendAbAttr { } } -export class PostAttackChangeType extends PostAttackAbAttr{ - applyPostAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean { - //if (this.condition(pokemon,defender,move.getMove())){ - const MoveType = move.getMove().type; - const originalType = pokemon.getTypes(); - - if (originalType.length > 1 || !pokemon.isOfType(MoveType)){ - pokemon.summonData.types = [MoveType]; - pokemon.updateInfo(); - pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`)); - return true; - } - return false; - } - } export class PostVictoryAbAttr extends AbAttr { applyPostVictory(pokemon: Pokemon, passive: boolean, args: any[]): boolean | Promise { return false; @@ -2996,8 +2988,8 @@ export function initAbilities() { new Ability(Abilities.CHEEK_POUCH, 6) .unimplemented(), new Ability(Abilities.PROTEAN, 6) + .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized()), //.attr(PostSummonMessageAbAttr,(pokemon: Pokemon) => getPokemonMessage(pokemon,' Testing out the text!')) - .attr(PreAttackChangeType), //.unimplemented(), new Ability(Abilities.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 9a7bfb486..c9f3d3635 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -27,7 +27,7 @@ import { TempBattleStat } from '../data/temp-battle-stat'; import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from '../data/arena-tag'; import { ArenaTagType } from "../data/enums/arena-tag-type"; import { Biome } from "../data/enums/biome"; -import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr } from '../data/ability'; +import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, VariableMoveTypeAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, PreAttackChangeType } from '../data/ability'; import { Abilities } from "#app/data/enums/abilities"; import PokemonData from '../system/pokemon-data'; import Battle, { BattlerIndex } from '../battle'; @@ -1230,6 +1230,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // 2nd argument is for MoveTypeChangePowerMultiplierAbAttr applyAbAttrs(VariableMoveTypeAbAttr, source, null, variableType, typeChangeMovePowerMultiplier); applyPreAttackAbAttrs(MoveTypeChangeAttr, source, this, battlerMove, variableType, typeChangeMovePowerMultiplier); + applyPreAttackAbAttrs(PreAttackChangeType,source,null,battlerMove,) const type = variableType.value as Type; const types = this.getTypes(true, true); From 7f9dfaa744bfd481710c9be370254f41940df61f Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 00:44:01 -0700 Subject: [PATCH 05/13] make overrides not carry --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 55f9203a8..d5ff76902 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ src/data/battle-anim-raw-data*.ts src/data/battle-anim-data.ts src/overrides.ts -coverage \ No newline at end of file +coverage +src/overrides.ts From b5206ff9d13bf225fed2467343db87aba0d591d0 Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 14:09:11 -0700 Subject: [PATCH 06/13] Final Version Working implementation of PreAttackChangeType class that has been applied to libero and protean --- src/data/ability.ts | 13 +++++-------- src/field/pokemon.ts | 5 +++-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 74d109257..6b1e0f6df 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -860,14 +860,13 @@ export class PreAttackChangeType extends PreAttackAbAttr{ this.condition = condition; } applyPreAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean{ - console.log("Made it here within the function!!") - //console.log(pokemon.battleData.hitCount) - console.log(this.condition(pokemon,defender,move.getMove())) const MoveType = move.getMove().type; const originalType = pokemon.getTypes(); + if (this.condition(pokemon,defender,move.getMove())){ - if (originalType.length > 1 || !pokemon.isOfType(MoveType)){ + if (originalType.length > 1 || originalType[0] !== MoveType){ pokemon.summonData.types = [MoveType]; + pokemon.battleSummonData.abilityTriggeredThisSwitch = true; pokemon.updateInfo(); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`)); } @@ -3001,9 +3000,7 @@ export function initAbilities() { new Ability(Abilities.CHEEK_POUCH, 6) .unimplemented(), new Ability(Abilities.PROTEAN, 6) - .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized()), - //.attr(PostSummonMessageAbAttr,(pokemon: Pokemon) => getPokemonMessage(pokemon,' Testing out the text!')) - //.unimplemented(), + .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggeredThisSwitch === false), new Ability(Abilities.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5) .ignorable(), @@ -3224,7 +3221,7 @@ export function initAbilities() { new Ability(Abilities.DAUNTLESS_SHIELD, 8) .attr(PostSummonStatChangeAbAttr, BattleStat.DEF, 1, true), new Ability(Abilities.LIBERO, 8) - .unimplemented(), + .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggeredThisSwitch === false), new Ability(Abilities.BALL_FETCH, 8) .unimplemented(), new Ability(Abilities.COTTON_DOWN, 8) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index df8e1389d..9428f913a 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -1247,7 +1247,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container { // 2nd argument is for MoveTypeChangePowerMultiplierAbAttr applyAbAttrs(VariableMoveTypeAbAttr, source, null, variableType, typeChangeMovePowerMultiplier); applyPreAttackAbAttrs(MoveTypeChangeAttr, source, this, battlerMove, variableType, typeChangeMovePowerMultiplier); - applyPreAttackAbAttrs(PreAttackChangeType,source,null,battlerMove,) + applyPreAttackAbAttrs(PreAttackChangeType,source,this,battlerMove,) const type = variableType.value as Type; const types = this.getTypes(true, true); @@ -3044,12 +3044,13 @@ export class PokemonSummonData { export class PokemonBattleData { public hitCount: integer = 0; public endured: boolean = false; - public berriesEaten: BerryType[] = []; + public berriesEaten: BerryType[] = []; } export class PokemonBattleSummonData { public turnCount: integer = 1; public moveHistory: TurnMove[] = []; + public abilityTriggeredThisSwitch: boolean = false; } export class PokemonTurnData { From 398c1584ef230c07edd260fe5434a80a797132f0 Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 14:32:28 -0700 Subject: [PATCH 07/13] Update src/field/pokemon.ts Co-authored-by: Samuel H --- src/field/pokemon.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/field/pokemon.ts b/src/field/pokemon.ts index 7456a6cf2..766e056b1 100644 --- a/src/field/pokemon.ts +++ b/src/field/pokemon.ts @@ -3061,7 +3061,7 @@ export class PokemonBattleData { export class PokemonBattleSummonData { public turnCount: integer = 1; public moveHistory: TurnMove[] = []; - public abilityTriggeredThisSwitch: boolean = false; + public abilityTriggered: boolean = false; } export class PokemonTurnData { From 39392ace328cee487a80d5c9e1ce50e841171e6c Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 14:33:11 -0700 Subject: [PATCH 08/13] Update src/data/ability.ts Co-authored-by: Samuel H --- src/data/ability.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 0937bd5cc..b9dc3df5a 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -901,8 +901,9 @@ export class PreAttackChangeType extends PreAttackAbAttr{ } } return false; - } - } + } +} + export class VariableMoveTypeAbAttr extends AbAttr { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { //const power = args[0] as Utils.IntegerHolder; From d2321f725f795dba601564f8f5cfb4a958a70c0f Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 14:33:29 -0700 Subject: [PATCH 09/13] Update src/data/ability.ts Co-authored-by: Samuel H --- src/data/ability.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index b9dc3df5a..13edb8f1b 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -884,10 +884,12 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr { export class PreAttackChangeType extends PreAttackAbAttr{ private condition: PokemonAttackCondition; - constructor (condition:PokemonAttackCondition){ + + constructor (condition:PokemonAttackCondition) { super(true); this.condition = condition; } + applyPreAttack(pokemon:Pokemon,passive:boolean,defender:Pokemon,move:PokemonMove): boolean{ const MoveType = move.getMove().type; const originalType = pokemon.getTypes(); From 194a1135c90ec5027484db478ef88c5773893e65 Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 14:35:30 -0700 Subject: [PATCH 10/13] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index d5ff76902..a19a17696 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,3 @@ src/data/battle-anim-data.ts src/overrides.ts coverage -src/overrides.ts From 4ffedc2a928cb3cd141d484f73dcf2074f57cf8f Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 15:15:19 -0700 Subject: [PATCH 11/13] changed variable name for ability trigger abilityTriggeredThisSwitch --> abilityTriggered --- src/data/ability.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 13edb8f1b..6cbb1d41e 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -897,7 +897,7 @@ export class PreAttackChangeType extends PreAttackAbAttr{ if (this.condition(pokemon,defender,move.getMove())){ if (originalType.length > 1 || originalType[0] !== MoveType){ pokemon.summonData.types = [MoveType]; - pokemon.battleSummonData.abilityTriggeredThisSwitch = true; + pokemon.battleSummonData.abilityTriggered = true; pokemon.updateInfo(); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` tranformed\ninto the ${Utils.toReadableString(Type[MoveType])} type!`)); } @@ -3053,7 +3053,7 @@ export function initAbilities() { new Ability(Abilities.CHEEK_POUCH, 6) .unimplemented(), new Ability(Abilities.PROTEAN, 6) - .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggeredThisSwitch === false), + .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false), new Ability(Abilities.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5) .ignorable(), From 302156d6965ce9d20c2ce73ffdb0c60313759c52 Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 15:32:45 -0700 Subject: [PATCH 12/13] missed var name change on libero --- 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 6cbb1d41e..3c523a494 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3274,7 +3274,7 @@ export function initAbilities() { new Ability(Abilities.DAUNTLESS_SHIELD, 8) .attr(PostSummonStatChangeAbAttr, BattleStat.DEF, 1, true), new Ability(Abilities.LIBERO, 8) - .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggeredThisSwitch === false), + .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false), new Ability(Abilities.BALL_FETCH, 8) .unimplemented(), new Ability(Abilities.COTTON_DOWN, 8) From 035ba6e47ebafaa05d6b1c44ca533eed52edf23e Mon Sep 17 00:00:00 2001 From: takeyourt1me <144757710+takeyourt1me@users.noreply.github.com> Date: Fri, 3 May 2024 22:13:30 -0700 Subject: [PATCH 13/13] Changed struggle check to use move id instead of name --- src/data/ability.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 3c523a494..063a5904d 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3053,7 +3053,7 @@ export function initAbilities() { new Ability(Abilities.CHEEK_POUCH, 6) .unimplemented(), new Ability(Abilities.PROTEAN, 6) - .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false), + .attr(PreAttackChangeType,(user,target,move) => move.id !== Moves.STRUGGLE && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false), new Ability(Abilities.FUR_COAT, 6) .attr(ReceivedMoveDamageMultiplierAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, 0.5) .ignorable(), @@ -3274,7 +3274,7 @@ export function initAbilities() { new Ability(Abilities.DAUNTLESS_SHIELD, 8) .attr(PostSummonStatChangeAbAttr, BattleStat.DEF, 1, true), new Ability(Abilities.LIBERO, 8) - .attr(PreAttackChangeType,(user,target,move) => move.name !== 'Struggle' && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false), + .attr(PreAttackChangeType,(user,target,move) => move.id !== Moves.STRUGGLE && !user.isTerastallized() && user.battleSummonData.abilityTriggered === false), new Ability(Abilities.BALL_FETCH, 8) .unimplemented(), new Ability(Abilities.COTTON_DOWN, 8)