mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-10 18:32:16 +02:00
Merge branch 'beta' into update-phaser
This commit is contained in:
commit
d1c7f210c0
@ -1 +1 @@
|
|||||||
Subproject commit e98f0eb9c2022bc78b53f0444424c636498e725a
|
Subproject commit 18c1963ef309612a5a7fef76f9879709a7202189
|
@ -1394,9 +1394,9 @@ export default class BattleScene extends SceneBase {
|
|||||||
if (double === undefined && newWaveIndex > 1) {
|
if (double === undefined && newWaveIndex > 1) {
|
||||||
if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) {
|
if (newBattleType === BattleType.WILD && !this.gameMode.isWaveFinal(newWaveIndex)) {
|
||||||
newDouble = !randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField));
|
newDouble = !randSeedInt(this.getDoubleBattleChance(newWaveIndex, playerField));
|
||||||
|
} else if (newBattleType === BattleType.TRAINER) {
|
||||||
|
newDouble = newTrainer?.variant === TrainerVariant.DOUBLE;
|
||||||
}
|
}
|
||||||
} else if (double === undefined && newBattleType === BattleType.TRAINER) {
|
|
||||||
newDouble = newTrainer?.variant === TrainerVariant.DOUBLE;
|
|
||||||
} else if (!battleConfig) {
|
} else if (!battleConfig) {
|
||||||
newDouble = !!double;
|
newDouble = !!double;
|
||||||
}
|
}
|
||||||
|
@ -31,29 +31,7 @@ import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
|||||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { BattleType } from "#enums/battle-type";
|
import { BattleType } from "#enums/battle-type";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
export enum ClassicFixedBossWaves {
|
|
||||||
TOWN_YOUNGSTER = 5,
|
|
||||||
RIVAL_1 = 8,
|
|
||||||
RIVAL_2 = 25,
|
|
||||||
EVIL_GRUNT_1 = 35,
|
|
||||||
RIVAL_3 = 55,
|
|
||||||
EVIL_GRUNT_2 = 62,
|
|
||||||
EVIL_GRUNT_3 = 64,
|
|
||||||
EVIL_ADMIN_1 = 66,
|
|
||||||
RIVAL_4 = 95,
|
|
||||||
EVIL_GRUNT_4 = 112,
|
|
||||||
EVIL_ADMIN_2 = 114,
|
|
||||||
EVIL_BOSS_1 = 115,
|
|
||||||
RIVAL_5 = 145,
|
|
||||||
EVIL_BOSS_2 = 165,
|
|
||||||
ELITE_FOUR_1 = 182,
|
|
||||||
ELITE_FOUR_2 = 184,
|
|
||||||
ELITE_FOUR_3 = 186,
|
|
||||||
ELITE_FOUR_4 = 188,
|
|
||||||
CHAMPION = 190,
|
|
||||||
RIVAL_6 = 195,
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum BattlerIndex {
|
export enum BattlerIndex {
|
||||||
ATTACKER = -1,
|
ATTACKER = -1,
|
||||||
|
@ -7227,7 +7227,7 @@ export function initAbilities() {
|
|||||||
new Ability(Abilities.CURIOUS_MEDICINE, 8)
|
new Ability(Abilities.CURIOUS_MEDICINE, 8)
|
||||||
.attr(PostSummonClearAllyStatStagesAbAttr),
|
.attr(PostSummonClearAllyStatStagesAbAttr),
|
||||||
new Ability(Abilities.TRANSISTOR, 8)
|
new Ability(Abilities.TRANSISTOR, 8)
|
||||||
.attr(MoveTypePowerBoostAbAttr, PokemonType.ELECTRIC),
|
.attr(MoveTypePowerBoostAbAttr, PokemonType.ELECTRIC, 1.3),
|
||||||
new Ability(Abilities.DRAGONS_MAW, 8)
|
new Ability(Abilities.DRAGONS_MAW, 8)
|
||||||
.attr(MoveTypePowerBoostAbAttr, PokemonType.DRAGON),
|
.attr(MoveTypePowerBoostAbAttr, PokemonType.DRAGON),
|
||||||
new Ability(Abilities.CHILLING_NEIGH, 8)
|
new Ability(Abilities.CHILLING_NEIGH, 8)
|
||||||
@ -7412,4 +7412,4 @@ export function initAbilities() {
|
|||||||
.unreplaceable() // TODO is this true?
|
.unreplaceable() // TODO is this true?
|
||||||
.attr(ConfusionOnStatusEffectAbAttr, StatusEffect.POISON, StatusEffect.TOXIC)
|
.attr(ConfusionOnStatusEffectAbAttr, StatusEffect.POISON, StatusEffect.TOXIC)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,8 @@ import { speciesStarterCosts } from "#app/data/balance/starters";
|
|||||||
import type Pokemon from "#app/field/pokemon";
|
import type Pokemon from "#app/field/pokemon";
|
||||||
import { PokemonMove } from "#app/field/pokemon";
|
import { PokemonMove } from "#app/field/pokemon";
|
||||||
import type { FixedBattleConfig } from "#app/battle";
|
import type { FixedBattleConfig } from "#app/battle";
|
||||||
import { ClassicFixedBossWaves, getRandomTrainerFunc } from "#app/battle";
|
import { getRandomTrainerFunc } from "#app/battle";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import { BattleType } from "#enums/battle-type";
|
import { BattleType } from "#enums/battle-type";
|
||||||
import Trainer, { TrainerVariant } from "#app/field/trainer";
|
import Trainer, { TrainerVariant } from "#app/field/trainer";
|
||||||
import { PokemonType } from "#enums/pokemon-type";
|
import { PokemonType } from "#enums/pokemon-type";
|
||||||
|
@ -2459,14 +2459,7 @@ export class StatusEffectAttr extends MoveEffectAttr {
|
|||||||
const statusCheck = moveChance < 0 || moveChance === 100 || user.randSeedInt(100) < moveChance;
|
const statusCheck = moveChance < 0 || moveChance === 100 || user.randSeedInt(100) < moveChance;
|
||||||
if (statusCheck) {
|
if (statusCheck) {
|
||||||
const pokemon = this.selfTarget ? user : target;
|
const pokemon = this.selfTarget ? user : target;
|
||||||
if (pokemon.status && !this.overrideStatus) {
|
if (user !== target && move.category === MoveCategory.STATUS && !target.canSetStatus(this.effect, false, false, user, true)) {
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (user !== target && target.isSafeguarded(user)) {
|
|
||||||
if (move.category === MoveCategory.STATUS) {
|
|
||||||
globalScene.queueMessage(i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(target) }));
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (((!pokemon.status || this.overrideStatus) || (pokemon.status.effect === this.effect && moveChance < 0))
|
if (((!pokemon.status || this.overrideStatus) || (pokemon.status.effect === this.effect && moveChance < 0))
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { startingWave } from "#app/starting-wave";
|
import { startingWave } from "#app/starting-wave";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||||
|
import { GameModes } from "#app/game-mode";
|
||||||
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
|
|
||||||
export class TrainerPartyTemplate {
|
export class TrainerPartyTemplate {
|
||||||
public size: number;
|
public size: number;
|
||||||
@ -222,19 +224,18 @@ export const trainerPartyTemplates = {
|
|||||||
*/
|
*/
|
||||||
export function getEvilGruntPartyTemplate(): TrainerPartyTemplate {
|
export function getEvilGruntPartyTemplate(): TrainerPartyTemplate {
|
||||||
const waveIndex = globalScene.currentBattle?.waveIndex;
|
const waveIndex = globalScene.currentBattle?.waveIndex;
|
||||||
if (waveIndex < 40) {
|
switch (waveIndex) {
|
||||||
return trainerPartyTemplates.TWO_AVG;
|
case ClassicFixedBossWaves.EVIL_GRUNT_1:
|
||||||
|
return trainerPartyTemplates.TWO_AVG;
|
||||||
|
case ClassicFixedBossWaves.EVIL_GRUNT_2:
|
||||||
|
return trainerPartyTemplates.THREE_AVG;
|
||||||
|
case ClassicFixedBossWaves.EVIL_GRUNT_3:
|
||||||
|
return trainerPartyTemplates.TWO_AVG_ONE_STRONG;
|
||||||
|
case ClassicFixedBossWaves.EVIL_ADMIN_1:
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_4; // 3avg 1 strong 1 stronger
|
||||||
|
default:
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger
|
||||||
}
|
}
|
||||||
if (waveIndex < 63) {
|
|
||||||
return trainerPartyTemplates.THREE_AVG;
|
|
||||||
}
|
|
||||||
if (waveIndex < 65) {
|
|
||||||
return trainerPartyTemplates.TWO_AVG_ONE_STRONG;
|
|
||||||
}
|
|
||||||
if (waveIndex < 112) {
|
|
||||||
return trainerPartyTemplates.GYM_LEADER_4; // 3avg 1 strong 1 stronger
|
|
||||||
}
|
|
||||||
return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getWavePartyTemplate(...templates: TrainerPartyTemplate[]) {
|
export function getWavePartyTemplate(...templates: TrainerPartyTemplate[]) {
|
||||||
@ -245,11 +246,36 @@ export function getWavePartyTemplate(...templates: TrainerPartyTemplate[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getGymLeaderPartyTemplate() {
|
export function getGymLeaderPartyTemplate() {
|
||||||
return getWavePartyTemplate(
|
const { currentBattle, gameMode } = globalScene;
|
||||||
trainerPartyTemplates.GYM_LEADER_1,
|
switch (gameMode.modeId) {
|
||||||
trainerPartyTemplates.GYM_LEADER_2,
|
case GameModes.DAILY:
|
||||||
trainerPartyTemplates.GYM_LEADER_3,
|
if (currentBattle?.waveIndex <= 20) {
|
||||||
trainerPartyTemplates.GYM_LEADER_4,
|
return trainerPartyTemplates.GYM_LEADER_2
|
||||||
trainerPartyTemplates.GYM_LEADER_5,
|
}
|
||||||
);
|
return trainerPartyTemplates.GYM_LEADER_3;
|
||||||
|
case GameModes.CHALLENGE: // In the future, there may be a ChallengeType to call here. For now, use classic's.
|
||||||
|
case GameModes.CLASSIC:
|
||||||
|
if (currentBattle?.waveIndex <= 20) {
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_1; // 1 avg 1 strong
|
||||||
|
}
|
||||||
|
else if (currentBattle?.waveIndex <= 30) {
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_2; // 1 avg 1 strong 1 stronger
|
||||||
|
}
|
||||||
|
else if (currentBattle?.waveIndex <= 60) { // 50 and 60
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_3; // 2 avg 1 strong 1 stronger
|
||||||
|
}
|
||||||
|
else if (currentBattle?.waveIndex <= 90) { // 80 and 90
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_4; // 3 avg 1 strong 1 stronger
|
||||||
|
}
|
||||||
|
// 110+
|
||||||
|
return trainerPartyTemplates.GYM_LEADER_5; // 3 avg 2 strong 1 stronger
|
||||||
|
default:
|
||||||
|
return getWavePartyTemplate(
|
||||||
|
trainerPartyTemplates.GYM_LEADER_1,
|
||||||
|
trainerPartyTemplates.GYM_LEADER_2,
|
||||||
|
trainerPartyTemplates.GYM_LEADER_3,
|
||||||
|
trainerPartyTemplates.GYM_LEADER_4,
|
||||||
|
trainerPartyTemplates.GYM_LEADER_5,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
22
src/enums/fixed-boss-waves.ts
Normal file
22
src/enums/fixed-boss-waves.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
export enum ClassicFixedBossWaves {
|
||||||
|
TOWN_YOUNGSTER = 5,
|
||||||
|
RIVAL_1 = 8,
|
||||||
|
RIVAL_2 = 25,
|
||||||
|
EVIL_GRUNT_1 = 35,
|
||||||
|
RIVAL_3 = 55,
|
||||||
|
EVIL_GRUNT_2 = 62,
|
||||||
|
EVIL_GRUNT_3 = 64,
|
||||||
|
EVIL_ADMIN_1 = 66,
|
||||||
|
RIVAL_4 = 95,
|
||||||
|
EVIL_GRUNT_4 = 112,
|
||||||
|
EVIL_ADMIN_2 = 114,
|
||||||
|
EVIL_BOSS_1 = 115,
|
||||||
|
RIVAL_5 = 145,
|
||||||
|
EVIL_BOSS_2 = 165,
|
||||||
|
ELITE_FOUR_1 = 182,
|
||||||
|
ELITE_FOUR_2 = 184,
|
||||||
|
ELITE_FOUR_3 = 186,
|
||||||
|
ELITE_FOUR_4 = 188,
|
||||||
|
CHAMPION = 190,
|
||||||
|
RIVAL_6 = 195
|
||||||
|
}
|
@ -248,6 +248,7 @@ import { PLAYER_PARTY_MAX_SIZE } from "#app/constants";
|
|||||||
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
||||||
import { SwitchType } from "#enums/switch-type";
|
import { SwitchType } from "#enums/switch-type";
|
||||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||||
|
import {getStatusEffectOverlapText } from "#app/data/status-effect";
|
||||||
import {
|
import {
|
||||||
BASE_HIDDEN_ABILITY_CHANCE,
|
BASE_HIDDEN_ABILITY_CHANCE,
|
||||||
BASE_SHINY_CHANCE,
|
BASE_SHINY_CHANCE,
|
||||||
@ -5364,6 +5365,18 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
queueImmuneMessage(quiet: boolean, effect?: StatusEffect): void {
|
||||||
|
if (!effect || quiet) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const message = effect && this.status?.effect === effect
|
||||||
|
? getStatusEffectOverlapText(effect ?? StatusEffect.NONE, getPokemonNameWithAffix(this))
|
||||||
|
: i18next.t("abilityTriggers:moveImmunity", {
|
||||||
|
pokemonNameWithAffix: getPokemonNameWithAffix(this),
|
||||||
|
});
|
||||||
|
globalScene.queueMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a status effect can be applied to the Pokemon.
|
* Checks if a status effect can be applied to the Pokemon.
|
||||||
*
|
*
|
||||||
@ -5382,6 +5395,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
): boolean {
|
): boolean {
|
||||||
if (effect !== StatusEffect.FAINT) {
|
if (effect !== StatusEffect.FAINT) {
|
||||||
if (overrideStatus ? this.status?.effect === effect : this.status) {
|
if (overrideStatus ? this.status?.effect === effect : this.status) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@ -5389,18 +5403,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
!ignoreField &&
|
!ignoreField &&
|
||||||
globalScene.arena.terrain?.terrainType === TerrainType.MISTY
|
globalScene.arena.terrain?.terrainType === TerrainType.MISTY
|
||||||
) {
|
) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
|
||||||
sourcePokemon &&
|
|
||||||
sourcePokemon !== this &&
|
|
||||||
this.isSafeguarded(sourcePokemon)
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const types = this.getTypes(true, true);
|
const types = this.getTypes(true, true);
|
||||||
|
|
||||||
switch (effect) {
|
switch (effect) {
|
||||||
@ -5429,17 +5436,19 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) {
|
if (this.isOfType(PokemonType.POISON) || this.isOfType(PokemonType.STEEL)) {
|
||||||
if (poisonImmunity.includes(true)) {
|
if (poisonImmunity.includes(true)) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StatusEffect.PARALYSIS:
|
case StatusEffect.PARALYSIS:
|
||||||
if (this.isOfType(PokemonType.ELECTRIC)) {
|
if (this.isOfType(PokemonType.ELECTRIC)) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5448,6 +5457,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
this.isGrounded() &&
|
this.isGrounded() &&
|
||||||
globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC
|
globalScene.arena.terrain?.terrainType === TerrainType.ELECTRIC
|
||||||
) {
|
) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5460,11 +5470,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
globalScene.arena.weather.weatherType,
|
globalScene.arena.weather.weatherType,
|
||||||
))
|
))
|
||||||
) {
|
) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case StatusEffect.BURN:
|
case StatusEffect.BURN:
|
||||||
if (this.isOfType(PokemonType.FIRE)) {
|
if (this.isOfType(PokemonType.FIRE)) {
|
||||||
|
this.queueImmuneMessage(quiet, effect);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -5499,6 +5511,19 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
sourcePokemon &&
|
||||||
|
sourcePokemon !== this &&
|
||||||
|
this.isSafeguarded(sourcePokemon)
|
||||||
|
) {
|
||||||
|
if(!quiet){
|
||||||
|
globalScene.queueMessage(
|
||||||
|
i18next.t("moveTriggers:safeguard", { targetName: getPokemonNameWithAffix(this)
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5510,7 +5535,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
sourceText: string | null = null,
|
sourceText: string | null = null,
|
||||||
overrideStatus?: boolean
|
overrideStatus?: boolean
|
||||||
): boolean {
|
): boolean {
|
||||||
if (!this.canSetStatus(effect, asPhase, overrideStatus, sourcePokemon)) {
|
if (!this.canSetStatus(effect, false, overrideStatus, sourcePokemon)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isFainted() && effect !== StatusEffect.FAINT) {
|
if (this.isFainted() && effect !== StatusEffect.FAINT) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { BattlerIndex } from "#app/battle";
|
import type { BattlerIndex } from "#app/battle";
|
||||||
import { ClassicFixedBossWaves } from "#app/battle";
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import { BattleType } from "#enums/battle-type";
|
import { BattleType } from "#enums/battle-type";
|
||||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
|
@ -163,6 +163,7 @@ describe("Moves - Whirlwind", () => {
|
|||||||
|
|
||||||
it("should not pull in the other trainer's pokemon in a partner trainer battle", async () => {
|
it("should not pull in the other trainer's pokemon in a partner trainer battle", async () => {
|
||||||
game.override
|
game.override
|
||||||
|
.startingWave(2)
|
||||||
.battleType(BattleType.TRAINER)
|
.battleType(BattleType.TRAINER)
|
||||||
.randomTrainer({
|
.randomTrainer({
|
||||||
trainerType: TrainerType.BREEDER,
|
trainerType: TrainerType.BREEDER,
|
||||||
|
Loading…
Reference in New Issue
Block a user