mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-21 14:59:26 +02:00
Apply code review suggestions
This commit is contained in:
parent
6982f34f9a
commit
6a244e6c69
@ -164,9 +164,9 @@ export const DarkDealEncounter: MysteryEncounter =
|
||||
// Start encounter with random legendary (7-10 starter strength) that has level additive
|
||||
// If this is a mono-type challenge, always ensure the required type is filtered for
|
||||
let bossTypes: Type[] = encounter.misc.removedTypes;
|
||||
const singleTypeChallenges = scene.gameMode.challenges.filter(c => c.id === Challenges.SINGLE_TYPE);
|
||||
const singleTypeChallenges = scene.gameMode.challenges.filter(c => c.value && c.id === Challenges.SINGLE_TYPE);
|
||||
if (scene.gameMode.isChallenge && singleTypeChallenges.length > 0) {
|
||||
bossTypes = singleTypeChallenges.map(c => c.value as Type);
|
||||
bossTypes = singleTypeChallenges.map(c => (c.value - 1) as Type);
|
||||
}
|
||||
|
||||
const bossModifiers: PokemonHeldItemModifier[] = encounter.misc.modifiers;
|
||||
|
@ -199,7 +199,7 @@ export const DelibirdyEncounter: MysteryEncounter =
|
||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||
const modifier: BerryModifier | HealingBoosterModifier = encounter.misc.chosenModifier;
|
||||
|
||||
// Give the player a Candy Jar if they gave a Berry, and a Healing Charm for Reviver Seed
|
||||
// Give the player a Candy Jar if they gave a Berry, and a Berry Pouch for Reviver Seed
|
||||
if (modifier instanceof BerryModifier) {
|
||||
// Check if the player has max stacks of that Candy Jar already
|
||||
const existing = scene.findModifier(m => m instanceof LevelIncrementBoosterModifier) as LevelIncrementBoosterModifier;
|
||||
@ -214,7 +214,7 @@ export const DelibirdyEncounter: MysteryEncounter =
|
||||
scene.unshiftPhase(new ModifierRewardPhase(scene, modifierTypes.CANDY_JAR));
|
||||
}
|
||||
} else {
|
||||
// Check if the player has max stacks of that Healing Charm already
|
||||
// Check if the player has max stacks of that Berry Pouch already
|
||||
const existing = scene.findModifier(m => m instanceof PreserveBerryModifier) as PreserveBerryModifier;
|
||||
|
||||
if (existing && existing.getStackCount() >= existing.getMaxStackCount(scene)) {
|
||||
|
@ -71,7 +71,7 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
||||
gender: Gender.MALE,
|
||||
tags: [ BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON ],
|
||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.SPDEF, Stat.SPD ], 2));
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.SPDEF, Stat.SPD ], 1));
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -80,7 +80,7 @@ export const FieryFalloutEncounter: MysteryEncounter =
|
||||
gender: Gender.FEMALE,
|
||||
tags: [ BattlerTagType.MYSTERY_ENCOUNTER_POST_SUMMON ],
|
||||
mysteryEncounterBattleEffects: (pokemon: Pokemon) => {
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.SPDEF, Stat.SPD ], 2));
|
||||
pokemon.scene.unshiftPhase(new StatStageChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ Stat.SPDEF, Stat.SPD ], 1));
|
||||
}
|
||||
}
|
||||
],
|
||||
@ -259,9 +259,14 @@ function giveLeadPokemonAttackTypeBoostItem(scene: BattleScene) {
|
||||
// Give first party pokemon attack type boost item for free at end of battle
|
||||
const leadPokemon = scene.getParty()?.[0];
|
||||
if (leadPokemon) {
|
||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||
const boosterModifierType = generateModifierType(scene, modifierTypes.ATTACK_TYPE_BOOSTER) as AttackTypeBoosterModifierType;
|
||||
// Generate type booster held item, default to Charcoal if item fails to generate
|
||||
let boosterModifierType = generateModifierType(scene, modifierTypes.ATTACK_TYPE_BOOSTER) as AttackTypeBoosterModifierType;
|
||||
if (!boosterModifierType) {
|
||||
boosterModifierType = generateModifierType(scene, modifierTypes.ATTACK_TYPE_BOOSTER, [ Type.FIRE ]) as AttackTypeBoosterModifierType;
|
||||
}
|
||||
applyModifierTypeToPlayerPokemon(scene, leadPokemon, boosterModifierType);
|
||||
|
||||
const encounter = scene.currentBattle.mysteryEncounter!;
|
||||
encounter.setDialogueToken("itemName", boosterModifierType.name);
|
||||
encounter.setDialogueToken("leadPokemon", leadPokemon.getNameToRender());
|
||||
queueEncounterMessage(scene, `${namespace}:found_item`);
|
||||
|
@ -130,5 +130,8 @@ export const FIRE_RESISTANT_ABILITIES = [
|
||||
Abilities.THERMAL_EXCHANGE,
|
||||
Abilities.THICK_FAT,
|
||||
Abilities.WATER_BUBBLE,
|
||||
Abilities.MAGMA_ARMOR
|
||||
Abilities.MAGMA_ARMOR,
|
||||
Abilities.WATER_VEIL,
|
||||
Abilities.STEAM_ENGINE,
|
||||
Abilities.PRIMORDIAL_SEA
|
||||
];
|
||||
|
@ -276,7 +276,7 @@ export class SelectModifierPhase extends BattlePhase {
|
||||
multiplier = this.customModifierSettings.rerollMultiplier;
|
||||
}
|
||||
|
||||
const baseMultiplier = Math.min(Math.ceil(this.scene.currentBattle.waveIndex / 10) * baseValue * (this.rerollCount ** 2) * multiplier, Number.MAX_SAFE_INTEGER);
|
||||
const baseMultiplier = Math.min(Math.ceil(this.scene.currentBattle.waveIndex / 10) * baseValue * (2 ** this.rerollCount) * multiplier, Number.MAX_SAFE_INTEGER);
|
||||
|
||||
// Apply Black Sludge to reroll cost
|
||||
const modifiedRerollCost = new NumberHolder(baseMultiplier);
|
||||
|
@ -116,6 +116,8 @@ export default class PokemonData {
|
||||
|
||||
this.customPokemonData = new CustomPokemonData(source.customPokemonData);
|
||||
|
||||
// Deprecated, but needed for session data migration
|
||||
this.natureOverride = source.natureOverride;
|
||||
this.mysteryEncounterPokemonData = new CustomPokemonData(source.mysteryEncounterPokemonData);
|
||||
this.fusionMysteryEncounterPokemonData = new CustomPokemonData(source.fusionMysteryEncounterPokemonData);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user