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) {
const biomeList = Object.keys(Biome).filter(key => !isNaN(Number(key)));
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]];
}
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("logo", "");
// this.loadImage("pride-update", "events");
this.loadImage("august-variant-update", "events");
// Load menu images
this.loadAtlas("bg", "ui");
@ -244,12 +246,7 @@ export class LoadingScene extends SceneBase {
} else {
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("categories", "");

View File

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