mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-27 09:16:03 +00:00
add MysteryEncounterBuilder.withSceneWaveRangeRequirement()
This commit is contained in:
parent
5a5806185f
commit
25d0bd39ee
@ -1,5 +1,15 @@
|
|||||||
|
import { Type } from "#app/data/type";
|
||||||
|
import { ModifierRewardPhase } from "#app/phases";
|
||||||
|
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
import BattleScene from "../../../battle-scene";
|
import BattleScene from "../../../battle-scene";
|
||||||
import { AddPokeballModifierType } from "../../../modifier/modifier-type";
|
import { AddPokeballModifierType } from "../../../modifier/modifier-type";
|
||||||
|
import { PokeballType } from "../../pokeball";
|
||||||
|
import { getPokemonSpecies } from "../../pokemon-species";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
import { PartySizeRequirement } from "../mystery-encounter-requirements";
|
||||||
import {
|
import {
|
||||||
EnemyPartyConfig, EnemyPokemonConfig,
|
EnemyPartyConfig, EnemyPokemonConfig,
|
||||||
getRandomPlayerPokemon,
|
getRandomPlayerPokemon,
|
||||||
@ -7,16 +17,6 @@ import {
|
|||||||
initBattleWithEnemyConfig,
|
initBattleWithEnemyConfig,
|
||||||
leaveEncounterWithoutBattle
|
leaveEncounterWithoutBattle
|
||||||
} from "../mystery-encounter-utils";
|
} from "../mystery-encounter-utils";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
|
||||||
import { ModifierRewardPhase } from "#app/phases";
|
|
||||||
import { getPokemonSpecies } from "../../pokemon-species";
|
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|
||||||
import { PokeballType } from "../../pokeball";
|
|
||||||
import { PartySizeRequirement, WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import { Type } from "#app/data/type";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { isNullOrUndefined, randSeedInt } from "#app/utils";
|
|
||||||
|
|
||||||
// Exclude Ultra Beasts, Paradox, Necrozma, Eternatus, and egg-locked mythicals
|
// Exclude Ultra Beasts, Paradox, Necrozma, Eternatus, and egg-locked mythicals
|
||||||
const excludedBosses = [
|
const excludedBosses = [
|
||||||
@ -83,7 +83,7 @@ export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder
|
|||||||
repeat: true
|
repeat: true
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withSceneRequirement(new WaveCountRequirement([30, 180])) // waves 30 to 180
|
.withSceneWaveRangeRequirement(30, 180) // waves 30 to 180
|
||||||
.withSceneRequirement(new PartySizeRequirement([2, 6])) // Must have at least 2 pokemon in party
|
.withSceneRequirement(new PartySizeRequirement([2, 6])) // Must have at least 2 pokemon in party
|
||||||
.withCatchAllowed(true)
|
.withCatchAllowed(true)
|
||||||
.withOption(new MysteryEncounterOptionBuilder()
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import BattleScene from "../../../battle-scene";
|
|
||||||
import {
|
import {
|
||||||
leaveEncounterWithoutBattle, setEncounterExp,
|
leaveEncounterWithoutBattle, setEncounterExp,
|
||||||
setEncounterRewards,
|
setEncounterRewards,
|
||||||
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|
||||||
import { WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
|
||||||
export const DepartmentStoreSaleEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const DepartmentStoreSaleEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.DEPARTMENT_STORE_SALE)
|
.withEncounterType(MysteryEncounterType.DEPARTMENT_STORE_SALE)
|
||||||
@ -30,7 +29,7 @@ export const DepartmentStoreSaleEncounter: MysteryEncounter = MysteryEncounterBu
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
// .withHideIntroVisuals(false)
|
// .withHideIntroVisuals(false)
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 100]))
|
.withSceneWaveRangeRequirement(10, 100)
|
||||||
.withOption(new MysteryEncounterOptionBuilder()
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
.withOptionPhase(async (scene: BattleScene) => {
|
.withOptionPhase(async (scene: BattleScene) => {
|
||||||
// Choose TMs
|
// Choose TMs
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import BattleScene from "../../../battle-scene";
|
import { BattleStat } from "#app/data/battle-stat";
|
||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
|
||||||
import {
|
import {
|
||||||
EnemyPartyConfig,
|
EnemyPartyConfig,
|
||||||
initBattleWithEnemyConfig,
|
initBattleWithEnemyConfig,
|
||||||
@ -7,10 +6,8 @@ import {
|
|||||||
setEncounterRewards,
|
setEncounterRewards,
|
||||||
showEncounterText
|
showEncounterText
|
||||||
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
import Pokemon from "#app/field/pokemon";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
import { MoveRequirement, WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import {
|
import {
|
||||||
getPartyLuckValue,
|
getPartyLuckValue,
|
||||||
getPlayerModifierTypeOptions,
|
getPlayerModifierTypeOptions,
|
||||||
@ -18,13 +15,16 @@ import {
|
|||||||
ModifierTypeOption,
|
ModifierTypeOption,
|
||||||
regenerateModifierPoolThresholds
|
regenerateModifierPoolThresholds
|
||||||
} from "#app/modifier/modifier-type";
|
} from "#app/modifier/modifier-type";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
|
||||||
import { StatChangePhase } from "#app/phases";
|
import { StatChangePhase } from "#app/phases";
|
||||||
import { BattleStat } from "#app/data/battle-stat";
|
|
||||||
import Pokemon from "#app/field/pokemon";
|
|
||||||
import { randSeedInt } from "#app/utils";
|
|
||||||
import { Moves } from "#enums/moves";
|
|
||||||
import { TextStyle } from "#app/ui/text";
|
import { TextStyle } from "#app/ui/text";
|
||||||
|
import { randSeedInt } from "#app/utils";
|
||||||
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
import { MoveRequirement } from "../mystery-encounter-requirements";
|
||||||
|
|
||||||
const validMovesForSteal = [
|
const validMovesForSteal = [
|
||||||
Moves.PLUCK,
|
Moves.PLUCK,
|
||||||
@ -40,7 +40,7 @@ export const FightOrFlightEncounter: MysteryEncounter = MysteryEncounterBuilder
|
|||||||
.withEncounterType(MysteryEncounterType.FIGHT_OR_FLIGHT)
|
.withEncounterType(MysteryEncounterType.FIGHT_OR_FLIGHT)
|
||||||
.withEncounterTier(MysteryEncounterTier.COMMON)
|
.withEncounterTier(MysteryEncounterTier.COMMON)
|
||||||
.withIntroSpriteConfigs([]) // Set in onInit()
|
.withIntroSpriteConfigs([]) // Set in onInit()
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 180])) // waves 10 to 180
|
.withSceneWaveRangeRequirement(10, 180) // waves 10 to 180
|
||||||
.withCatchAllowed(true)
|
.withCatchAllowed(true)
|
||||||
.withHideWildIntroMessage(true)
|
.withHideWildIntroMessage(true)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
import BattleScene from "../../../battle-scene";
|
|
||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
|
||||||
import { EnemyPartyConfig, initBattleWithEnemyConfig, setEncounterRewards } from "#app/data/mystery-encounters/mystery-encounter-utils";
|
import { EnemyPartyConfig, initBattleWithEnemyConfig, setEncounterRewards } from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import { WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import {
|
import {
|
||||||
trainerConfigs,
|
trainerConfigs,
|
||||||
TrainerPartyCompoundTemplate,
|
TrainerPartyCompoundTemplate,
|
||||||
TrainerPartyTemplate,
|
TrainerPartyTemplate,
|
||||||
trainerPartyTemplates
|
trainerPartyTemplates
|
||||||
} from "#app/data/trainer-config";
|
} from "#app/data/trainer-config";
|
||||||
import * as Utils from "../../../utils";
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import * as Utils from "../../../utils";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
|
||||||
export const MysteriousChallengersEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const MysteriousChallengersEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.MYSTERIOUS_CHALLENGERS)
|
.withEncounterType(MysteryEncounterType.MYSTERIOUS_CHALLENGERS)
|
||||||
.withEncounterTier(MysteryEncounterTier.GREAT)
|
.withEncounterTier(MysteryEncounterTier.GREAT)
|
||||||
.withIntroSpriteConfigs([]) // These are set in onInit()
|
.withIntroSpriteConfigs([]) // These are set in onInit()
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 180])) // waves 10 to 180
|
.withSceneWaveRangeRequirement(10, 180) // waves 10 to 180
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
const encounter = scene.currentBattle.mysteryEncounter;
|
const encounter = scene.currentBattle.mysteryEncounter;
|
||||||
// Calculates what trainers are available for battle in the encounter
|
// Calculates what trainers are available for battle in the encounter
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import BattleScene from "../../../battle-scene";
|
|
||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
|
||||||
import {
|
import {
|
||||||
getHighestLevelPlayerPokemon,
|
getHighestLevelPlayerPokemon,
|
||||||
koPlayerPokemon,
|
koPlayerPokemon,
|
||||||
@ -8,12 +6,13 @@ import {
|
|||||||
setEncounterRewards,
|
setEncounterRewards,
|
||||||
showEncounterText
|
showEncounterText
|
||||||
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|
||||||
import { WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import { GameOverPhase } from "#app/phases";
|
import { GameOverPhase } from "#app/phases";
|
||||||
import { randSeedInt } from "#app/utils";
|
import { randSeedInt } from "#app/utils";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
|
||||||
export const MysteriousChestEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const MysteriousChestEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.MYSTERIOUS_CHEST)
|
.withEncounterType(MysteryEncounterType.MYSTERIOUS_CHEST)
|
||||||
@ -29,7 +28,7 @@ export const MysteriousChestEncounter: MysteryEncounter = MysteryEncounterBuilde
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withHideIntroVisuals(false)
|
.withHideIntroVisuals(false)
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 180])) // waves 2 to 180
|
.withSceneWaveRangeRequirement(10, 180) // waves 2 to 180
|
||||||
.withOption(new MysteryEncounterOptionBuilder()
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
.withPreOptionPhase(async (scene: BattleScene) => {
|
.withPreOptionPhase(async (scene: BattleScene) => {
|
||||||
// Play animation
|
// Play animation
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import BattleScene from "../../../battle-scene";
|
|
||||||
import {
|
import {
|
||||||
generateModifierType,
|
generateModifierType,
|
||||||
leaveEncounterWithoutBattle,
|
leaveEncounterWithoutBattle,
|
||||||
@ -7,20 +6,20 @@ import {
|
|||||||
setEncounterRewards,
|
setEncounterRewards,
|
||||||
updatePlayerMoney,
|
updatePlayerMoney,
|
||||||
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
import { StatusEffect } from "#app/data/status-effect";
|
||||||
|
import Pokemon, { PlayerPokemon } from "#app/field/pokemon";
|
||||||
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
|
import { randSeedInt } from "#app/utils";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
import {
|
import {
|
||||||
HealthRatioRequirement,
|
HealthRatioRequirement,
|
||||||
MoneyRequirement,
|
MoneyRequirement,
|
||||||
StatusEffectRequirement,
|
StatusEffectRequirement
|
||||||
WaveCountRequirement
|
|
||||||
} from "../mystery-encounter-requirements";
|
} from "../mystery-encounter-requirements";
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { randSeedInt } from "#app/utils";
|
|
||||||
import Pokemon, { PlayerPokemon } from "#app/field/pokemon";
|
|
||||||
import { StatusEffect } from "#app/data/status-effect";
|
|
||||||
|
|
||||||
export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.SHADY_VITAMIN_DEALER)
|
.withEncounterType(MysteryEncounterType.SHADY_VITAMIN_DEALER)
|
||||||
@ -42,7 +41,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBui
|
|||||||
y: 2
|
y: 2
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 180]))
|
.withSceneWaveRangeRequirement(10, 180)
|
||||||
.withPrimaryPokemonRequirement(new StatusEffectRequirement([StatusEffect.NONE])) // Pokemon must not have status
|
.withPrimaryPokemonRequirement(new StatusEffectRequirement([StatusEffect.NONE])) // Pokemon must not have status
|
||||||
.withPrimaryPokemonRequirement(new HealthRatioRequirement([0.34, 1])) // Pokemon must have above 1/3rd HP
|
.withPrimaryPokemonRequirement(new HealthRatioRequirement([0.34, 1])) // Pokemon must have above 1/3rd HP
|
||||||
.withOption(new MysteryEncounterOptionBuilder()
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
|
@ -1,4 +1,18 @@
|
|||||||
|
import {
|
||||||
|
ModifierTypeOption,
|
||||||
|
modifierTypes
|
||||||
|
} from "#app/modifier/modifier-type";
|
||||||
|
import { BerryType } from "#enums/berry-type";
|
||||||
|
import { Moves } from "#enums/moves";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import { Species } from "#enums/species";
|
||||||
import BattleScene from "../../../battle-scene";
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import * as Utils from "../../../utils";
|
||||||
|
import { getPokemonSpecies } from "../../pokemon-species";
|
||||||
|
import { Status, StatusEffect } from "../../status-effect";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
import { MoveRequirement } from "../mystery-encounter-requirements";
|
||||||
import {
|
import {
|
||||||
EnemyPartyConfig,
|
EnemyPartyConfig,
|
||||||
EnemyPokemonConfig, generateModifierType,
|
EnemyPokemonConfig, generateModifierType,
|
||||||
@ -6,20 +20,6 @@ import {
|
|||||||
leaveEncounterWithoutBattle, queueEncounterMessage,
|
leaveEncounterWithoutBattle, queueEncounterMessage,
|
||||||
setEncounterRewards
|
setEncounterRewards
|
||||||
} from "../mystery-encounter-utils";
|
} from "../mystery-encounter-utils";
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
|
||||||
import * as Utils from "../../../utils";
|
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|
||||||
import { MoveRequirement, WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import {
|
|
||||||
ModifierTypeOption,
|
|
||||||
modifierTypes
|
|
||||||
} from "#app/modifier/modifier-type";
|
|
||||||
import { getPokemonSpecies } from "../../pokemon-species";
|
|
||||||
import { Species } from "#enums/species";
|
|
||||||
import { Status, StatusEffect } from "../../status-effect";
|
|
||||||
import { Moves } from "#enums/moves";
|
|
||||||
import { BerryType } from "#enums/berry-type";
|
|
||||||
|
|
||||||
export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX)
|
.withEncounterType(MysteryEncounterType.SLEEPING_SNORLAX)
|
||||||
@ -33,7 +33,7 @@ export const SleepingSnorlaxEncounter: MysteryEncounter = MysteryEncounterBuilde
|
|||||||
repeat: true
|
repeat: true
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 180])) // waves 10 to 180
|
.withSceneWaveRangeRequirement(10, 180) // waves 10 to 180
|
||||||
.withCatchAllowed(true)
|
.withCatchAllowed(true)
|
||||||
.withHideWildIntroMessage(true)
|
.withHideWildIntroMessage(true)
|
||||||
.withOnInit((scene: BattleScene) => {
|
.withOnInit((scene: BattleScene) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import BattleScene from "../../../battle-scene";
|
import { Ability, allAbilities } from "#app/data/ability";
|
||||||
import {
|
import {
|
||||||
EnemyPartyConfig,
|
EnemyPartyConfig,
|
||||||
getEncounterText,
|
getEncounterText,
|
||||||
@ -6,23 +6,22 @@ import {
|
|||||||
selectPokemonForOption,
|
selectPokemonForOption,
|
||||||
setEncounterRewards
|
setEncounterRewards
|
||||||
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
} from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
|
||||||
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
|
||||||
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
|
||||||
import { WaveCountRequirement } from "../mystery-encounter-requirements";
|
|
||||||
import { PlayerPokemon } from "#app/field/pokemon";
|
|
||||||
import PokemonData from "#app/system/pokemon-data";
|
|
||||||
import { randSeedShuffle } from "#app/utils";
|
|
||||||
import { getNatureName, Nature } from "#app/data/nature";
|
import { getNatureName, Nature } from "#app/data/nature";
|
||||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
import { speciesStarters } from "#app/data/pokemon-species";
|
||||||
import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
import { Stat } from "#app/data/pokemon-stat";
|
||||||
|
import { PlayerPokemon } from "#app/field/pokemon";
|
||||||
|
import { pokemonInfo } from "#app/locales/en/pokemon-info";
|
||||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||||
import { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
import { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||||
import { Ability, allAbilities } from "#app/data/ability";
|
|
||||||
import { speciesStarters } from "#app/data/pokemon-species";
|
|
||||||
import { AbilityAttr } from "#app/system/game-data";
|
import { AbilityAttr } from "#app/system/game-data";
|
||||||
import { Stat } from "#app/data/pokemon-stat";
|
import PokemonData from "#app/system/pokemon-data";
|
||||||
import { pokemonInfo } from "#app/locales/en/pokemon-info";
|
import { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||||
|
import { randSeedShuffle } from "#app/utils";
|
||||||
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
|
import BattleScene from "../../../battle-scene";
|
||||||
|
import MysteryEncounter, { MysteryEncounterBuilder, MysteryEncounterTier } from "../mystery-encounter";
|
||||||
|
import { MysteryEncounterOptionBuilder } from "../mystery-encounter-option";
|
||||||
|
|
||||||
export const TrainingSessionEncounter: MysteryEncounter = MysteryEncounterBuilder
|
export const TrainingSessionEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||||
.withEncounterType(MysteryEncounterType.TRAINING_SESSION)
|
.withEncounterType(MysteryEncounterType.TRAINING_SESSION)
|
||||||
@ -35,7 +34,7 @@ export const TrainingSessionEncounter: MysteryEncounter = MysteryEncounterBuilde
|
|||||||
y: 3
|
y: 3
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
.withSceneRequirement(new WaveCountRequirement([10, 180])) // waves 10 to 180
|
.withSceneWaveRangeRequirement(10, 180) // waves 10 to 180
|
||||||
.withHideWildIntroMessage(true)
|
.withHideWildIntroMessage(true)
|
||||||
.withOption(new MysteryEncounterOptionBuilder()
|
.withOption(new MysteryEncounterOptionBuilder()
|
||||||
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
.withPreOptionPhase(async (scene: BattleScene): Promise<boolean> => {
|
||||||
|
@ -71,7 +71,7 @@ export class PreviousEncounterRequirement extends EncounterSceneRequirement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class WaveCountRequirement extends EncounterSceneRequirement {
|
export class WaveRangeRequirement extends EncounterSceneRequirement {
|
||||||
waveRange: [number, number];
|
waveRange: [number, number];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -7,7 +7,8 @@ import MysteryEncounterDialogue, {
|
|||||||
import MysteryEncounterOption from "./mystery-encounter-option";
|
import MysteryEncounterOption from "./mystery-encounter-option";
|
||||||
import {
|
import {
|
||||||
EncounterPokemonRequirement,
|
EncounterPokemonRequirement,
|
||||||
EncounterSceneRequirement
|
EncounterSceneRequirement,
|
||||||
|
WaveRangeRequirement
|
||||||
} from "./mystery-encounter-requirements";
|
} from "./mystery-encounter-requirements";
|
||||||
import * as Utils from "../../utils";
|
import * as Utils from "../../utils";
|
||||||
import { EnemyPartyConfig } from "#app/data/mystery-encounters/mystery-encounter-utils";
|
import { EnemyPartyConfig } from "#app/data/mystery-encounters/mystery-encounter-utils";
|
||||||
@ -430,6 +431,17 @@ export class MysteryEncounterBuilder implements Partial<MysteryEncounter> {
|
|||||||
return Object.assign(this, { requirements: this.requirements });
|
return Object.assign(this, { requirements: this.requirements });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specifies a wave range requirement for an encounter.
|
||||||
|
*
|
||||||
|
* @param min min wave (or exact wave if only min is given)
|
||||||
|
* @param max optional max wave. If not given, defaults to min => exact wave
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
withSceneWaveRangeRequirement(min: number, max?: number) {
|
||||||
|
return this.withSceneRequirement(new WaveRangeRequirement([min, max ?? min]));
|
||||||
|
}
|
||||||
|
|
||||||
withPrimaryPokemonRequirement(requirement: EncounterPokemonRequirement): this & Required<Pick<MysteryEncounter, "primaryPokemonRequirements">> {
|
withPrimaryPokemonRequirement(requirement: EncounterPokemonRequirement): this & Required<Pick<MysteryEncounter, "primaryPokemonRequirements">> {
|
||||||
this.primaryPokemonRequirements.push(requirement);
|
this.primaryPokemonRequirements.push(requirement);
|
||||||
return Object.assign(this, { primaryPokemonRequirements: this.primaryPokemonRequirements });
|
return Object.assign(this, { primaryPokemonRequirements: this.primaryPokemonRequirements });
|
||||||
|
Loading…
Reference in New Issue
Block a user