From f82f16173ba65a65f540d61d79ee0d28d9934c41 Mon Sep 17 00:00:00 2001 From: Luc Dube Date: Mon, 22 Apr 2024 02:07:58 -0400 Subject: [PATCH 1/4] implemented Terrain Pulse --- src/data/move.ts | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index 5ae46c55d81..f13056b8074 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2247,6 +2247,31 @@ export class WeatherBallTypeAttr extends VariableMoveTypeAttr { } } +export class TerrainPulseTypeAttr extends VariableMoveTypeAttr { + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + const currentTerrain = user.scene.arena.getTerrainType() + const type = (args[0] as Utils.IntegerHolder); + + switch (currentTerrain) { + case TerrainType.MISTY: + type.value = Type.FAIRY; + break; + case TerrainType.ELECTRIC: + type.value = Type.ELECTRIC; + break; + case TerrainType.GRASSY: + type.value = Type.GRASS; + break; + case TerrainType.PSYCHIC: + type.value = Type.PSYCHIC; + break; + default: + return false; + } + return true; + } +} + export class HiddenPowerTypeAttr extends VariableMoveTypeAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { const type = (args[0] as Utils.IntegerHolder); @@ -5842,8 +5867,9 @@ export function initMoves() { new AttackMove(Moves.RISING_VOLTAGE, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 8) .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.ELECTRIC && target.isGrounded() ? 2 : 1), new AttackMove(Moves.TERRAIN_PULSE, Type.NORMAL, MoveCategory.SPECIAL, 50, 100, 10, -1, 0, 8) - .pulseMove() - .partial(), + .attr(TerrainPulseTypeAttr) + .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() !== TerrainType.NONE && user.isGrounded() ? 2 : 1) + .pulseMove(), new AttackMove(Moves.SKITTER_SMACK, Type.BUG, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) .attr(StatChangeAttr, BattleStat.SPATK, -1), new AttackMove(Moves.BURNING_JEALOUSY, Type.FIRE, MoveCategory.SPECIAL, 70, 100, 5, 100, 0, 8) From 92d8bf0ed7448f8d6ea032f6ba024c34558a84bf Mon Sep 17 00:00:00 2001 From: Luc Dube Date: Mon, 22 Apr 2024 02:40:36 -0400 Subject: [PATCH 2/4] type only changes when grounded --- src/data/move.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index f13056b8074..fd2b2256225 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2249,7 +2249,10 @@ export class WeatherBallTypeAttr extends VariableMoveTypeAttr { export class TerrainPulseTypeAttr extends VariableMoveTypeAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - const currentTerrain = user.scene.arena.getTerrainType() + if(user.isGrounded) + return false; + + const currentTerrain = user.scene.arena.getTerrainType(); const type = (args[0] as Utils.IntegerHolder); switch (currentTerrain) { From 189b20737da0fd90b605871dcd4227b59ea39962 Mon Sep 17 00:00:00 2001 From: lucfd <83493765+lucfd@users.noreply.github.com> Date: Mon, 22 Apr 2024 03:10:11 -0400 Subject: [PATCH 3/4] Implement Misty Explosion --- src/data/move.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/move.ts b/src/data/move.ts index fd2b2256225..7b6311df9e2 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -5863,8 +5863,10 @@ export function initMoves() { .attr(StatusEffectAttr, StatusEffect.POISON) .partial(), new AttackMove(Moves.MISTY_EXPLOSION, Type.FAIRY, MoveCategory.SPECIAL, 100, 100, 5, -1, 0, 8) - .target(MoveTarget.ALL_NEAR_OTHERS) - .partial(), + .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.MISTY && user.isGrounded() ? 1.5 : 1) + .attr(SacrificialAttr) + .makesContact(false) + .target(MoveTarget.ALL_NEAR_OTHERS), new AttackMove(Moves.GRASSY_GLIDE, Type.GRASS, MoveCategory.PHYSICAL, 55, 100, 20, -1, 0, 8) .partial(), new AttackMove(Moves.RISING_VOLTAGE, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 8) From 310ad59def8c2a67fdd1d70b2a7d8c23606272d7 Mon Sep 17 00:00:00 2001 From: Luc Date: Fri, 26 Apr 2024 11:31:40 -0400 Subject: [PATCH 4/4] fixed grounded check --- src/data/move.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/move.ts b/src/data/move.ts index 7b6311df9e2..58d3272188c 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -2249,7 +2249,7 @@ export class WeatherBallTypeAttr extends VariableMoveTypeAttr { export class TerrainPulseTypeAttr extends VariableMoveTypeAttr { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - if(user.isGrounded) + if(!user.isGrounded) return false; const currentTerrain = user.scene.arena.getTerrainType();