mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 07:50:19 +00:00
New Year's Eve FX (#2745)
## Description: Happy new year! - Atom and hydro:  - Mirv:  ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: IngloriousTom
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 959 B |
Binary file not shown.
|
After Width: | Height: | Size: 937 B |
Binary file not shown.
|
After Width: | Height: | Size: 976 B |
@@ -5,6 +5,11 @@ import dust from "../../../resources/sprites/dust.png";
|
||||
import miniExplosion from "../../../resources/sprites/miniExplosion.png";
|
||||
import miniFire from "../../../resources/sprites/minifire.png";
|
||||
import nuke from "../../../resources/sprites/nukeExplosion.png";
|
||||
import conquestChampagne from "../../../resources/sprites/nyeve/conquest.png";
|
||||
import nukeEve from "../../../resources/sprites/nyeve/firework.png";
|
||||
import nukeEveCyan from "../../../resources/sprites/nyeve/firework_cyan.png";
|
||||
import nukeEveRed from "../../../resources/sprites/nyeve/firework_red.png";
|
||||
import nukeEveYellow from "../../../resources/sprites/nyeve/firework_yellow.png";
|
||||
import SAMExplosion from "../../../resources/sprites/samExplosion.png";
|
||||
import sinkingShip from "../../../resources/sprites/sinkingShip.png";
|
||||
import miniSmoke from "../../../resources/sprites/smoke.png";
|
||||
@@ -135,6 +140,51 @@ const ANIMATED_SPRITE_CONFIG: Partial<Record<FxType, AnimatedSpriteConfig>> = {
|
||||
originX: 10,
|
||||
originY: 16,
|
||||
},
|
||||
[FxType.ConquestChampagne]: {
|
||||
url: conquestChampagne,
|
||||
frameWidth: 28,
|
||||
frameCount: 8,
|
||||
frameDuration: 90,
|
||||
looping: false,
|
||||
originX: 14,
|
||||
originY: 23,
|
||||
},
|
||||
[FxType.FireworkAll]: {
|
||||
url: nukeEve,
|
||||
frameWidth: 60,
|
||||
frameCount: 15,
|
||||
frameDuration: 90,
|
||||
looping: false,
|
||||
originX: 30,
|
||||
originY: 30,
|
||||
},
|
||||
[FxType.FireworkRed]: {
|
||||
url: nukeEveRed,
|
||||
frameWidth: 30,
|
||||
frameCount: 9,
|
||||
frameDuration: 100,
|
||||
looping: false,
|
||||
originX: 15,
|
||||
originY: 20,
|
||||
},
|
||||
[FxType.FireworkCyan]: {
|
||||
url: nukeEveCyan,
|
||||
frameWidth: 30,
|
||||
frameCount: 13,
|
||||
frameDuration: 100,
|
||||
looping: false,
|
||||
originX: 15,
|
||||
originY: 20,
|
||||
},
|
||||
[FxType.FireworkYellow]: {
|
||||
url: nukeEveYellow,
|
||||
frameWidth: 30,
|
||||
frameCount: 15,
|
||||
frameDuration: 100,
|
||||
looping: false,
|
||||
originX: 15,
|
||||
originY: 20,
|
||||
},
|
||||
};
|
||||
|
||||
export class AnimatedSpriteLoader {
|
||||
|
||||
@@ -25,7 +25,7 @@ export function conquestFxFactory(
|
||||
animatedSpriteLoader,
|
||||
x,
|
||||
y,
|
||||
FxType.Conquest,
|
||||
FxType.ConquestChampagne,
|
||||
2500,
|
||||
);
|
||||
const fadeAnimation = new FadeFx(swordAnimation, 0.1, 0.6);
|
||||
|
||||
@@ -16,4 +16,9 @@ export enum FxType {
|
||||
UnderConstruction = "UnderConstruction",
|
||||
Dust = "Dust",
|
||||
Conquest = "Conquest",
|
||||
FireworkAll = "FireworkAll",
|
||||
FireworkRed = "FireworkRed",
|
||||
FireworkYellow = "FireworkYellow",
|
||||
FireworkCyan = "FireworkCyan",
|
||||
ConquestChampagne = "ConquestChampagne",
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ function addSpriteInCircle(
|
||||
game.isLand(game.ref(spawnX, spawnY))
|
||||
) {
|
||||
const sprite = new FadeFx(
|
||||
new SpriteFx(animatedSpriteLoader, spawnX, spawnY, type, 6000),
|
||||
new SpriteFx(animatedSpriteLoader, spawnX, spawnY, type),
|
||||
0.1,
|
||||
0.8,
|
||||
);
|
||||
@@ -79,19 +79,16 @@ export function nukeFxFactory(
|
||||
): Fx[] {
|
||||
const nukeFx: Fx[] = [];
|
||||
// Explosion animation
|
||||
nukeFx.push(new SpriteFx(animatedSpriteLoader, x, y, FxType.Nuke));
|
||||
// Shockwave animation
|
||||
nukeFx.push(new ShockwaveFx(x, y, 1500, radius * 1.5));
|
||||
nukeFx.push(new SpriteFx(animatedSpriteLoader, x, y, FxType.FireworkAll));
|
||||
// Ruins and desolation sprites
|
||||
const debrisPlan: Array<{
|
||||
type: FxType;
|
||||
radiusFactor: number;
|
||||
density: number;
|
||||
}> = [
|
||||
{ type: FxType.MiniFire, radiusFactor: 1.0, density: 1 / 25 },
|
||||
{ type: FxType.MiniSmoke, radiusFactor: 1.0, density: 1 / 28 },
|
||||
{ type: FxType.MiniBigSmoke, radiusFactor: 0.9, density: 1 / 70 },
|
||||
{ type: FxType.MiniSmokeAndFire, radiusFactor: 0.9, density: 1 / 70 },
|
||||
{ type: FxType.FireworkRed, radiusFactor: 1.0, density: 1 / 28 },
|
||||
{ type: FxType.FireworkCyan, radiusFactor: 0.9, density: 1 / 70 },
|
||||
{ type: FxType.FireworkYellow, radiusFactor: 0.9, density: 1 / 70 },
|
||||
];
|
||||
|
||||
for (const { type, radiusFactor, density } of debrisPlan) {
|
||||
|
||||
Reference in New Issue
Block a user