pull/350/merge
Ice 2024-05-03 22:50:10 -05:00 committed by GitHub
commit 8ba540ea6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 44 additions and 9 deletions

2
package-lock.json generated
View File

@ -26,7 +26,7 @@
"phaser3spectorjs": "^0.0.8", "phaser3spectorjs": "^0.0.8",
"pokenode-ts": "^1.20.0", "pokenode-ts": "^1.20.0",
"typescript": "^5.0.3", "typescript": "^5.0.3",
"vite": "^4.5.0", "vite": "^4.5.3",
"vite-plugin-fs": "^0.4.4", "vite-plugin-fs": "^0.4.4",
"vitest": "^1.4.0", "vitest": "^1.4.0",
"vitest-canvas-mock": "^0.3.3" "vitest-canvas-mock": "^0.3.3"

View File

@ -22,7 +22,7 @@
"phaser3spectorjs": "^0.0.8", "phaser3spectorjs": "^0.0.8",
"pokenode-ts": "^1.20.0", "pokenode-ts": "^1.20.0",
"typescript": "^5.0.3", "typescript": "^5.0.3",
"vite": "^4.5.0", "vite": "^4.5.3",
"vite-plugin-fs": "^0.4.4", "vite-plugin-fs": "^0.4.4",
"vitest": "^1.4.0", "vitest": "^1.4.0",
"vitest-canvas-mock": "^0.3.3" "vitest-canvas-mock": "^0.3.3"

View File

@ -112,6 +112,7 @@ export default class BattleScene extends SceneBase {
public gameSpeed: integer = 1; public gameSpeed: integer = 1;
public damageNumbersMode: integer = 0; public damageNumbersMode: integer = 0;
public showLevelUpStats: boolean = true; public showLevelUpStats: boolean = true;
public disableIVScanner: boolean = true;
public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1"; public enableTutorials: boolean = import.meta.env.VITE_BYPASS_TUTORIAL === "1";
public enableRetries: boolean = false; public enableRetries: boolean = false;
public uiTheme: UiTheme = UiTheme.DEFAULT; public uiTheme: UiTheme = UiTheme.DEFAULT;

View File

@ -3390,13 +3390,38 @@ export class CopyMoveAttr extends OverrideMoveEffectAttr {
} }
export class ReducePpMoveAttr extends MoveEffectAttr { export class ReducePpMoveAttr extends MoveEffectAttr {
public reduction: integer
public causesMoveToFail: boolean
constructor(reduction: integer, causesMoveToFail: boolean) {
super(false, MoveEffectTrigger.POST_APPLY);
this.reduction = reduction;
this.causesMoveToFail = causesMoveToFail;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
// Null checks can be skipped due to condition function
const lastMove = target.getLastXMoves().find(() => true); const lastMove = target.getLastXMoves().find(() => true);
if (!lastMove) {
return false;
}
const movesetMove = target.getMoveset().find(m => m.moveId === lastMove.move); const movesetMove = target.getMoveset().find(m => m.moveId === lastMove.move);
const lastPpUsed = movesetMove.ppUsed; const lastPpUsed = movesetMove.ppUsed;
movesetMove.ppUsed = Math.min(movesetMove.ppUsed + 4, movesetMove.getMovePp()); <<<<<<< Updated upstream
user.scene.queueMessage(`It reduced the PP of ${getPokemonMessage(target, `'s\n${movesetMove.getName()} by ${movesetMove.ppUsed - lastPpUsed}!`)}`); <<<<<<< Updated upstream
if (!lastMove || lastPpUsed < 1) {
=======
if (lastPpUsed < 1) {
>>>>>>> Stashed changes
=======
if (lastPpUsed < 1) {
>>>>>>> Stashed changes
return false;
}
else {
movesetMove.ppUsed = Math.min(movesetMove.ppUsed + this.reduction, movesetMove.getMovePp());
user.scene.queueMessage(`It reduced the PP of ${getPokemonMessage(target, `'s\n${movesetMove.getName()} by ${movesetMove.ppUsed - lastPpUsed}!`)}`);
}
return true; return true;
} }
@ -3408,6 +3433,7 @@ export class ReducePpMoveAttr extends MoveEffectAttr {
const movesetMove = target.getMoveset().find(m => m.moveId === lastMove.move); const movesetMove = target.getMoveset().find(m => m.moveId === lastMove.move);
return !!movesetMove?.getPpRatio(); return !!movesetMove?.getPpRatio();
} }
if (!this.causesMoveToFail) {return true;}
return false; return false;
}; };
} }
@ -4323,7 +4349,7 @@ export function initMoves() {
new AttackMove(Moves.REVERSAL, Type.FIGHTING, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2) new AttackMove(Moves.REVERSAL, Type.FIGHTING, MoveCategory.PHYSICAL, -1, 100, 15, -1, 0, 2)
.attr(LowHpPowerAttr), .attr(LowHpPowerAttr),
new StatusMove(Moves.SPITE, Type.GHOST, 100, 10, -1, 0, 2) new StatusMove(Moves.SPITE, Type.GHOST, 100, 10, -1, 0, 2)
.attr(ReducePpMoveAttr), .attr(ReducePpMoveAttr, 4, true),
new AttackMove(Moves.POWDER_SNOW, Type.ICE, MoveCategory.SPECIAL, 40, 100, 25, 10, 0, 2) new AttackMove(Moves.POWDER_SNOW, Type.ICE, MoveCategory.SPECIAL, 40, 100, 25, 10, 0, 2)
.attr(StatusEffectAttr, StatusEffect.FREEZE) .attr(StatusEffectAttr, StatusEffect.FREEZE)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
@ -6078,7 +6104,7 @@ export function initMoves() {
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.EERIE_SPELL, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 5, 100, 0, 8) new AttackMove(Moves.EERIE_SPELL, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 5, 100, 0, 8)
.soundBased() .soundBased()
.partial(), .attr(ReducePpMoveAttr, 3, false),
new AttackMove(Moves.DIRE_CLAW, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 15, 50, 0, 8) new AttackMove(Moves.DIRE_CLAW, Type.POISON, MoveCategory.PHYSICAL, 80, 100, 15, 50, 0, 8)
.attr(MultiStatusEffectAttr, [StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP]), .attr(MultiStatusEffectAttr, [StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP]),
new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8) new AttackMove(Moves.PSYSHIELD_BASH, Type.PSYCHIC, MoveCategory.PHYSICAL, 70, 90, 10, 100, 0, 8)

