temp save of current unfinished implementation

This commit is contained in:
geeil-han 2025-01-22 09:34:31 +01:00
parent d10b7c05f7
commit 356cffaf97
4 changed files with 78 additions and 4 deletions

@ -1 +1 @@
Subproject commit e07ab625f2080afe36b61fad291b0ec5eff4000c
Subproject commit acad8499a4ca488a9871902de140f635235f309a

View File

@ -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)

View File

@ -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 {

View File

@ -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<InstanceType<typeof DefaultOverrides>>;
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<InstanceType<typeof DefaultOverrides>>;
/**
* If you need to add Overrides values for local testing do that inside {@linkcode overrides}