mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 07:22:19 +02:00
Compare commits
5 Commits
7f0362e124
...
10cf1cd94f
Author | SHA1 | Date | |
---|---|---|---|
|
10cf1cd94f | ||
|
882f9c289c | ||
|
1d7d8b1ac7 | ||
|
d5681a6e03 | ||
|
407d9b7c49 |
@ -4,7 +4,7 @@ import { NextEncounterPhase, NewBiomeEncounterPhase, SelectBiomePhase, MessagePh
|
|||||||
import Pokemon, { PlayerPokemon, EnemyPokemon } from './field/pokemon';
|
import Pokemon, { PlayerPokemon, EnemyPokemon } from './field/pokemon';
|
||||||
import PokemonSpecies, { PokemonSpeciesFilter, allSpecies, getPokemonSpecies, initSpecies, speciesStarters } from './data/pokemon-species';
|
import PokemonSpecies, { PokemonSpeciesFilter, allSpecies, getPokemonSpecies, initSpecies, speciesStarters } from './data/pokemon-species';
|
||||||
import * as Utils from './utils';
|
import * as Utils from './utils';
|
||||||
import { Modifier, ModifierBar, ConsumablePokemonModifier, ConsumableModifier, PokemonHpRestoreModifier, HealingBoosterModifier, PersistentModifier, PokemonHeldItemModifier, ModifierPredicate, DoubleBattleChanceBoosterModifier, FusePokemonModifier, PokemonFormChangeItemModifier, TerastallizeModifier } from './modifier/modifier';
|
import { Modifier, ModifierBar, ConsumablePokemonModifier, ConsumableModifier, PokemonHpRestoreModifier, HealingBoosterModifier, PersistentModifier, PokemonHeldItemModifier, ModifierPredicate, DoubleBattleChanceBoosterModifier, FusePokemonModifier, PokemonFormChangeItemModifier, TerastallizeModifier, overrideModifiers, overrideHeldItems } from './modifier/modifier';
|
||||||
import { PokeballType } from './data/pokeball';
|
import { PokeballType } from './data/pokeball';
|
||||||
import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets, populateAnims } from './data/battle-anims';
|
import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets, populateAnims } from './data/battle-anims';
|
||||||
import { Phase } from './phase';
|
import { Phase } from './phase';
|
||||||
@ -59,7 +59,7 @@ import { SceneBase } from './scene-base';
|
|||||||
import CandyBar from './ui/candy-bar';
|
import CandyBar from './ui/candy-bar';
|
||||||
import { Variant, variantData } from './data/variant';
|
import { Variant, variantData } from './data/variant';
|
||||||
import { Localizable } from './plugins/i18n';
|
import { Localizable } from './plugins/i18n';
|
||||||
import { STARTING_WAVE_OVERRIDE, OPP_SPECIES_OVERRIDE, SEED_OVERRIDE, STARTING_BIOME_OVERRIDE, DOUBLE_BATTLE_OVERRIDE } from './overrides';
|
import * as Overrides from './overrides';
|
||||||
import {InputsController} from "./inputs-controller";
|
import {InputsController} from "./inputs-controller";
|
||||||
import {UiInputs} from "./ui-inputs";
|
import {UiInputs} from "./ui-inputs";
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
|||||||
|
|
||||||
const DEBUG_RNG = false;
|
const DEBUG_RNG = false;
|
||||||
|
|
||||||
export const startingWave = STARTING_WAVE_OVERRIDE || 1;
|
export const startingWave = Overrides.STARTING_WAVE_OVERRIDE || 1;
|
||||||
|
|
||||||
const expSpriteKeys: string[] = [];
|
const expSpriteKeys: string[] = [];
|
||||||
|
|
||||||
@ -612,9 +612,11 @@ export default class BattleScene extends SceneBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
addEnemyPokemon(species: PokemonSpecies, level: integer, trainerSlot: TrainerSlot, boss: boolean = false, dataSource?: PokemonData, postProcess?: (enemyPokemon: EnemyPokemon) => void): EnemyPokemon {
|
addEnemyPokemon(species: PokemonSpecies, level: integer, trainerSlot: TrainerSlot, boss: boolean = false, dataSource?: PokemonData, postProcess?: (enemyPokemon: EnemyPokemon) => void): EnemyPokemon {
|
||||||
if (OPP_SPECIES_OVERRIDE)
|
if (Overrides.OPP_SPECIES_OVERRIDE)
|
||||||
species = getPokemonSpecies(OPP_SPECIES_OVERRIDE);
|
species = getPokemonSpecies(Overrides.OPP_SPECIES_OVERRIDE);
|
||||||
const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource);
|
const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource);
|
||||||
|
overrideModifiers(this, false);
|
||||||
|
overrideHeldItems(this, pokemon, false);
|
||||||
if (boss && !dataSource) {
|
if (boss && !dataSource) {
|
||||||
const secondaryIvs = Utils.getIvsFromId(Utils.randSeedInt(4294967295));
|
const secondaryIvs = Utils.getIvsFromId(Utils.randSeedInt(4294967295));
|
||||||
|
|
||||||
@ -705,7 +707,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
this.gameMode = gameModes[GameModes.CLASSIC];
|
this.gameMode = gameModes[GameModes.CLASSIC];
|
||||||
|
|
||||||
this.setSeed(SEED_OVERRIDE || Utils.randomString(24));
|
this.setSeed(Overrides.SEED_OVERRIDE || Utils.randomString(24));
|
||||||
console.log('Seed:', this.seed);
|
console.log('Seed:', this.seed);
|
||||||
|
|
||||||
this.disableMenu = false;
|
this.disableMenu = false;
|
||||||
@ -742,7 +744,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
[ this.luckLabelText, this.luckText ].map(t => t.setVisible(false));
|
[ this.luckLabelText, this.luckText ].map(t => t.setVisible(false));
|
||||||
|
|
||||||
this.newArena(STARTING_BIOME_OVERRIDE || Biome.TOWN);
|
this.newArena(Overrides.STARTING_BIOME_OVERRIDE || Biome.TOWN);
|
||||||
|
|
||||||
this.arenaBgTransition.setPosition(0, 0);
|
this.arenaBgTransition.setPosition(0, 0);
|
||||||
this.arenaPlayer.setPosition(300, 0);
|
this.arenaPlayer.setPosition(300, 0);
|
||||||
@ -842,7 +844,7 @@ export default class BattleScene extends SceneBase {
|
|||||||
} else if (!battleConfig)
|
} else if (!battleConfig)
|
||||||
newDouble = !!double;
|
newDouble = !!double;
|
||||||
|
|
||||||
if (DOUBLE_BATTLE_OVERRIDE)
|
if (Overrides.DOUBLE_BATTLE_OVERRIDE)
|
||||||
newDouble = true;
|
newDouble = true;
|
||||||
|
|
||||||
const lastBattle = this.currentBattle;
|
const lastBattle = this.currentBattle;
|
||||||
@ -1767,6 +1769,19 @@ export default class BattleScene extends SceneBase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all modifiers from enemy of PersistentModifier type
|
||||||
|
*/
|
||||||
|
clearEnemyModifiers(): void {
|
||||||
|
const modifiersToRemove = this.enemyModifiers.filter(m => m instanceof PersistentModifier);
|
||||||
|
for (let m of modifiersToRemove)
|
||||||
|
this.enemyModifiers.splice(this.enemyModifiers.indexOf(m), 1);
|
||||||
|
this.updateModifiers(false).then(() => this.updateUIPositions());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all modifiers from enemy of PokemonHeldItemModifier type
|
||||||
|
*/
|
||||||
clearEnemyHeldItemModifiers(): void {
|
clearEnemyHeldItemModifiers(): void {
|
||||||
const modifiersToRemove = this.enemyModifiers.filter(m => m instanceof PokemonHeldItemModifier);
|
const modifiersToRemove = this.enemyModifiers.filter(m => m instanceof PokemonHeldItemModifier);
|
||||||
for (let m of modifiersToRemove)
|
for (let m of modifiersToRemove)
|
||||||
|
@ -985,7 +985,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
|
|||||||
loadTag(source: BattlerTag | any): void {
|
loadTag(source: BattlerTag | any): void {
|
||||||
super.loadTag(source);
|
super.loadTag(source);
|
||||||
this.stat = source.stat as Stat;
|
this.stat = source.stat as Stat;
|
||||||
this.multiplier = this.multiplier;
|
this.multiplier = source.multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
onAdd(pokemon: Pokemon): void {
|
onAdd(pokemon: Pokemon): void {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Moves } from "./enums/moves";
|
import { Moves } from "./enums/moves";
|
||||||
import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims";
|
import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims";
|
||||||
import { BattleEndPhase, MovePhase, NewBattlePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases";
|
import { BattleEndPhase, MovePhase, NewBattlePhase, PartyEffectPhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases";
|
||||||
import { BattleStat, getBattleStatName } from "./battle-stat";
|
import { BattleStat, getBattleStatName } from "./battle-stat";
|
||||||
import { EncoreTag } from "./battler-tags";
|
import { EncoreTag } from "./battler-tags";
|
||||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||||
@ -50,7 +50,8 @@ export enum MoveTarget {
|
|||||||
ALL,
|
ALL,
|
||||||
USER_SIDE,
|
USER_SIDE,
|
||||||
ENEMY_SIDE,
|
ENEMY_SIDE,
|
||||||
BOTH_SIDES
|
BOTH_SIDES,
|
||||||
|
PARTY
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum MoveFlags {
|
export enum MoveFlags {
|
||||||
@ -832,6 +833,34 @@ export class HealAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cures the user's party of non-volatile status conditions, ie. Heal Bell, Aromatherapy
|
||||||
|
* @param {string} message Message to display after using move
|
||||||
|
* @param {Abilities} abilityCondition Skips mons with this ability, ie. Soundproof
|
||||||
|
*/
|
||||||
|
export class PartyStatusCureAttr extends MoveEffectAttr {
|
||||||
|
private message: string;
|
||||||
|
private abilityCondition: Abilities;
|
||||||
|
|
||||||
|
constructor(message: string, abilityCondition: Abilities) {
|
||||||
|
super();
|
||||||
|
|
||||||
|
this.message = message;
|
||||||
|
this.abilityCondition = abilityCondition;
|
||||||
|
}
|
||||||
|
|
||||||
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
if (!super.apply(user, target, move, args))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
this.addPartyCurePhase(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
addPartyCurePhase(user: Pokemon) {
|
||||||
|
user.scene.unshiftPhase(new PartyStatusCurePhase(user.scene, user, this.message, this.abilityCondition));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class SacrificialFullRestoreAttr extends SacrificialAttr {
|
export class SacrificialFullRestoreAttr extends SacrificialAttr {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -4003,6 +4032,7 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet {
|
|||||||
|
|
||||||
switch (moveTarget) {
|
switch (moveTarget) {
|
||||||
case MoveTarget.USER:
|
case MoveTarget.USER:
|
||||||
|
case MoveTarget.PARTY:
|
||||||
set = [ user];
|
set = [ user];
|
||||||
break;
|
break;
|
||||||
case MoveTarget.NEAR_OTHER:
|
case MoveTarget.NEAR_OTHER:
|
||||||
@ -4628,9 +4658,9 @@ export function initMoves() {
|
|||||||
.condition((user, target, move) => user.status?.effect === StatusEffect.SLEEP)
|
.condition((user, target, move) => user.status?.effect === StatusEffect.SLEEP)
|
||||||
.ignoresVirtual(),
|
.ignoresVirtual(),
|
||||||
new StatusMove(Moves.HEAL_BELL, Type.NORMAL, -1, 5, -1, 0, 2)
|
new StatusMove(Moves.HEAL_BELL, Type.NORMAL, -1, 5, -1, 0, 2)
|
||||||
|
.attr(PartyStatusCureAttr, "A bell chimed!", Abilities.SOUNDPROOF)
|
||||||
.soundBased()
|
.soundBased()
|
||||||
.target(MoveTarget.USER_AND_ALLIES)
|
.target(MoveTarget.PARTY),
|
||||||
.unimplemented(),
|
|
||||||
new AttackMove(Moves.RETURN, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, 0, 2)
|
new AttackMove(Moves.RETURN, Type.NORMAL, MoveCategory.PHYSICAL, -1, 100, 20, -1, 0, 2)
|
||||||
.attr(FriendshipPowerAttr),
|
.attr(FriendshipPowerAttr),
|
||||||
new AttackMove(Moves.PRESENT, Type.NORMAL, MoveCategory.PHYSICAL, -1, 90, 15, -1, 0, 2)
|
new AttackMove(Moves.PRESENT, Type.NORMAL, MoveCategory.PHYSICAL, -1, 90, 15, -1, 0, 2)
|
||||||
@ -4901,8 +4931,8 @@ export function initMoves() {
|
|||||||
.attr(MovePowerMultiplierAttr, (user, target, move) => [WeatherType.SUNNY, WeatherType.RAIN, WeatherType.SANDSTORM, WeatherType.HAIL, WeatherType.SNOW, WeatherType.FOG, WeatherType.HEAVY_RAIN, WeatherType.HARSH_SUN].includes(user.scene.arena.weather?.weatherType) && !user.scene.arena.weather?.isEffectSuppressed(user.scene) ? 2 : 1)
|
.attr(MovePowerMultiplierAttr, (user, target, move) => [WeatherType.SUNNY, WeatherType.RAIN, WeatherType.SANDSTORM, WeatherType.HAIL, WeatherType.SNOW, WeatherType.FOG, WeatherType.HEAVY_RAIN, WeatherType.HARSH_SUN].includes(user.scene.arena.weather?.weatherType) && !user.scene.arena.weather?.isEffectSuppressed(user.scene) ? 2 : 1)
|
||||||
.ballBombMove(),
|
.ballBombMove(),
|
||||||
new StatusMove(Moves.AROMATHERAPY, Type.GRASS, -1, 5, -1, 0, 3)
|
new StatusMove(Moves.AROMATHERAPY, Type.GRASS, -1, 5, -1, 0, 3)
|
||||||
.target(MoveTarget.USER_AND_ALLIES)
|
.attr(PartyStatusCureAttr, "A soothing aroma wafted through the area!", Abilities.SAP_SIPPER)
|
||||||
.unimplemented(),
|
.target(MoveTarget.PARTY),
|
||||||
new StatusMove(Moves.FAKE_TEARS, Type.DARK, 100, 20, -1, 0, 3)
|
new StatusMove(Moves.FAKE_TEARS, Type.DARK, 100, 20, -1, 0, 3)
|
||||||
.attr(StatChangeAttr, BattleStat.SPDEF, -2),
|
.attr(StatChangeAttr, BattleStat.SPDEF, -2),
|
||||||
new AttackMove(Moves.AIR_CUTTER, Type.FLYING, MoveCategory.SPECIAL, 60, 95, 25, -1, 0, 3)
|
new AttackMove(Moves.AIR_CUTTER, Type.FLYING, MoveCategory.SPECIAL, 60, 95, 25, -1, 0, 3)
|
||||||
|
@ -2313,7 +2313,7 @@ export function initSpecies() {
|
|||||||
new PokemonSpecies(Species.QUAXWELL, 9, false, false, false, "Practicing Pokémon", Type.WATER, null, 1.2, 21.5, Abilities.TORRENT, Abilities.NONE, Abilities.MOXIE, 410, 70, 85, 65, 65, 60, 65, 45, 50, 144, GrowthRate.MEDIUM_SLOW, 87.5, false),
|
new PokemonSpecies(Species.QUAXWELL, 9, false, false, false, "Practicing Pokémon", Type.WATER, null, 1.2, 21.5, Abilities.TORRENT, Abilities.NONE, Abilities.MOXIE, 410, 70, 85, 65, 65, 60, 65, 45, 50, 144, GrowthRate.MEDIUM_SLOW, 87.5, false),
|
||||||
new PokemonSpecies(Species.QUAQUAVAL, 9, false, false, false, "Dancer Pokémon", Type.WATER, Type.FIGHTING, 1.8, 61.9, Abilities.TORRENT, Abilities.NONE, Abilities.MOXIE, 530, 85, 120, 80, 85, 75, 85, 45, 50, 265, GrowthRate.MEDIUM_SLOW, 87.5, false),
|
new PokemonSpecies(Species.QUAQUAVAL, 9, false, false, false, "Dancer Pokémon", Type.WATER, Type.FIGHTING, 1.8, 61.9, Abilities.TORRENT, Abilities.NONE, Abilities.MOXIE, 530, 85, 120, 80, 85, 75, 85, 45, 50, 265, GrowthRate.MEDIUM_SLOW, 87.5, false),
|
||||||
new PokemonSpecies(Species.LECHONK, 9, false, false, false, "Hog Pokémon", Type.NORMAL, null, 0.5, 10.2, Abilities.AROMA_VEIL, Abilities.GLUTTONY, Abilities.THICK_FAT, 254, 54, 45, 40, 35, 45, 35, 255, 50, 51, GrowthRate.MEDIUM_FAST, 50, false),
|
new PokemonSpecies(Species.LECHONK, 9, false, false, false, "Hog Pokémon", Type.NORMAL, null, 0.5, 10.2, Abilities.AROMA_VEIL, Abilities.GLUTTONY, Abilities.THICK_FAT, 254, 54, 45, 40, 35, 45, 35, 255, 50, 51, GrowthRate.MEDIUM_FAST, 50, false),
|
||||||
new PokemonSpecies(Species.OINKOLOGNE, 9, false, false, false, "Hog Pokémon", Type.NORMAL, null, 1, 120, Abilities.LINGERING_AROMA, Abilities.GLUTTONY, Abilities.THICK_FAT, 489, 110, 100, 75, 59, 80, 65, 100, 50, 171, GrowthRate.MEDIUM_FAST, 100, false, false,
|
new PokemonSpecies(Species.OINKOLOGNE, 9, false, false, false, "Hog Pokémon", Type.NORMAL, null, 1, 120, Abilities.LINGERING_AROMA, Abilities.GLUTTONY, Abilities.THICK_FAT, 489, 110, 100, 75, 59, 80, 65, 100, 50, 171, GrowthRate.MEDIUM_FAST, 50, false, false,
|
||||||
new PokemonForm("Male", "male", Type.NORMAL, null, 1, 120, Abilities.LINGERING_AROMA, Abilities.GLUTTONY, Abilities.THICK_FAT, 489, 110, 100, 75, 59, 80, 65, 100, 50, 171, false, ""),
|
new PokemonForm("Male", "male", Type.NORMAL, null, 1, 120, Abilities.LINGERING_AROMA, Abilities.GLUTTONY, Abilities.THICK_FAT, 489, 110, 100, 75, 59, 80, 65, 100, 50, 171, false, ""),
|
||||||
new PokemonForm("Female", "female", Type.NORMAL, null, 1, 120, Abilities.AROMA_VEIL, Abilities.GLUTTONY, Abilities.THICK_FAT, 489, 115, 90, 70, 59, 90, 65, 100, 50, 171),
|
new PokemonForm("Female", "female", Type.NORMAL, null, 1, 120, Abilities.AROMA_VEIL, Abilities.GLUTTONY, Abilities.THICK_FAT, 489, 115, 90, 70, 59, 90, 65, 100, 50, 171),
|
||||||
),
|
),
|
||||||
|
@ -18,7 +18,7 @@ import { TimeOfDay } from "../data/enums/time-of-day";
|
|||||||
import { Terrain, TerrainType } from "../data/terrain";
|
import { Terrain, TerrainType } from "../data/terrain";
|
||||||
import { PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs } from "../data/ability";
|
import { PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs } from "../data/ability";
|
||||||
import Pokemon from "./pokemon";
|
import Pokemon from "./pokemon";
|
||||||
import { WEATHER_OVERRIDE } from '../overrides';
|
import * as Overrides from '../overrides';
|
||||||
|
|
||||||
export class Arena {
|
export class Arena {
|
||||||
public scene: BattleScene;
|
public scene: BattleScene;
|
||||||
@ -273,6 +273,11 @@ export class Arena {
|
|||||||
return 131 / 180;
|
return 131 / 180;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets weather to the override specified in overrides.ts
|
||||||
|
* @param weather new weather to set of type WeatherType
|
||||||
|
* @returns true to force trySetWeather to return true
|
||||||
|
*/
|
||||||
trySetWeatherOverride(weather: WeatherType): boolean {
|
trySetWeatherOverride(weather: WeatherType): boolean {
|
||||||
this.weather = new Weather(weather, 0);
|
this.weather = new Weather(weather, 0);
|
||||||
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, undefined, undefined, CommonAnim.SUNNY + (weather - 1)));
|
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, undefined, undefined, CommonAnim.SUNNY + (weather - 1)));
|
||||||
@ -280,10 +285,15 @@ export class Arena {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempts to set a new weather to the battle
|
||||||
|
* @param weather new weather to set of type WeatherType
|
||||||
|
* @param hasPokemonSource is the new weather from a pokemon
|
||||||
|
* @returns true if new weather set, false if no weather provided or attempting to set the same weather as currently in use
|
||||||
|
*/
|
||||||
trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean {
|
trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean {
|
||||||
// override hook for debugging
|
if (Overrides.WEATHER_OVERRIDE)
|
||||||
if (WEATHER_OVERRIDE)
|
return this.trySetWeatherOverride(Overrides.WEATHER_OVERRIDE);
|
||||||
return this.trySetWeatherOverride(WEATHER_OVERRIDE);
|
|
||||||
|
|
||||||
if (this.weather?.weatherType === (weather || undefined))
|
if (this.weather?.weatherType === (weather || undefined))
|
||||||
return false;
|
return false;
|
||||||
|
@ -43,7 +43,7 @@ import { Nature, getNatureStatMultiplier } from '../data/nature';
|
|||||||
import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangeStatusEffectTrigger } from '../data/pokemon-forms';
|
import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangeStatusEffectTrigger } from '../data/pokemon-forms';
|
||||||
import { TerrainType } from '../data/terrain';
|
import { TerrainType } from '../data/terrain';
|
||||||
import { TrainerSlot } from '../data/trainer-config';
|
import { TrainerSlot } from '../data/trainer-config';
|
||||||
import { ABILITY_OVERRIDE, MOVE_OVERRIDE, MOVE_OVERRIDE_2, OPP_ABILITY_OVERRIDE, OPP_MOVE_OVERRIDE, OPP_MOVE_OVERRIDE_2, OPP_PASSIVE_ABILITY_OVERRIDE, OPP_SHINY_OVERRIDE, OPP_VARIANT_OVERRIDE, PASSIVE_ABILITY_OVERRIDE } from '../overrides';
|
import * as Overrides from '../overrides';
|
||||||
import { BerryType } from '../data/berry';
|
import { BerryType } from '../data/berry';
|
||||||
import i18next from '../plugins/i18n';
|
import i18next from '../plugins/i18n';
|
||||||
|
|
||||||
@ -725,15 +725,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
? this.summonData.moveset
|
? this.summonData.moveset
|
||||||
: this.moveset;
|
: this.moveset;
|
||||||
|
|
||||||
if (MOVE_OVERRIDE && this.isPlayer())
|
// Overrides moveset based on arrays specified in overrides.ts
|
||||||
this.moveset[0] = new PokemonMove(MOVE_OVERRIDE, Math.min(this.moveset[0].ppUsed, allMoves[MOVE_OVERRIDE].pp));
|
const overrideArray: Array<Moves> = this.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
||||||
else if (OPP_MOVE_OVERRIDE && !this.isPlayer())
|
if (overrideArray.length > 0) {
|
||||||
this.moveset[0] = new PokemonMove(OPP_MOVE_OVERRIDE, Math.min(this.moveset[0].ppUsed, allMoves[OPP_MOVE_OVERRIDE].pp));
|
overrideArray.forEach((move: Moves, index: number) => {
|
||||||
if (MOVE_OVERRIDE_2 && this.isPlayer())
|
const ppUsed = this.moveset[index]?.ppUp || 0;
|
||||||
this.moveset[1] = new PokemonMove(MOVE_OVERRIDE_2, Math.min(this.moveset[1].ppUsed, allMoves[MOVE_OVERRIDE_2].pp));
|
this.moveset[index] = new PokemonMove(move, Math.min(ppUsed, allMoves[move].pp))
|
||||||
else if (OPP_MOVE_OVERRIDE_2 && !this.isPlayer())
|
});
|
||||||
this.moveset[1] = new PokemonMove(OPP_MOVE_OVERRIDE_2, Math.min(this.moveset[1].ppUsed, allMoves[OPP_MOVE_OVERRIDE_2].pp));
|
}
|
||||||
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -798,10 +797,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
getAbility(ignoreOverride?: boolean): Ability {
|
getAbility(ignoreOverride?: boolean): Ability {
|
||||||
if (!ignoreOverride && this.summonData?.ability)
|
if (!ignoreOverride && this.summonData?.ability)
|
||||||
return allAbilities[this.summonData.ability];
|
return allAbilities[this.summonData.ability];
|
||||||
if (ABILITY_OVERRIDE && this.isPlayer())
|
if (Overrides.ABILITY_OVERRIDE && this.isPlayer())
|
||||||
return allAbilities[ABILITY_OVERRIDE];
|
return allAbilities[Overrides.ABILITY_OVERRIDE];
|
||||||
if (OPP_ABILITY_OVERRIDE && !this.isPlayer())
|
if (Overrides.OPP_ABILITY_OVERRIDE && !this.isPlayer())
|
||||||
return allAbilities[OPP_ABILITY_OVERRIDE];
|
return allAbilities[Overrides.OPP_ABILITY_OVERRIDE];
|
||||||
if (this.isFusion())
|
if (this.isFusion())
|
||||||
return allAbilities[this.getFusionSpeciesForm(ignoreOverride).getAbility(this.fusionAbilityIndex)];
|
return allAbilities[this.getFusionSpeciesForm(ignoreOverride).getAbility(this.fusionAbilityIndex)];
|
||||||
let abilityId = this.getSpeciesForm(ignoreOverride).getAbility(this.abilityIndex);
|
let abilityId = this.getSpeciesForm(ignoreOverride).getAbility(this.abilityIndex);
|
||||||
@ -811,10 +810,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPassiveAbility(): Ability {
|
getPassiveAbility(): Ability {
|
||||||
if (PASSIVE_ABILITY_OVERRIDE && this.isPlayer())
|
if (Overrides.PASSIVE_ABILITY_OVERRIDE && this.isPlayer())
|
||||||
return allAbilities[PASSIVE_ABILITY_OVERRIDE];
|
return allAbilities[Overrides.PASSIVE_ABILITY_OVERRIDE];
|
||||||
if (OPP_PASSIVE_ABILITY_OVERRIDE && !this.isPlayer())
|
if (Overrides.OPP_PASSIVE_ABILITY_OVERRIDE && !this.isPlayer())
|
||||||
return allAbilities[OPP_PASSIVE_ABILITY_OVERRIDE];
|
return allAbilities[Overrides.OPP_PASSIVE_ABILITY_OVERRIDE];
|
||||||
|
|
||||||
let starterSpeciesId = this.species.speciesId;
|
let starterSpeciesId = this.species.speciesId;
|
||||||
while (pokemonPrevolutions.hasOwnProperty(starterSpeciesId))
|
while (pokemonPrevolutions.hasOwnProperty(starterSpeciesId))
|
||||||
@ -822,8 +821,17 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return allAbilities[starterPassiveAbilities[starterSpeciesId]];
|
return allAbilities[starterPassiveAbilities[starterSpeciesId]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a pokemon has a passive either from:
|
||||||
|
* - bought with starter candy
|
||||||
|
* - set by override
|
||||||
|
* - is a boss pokemon
|
||||||
|
* @returns whether or not a pokemon should have a passive
|
||||||
|
*/
|
||||||
hasPassive(): boolean {
|
hasPassive(): boolean {
|
||||||
if ((PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE && this.isPlayer()) || (OPP_PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE && !this.isPlayer()))
|
// returns override if valid for current case
|
||||||
|
if ((Overrides.PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE && this.isPlayer()) ||
|
||||||
|
(Overrides.OPP_PASSIVE_ABILITY_OVERRIDE !== Abilities.NONE && !this.isPlayer()))
|
||||||
return true;
|
return true;
|
||||||
return this.passive || this.isBoss();
|
return this.passive || this.isBoss();
|
||||||
}
|
}
|
||||||
@ -2692,14 +2700,14 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
this.generateAndPopulateMoveset();
|
this.generateAndPopulateMoveset();
|
||||||
|
|
||||||
this.trySetShiny();
|
this.trySetShiny();
|
||||||
if (OPP_SHINY_OVERRIDE) {
|
if (Overrides.OPP_SHINY_OVERRIDE) {
|
||||||
this.shiny = true;
|
this.shiny = true;
|
||||||
this.initShinySparkle();
|
this.initShinySparkle();
|
||||||
}
|
}
|
||||||
if (this.shiny) {
|
if (this.shiny) {
|
||||||
this.variant = this.generateVariant();
|
this.variant = this.generateVariant();
|
||||||
if (OPP_VARIANT_OVERRIDE)
|
if (Overrides.OPP_VARIANT_OVERRIDE)
|
||||||
this.variant = OPP_VARIANT_OVERRIDE;
|
this.variant = Overrides.OPP_VARIANT_OVERRIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.luck = (this.shiny ? this.variant + 1 : 0) + (this.fusionShiny ? this.fusionVariant + 1 : 0);
|
this.luck = (this.shiny ? this.variant + 1 : 0) + (this.fusionShiny ? this.fusionVariant + 1 : 0);
|
||||||
|
@ -5,7 +5,7 @@ import { Species } from "./data/enums/species";
|
|||||||
import PokemonSpecies, { allSpecies } from "./data/pokemon-species";
|
import PokemonSpecies, { allSpecies } from "./data/pokemon-species";
|
||||||
import { Arena } from "./field/arena";
|
import { Arena } from "./field/arena";
|
||||||
import * as Utils from "./utils";
|
import * as Utils from "./utils";
|
||||||
import { STARTING_BIOME_OVERRIDE, STARTING_LEVEL_OVERRIDE, STARTING_MONEY_OVERRIDE } from './overrides';
|
import * as Overrides from './overrides';
|
||||||
|
|
||||||
export enum GameModes {
|
export enum GameModes {
|
||||||
CLASSIC,
|
CLASSIC,
|
||||||
@ -45,9 +45,15 @@ export class GameMode implements GameModeConfig {
|
|||||||
Object.assign(this, config);
|
Object.assign(this, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns either:
|
||||||
|
* - override from overrides.ts
|
||||||
|
* - 20 for Daily Runs
|
||||||
|
* - 5 for all other modes
|
||||||
|
*/
|
||||||
getStartingLevel(): integer {
|
getStartingLevel(): integer {
|
||||||
if (STARTING_LEVEL_OVERRIDE)
|
if (Overrides.STARTING_LEVEL_OVERRIDE)
|
||||||
return STARTING_LEVEL_OVERRIDE;
|
return Overrides.STARTING_LEVEL_OVERRIDE;
|
||||||
switch (this.modeId) {
|
switch (this.modeId) {
|
||||||
case GameModes.DAILY:
|
case GameModes.DAILY:
|
||||||
return 20;
|
return 20;
|
||||||
@ -56,16 +62,28 @@ export class GameMode implements GameModeConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns either:
|
||||||
|
* - override from overrides.ts
|
||||||
|
* - 1000
|
||||||
|
*/
|
||||||
getStartingMoney(): integer {
|
getStartingMoney(): integer {
|
||||||
return STARTING_MONEY_OVERRIDE || 1000;
|
return Overrides.STARTING_MONEY_OVERRIDE || 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param scene current BattleScene
|
||||||
|
* @returns either:
|
||||||
|
* - random biome for Daily mode
|
||||||
|
* - override from overrides.ts
|
||||||
|
* - Town
|
||||||
|
*/
|
||||||
getStartingBiome(scene: BattleScene): Biome {
|
getStartingBiome(scene: BattleScene): Biome {
|
||||||
switch (this.modeId) {
|
switch (this.modeId) {
|
||||||
case GameModes.DAILY:
|
case GameModes.DAILY:
|
||||||
return scene.generateRandomBiome(this.getWaveForDifficulty(1));
|
return scene.generateRandomBiome(this.getWaveForDifficulty(1));
|
||||||
default:
|
default:
|
||||||
return STARTING_BIOME_OVERRIDE || Biome.TOWN;
|
return Overrides.STARTING_BIOME_OVERRIDE || Biome.TOWN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,7 +482,7 @@ export const move: MoveTranslationEntries = {
|
|||||||
effect: "Le lanceur explose en blessant tous les Pokémon autour de lui. Le lanceur tombe K.O."
|
effect: "Le lanceur explose en blessant tous les Pokémon autour de lui. Le lanceur tombe K.O."
|
||||||
},
|
},
|
||||||
"eggBomb": {
|
"eggBomb": {
|
||||||
name: "Bombe Oeuf",
|
name: "Bombe Œuf",
|
||||||
effect: "De toutes ses forces, le lanceur jette un gros œuf sur l’ennemi pour lui infliger des dégâts."
|
effect: "De toutes ses forces, le lanceur jette un gros œuf sur l’ennemi pour lui infliger des dégâts."
|
||||||
},
|
},
|
||||||
"lick": {
|
"lick": {
|
||||||
@ -1426,7 +1426,7 @@ export const move: MoveTranslationEntries = {
|
|||||||
effect: "Pendant cinq tours, les Pokémon Vol ou qui ont Lévitation deviennent sensibles aux capacités Sol, et les capacités volantes deviennent inutilisables."
|
effect: "Pendant cinq tours, les Pokémon Vol ou qui ont Lévitation deviennent sensibles aux capacités Sol, et les capacités volantes deviennent inutilisables."
|
||||||
},
|
},
|
||||||
"miracleEye": {
|
"miracleEye": {
|
||||||
name: "Oeil Miracle",
|
name: "Œil Miracle",
|
||||||
effect: "Permet de toucher un Pokémon Ténèbres avec les capacités de type Psy ou de toucher un ennemi ayant beaucoup d’esquive."
|
effect: "Permet de toucher un Pokémon Ténèbres avec les capacités de type Psy ou de toucher un ennemi ayant beaucoup d’esquive."
|
||||||
},
|
},
|
||||||
"wakeUpSlap": {
|
"wakeUpSlap": {
|
||||||
@ -1562,8 +1562,8 @@ export const move: MoveTranslationEntries = {
|
|||||||
effect: "Le lanceur éparpille des pics autour de la cible, ce qui empoisonne les Pokémon entrant au combat de ce côté."
|
effect: "Le lanceur éparpille des pics autour de la cible, ce qui empoisonne les Pokémon entrant au combat de ce côté."
|
||||||
},
|
},
|
||||||
"heartSwap": {
|
"heartSwap": {
|
||||||
name: "Permucoeur",
|
name: "Permucœur",
|
||||||
effect: "Cette capacité ne peut pas être utilisée. Il est recommandé de l’oublier, même s’il sera impossible de se la remémorer une fois oubliée."
|
effect: "Le lanceur utilise un pouvoir psychique pour échanger ses changements de stats avec la cible."
|
||||||
},
|
},
|
||||||
"aquaRing": {
|
"aquaRing": {
|
||||||
name: "Anneau Hydro",
|
name: "Anneau Hydro",
|
||||||
@ -2122,7 +2122,7 @@ export const move: MoveTranslationEntries = {
|
|||||||
effect: "Le lanceur frappe l’ennemi deux fois d’affilée avec les parties les plus robustes de son corps."
|
effect: "Le lanceur frappe l’ennemi deux fois d’affilée avec les parties les plus robustes de son corps."
|
||||||
},
|
},
|
||||||
"heartStamp": {
|
"heartStamp": {
|
||||||
name: "Crève-Coeur",
|
name: "Crève-Cœur",
|
||||||
effect: "Déconcentre l’ennemi avec des mouvements mignons avant de le frapper violemment. Peut aussi l’apeurer (30% de chances)."
|
effect: "Déconcentre l’ennemi avec des mouvements mignons avant de le frapper violemment. Peut aussi l’apeurer (30% de chances)."
|
||||||
},
|
},
|
||||||
"hornLeech": {
|
"hornLeech": {
|
||||||
@ -3742,7 +3742,7 @@ export const move: MoveTranslationEntries = {
|
|||||||
effect: "Le lanceur remue son thé et en bombarde la cible. La moitié des dégâts infligés sont convertis en PV pour le lanceur. Cette capacité peut aussi brûler la cible."
|
effect: "Le lanceur remue son thé et en bombarde la cible. La moitié des dégâts infligés sont convertis en PV pour le lanceur. Cette capacité peut aussi brûler la cible."
|
||||||
},
|
},
|
||||||
"syrupBomb": {
|
"syrupBomb": {
|
||||||
name: "Bombe au sirop",
|
name: "Bombe au Sirop",
|
||||||
effect: "Le lanceur jette une bombe qui recouvre la cible de sirop gluant et fait progressivement baisser la Vitesse de la cible pendant trois tours."
|
effect: "Le lanceur jette une bombe qui recouvre la cible de sirop gluant et fait progressivement baisser la Vitesse de la cible pendant trois tours."
|
||||||
},
|
},
|
||||||
"ivyCudgel": {
|
"ivyCudgel": {
|
||||||
|
@ -19,8 +19,9 @@ import { VoucherType } from '../system/voucher';
|
|||||||
import { FormChangeItem, SpeciesFormChangeItemTrigger } from '../data/pokemon-forms';
|
import { FormChangeItem, SpeciesFormChangeItemTrigger } from '../data/pokemon-forms';
|
||||||
import { Nature } from '#app/data/nature';
|
import { Nature } from '#app/data/nature';
|
||||||
import { BattlerTagType } from '#app/data/enums/battler-tag-type';
|
import { BattlerTagType } from '#app/data/enums/battler-tag-type';
|
||||||
|
import * as Overrides from '../overrides';
|
||||||
|
import { ModifierType, modifierTypes } from './modifier-type';
|
||||||
|
|
||||||
type ModifierType = ModifierTypes.ModifierType;
|
|
||||||
export type ModifierPredicate = (modifier: Modifier) => boolean;
|
export type ModifierPredicate = (modifier: Modifier) => boolean;
|
||||||
|
|
||||||
const iconOverflowIndex = 24;
|
const iconOverflowIndex = 24;
|
||||||
@ -2175,4 +2176,63 @@ export class EnemyFusionChanceModifier extends EnemyPersistentModifier {
|
|||||||
getMaxStackCount(scene: BattleScene): integer {
|
getMaxStackCount(scene: BattleScene): integer {
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uses override from overrides.ts to set PersistentModifiers for starting a new game
|
||||||
|
* @param scene current BattleScene
|
||||||
|
* @param player is this for player for enemy
|
||||||
|
*/
|
||||||
|
export function overrideModifiers(scene: BattleScene, player: boolean = true): void {
|
||||||
|
const modifierOverride = player ? Overrides.STARTING_MODIFIER_OVERRIDE : Overrides.OPP_MODIFIER_OVERRIDE;
|
||||||
|
if (!modifierOverride || modifierOverride.length === 0 || !scene) return; // if no override, do nothing
|
||||||
|
// if it's the opponent, we clear all his current modifiers to avoid stacking
|
||||||
|
if (!player) {
|
||||||
|
scene.clearEnemyModifiers();
|
||||||
|
}
|
||||||
|
// we loop through all the modifier name given in the override file
|
||||||
|
modifierOverride.forEach(item => {
|
||||||
|
const modifierName = item.name;
|
||||||
|
const qty = item.count || 1;
|
||||||
|
if (!modifierTypes.hasOwnProperty(modifierName)) return; // if the modifier does not exist, we skip it
|
||||||
|
const modifierType: ModifierType = modifierTypes[modifierName]();
|
||||||
|
const modifier: PersistentModifier = modifierType.withIdFromFunc(modifierTypes[modifierName]).newModifier() as PersistentModifier;
|
||||||
|
modifier.stackCount = qty;
|
||||||
|
if (player) {
|
||||||
|
scene.addModifier(modifier, true, false, false, true);
|
||||||
|
} else {
|
||||||
|
scene.addEnemyModifier(modifier, true, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Uses override from overrides.ts to set PokemonHeldItemModifiers for starting a new game
|
||||||
|
* @param scene current BattleScene
|
||||||
|
* @param player is this for player for enemy
|
||||||
|
*/
|
||||||
|
export function overrideHeldItems(scene: BattleScene, pokemon: Pokemon, player: boolean = true): void {
|
||||||
|
const heldItemsOverride = player ? Overrides.STARTING_HELD_ITEMS_OVERRIDE : Overrides.OPP_HELD_ITEMS_OVERRIDE;
|
||||||
|
if (!heldItemsOverride || heldItemsOverride.length === 0 || !scene) return; // if no override, do nothing
|
||||||
|
// we loop through all the itemName given in the override file
|
||||||
|
heldItemsOverride.forEach(item => {
|
||||||
|
const itemName = item.name;
|
||||||
|
const qty = item.count || 1;
|
||||||
|
if (!modifierTypes.hasOwnProperty(itemName)) return; // if the item does not exist, we skip it
|
||||||
|
const modifierType: ModifierType = modifierTypes[itemName](); // we retrieve the item in the list
|
||||||
|
var itemModifier: PokemonHeldItemModifier;
|
||||||
|
if (modifierType instanceof ModifierTypes.ModifierTypeGenerator) {
|
||||||
|
itemModifier = modifierType.generateType(null, [item.type]).withIdFromFunc(modifierTypes[itemName]).newModifier(pokemon) as PokemonHeldItemModifier;
|
||||||
|
} else {
|
||||||
|
itemModifier = modifierType.withIdFromFunc(modifierTypes[itemName]).newModifier(pokemon) as PokemonHeldItemModifier;
|
||||||
|
}
|
||||||
|
// we create the item
|
||||||
|
itemModifier.pokemonId = pokemon.id; // we assign the created item to the pokemon
|
||||||
|
itemModifier.stackCount = qty; // we say how many items we want
|
||||||
|
if (player) {
|
||||||
|
scene.addModifier(itemModifier, true, false, false, true);
|
||||||
|
} else {
|
||||||
|
scene.addEnemyModifier(itemModifier, true, true);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
@ -3,26 +3,84 @@ import { Abilities } from "./data/enums/abilities";
|
|||||||
import { Biome } from "./data/enums/biome";
|
import { Biome } from "./data/enums/biome";
|
||||||
import { Moves } from "./data/enums/moves";
|
import { Moves } from "./data/enums/moves";
|
||||||
import { WeatherType } from "./data/weather";
|
import { WeatherType } from "./data/weather";
|
||||||
|
import { Variant } from './data/variant';
|
||||||
|
import { BerryType } from './data/berry';
|
||||||
|
import { TempBattleStat } from './data/temp-battle-stat';
|
||||||
|
import { Nature } from './data/nature';
|
||||||
|
import { Type } from './data/type';
|
||||||
|
import { Stat } from './data/pokemon-stat';
|
||||||
|
|
||||||
export const SEED_OVERRIDE = '';
|
/**
|
||||||
export const STARTER_SPECIES_OVERRIDE = 0;
|
* Overrides for testing different in game situations
|
||||||
export const STARTER_FORM_OVERRIDE = 0;
|
* if an override name starts with "STARTING", it will apply when a new run begins
|
||||||
export const STARTING_LEVEL_OVERRIDE = 0;
|
*/
|
||||||
export const STARTING_WAVE_OVERRIDE = 0;
|
|
||||||
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
|
||||||
export const STARTING_MONEY_OVERRIDE = 0;
|
|
||||||
export const WEATHER_OVERRIDE = WeatherType.NONE;
|
|
||||||
export const DOUBLE_BATTLE_OVERRIDE = false;
|
|
||||||
|
|
||||||
export const ABILITY_OVERRIDE = Abilities.NONE;
|
/**
|
||||||
export const PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
|
* OVERALL OVERRIDES
|
||||||
export const MOVE_OVERRIDE = Moves.NONE;
|
*/
|
||||||
export const MOVE_OVERRIDE_2 = Moves.NONE;
|
|
||||||
export const OPP_SPECIES_OVERRIDE = 0;
|
// a specific seed (default: a random string of 24 characters)
|
||||||
export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
|
export const SEED_OVERRIDE: string = '';
|
||||||
|
export const WEATHER_OVERRIDE: WeatherType = WeatherType.NONE;
|
||||||
|
export const DOUBLE_BATTLE_OVERRIDE: boolean = false;
|
||||||
|
export const STARTING_WAVE_OVERRIDE: integer = 0;
|
||||||
|
export const STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN;
|
||||||
|
// default 1000
|
||||||
|
export const STARTING_MONEY_OVERRIDE: integer = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PLAYER OVERRIDES
|
||||||
|
*/
|
||||||
|
|
||||||
|
// forms can be found in pokemon-species.ts
|
||||||
|
export const STARTER_FORM_OVERRIDE: integer = 0;
|
||||||
|
// default 5 or 20 for Daily
|
||||||
|
export const STARTING_LEVEL_OVERRIDE: integer = 0;
|
||||||
|
export const ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||||
|
export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||||
|
export const MOVESET_OVERRIDE: Array<Moves> = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OPPONENT / ENEMY OVERRIDES
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
|
||||||
export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
|
export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
|
||||||
export const OPP_MOVE_OVERRIDE = Moves.NONE;
|
export const OPP_MOVESET_OVERRIDE: Array<Moves> = [];
|
||||||
export const OPP_MOVE_OVERRIDE_2 = Moves.NONE;
|
export const OPP_SHINY_OVERRIDE: boolean = false;
|
||||||
|
export const OPP_VARIANT_OVERRIDE: Variant = 0;
|
||||||
|
|
||||||
export const OPP_SHINY_OVERRIDE = false;
|
/**
|
||||||
export const OPP_VARIANT_OVERRIDE = 0;
|
* SPECIES OVERRIDE
|
||||||
|
* will only apply to the first starter in your party or each enemy pokemon
|
||||||
|
* default is 0 to not override
|
||||||
|
* @example SPECIES_OVERRIDE = Species.Bulbasaur;
|
||||||
|
*/
|
||||||
|
export const STARTER_SPECIES_OVERRIDE: Species | integer = 0;
|
||||||
|
export const OPP_SPECIES_OVERRIDE: Species | integer = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MODIFIER / ITEM OVERRIDES
|
||||||
|
* if count is not provided, it will default to 1
|
||||||
|
* @example Modifier Override [{name: "EXP_SHARE", count: 2}]
|
||||||
|
* @example Held Item Override [{name: "LUCKY_EGG"}]
|
||||||
|
*
|
||||||
|
* Some items are generated based on a sub-type (i.e. berries), to override those:
|
||||||
|
* @example [{name: "BERRY", count: 5, type: BerryType.SITRUS}]
|
||||||
|
* types are listed in interface below
|
||||||
|
* - TempBattleStat is for TEMP_STAT_BOOSTER / X Items (Dire hit is separate)
|
||||||
|
* - Stat is for BASE_STAT_BOOSTER / Vitamin
|
||||||
|
* - Nature is for MINT
|
||||||
|
* - Type is for TERA_SHARD or ATTACK_TYPE_BOOSTER (type boosting items i.e Silk Scarf)
|
||||||
|
* - BerryType is for BERRY
|
||||||
|
*/
|
||||||
|
interface ModifierOverride {
|
||||||
|
name: string,
|
||||||
|
count?: integer
|
||||||
|
type?: TempBattleStat|Stat|Nature|Type|BerryType
|
||||||
|
}
|
||||||
|
export const STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
|
||||||
|
export const OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
|
||||||
|
|
||||||
|
export const STARTING_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
|
||||||
|
export const OPP_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
|
||||||
|
@ -6,7 +6,7 @@ import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMov
|
|||||||
import { Mode } from './ui/ui';
|
import { Mode } from './ui/ui';
|
||||||
import { Command } from "./ui/command-ui-handler";
|
import { Command } from "./ui/command-ui-handler";
|
||||||
import { Stat } from "./data/pokemon-stat";
|
import { Stat } from "./data/pokemon-stat";
|
||||||
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier, PokemonMoveAccuracyBoosterModifier } from "./modifier/modifier";
|
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier, PokemonMoveAccuracyBoosterModifier, overrideModifiers, overrideHeldItems } from "./modifier/modifier";
|
||||||
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
||||||
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
||||||
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
||||||
@ -58,7 +58,7 @@ import { GameModes, gameModes } from "./game-mode";
|
|||||||
import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./data/pokemon-species";
|
import PokemonSpecies, { getPokemonSpecies, getPokemonSpeciesForm, speciesStarters } from "./data/pokemon-species";
|
||||||
import i18next from './plugins/i18n';
|
import i18next from './plugins/i18n';
|
||||||
import { Abilities } from "./data/enums/abilities";
|
import { Abilities } from "./data/enums/abilities";
|
||||||
import { STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE } from './overrides';
|
import * as Overrides from './overrides';
|
||||||
|
|
||||||
export class LoginPhase extends Phase {
|
export class LoginPhase extends Phase {
|
||||||
private showText: boolean;
|
private showText: boolean;
|
||||||
@ -487,12 +487,12 @@ export class SelectStarterPhase extends Phase {
|
|||||||
const party = this.scene.getParty();
|
const party = this.scene.getParty();
|
||||||
const loadPokemonAssets: Promise<void>[] = [];
|
const loadPokemonAssets: Promise<void>[] = [];
|
||||||
starters.forEach((starter: Starter, i: integer) => {
|
starters.forEach((starter: Starter, i: integer) => {
|
||||||
if (!i && STARTER_SPECIES_OVERRIDE)
|
if (!i && Overrides.STARTER_SPECIES_OVERRIDE)
|
||||||
starter.species = getPokemonSpecies(STARTER_SPECIES_OVERRIDE as Species);
|
starter.species = getPokemonSpecies(Overrides.STARTER_SPECIES_OVERRIDE as Species);
|
||||||
const starterProps = this.scene.gameData.getSpeciesDexAttrProps(starter.species, starter.dexAttr);
|
const starterProps = this.scene.gameData.getSpeciesDexAttrProps(starter.species, starter.dexAttr);
|
||||||
let starterFormIndex = Math.min(starterProps.formIndex, Math.max(starter.species.forms.length - 1, 0));
|
let starterFormIndex = Math.min(starterProps.formIndex, Math.max(starter.species.forms.length - 1, 0));
|
||||||
if (!i && STARTER_SPECIES_OVERRIDE)
|
if (!i && Overrides.STARTER_SPECIES_OVERRIDE)
|
||||||
starterFormIndex = STARTER_FORM_OVERRIDE;
|
starterFormIndex = Overrides.STARTER_FORM_OVERRIDE;
|
||||||
const starterGender = starter.species.malePercent !== null
|
const starterGender = starter.species.malePercent !== null
|
||||||
? !starterProps.female ? Gender.MALE : Gender.FEMALE
|
? !starterProps.female ? Gender.MALE : Gender.FEMALE
|
||||||
: Gender.GENDERLESS;
|
: Gender.GENDERLESS;
|
||||||
@ -510,6 +510,8 @@ export class SelectStarterPhase extends Phase {
|
|||||||
party.push(starterPokemon);
|
party.push(starterPokemon);
|
||||||
loadPokemonAssets.push(starterPokemon.loadAssets());
|
loadPokemonAssets.push(starterPokemon.loadAssets());
|
||||||
});
|
});
|
||||||
|
overrideModifiers(this.scene);
|
||||||
|
overrideHeldItems(this.scene, party[0]);
|
||||||
Promise.all(loadPokemonAssets).then(() => {
|
Promise.all(loadPokemonAssets).then(() => {
|
||||||
SoundFade.fadeOut(this.scene, this.scene.sound.get('menu'), 500, true);
|
SoundFade.fadeOut(this.scene, this.scene.sound.get('menu'), 500, true);
|
||||||
this.scene.time.delayedCall(500, () => this.scene.playBgm());
|
this.scene.time.delayedCall(500, () => this.scene.playBgm());
|
||||||
@ -4544,6 +4546,48 @@ export class AddEnemyBuffModifierPhase extends Phase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cures the party of all non-volatile status conditions, shows a message
|
||||||
|
* @param {BattleScene} scene The current scene
|
||||||
|
* @param {Pokemon} user The user of the move that cures the party
|
||||||
|
* @param {string} message The message that should be displayed
|
||||||
|
* @param {Abilities} abilityCondition Pokemon with this ability will not be affected ie. Soundproof
|
||||||
|
*/
|
||||||
|
export class PartyStatusCurePhase extends BattlePhase {
|
||||||
|
private user: Pokemon;
|
||||||
|
private message: string;
|
||||||
|
private abilityCondition: Abilities;
|
||||||
|
|
||||||
|
constructor(scene: BattleScene, user: Pokemon, message: string, abilityCondition: Abilities) {
|
||||||
|
super(scene);
|
||||||
|
|
||||||
|
this.user = user;
|
||||||
|
this.message = message;
|
||||||
|
this.abilityCondition = abilityCondition;
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
super.start();
|
||||||
|
for (let pokemon of this.scene.getParty()) {
|
||||||
|
if (!pokemon.isOnField() || pokemon === this.user) {
|
||||||
|
pokemon.resetStatus(false);
|
||||||
|
pokemon.updateInfo(true);
|
||||||
|
} else {
|
||||||
|
if (!pokemon.hasAbility(this.abilityCondition)) {
|
||||||
|
pokemon.resetStatus();
|
||||||
|
pokemon.updateInfo(true);
|
||||||
|
} else {
|
||||||
|
// Manually show ability bar, since we're not hooked into the targeting system
|
||||||
|
pokemon.scene.unshiftPhase(new ShowAbilityPhase(pokemon.scene, pokemon.id, pokemon.getPassiveAbility()?.id === this.abilityCondition));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.message)
|
||||||
|
this.scene.queueMessage(this.message);
|
||||||
|
this.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class PartyHealPhase extends BattlePhase {
|
export class PartyHealPhase extends BattlePhase {
|
||||||
private resumeBgm: boolean;
|
private resumeBgm: boolean;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user