View File

@ -15330,6 +15330,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.LECHONK]: [ [Species.LECHONK]: [
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
[ 1, Moves.TAIL_WHIP ], [ 1, Moves.TAIL_WHIP ],
[ 1, Moves.EERIE_SPELL ],
[ 1, Moves.SPITE ],
[ 5, Moves.DISARMING_VOICE ], [ 5, Moves.DISARMING_VOICE ],
[ 8, Moves.ECHOED_VOICE ], [ 8, Moves.ECHOED_VOICE ],
[ 12, Moves.MUD_SHOT ], [ 12, Moves.MUD_SHOT ],

View File

@ -835,7 +835,7 @@ export function initSpecies() {
new PokemonSpecies(Species.NIDORAN_F, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.4, 7, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 275, 55, 47, 52, 40, 40, 41, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 0, false), new PokemonSpecies(Species.NIDORAN_F, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.4, 7, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 275, 55, 47, 52, 40, 40, 41, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 0, false),
new PokemonSpecies(Species.NIDORINA, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.8, 20, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 365, 70, 62, 67, 55, 55, 56, 120, 50, 128, GrowthRate.MEDIUM_SLOW, 0, false), new PokemonSpecies(Species.NIDORINA, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.8, 20, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 365, 70, 62, 67, 55, 55, 56, 120, 50, 128, GrowthRate.MEDIUM_SLOW, 0, false),
new PokemonSpecies(Species.NIDOQUEEN, 1, false, false, false, "Drill Pokémon", Type.POISON, Type.GROUND, 1.3, 60, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.SHEER_FORCE, 505, 90, 92, 87, 75, 85, 76, 45, 50, 253, GrowthRate.MEDIUM_SLOW, 0, false), new PokemonSpecies(Species.NIDOQUEEN, 1, false, false, false, "Drill Pokémon", Type.POISON, Type.GROUND, 1.3, 60, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.SHEER_FORCE, 505, 90, 92, 87, 75, 85, 76, 45, 50, 253, GrowthRate.MEDIUM_SLOW, 0, false),
new PokemonSpecies(Species.NIDORAN_M, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.5, 9, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 273, 46, 57, 40, 40, 40, 50, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 100, false), new PokemonSpecies(Species.NIDORAN_M, 1, false, false, false, "Poison Pin Pokémon", Type.PSYCHIC, null, 0.5, 9, Abilities.ICE_SCALES, Abilities.RIVALRY, Abilities.HUSTLE, 273, 46, 57, 40, 40, 40, 50, 235, 50, 55, GrowthRate.MEDIUM_SLOW, 100, false),
new PokemonSpecies(Species.NIDORINO, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.9, 19.5, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 365, 61, 72, 57, 55, 55, 65, 120, 50, 128, GrowthRate.MEDIUM_SLOW, 100, false), new PokemonSpecies(Species.NIDORINO, 1, false, false, false, "Poison Pin Pokémon", Type.POISON, null, 0.9, 19.5, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.HUSTLE, 365, 61, 72, 57, 55, 55, 65, 120, 50, 128, GrowthRate.MEDIUM_SLOW, 100, false),
new PokemonSpecies(Species.NIDOKING, 1, false, false, false, "Drill Pokémon", Type.POISON, Type.GROUND, 1.4, 62, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.SHEER_FORCE, 505, 81, 102, 77, 85, 75, 85, 45, 50, 253, GrowthRate.MEDIUM_SLOW, 100, false), new PokemonSpecies(Species.NIDOKING, 1, false, false, false, "Drill Pokémon", Type.POISON, Type.GROUND, 1.4, 62, Abilities.POISON_POINT, Abilities.RIVALRY, Abilities.SHEER_FORCE, 505, 81, 102, 77, 85, 75, 85, 45, 50, 253, GrowthRate.MEDIUM_SLOW, 100, false),
new PokemonSpecies(Species.CLEFAIRY, 1, false, false, false, "Fairy Pokémon", Type.FAIRY, null, 0.6, 7.5, Abilities.CUTE_CHARM, Abilities.MAGIC_GUARD, Abilities.FRIEND_GUARD, 323, 70, 45, 48, 60, 65, 35, 150, 140, 113, GrowthRate.FAST, 25, false), new PokemonSpecies(Species.CLEFAIRY, 1, false, false, false, "Fairy Pokémon", Type.FAIRY, null, 0.6, 7.5, Abilities.CUTE_CHARM, Abilities.MAGIC_GUARD, Abilities.FRIEND_GUARD, 323, 70, 45, 48, 60, 65, 35, 150, 140, 113, GrowthRate.FAST, 25, false),

View File

@ -899,7 +899,7 @@ export class EncounterPhase extends BattlePhase {
if (this.scene.currentBattle.battleType !== BattleType.TRAINER) { if (this.scene.currentBattle.battleType !== BattleType.TRAINER) {
enemyField.map(p => this.scene.pushPhase(new PostSummonPhase(this.scene, p.getBattlerIndex()))); enemyField.map(p => this.scene.pushPhase(new PostSummonPhase(this.scene, p.getBattlerIndex())));
const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier); const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier);
if (ivScannerModifier) if (ivScannerModifier && !this.scene.disableIVScanner)
enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6)))); enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6))));
} }

