diff --git a/public/locales b/public/locales index e07ab625f20..acad8499a4c 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit e07ab625f2080afe36b61fad291b0ec5eff4000c +Subproject commit acad8499a4ca488a9871902de140f635235f309a diff --git a/src/data/move.ts b/src/data/move.ts index 06f3c85e9c4..a3e909dc923 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -4643,6 +4643,49 @@ export class VariableMoveTypeAttr extends MoveAttr { } } +/** + * Attribute used to control the Power and Type of Natural Gift + * @extends VariablePowerAttr + */ +export class NaturalGiftPowerAttr extends VariablePowerAttr { + private randomBerry; + + /** + * Overrides the power of Natural Gift depending on the consumed berry + * @param user - The Pokémon using the move. + * @param target - The target Pokémon. + * @param move - The move being used. + * @param args - {@linkcode Utils.NumberHolder} the power of user's move + * @returns A boolean indicating whether the move was successfully applied. + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + console.log("GHNote Natural Gift POWER Attr called"); + return false; + } +} + +/** + * Attribute used to control the type of Natural Gift + * @extends VariableMoveTypeAttr + */ +export class NaturalGiftTypeAttr extends VariableMoveTypeAttr { + private randomBerry; + + /** + * Overrides the type of Natural Gift depending on the consumed berry + * @param user - The Pokémon using the move. + * @param target - The target Pokémon. + * @param move - The move being used. + * @param args - {@linkcode Utils.NumberHolder} the move type + * @returns A boolean indicating whether the move was successfully applied. + */ + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { + console.log("GHNote Natural Gift TYPE Attr called"); + return false; + } +} + + /** * Attribute used for Tera Starstorm that changes the move type to Stellar * @extends VariableMoveTypeAttr @@ -9317,8 +9360,10 @@ export function initMoves() { new AttackMove(Moves.BRINE, Type.WATER, MoveCategory.SPECIAL, 65, 100, 10, -1, 0, 4) .attr(MovePowerMultiplierAttr, (user, target, move) => target.getHpRatio() < 0.5 ? 2 : 1), new AttackMove(Moves.NATURAL_GIFT, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 4) - .makesContact(false) - .unimplemented(), + .attr(NaturalGiftPowerAttr) + .attr(NaturalGiftTypeAttr) + .makesContact(false), + //.unimplemented(), new AttackMove(Moves.FEINT, Type.NORMAL, MoveCategory.PHYSICAL, 30, 100, 10, -1, 2, 4) .attr(RemoveBattlerTagAttr, [ BattlerTagType.PROTECTED ]) .attr(RemoveArenaTagsAttr, [ ArenaTagType.QUICK_GUARD, ArenaTagType.WIDE_GUARD, ArenaTagType.MAT_BLOCK, ArenaTagType.CRAFTY_SHIELD ], false) diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 37f88deea7f..041bf31853e 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -1809,6 +1809,20 @@ export class LevelIncrementBoosterModifier extends PersistentModifier { } } +const berryNaturalGiftMap: { [key in BerryType]: { power: number; type: Type } } = { + [BerryType.SITRUS]: { power: 80, type: Type.PSYCHIC }, + [BerryType.LUM]: { power: 80, type: Type.FLYING }, + [BerryType.ENIGMA]: { power: 100, type: Type.BUG }, + [BerryType.LIECHI]: { power: 100, type: Type.GRASS }, + [BerryType.GANLON]: { power: 100, type: Type.ICE }, + [BerryType.PETAYA]: { power: 100, type: Type.POISON }, + [BerryType.APICOT]: { power: 100, type: Type.GROUND }, + [BerryType.SALAC]: { power: 100, type: Type.FIGHTING }, + [BerryType.LANSAT]: { power: 100, type: Type.FLYING }, + [BerryType.STARF]: { power: 100, type: Type.PSYCHIC }, + [BerryType.LEPPA]: { power: 80, type: Type.FIGHTING }, +}; + export class BerryModifier extends PokemonHeldItemModifier { public berryType: BerryType; public consumed: boolean; @@ -1864,6 +1878,14 @@ export class BerryModifier extends PokemonHeldItemModifier { } return 3; } + + getNaturalGiftPower(): number { + return berryNaturalGiftMap[this.berryType].power ?? 0; + } + + getNaturalGiftType(): Type { + return berryNaturalGiftMap[this.berryType].type ?? null; + } } export class PreserveBerryModifier extends PersistentModifier { diff --git a/src/overrides.ts b/src/overrides.ts index 1f8601b7659..da8e00f9246 100644 --- a/src/overrides.ts +++ b/src/overrides.ts @@ -16,6 +16,7 @@ import { StatusEffect } from "#enums/status-effect"; import { TimeOfDay } from "#enums/time-of-day"; import { VariantTier } from "#enums/variant-tier"; import { WeatherType } from "#enums/weather-type"; +import { BerryType } from "#enums/berry-type"; /** * Overrides that are using when testing different in game situations @@ -32,7 +33,13 @@ import { WeatherType } from "#enums/weather-type"; * } * ``` */ -const overrides = {} satisfies Partial>; +const overrides = { + OPP_LEVEL_OVERRIDE: 100, + OPP_MOVESET_OVERRIDE: [ Moves.SPLASH ], + STARTING_LEVEL_OVERRIDE: 1, + MOVESET_OVERRIDE: [ Moves.NATURAL_GIFT ], + STARTING_HELD_ITEMS_OVERRIDE: [{ name: "BERRY", type: BerryType.SITRUS }] +} satisfies Partial>; /** * If you need to add Overrides values for local testing do that inside {@linkcode overrides}