mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-05-07 17:05:18 +01:00
update requested changes from xavion
This commit is contained in:
parent
680578acbe
commit
a929975a6d
@ -17,7 +17,6 @@ import { pokemonEvolutions } from "./pokemon-evolutions";
|
|||||||
import { pokemonFormChanges } from "./pokemon-forms";
|
import { pokemonFormChanges } from "./pokemon-forms";
|
||||||
import { Arena } from "#app/field/arena";
|
import { Arena } from "#app/field/arena";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
import { ArenaTagSide } from "./arena-tag";
|
|
||||||
|
|
||||||
/** A constant for the default max cost of the starting party before a run */
|
/** A constant for the default max cost of the starting party before a run */
|
||||||
const DEFAULT_PARTY_MAX_COST = 10;
|
const DEFAULT_PARTY_MAX_COST = 10;
|
||||||
@ -347,12 +346,9 @@ export abstract class Challenge {
|
|||||||
/**
|
/**
|
||||||
* An apply function for ARENA_TAG challenges. Derived classes should alter this.
|
* An apply function for ARENA_TAG challenges. Derived classes should alter this.
|
||||||
* @param arena {@link Arena} The arena to apply the tag to.
|
* @param arena {@link Arena} The arena to apply the tag to.
|
||||||
* @param arenaTag {@link ArenaTagType} The arena tag to apply.
|
|
||||||
* @param turnCount {@link Number} The amount of turns the tag should last.
|
|
||||||
* @param side {@link ArenaTagSide} The side to apply the tag to. (optional)
|
|
||||||
* @returns {@link boolean} Whether this function did anything.
|
* @returns {@link boolean} Whether this function did anything.
|
||||||
*/
|
*/
|
||||||
applyArenaTag(arena: Arena, arenaTag: ArenaTagType, turnCount: Number, side?: ArenaTagSide): boolean {
|
applyArenaTag(arena: Arena): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -740,17 +736,12 @@ export class TrickRoomChallenge extends Challenge {
|
|||||||
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Trick_Room_(move)}
|
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Trick_Room_(move)}
|
||||||
*
|
*
|
||||||
* @param arena {@link Arena} The arena to apply the tag to.
|
* @param arena {@link Arena} The arena to apply the tag to.
|
||||||
* @param arenaTag {@link ArenaTagType} The arena tag to apply.
|
|
||||||
* @param turnCount {@link Number} The amount of turns the tag should last.
|
|
||||||
* @returns `true` if any challenge was successfully applied.
|
* @returns `true` if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
override applyArenaTag(arena: Arena, arenaTag: ArenaTagType, turnCount: Number): boolean {
|
override applyArenaTag(arena: Arena): boolean {
|
||||||
if (arenaTag === ArenaTagType.TRICK_ROOM) {
|
arena.addTag(ArenaTagType.TRICK_ROOM, Number.POSITIVE_INFINITY, undefined, -1);
|
||||||
arena.addTag(ArenaTagType.TRICK_ROOM, turnCount.valueOf(), undefined, -1);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -885,12 +876,9 @@ export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType
|
|||||||
* @param gameMode The current {@linkcode GameMode}
|
* @param gameMode The current {@linkcode GameMode}
|
||||||
* @param challengeType {@linkcode ChallengeType.ARENA_TAG}
|
* @param challengeType {@linkcode ChallengeType.ARENA_TAG}
|
||||||
* @param arena {@linkcode Arena} The arena to apply the tag to.
|
* @param arena {@linkcode Arena} The arena to apply the tag to.
|
||||||
* @param arenaTag {@linkcode ArenaTagType} The arena tag to apply.
|
|
||||||
* @param turnCount {@linkcode Number} The amount of turns the tag should last.
|
|
||||||
* @param side {@linkcode ArenaTagSide} The side to apply the tag to. (optional)
|
|
||||||
* @returns `true` if any challenge was successfully applied.
|
* @returns `true` if any challenge was successfully applied.
|
||||||
*/
|
*/
|
||||||
export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType.ARENA_TAG, arena: Arena, arenaTag: ArenaTagType, turnCount: Number, side?: ArenaTagSide): boolean;
|
export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType.ARENA_TAG, arena: Arena): boolean;
|
||||||
/**
|
/**
|
||||||
* Apply all challenges that modify what level AI are.
|
* Apply all challenges that modify what level AI are.
|
||||||
* @param gameMode {@link GameMode} The current gameMode
|
* @param gameMode {@link GameMode} The current gameMode
|
||||||
@ -976,7 +964,7 @@ export function applyChallenges(gameMode: GameMode, challengeType: ChallengeType
|
|||||||
ret ||= c.applyTypeEffectiveness(args[0]);
|
ret ||= c.applyTypeEffectiveness(args[0]);
|
||||||
break;
|
break;
|
||||||
case ChallengeType.ARENA_TAG:
|
case ChallengeType.ARENA_TAG:
|
||||||
ret ||= c.applyArenaTag(args[0], args[1], args[2], args[3]);
|
ret ||= c.applyArenaTag(args[0]);
|
||||||
break;
|
break;
|
||||||
case ChallengeType.AI_LEVEL:
|
case ChallengeType.AI_LEVEL:
|
||||||
ret ||= c.applyLevelChange(args[0], args[1], args[2], args[3]);
|
ret ||= c.applyLevelChange(args[0], args[1], args[2], args[3]);
|
||||||
|
@ -36,7 +36,6 @@ import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
|||||||
import { getGoldenBugNetSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
import { getGoldenBugNetSpecies } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||||
import { Biome } from "#enums/biome";
|
import { Biome } from "#enums/biome";
|
||||||
import { applyChallenges, ChallengeType } from "#app/data/challenge";
|
import { applyChallenges, ChallengeType } from "#app/data/challenge";
|
||||||
import { ArenaTagType } from "#app/enums/arena-tag-type";
|
|
||||||
|
|
||||||
export class EncounterPhase extends BattlePhase {
|
export class EncounterPhase extends BattlePhase {
|
||||||
private loaded: boolean;
|
private loaded: boolean;
|
||||||
@ -427,7 +426,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
applyChallenges(this.scene.gameMode, ChallengeType.ARENA_TAG, this.scene.arena, ArenaTagType.TRICK_ROOM, Number.POSITIVE_INFINITY);
|
applyChallenges(this.scene.gameMode, ChallengeType.ARENA_TAG, this.scene.arena);
|
||||||
}
|
}
|
||||||
|
|
||||||
end() {
|
end() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user