@wayward/types 2.15.5-beta.dev.20260504.1 → 2.15.5-beta.dev.20260508.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,6 @@ import type Translation from "@wayward/game/language/Translation";
26
26
  import ActionPacket from "@wayward/game/multiplayer/packets/shared/ActionPacket";
27
27
  import type { Direction } from "@wayward/game/utilities/math/Direction";
28
28
  import type { IVector3 } from "@wayward/game/utilities/math/IVector";
29
- import type { IRGB } from "@wayward/utilities/Color";
30
29
  import EventEmitter from "@wayward/utilities/event/EventEmitter";
31
30
  export default class ActionExecutor<A extends ActionArguments, E extends Entity, R, CU extends IActionUsable, AV extends any[]> extends EventEmitter.Host<ActionExecutorEvents> implements IActionApi<E, CU>, IActionConfirmerApi<E, CU> {
32
31
  /**
@@ -123,8 +122,6 @@ export default class ActionExecutor<A extends ActionArguments, E extends Entity,
123
122
  setMilestone(milestone: Milestone, data?: number): this;
124
123
  setSoundEffect(soundEffect: IActionSoundEffect): this;
125
124
  setSoundEffect(type: SfxType, inFront?: boolean): this;
126
- setParticle(color: IRGB, inFront?: boolean): this;
127
- setParticle(color: IRGB, count?: number, inFront?: boolean): this;
128
125
  setParticle(particle: IActionParticle): this;
129
126
  addItems(...addItems: Array<Item | undefined>): this;
130
127
  canProtectedItemBeUsed(items: IProtectedItems): true | IActionNotUsable;
@@ -42,6 +42,7 @@ import type { TranslationArg } from "@wayward/game/language/ITranslation";
42
42
  import type Translation from "@wayward/game/language/Translation";
43
43
  import type Message from "@wayward/game/language/dictionary/Message";
44
44
  import type { IModdable } from "@wayward/game/mod/ModRegistry";
45
+ import type { ParticlePhysics } from "@wayward/game/renderer/particle/IParticle";
45
46
  import type { Direction } from "@wayward/game/utilities/math/Direction";
46
47
  import type { IVector2, IVector3 } from "@wayward/game/utilities/math/IVector";
47
48
  import type { IRGB } from "@wayward/utilities/Color";
@@ -345,8 +346,6 @@ export interface IActionApi<E extends Entity = Entity, CU extends IActionUsable
345
346
  */
346
347
  setRuneChance(alignment: ArrayOr<Deity> | undefined, chance: number): this;
347
348
  setMilestone(milestone: Milestone, data?: number): this;
348
- setParticle(color: IRGB, count?: number, inFront?: boolean): this;
349
- setParticle(color: IRGB, inFront?: boolean): this;
350
349
  setParticle(particle: IActionParticle): this;
351
350
  /**
352
351
  * The items passed to this method will be registered as items potentially to be damaged when the action completes.
@@ -423,6 +422,7 @@ export interface IActionParticle {
423
422
  color: IRGB;
424
423
  tile?: Tile;
425
424
  count?: number;
425
+ physics?: ParticlePhysics;
426
426
  inFront?: boolean;
427
427
  }
428
428
  export interface IActionTargetAdjacent {
@@ -37,6 +37,7 @@ import type { IRendererOrigin } from "@wayward/game/renderer/context/RendererOri
37
37
  import { FieldOfView } from "@wayward/game/renderer/fieldOfView/FieldOfView";
38
38
  import type { IFieldOfViewOrigin } from "@wayward/game/renderer/fieldOfView/IFieldOfView";
39
39
  import { CanASeeBType } from "@wayward/game/renderer/fieldOfView/IFieldOfView";
40
+ import { ParticlePhysics } from "@wayward/game/renderer/particle/IParticle";
40
41
  import Debug from "@wayward/game/utilities/dev/Debug";
41
42
  import { Direction } from "@wayward/game/utilities/math/Direction";
42
43
  import type { IVector2, IVector3 } from "@wayward/game/utilities/math/IVector";
@@ -365,7 +366,7 @@ export default class Tile implements IVector4, Partial<ITileContainer>, IFieldOf
365
366
  */
366
367
  private canSwitchCave;
367
368
  queueSoundEffect(type: SfxType, delay?: number, speed?: number): void;
368
- createParticles(particle: IRGB | undefined, count?: number, intensity?: number): void;
369
+ createParticles(particle: IRGB | undefined, physics?: ParticlePhysics, count?: number, intensity?: number): void;
369
370
  /**
370
371
  * Finds either lava or water ajacent to either lava or water, and cools the lava down based its findings.
371
372
  */
@@ -13,6 +13,7 @@ import type Island from "@wayward/game/game/island/Island";
13
13
  import type { IOverlayInfo } from "@wayward/game/game/tile/ITerrain";
14
14
  import type Tile from "@wayward/game/game/tile/Tile";
15
15
  import type { RenderSource, UpdateRenderFlag } from "@wayward/game/renderer/IRenderer";
16
+ import { ParticlePhysics } from "@wayward/game/renderer/particle/IParticle";
16
17
  import type { Renderer } from "@wayward/game/renderer/Renderer";
17
18
  import { RenderersNotifiers } from "@wayward/game/renderer/RenderersNotifiers";
18
19
  import type { IVector4 } from "@wayward/game/utilities/math/Vector4";
@@ -24,7 +25,7 @@ export default class Renderers {
24
25
  readonly renderers: Set<Renderer>;
25
26
  readonly notifier: RenderersNotifiers;
26
27
  readonly particle: {
27
- create: (tile: Tile, particle: IRGB, count?: number, intensity?: number) => void;
28
+ create: (tile: Tile, particle: IRGB, count?: number, intensity?: number, physics?: ParticlePhysics) => void;
28
29
  };
29
30
  getRenderersForObject(object: IVector4): Renderer[];
30
31
  getRenderersForIslandId(islandId?: IslandId): Renderer[];
@@ -10,5 +10,12 @@
10
10
  */
11
11
  export declare enum ParticleType {
12
12
  Fire = 0,
13
- Blood = 1
13
+ Blood = 1,
14
+ Smoke = 2
15
+ }
16
+ export declare enum ParticlePhysics {
17
+ Fall = 0,
18
+ Ember = 1,
19
+ Explode = 2,
20
+ Rustle = 3
14
21
  }
@@ -8,6 +8,7 @@
8
8
  * Wayward is a copyrighted and licensed work. Modification and/or distribution of any source files is prohibited. If you wish to modify the game in any way, please refer to the modding guide:
9
9
  * https://github.com/WaywardGame/types/wiki
10
10
  */
11
+ import { ParticlePhysics } from "@wayward/game/renderer/particle/IParticle";
11
12
  import type { WorldRenderer } from "@wayward/game/renderer/world/WorldRenderer";
12
13
  import type { IRGB } from "@wayward/utilities/Color";
13
14
  import type Tile from "@wayward/game/game/tile/Tile";
@@ -17,7 +18,7 @@ export declare class ParticleSystem {
17
18
  private readonly worldRenderer;
18
19
  private readonly maxParticles;
19
20
  readonly particles: Float32Array;
20
- readonly dataPerParticle = 10;
21
+ readonly dataPerParticle = 12;
21
22
  private readonly positionSizeData;
22
23
  private readonly colorData;
23
24
  private count;
@@ -26,7 +27,7 @@ export declare class ParticleSystem {
26
27
  private readonly renderer;
27
28
  constructor(context: IRendererContext, worldRenderer: WorldRenderer, maxParticles?: number);
28
29
  delete(): void;
29
- create(tile: Tile, particle: IRGB, count?: number, intensity?: number): number[] | undefined;
30
+ create(tile: Tile, particle: IRGB, count?: number, intensity?: number, physics?: ParticlePhysics): number[] | undefined;
30
31
  clear(): void;
31
32
  /**
32
33
  * Updates particles (ticks their life)
@@ -34,6 +35,16 @@ export declare class ParticleSystem {
34
35
  */
35
36
  private update;
36
37
  render(timeStamp: number, x: number, y: number): boolean;
38
+ private updateParticlePhysics;
39
+ private updateFallParticle;
40
+ private updateEmberParticle;
41
+ private updateExplodeParticle;
37
42
  private findUnusedParticle;
43
+ private getPixelAlignedPosition;
44
+ private getParticleLifetime;
45
+ private getParticleFloorY;
46
+ private getParticleSize;
47
+ private getParticleVelocityX;
48
+ private getParticleVelocityY;
38
49
  private spawn;
39
50
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.15.5-beta.dev.20260504.1",
4
+ "version": "2.15.5-beta.dev.20260508.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",