From 883f986ed205b38b6c3f4139ea69d4ee4fcf64b7 Mon Sep 17 00:00:00 2001 From: InfernoVulpix Date: Sun, 21 Apr 2024 03:27:46 -0400 Subject: [PATCH 1/2] Implemented Synchronoise's effect Tested with Soak, Forest's Curse, and a variety of attacker and defender types. --- src/data/move.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index d5bd71ad2e1..fe1ab24a863 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3585,6 +3585,8 @@ export class FirstMoveCondition extends MoveCondition { } } +const sameTypeCondition: MoveConditionFunc = (user, target, move) => user.getTypes().some(item => target.getTypes().includes(item)); + export type MoveTargetSet = { targets: BattlerIndex[]; multiple: boolean; @@ -4961,7 +4963,7 @@ export function initMoves() { .attr(CompareWeightPowerAttr), new AttackMove(Moves.SYNCHRONOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 120, 100, 10, -1, 0, 5) .target(MoveTarget.ALL_NEAR_OTHERS) - .partial(), + .condition(sameTypeCondition), new AttackMove(Moves.ELECTRO_BALL, Type.ELECTRIC, MoveCategory.SPECIAL, -1, 100, 10, -1, 0, 5) .attr(BattleStatRatioPowerAttr, Stat.SPD) .ballBombMove(), From 1ce89a1374ae27e2a494402b97612695b90a5d0f Mon Sep 17 00:00:00 2001 From: InfernoVulpix Date: Sun, 21 Apr 2024 17:31:32 -0400 Subject: [PATCH 2/2] Fixed Synchronoise double battle functionality It now does zero damage only to targets who do not share any types with it, while correctly damaging any who do. It also fails entirely if the user is UNKNOWN type. --- src/data/move.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index fe1ab24a863..b163744119b 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -3585,7 +3585,18 @@ export class FirstMoveCondition extends MoveCondition { } } -const sameTypeCondition: MoveConditionFunc = (user, target, move) => user.getTypes().some(item => target.getTypes().includes(item)); +export class hitsSameTypeAttr extends VariableMoveTypeMultiplierAttr { + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + const multiplier = args[0] as Utils.NumberHolder; + if (!user.getTypes().some(type => target.getTypes().includes(type))){ + multiplier.value = 0; + return true; + } + return false; + } +} + +const unknownTypeCondition: MoveConditionFunc = (user, target, move) => !user.getTypes().includes(Type.UNKNOWN); export type MoveTargetSet = { targets: BattlerIndex[]; @@ -4963,7 +4974,8 @@ export function initMoves() { .attr(CompareWeightPowerAttr), new AttackMove(Moves.SYNCHRONOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 120, 100, 10, -1, 0, 5) .target(MoveTarget.ALL_NEAR_OTHERS) - .condition(sameTypeCondition), + .condition(unknownTypeCondition) + .attr(hitsSameTypeAttr), new AttackMove(Moves.ELECTRO_BALL, Type.ELECTRIC, MoveCategory.SPECIAL, -1, 100, 10, -1, 0, 5) .attr(BattleStatRatioPowerAttr, Stat.SPD) .ballBombMove(),