View File

@ -20,6 +20,7 @@ export enum Setting {
Sprite_Set = "SPRITE_SET", Sprite_Set = "SPRITE_SET",
Move_Animations = "MOVE_ANIMATIONS", Move_Animations = "MOVE_ANIMATIONS",
Show_Stats_on_Level_Up = "SHOW_LEVEL_UP_STATS", Show_Stats_on_Level_Up = "SHOW_LEVEL_UP_STATS",
Disable_IV_Scanner = "DISABLE_IV_SCANNER",
EXP_Gains_Speed = "EXP_GAINS_SPEED", EXP_Gains_Speed = "EXP_GAINS_SPEED",
HP_Bar_Speed = "HP_BAR_SPEED", HP_Bar_Speed = "HP_BAR_SPEED",
Fusion_Palette_Swaps = "FUSION_PALETTE_SWAPS", Fusion_Palette_Swaps = "FUSION_PALETTE_SWAPS",
@ -51,6 +52,7 @@ export const settingOptions: SettingOptions = {
[Setting.Sprite_Set]: [ 'Consistent', 'Mixed Animated' ], [Setting.Sprite_Set]: [ 'Consistent', 'Mixed Animated' ],
[Setting.Move_Animations]: [ 'Off', 'On' ], [Setting.Move_Animations]: [ 'Off', 'On' ],
[Setting.Show_Stats_on_Level_Up]: [ 'Off', 'On' ], [Setting.Show_Stats_on_Level_Up]: [ 'Off', 'On' ],
[Setting.Disable_IV_Scanner]: [ 'On', 'Off' ],
[Setting.EXP_Gains_Speed]: [ 'Normal', 'Fast', 'Faster', 'Skip' ], [Setting.EXP_Gains_Speed]: [ 'Normal', 'Fast', 'Faster', 'Skip' ],
[Setting.HP_Bar_Speed]: [ 'Normal', 'Fast', 'Faster', 'Instant' ], [Setting.HP_Bar_Speed]: [ 'Normal', 'Fast', 'Faster', 'Instant' ],
[Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ], [Setting.Fusion_Palette_Swaps]: [ 'Off', 'On' ],
@ -74,6 +76,7 @@ export const settingDefaults: SettingDefaults = {
[Setting.Sprite_Set]: 0, [Setting.Sprite_Set]: 0,
[Setting.Move_Animations]: 1, [Setting.Move_Animations]: 1,
[Setting.Show_Stats_on_Level_Up]: 1, [Setting.Show_Stats_on_Level_Up]: 1,
[Setting.Disable_IV_Scanner]: 1,
[Setting.EXP_Gains_Speed]: 0, [Setting.EXP_Gains_Speed]: 0,
[Setting.HP_Bar_Speed]: 0, [Setting.HP_Bar_Speed]: 0,
[Setting.Fusion_Palette_Swaps]: 1, [Setting.Fusion_Palette_Swaps]: 1,
@ -128,6 +131,9 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
case Setting.Show_Stats_on_Level_Up: case Setting.Show_Stats_on_Level_Up:
scene.showLevelUpStats = settingOptions[setting][value] === 'On'; scene.showLevelUpStats = settingOptions[setting][value] === 'On';
break; break;
case Setting.Disable_IV_Scanner:
scene.disableIVScanner = settingOptions[setting][value] === 'On';
break;
case Setting.EXP_Gains_Speed: case Setting.EXP_Gains_Speed:
scene.expGainsSpeed = value; scene.expGainsSpeed = value;
break; break;