@adatechnology/game-vfx 0.10.0 → 0.11.0

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.
package/dist/index.js CHANGED
@@ -5334,12 +5334,14 @@ function lodScale(bands, distance, visualRadius) {
5334
5334
 
5335
5335
  // src/marks.ts
5336
5336
  var BLOOD_LIMIT = 450;
5337
+ var SCRAPE_LIMIT = 400;
5337
5338
  var SCORCH_VARIANTS = 3;
5338
5339
  var RIM_COLORS = [2829359, 3815478];
5339
5340
  function createMarkStore() {
5340
5341
  const entries = [];
5341
5342
  let version = 0;
5342
5343
  let bloodCount = 0;
5344
+ let scrapeCount = 0;
5343
5345
  const listeners = /* @__PURE__ */ new Set();
5344
5346
  return {
5345
5347
  entries,
@@ -5349,16 +5351,25 @@ function createMarkStore() {
5349
5351
  get bloodCount() {
5350
5352
  return bloodCount;
5351
5353
  },
5354
+ get scrapeCount() {
5355
+ return scrapeCount;
5356
+ },
5352
5357
  lift: 0,
5353
5358
  add(mark) {
5359
+ if (mark.kind === "scrape" && scrapeCount >= SCRAPE_LIMIT) {
5360
+ entries.splice(entries.findIndex((m) => m.kind === "scrape"), 1);
5361
+ scrapeCount--;
5362
+ }
5354
5363
  entries.push(mark);
5355
5364
  if (mark.kind === "blood") bloodCount++;
5365
+ if (mark.kind === "scrape") scrapeCount++;
5356
5366
  version++;
5357
5367
  for (const listener of listeners) listener({ type: "add", mark });
5358
5368
  },
5359
5369
  clear() {
5360
5370
  entries.length = 0;
5361
5371
  bloodCount = 0;
5372
+ scrapeCount = 0;
5362
5373
  this.lift = 0;
5363
5374
  version++;
5364
5375
  for (const listener of listeners) listener({ type: "clear" });
@@ -5418,6 +5429,9 @@ function addBloodSplat(store, ground, random, spec) {
5418
5429
  const scaleZ = spec.radius * random.between(1.2, 2);
5419
5430
  store.add({ kind: "blood", x: spec.x, y, z: spec.z, scaleX, scaleZ, rotation: random.next() * 6 });
5420
5431
  }
5432
+ function addScrape(store, spec) {
5433
+ store.add({ kind: "scrape", ...spec, y: spec.y + 2e-3 + nextLift(store) * 2e-4 });
5434
+ }
5421
5435
 
5422
5436
  // src/pools/rings.ts
5423
5437
  function createRingPool(capacity) {
@@ -6268,8 +6282,8 @@ var sprite_kinds_default = {
6268
6282
  id: "dust",
6269
6283
  additive: false,
6270
6284
  life: [
6271
- 1,
6272
- 2
6285
+ 2,
6286
+ 5
6273
6287
  ],
6274
6288
  size: [
6275
6289
  0.08,
@@ -6336,8 +6350,8 @@ var sprite_kinds_default = {
6336
6350
  id: "chips",
6337
6351
  additive: false,
6338
6352
  life: [
6339
- 0.8,
6340
- 1.5
6353
+ 2,
6354
+ 4
6341
6355
  ],
6342
6356
  size: [
6343
6357
  0.025,
@@ -7766,6 +7780,7 @@ function createVfx(options = {}) {
7766
7780
  }),
7767
7781
  fires: () => core.fires.items,
7768
7782
  onMarks: (listener) => core.marks.subscribe(listener),
7783
+ scrape: (mark) => addScrape(core.marks, mark),
7769
7784
  time: () => core.clock.time,
7770
7785
  randomState: () => sharedRandom.state,
7771
7786
  clear() {
@@ -8872,6 +8887,7 @@ export {
8872
8887
  PROFILES,
8873
8888
  RAIN_CAPACITY,
8874
8889
  RainField,
8890
+ SCRAPE_LIMIT,
8875
8891
  SMOKE_COLORS,
8876
8892
  SPRITE_KINDS,
8877
8893
  SpriteKindPool,