Compare commits

..

No commits in common. "e80b4fe1223a57586c2c1ca3bd4e9ab767a89869" and "85a8abc0e8bedaebd4b087a0136fbeda4e329135" have entirely different histories.

12 changed files with 61 additions and 69 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

View File

@ -7666,7 +7666,7 @@ export function initBiomes() {
if (biome === Biome.END) { if (biome === Biome.END) {
const biomeList = Object.keys(Biome).filter(key => !isNaN(Number(key))); const biomeList = Object.keys(Biome).filter(key => !isNaN(Number(key)));
biomeList.pop(); // Removes Biome.END from the list biomeList.pop(); // Removes Biome.END from the list
const randIndex = Utils.randInt(biomeList.length, 1); // Will never be Biome.TOWN const randIndex = Utils.randInt(biomeList.length, 2); // Will never be Biome.TOWN or Biome.PLAINS
biome = Biome[biomeList[randIndex]]; biome = Biome[biomeList[randIndex]];
} }
const linkedBiomes: (Biome | [ Biome, integer ])[] = Array.isArray(biomeLinks[biome]) const linkedBiomes: (Biome | [ Biome, integer ])[] = Array.isArray(biomeLinks[biome])

View File

@ -41,6 +41,8 @@ export class LoadingScene extends SceneBase {
this.loadImage("loading_bg", "arenas"); this.loadImage("loading_bg", "arenas");
this.loadImage("logo", ""); this.loadImage("logo", "");
// this.loadImage("pride-update", "events");
this.loadImage("august-variant-update", "events");
// Load menu images // Load menu images
this.loadAtlas("bg", "ui"); this.loadAtlas("bg", "ui");
@ -244,12 +246,7 @@ export class LoadingScene extends SceneBase {
} else { } else {
this.loadAtlas("types", ""); this.loadAtlas("types", "");
} }
const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"];
if (lang && availableLangs.includes(lang)) {
this.loadImage("september-update-"+lang, "events");
} else {
this.loadImage("september-update-en", "events");
}
this.loadAtlas("statuses", ""); this.loadAtlas("statuses", "");
this.loadAtlas("categories", ""); this.loadAtlas("categories", "");

View File

@ -1,39 +1,35 @@
import BattleScene from "#app/battle-scene"; import BattleScene from "#app/battle-scene.js";
import { TextStyle, addTextObject } from "#app/ui/text"; import { TextStyle, addTextObject } from "#app/ui/text.js";
import i18next from "i18next";
export enum EventType { export enum EventType {
SHINY, SHINY
GENERIC
} }
interface EventBanner { interface TimedEvent {
bannerKey?: string; name: string;
xPosition?: number; eventType: EventType;
yPosition?: number; shinyMultiplier?: number;
scale?: number; startDate: Date;
availableLangs?: string[]; endDate: Date;
} bannerFilename?: string
interface TimedEvent extends EventBanner {
name: string;
eventType: EventType;
shinyMultiplier?: number;
startDate: Date;
endDate: Date;
} }
const timedEvents: TimedEvent[] = [ const timedEvents: TimedEvent[] = [
{ {
name: "September Update", name: "Pride Update",
eventType: EventType.GENERIC, eventType: EventType.SHINY,
startDate: new Date(Date.UTC(2024, 7, 28, 0)), shinyMultiplier: 2,
endDate: new Date(Date.UTC(2024, 8, 15, 0)), startDate: new Date(Date.UTC(2024, 5, 14, 0)),
bannerKey: "september-update", endDate: new Date(Date.UTC(2024, 5, 23, 0)),
xPosition: 19, bannerFilename: "pride-update"
yPosition: 115, },
scale: 0.30, {
availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"] name: "August Variant Update",
eventType: EventType.SHINY,
shinyMultiplier: 2,
startDate: new Date(Date.UTC(2024, 7, 16, 0)),
endDate: new Date(Date.UTC(2024, 7, 22, 0)),
bannerFilename: "august-variant-update"
} }
]; ];
@ -71,7 +67,7 @@ export class TimedEventManager {
} }
getEventBannerFilename(): string { getEventBannerFilename(): string {
return timedEvents.find((te: TimedEvent) => this.isActive(te))?.bannerKey!; // TODO: is this bang correct? return timedEvents.find((te: TimedEvent) => this.isActive(te))?.bannerFilename!; // TODO: is this bang correct?
} }
} }
@ -89,37 +85,38 @@ export class TimedEventDisplay extends Phaser.GameObjects.Container {
} }
setup() { setup() {
const lang = i18next.resolvedLanguage; console.log(this.event?.bannerFilename);
if (this.event && this.event.bannerKey) { this.banner = new Phaser.GameObjects.Image(this.scene, 29, 64, this.event!.bannerFilename!); // TODO: are the bangs correct here?
let key = this.event.bannerKey; this.banner.setName("img-event-banner");
if (lang && this.event.availableLangs && this.event.availableLangs.length > 0) { this.banner.setOrigin(0.08, -0.35);
if (this.event.availableLangs.includes(lang)) { this.banner.setScale(0.18);
key += "-"+lang; // this.bannerShadow = new Phaser.GameObjects.Rectangle(
} else { // this.scene,
key += "-en"; // this.banner.x - 2,
} // this.banner.y + 2,
} // this.banner.width,
console.log(this.event.bannerKey); // this.banner.height,
this.banner = new Phaser.GameObjects.Image(this.scene, this.event.xPosition ?? 29, this.event.yPosition ?? 64, key); // 0x484848
this.banner.setName("img-event-banner"); // );
this.banner.setOrigin(0.08, -0.35); // this.bannerShadow.setName("rect-event-banner-shadow");
this.banner.setScale(this.event.scale ?? 0.18); // this.bannerShadow.setScale(0.07);
if (this.event.eventType !== EventType.GENERIC) { // this.bannerShadow.setAlpha(0.5);
this.eventTimerText = addTextObject( // this.bannerShadow.setOrigin(0,0);
this.scene, this.eventTimerText = addTextObject(
this.banner.x + 8, this.scene,
this.banner.y + 100, this.banner.x + 8,
this.timeToGo(this.event.endDate), this.banner.y + 100,
TextStyle.WINDOW this.timeToGo(this.event!.endDate), // TODO: is the bang correct here?
); TextStyle.WINDOW
this.eventTimerText.setName("text-event-timer"); );
this.eventTimerText.setScale(0.15); this.eventTimerText.setName("text-event-timer");
this.eventTimerText.setOrigin(0, 0); this.eventTimerText.setScale(0.15);
this.eventTimerText.setOrigin(0, 0);
this.add(this.eventTimerText); this.add([
} this.eventTimerText,
this.add(this.banner); // this.bannerShadow,
} this.banner]);
} }
show() { show() {
@ -160,8 +157,6 @@ export class TimedEventDisplay extends Phaser.GameObjects.Container {
} }
updateCountdown() { updateCountdown() {
if (this.event && this.event.eventType !== EventType.GENERIC) { this.eventTimerText.setText(this.timeToGo(this.event!.endDate)); // TODO: is the bang correct here?
this.eventTimerText.setText(this.timeToGo(this.event.endDate));
}
} }
} }