mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 23:13:42 +02:00
Merge e381be7dc9
into 8d5ba221d8
This commit is contained in:
commit
f65dd28897
@ -299,7 +299,11 @@ export class BattleScene extends SceneBase {
|
|||||||
public seed: string;
|
public seed: string;
|
||||||
public waveSeed: string;
|
public waveSeed: string;
|
||||||
public waveCycleOffset: number;
|
public waveCycleOffset: number;
|
||||||
public offsetGym: boolean;
|
/**
|
||||||
|
* Whether to offset Gym Leader waves by 10 (30, 50, 70 instead of 20, 40, 60).
|
||||||
|
* Determined at the start of the run, and is unused for non-Classic game modes.
|
||||||
|
*/
|
||||||
|
public offsetGym = false;
|
||||||
|
|
||||||
public damageNumberHandler: DamageNumberHandler;
|
public damageNumberHandler: DamageNumberHandler;
|
||||||
private spriteSparkleHandler: PokemonSpriteSparkleHandler;
|
private spriteSparkleHandler: PokemonSpriteSparkleHandler;
|
||||||
|
@ -543,22 +543,24 @@ export class Arena {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getTimeOfDay(): TimeOfDay {
|
public getTimeOfDay(): TimeOfDay {
|
||||||
switch (this.biomeType) {
|
switch (this.biomeType) {
|
||||||
case BiomeId.ABYSS:
|
case BiomeId.ABYSS:
|
||||||
return TimeOfDay.NIGHT;
|
return TimeOfDay.NIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
const waveCycle = ((globalScene.currentBattle?.waveIndex || 0) + globalScene.waveCycleOffset) % 40;
|
if (Overrides.TIME_OF_DAY_OVERRIDE != null) {
|
||||||
|
return Overrides.TIME_OF_DAY_OVERRIDE;
|
||||||
|
}
|
||||||
|
|
||||||
|
const waveCycle = ((globalScene.currentBattle?.waveIndex ?? 0) + globalScene.waveCycleOffset) % 40;
|
||||||
|
|
||||||
if (waveCycle < 15) {
|
if (waveCycle < 15) {
|
||||||
return TimeOfDay.DAY;
|
return TimeOfDay.DAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (waveCycle < 20) {
|
if (waveCycle < 20) {
|
||||||
return TimeOfDay.DUSK;
|
return TimeOfDay.DUSK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (waveCycle < 35) {
|
if (waveCycle < 35) {
|
||||||
return TimeOfDay.NIGHT;
|
return TimeOfDay.NIGHT;
|
||||||
}
|
}
|
||||||
@ -566,6 +568,10 @@ export class Arena {
|
|||||||
return TimeOfDay.DAWN;
|
return TimeOfDay.DAWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @returns Whether the current biome takes place "outdoors"
|
||||||
|
* (for the purposes of time of day tints)
|
||||||
|
*/
|
||||||
isOutside(): boolean {
|
isOutside(): boolean {
|
||||||
switch (this.biomeType) {
|
switch (this.biomeType) {
|
||||||
case BiomeId.SEABED:
|
case BiomeId.SEABED:
|
||||||
@ -584,23 +590,7 @@ export class Arena {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
overrideTint(): [number, number, number] {
|
|
||||||
switch (Overrides.ARENA_TINT_OVERRIDE) {
|
|
||||||
case TimeOfDay.DUSK:
|
|
||||||
return [98, 48, 73].map(c => Math.round((c + 128) / 2)) as [number, number, number];
|
|
||||||
case TimeOfDay.NIGHT:
|
|
||||||
return [64, 64, 64];
|
|
||||||
case TimeOfDay.DAWN:
|
|
||||||
case TimeOfDay.DAY:
|
|
||||||
default:
|
|
||||||
return [128, 128, 128];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
getDayTint(): [number, number, number] {
|
getDayTint(): [number, number, number] {
|
||||||
if (Overrides.ARENA_TINT_OVERRIDE !== null) {
|
|
||||||
return this.overrideTint();
|
|
||||||
}
|
|
||||||
switch (this.biomeType) {
|
switch (this.biomeType) {
|
||||||
case BiomeId.ABYSS:
|
case BiomeId.ABYSS:
|
||||||
return [64, 64, 64];
|
return [64, 64, 64];
|
||||||
@ -610,23 +600,14 @@ export class Arena {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDuskTint(): [number, number, number] {
|
getDuskTint(): [number, number, number] {
|
||||||
if (Overrides.ARENA_TINT_OVERRIDE) {
|
|
||||||
return this.overrideTint();
|
|
||||||
}
|
|
||||||
if (!this.isOutside()) {
|
if (!this.isOutside()) {
|
||||||
return [0, 0, 0];
|
return [0, 0, 0];
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (this.biomeType) {
|
return [113, 88, 101];
|
||||||
default:
|
|
||||||
return [98, 48, 73].map(c => Math.round((c + 128) / 2)) as [number, number, number];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getNightTint(): [number, number, number] {
|
getNightTint(): [number, number, number] {
|
||||||
if (Overrides.ARENA_TINT_OVERRIDE) {
|
|
||||||
return this.overrideTint();
|
|
||||||
}
|
|
||||||
switch (this.biomeType) {
|
switch (this.biomeType) {
|
||||||
case BiomeId.ABYSS:
|
case BiomeId.ABYSS:
|
||||||
case BiomeId.SPACE:
|
case BiomeId.SPACE:
|
||||||
@ -638,11 +619,8 @@ export class Arena {
|
|||||||
return [64, 64, 64];
|
return [64, 64, 64];
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (this.biomeType) {
|
|
||||||
default:
|
|
||||||
return [48, 48, 98];
|
return [48, 48, 98];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
setIgnoreAbilities(ignoreAbilities: boolean, ignoringEffectSource: BattlerIndex | null = null): void {
|
setIgnoreAbilities(ignoreAbilities: boolean, ignoringEffectSource: BattlerIndex | null = null): void {
|
||||||
this.ignoreAbilities = ignoreAbilities;
|
this.ignoreAbilities = ignoreAbilities;
|
||||||
|
@ -76,7 +76,11 @@ class DefaultOverrides {
|
|||||||
readonly BATTLE_STYLE_OVERRIDE: BattleStyle | null = null;
|
readonly BATTLE_STYLE_OVERRIDE: BattleStyle | null = null;
|
||||||
readonly STARTING_WAVE_OVERRIDE: number = 0;
|
readonly STARTING_WAVE_OVERRIDE: number = 0;
|
||||||
readonly STARTING_BIOME_OVERRIDE: BiomeId | null = null;
|
readonly STARTING_BIOME_OVERRIDE: BiomeId | null = null;
|
||||||
readonly ARENA_TINT_OVERRIDE: TimeOfDay | null = null;
|
/**
|
||||||
|
* Overrides the Time of Day for the given biome.
|
||||||
|
* Set to `null` to disable.
|
||||||
|
*/
|
||||||
|
readonly TIME_OF_DAY_OVERRIDE: Exclude<TimeOfDay, TimeOfDay.ALL> | null = null;
|
||||||
/** Multiplies XP gained by this value including 0. Set to null to ignore the override. */
|
/** Multiplies XP gained by this value including 0. Set to null to ignore the override. */
|
||||||
readonly XP_MULTIPLIER_OVERRIDE: number | null = null;
|
readonly XP_MULTIPLIER_OVERRIDE: number | null = null;
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user