@adatechnology/game-vfx 0.1.2 → 0.2.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/README.md +8 -1
- package/dist/index.d.ts +170 -6
- package/dist/index.global.js +751 -134
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +751 -134
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1360,77 +1360,77 @@ function createPuffPool(capacity) {
|
|
|
1360
1360
|
}));
|
|
1361
1361
|
}
|
|
1362
1362
|
function spawnPuff(pool, random, init) {
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
return
|
|
1393
|
-
}
|
|
1394
|
-
function ageOrKeep2(
|
|
1395
|
-
|
|
1396
|
-
return
|
|
1397
|
-
}
|
|
1398
|
-
function moveOnRing(
|
|
1363
|
+
const puff3 = pool.acquire();
|
|
1364
|
+
puff3.x = init.x ?? 0;
|
|
1365
|
+
puff3.y = init.y ?? 0;
|
|
1366
|
+
puff3.z = init.z ?? 0;
|
|
1367
|
+
puff3.vx = init.vx ?? 0;
|
|
1368
|
+
puff3.vy = init.vy ?? 0;
|
|
1369
|
+
puff3.vz = init.vz ?? 0;
|
|
1370
|
+
puff3.s0 = init.s0 ?? 0.2;
|
|
1371
|
+
puff3.s1 = init.s1 ?? 1;
|
|
1372
|
+
puff3.sg = init.sg ?? 0.1;
|
|
1373
|
+
puff3.gk = init.gk ?? 6;
|
|
1374
|
+
puff3.life = init.life ?? 3;
|
|
1375
|
+
puff3.t = 0;
|
|
1376
|
+
puff3.h0 = init.h0 ?? 0;
|
|
1377
|
+
puff3.hl = init.hl ?? 0.4;
|
|
1378
|
+
puff3.drag = init.drag ?? 3;
|
|
1379
|
+
puff3.buoy = init.buoy ?? 0.5;
|
|
1380
|
+
puff3.grav = init.grav ?? 0;
|
|
1381
|
+
puff3.kind = init.kind ?? 0;
|
|
1382
|
+
puff3.seed = random.next();
|
|
1383
|
+
puff3.wind = init.wind ?? 1;
|
|
1384
|
+
puff3.color = init.color ?? SMOKE_COLORS.grey;
|
|
1385
|
+
puff3.ring = init.ring ?? null;
|
|
1386
|
+
puff3.ph = init.ph ?? 0;
|
|
1387
|
+
puff3.th = init.th ?? 0;
|
|
1388
|
+
puff3.rng = random;
|
|
1389
|
+
puff3.age = 0;
|
|
1390
|
+
puff3.heat = 0;
|
|
1391
|
+
puff3.size = 0;
|
|
1392
|
+
return puff3;
|
|
1393
|
+
}
|
|
1394
|
+
function ageOrKeep2(puff3, dt) {
|
|
1395
|
+
puff3.t += dt;
|
|
1396
|
+
return puff3.t < puff3.life;
|
|
1397
|
+
}
|
|
1398
|
+
function moveOnRing(puff3, ring2, wind) {
|
|
1399
1399
|
const ringTime = ring2.t;
|
|
1400
1400
|
const centerY = ring2.y0 + ring2.rise * (1 - Math.exp(-ringTime * ring2.rk));
|
|
1401
1401
|
const majorRadius = ring2.R0 + (ring2.R1 - ring2.R0) * (1 - Math.exp(-ringTime * 1.6));
|
|
1402
|
-
const theta =
|
|
1402
|
+
const theta = puff3.th + ringTime * ring2.roll;
|
|
1403
1403
|
const minorRadius = ring2.r * (0.8 + 0.4 * Math.min(1, ringTime));
|
|
1404
1404
|
const radius = majorRadius + minorRadius * Math.cos(theta);
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
}
|
|
1409
|
-
function moveFree(
|
|
1410
|
-
const damping = Math.exp(-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1420
|
-
if (
|
|
1405
|
+
puff3.x = ring2.x + Math.cos(puff3.ph) * radius + wind.x * ringTime * 0.6;
|
|
1406
|
+
puff3.z = ring2.z + Math.sin(puff3.ph) * radius + wind.z * ringTime * 0.6;
|
|
1407
|
+
puff3.y = centerY + minorRadius * Math.sin(theta);
|
|
1408
|
+
}
|
|
1409
|
+
function moveFree(puff3, dt, age, heat, wind) {
|
|
1410
|
+
const damping = Math.exp(-puff3.drag * dt);
|
|
1411
|
+
puff3.vx *= damping;
|
|
1412
|
+
puff3.vy *= damping;
|
|
1413
|
+
puff3.vz *= damping;
|
|
1414
|
+
puff3.vy += (puff3.buoy * (heat > 0 ? 1.6 : 1) - puff3.grav) * dt;
|
|
1415
|
+
puff3.x += (puff3.vx + wind.x * puff3.wind * age) * dt;
|
|
1416
|
+
puff3.y += puff3.vy * dt;
|
|
1417
|
+
puff3.z += (puff3.vz + wind.z * puff3.wind * age) * dt;
|
|
1418
|
+
if (puff3.y < puff3.s0 * FLOOR_FRACTION) {
|
|
1419
|
+
puff3.y = puff3.s0 * FLOOR_FRACTION;
|
|
1420
|
+
if (puff3.vy < 0) puff3.vy *= FLOOR_BOUNCE;
|
|
1421
1421
|
}
|
|
1422
1422
|
}
|
|
1423
1423
|
function updatePuffs(pool, dt, wind) {
|
|
1424
1424
|
pool.compact(ageOrKeep2, dt);
|
|
1425
|
-
for (const
|
|
1426
|
-
const age =
|
|
1427
|
-
const heat =
|
|
1428
|
-
if (
|
|
1429
|
-
else moveFree(
|
|
1430
|
-
const size =
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1425
|
+
for (const puff3 of pool.items) {
|
|
1426
|
+
const age = puff3.t / puff3.life;
|
|
1427
|
+
const heat = puff3.h0 > 0 ? puff3.h0 * Math.pow(Math.max(0, 1 - puff3.t / puff3.hl), 1.25) : 0;
|
|
1428
|
+
if (puff3.ring) moveOnRing(puff3, puff3.ring, wind);
|
|
1429
|
+
else moveFree(puff3, dt, age, heat, wind);
|
|
1430
|
+
const size = puff3.s0 + (puff3.s1 - puff3.s0) * (1 - Math.exp(-puff3.t * puff3.gk)) + puff3.sg * Math.min(puff3.t, GROWTH_CAP_SECONDS);
|
|
1431
|
+
puff3.size = size * Math.min(1, puff3.t * ARRIVAL_FRAME + ARRIVAL_BASE);
|
|
1432
|
+
puff3.age = age;
|
|
1433
|
+
puff3.heat = heat;
|
|
1434
1434
|
}
|
|
1435
1435
|
}
|
|
1436
1436
|
|
|
@@ -1491,9 +1491,9 @@ function updateSparks(pool, step) {
|
|
|
1491
1491
|
var HOT_GLOW_COLOR = [1, 0.45, 0.12];
|
|
1492
1492
|
function addPuff(core, random, init) {
|
|
1493
1493
|
core.spawned.puffs++;
|
|
1494
|
-
const
|
|
1495
|
-
core.trace?.puff?.(
|
|
1496
|
-
return
|
|
1494
|
+
const puff3 = spawnPuff(core.puffs, random, init);
|
|
1495
|
+
core.trace?.puff?.(puff3);
|
|
1496
|
+
return puff3;
|
|
1497
1497
|
}
|
|
1498
1498
|
function addSpark(core, init) {
|
|
1499
1499
|
core.spawned.sparks++;
|
|
@@ -1679,6 +1679,7 @@ var mod = call("mod");
|
|
|
1679
1679
|
var neg = call("neg");
|
|
1680
1680
|
var abs = call("abs");
|
|
1681
1681
|
var sqrt = call("sqrt");
|
|
1682
|
+
var exp = call("exp");
|
|
1682
1683
|
var sin = call("sin");
|
|
1683
1684
|
var cos = call("cos");
|
|
1684
1685
|
var atan2 = call("atan2");
|
|
@@ -1724,12 +1725,14 @@ var DELTA = { $: "dt" };
|
|
|
1724
1725
|
var INDEX = { $: "index" };
|
|
1725
1726
|
var QUALITY = { $: "quality" };
|
|
1726
1727
|
var FRESH = { $: "fresh" };
|
|
1728
|
+
var DIRECTION = { $: "direction" };
|
|
1727
1729
|
var CAMERA_POSITION = { $: "cameraPosition" };
|
|
1728
1730
|
|
|
1729
1731
|
// src/effects/steps.ts
|
|
1730
1732
|
var burst = (system, count, spawn2) => ({ op: "burst", system, count, spawn: spawn2 });
|
|
1731
1733
|
var spawn = (system, options) => ({ op: "spawn", system, spawn: options });
|
|
1732
1734
|
var emit = (key, system, rate, options) => ({ op: "emit", key, system, rate, spawn: options });
|
|
1735
|
+
var mesh = (options) => ({ op: "mesh", spawn: options });
|
|
1733
1736
|
var debris = (options) => ({ op: "debris", spawn: options });
|
|
1734
1737
|
var decal = (...args) => ({ op: "decal", args });
|
|
1735
1738
|
var ring = (...args) => ({ op: "ring", args });
|
|
@@ -2798,6 +2801,256 @@ var BUILDING_FIRE = {
|
|
|
2798
2801
|
]
|
|
2799
2802
|
};
|
|
2800
2803
|
|
|
2804
|
+
// src/effects/world/fog-and-ash.ts
|
|
2805
|
+
var SPOTS_X = [-3, 1, 5];
|
|
2806
|
+
var SPOTS_Z = [-1, -2.4, 0.4];
|
|
2807
|
+
var FOG_AND_ASH = {
|
|
2808
|
+
id: "fog_and_ash",
|
|
2809
|
+
pageId: "neblina",
|
|
2810
|
+
team: "world",
|
|
2811
|
+
budget: { particles: 120, lights: 1 },
|
|
2812
|
+
loop: 0,
|
|
2813
|
+
view: { eye: [3, 1.8, 7.5], target: [-3, 1.2, -1] },
|
|
2814
|
+
setup: [
|
|
2815
|
+
cue("fog", { density: 0.075 }),
|
|
2816
|
+
cue("lamp_cone", { visible: true }),
|
|
2817
|
+
cue("zombie_visible", { index: -1, visible: false }),
|
|
2818
|
+
repeat(
|
|
2819
|
+
SPOTS_X.length,
|
|
2820
|
+
set("turn", rnd(-0.6, 0.6)),
|
|
2821
|
+
behavior("walkers", "place", { index: INDEX, x: pick(SPOTS_X, INDEX), z: pick(SPOTS_Z, INDEX), facing: variable("turn") })
|
|
2822
|
+
)
|
|
2823
|
+
],
|
|
2824
|
+
timeline: [],
|
|
2825
|
+
tick: [
|
|
2826
|
+
emit("fog", "normal", 5, { p: [rnd(-14, 10), rnd(0.2, 1.1), rnd(-3, 8)], v: [rnd(0.15, 0.35), 0, rnd(-0.05, 0.05)], sp: 0, life: [9, 13], size: [3, 5], grow: 1.4, c0: 8227488, a: 0.13, fi: 0.35 }),
|
|
2827
|
+
emit("ash", "normal", 14, { p: [rnd(-10, 8), rnd(4, 6), rnd(-3, 7)], v: [rnd(0.1, 0.4), -0.35, rnd(-0.1, 0.1)], sp: [0.05, 0.15], life: [8, 12], size: [0.025, 0.04], c0: 10525328, a: 0.75, fi: 0.1, gnd: 1 })
|
|
2828
|
+
]
|
|
2829
|
+
};
|
|
2830
|
+
|
|
2831
|
+
// src/workshop/rain.ts
|
|
2832
|
+
var RAIN_CAPACITY = 4e3;
|
|
2833
|
+
var FALL_SPEED = 15;
|
|
2834
|
+
var WIND_PER_FALL = 0.07;
|
|
2835
|
+
var STREAK_SLANT = 0.04;
|
|
2836
|
+
var STREAK_LENGTH = 0.6;
|
|
2837
|
+
var BOX_X = [-15, 15];
|
|
2838
|
+
var BOX_Z = [-6, 16];
|
|
2839
|
+
var START_HEIGHT = [0, 16];
|
|
2840
|
+
var REENTRY_HEIGHT = [14, 17];
|
|
2841
|
+
var SPLASH_CHANCE = 0.35;
|
|
2842
|
+
var SPLASH_RANGE = 12;
|
|
2843
|
+
var SPRITE_CHANCE = 0.5;
|
|
2844
|
+
var UP9 = [0, 1, 0];
|
|
2845
|
+
var WORKSHOP_PUDDLES = [
|
|
2846
|
+
[-1.5, 2.2, 1.6, 0.9],
|
|
2847
|
+
[3, 3.6, 1.1, 0.7],
|
|
2848
|
+
[-6, 3.2, 1.3, 0.8],
|
|
2849
|
+
[1.4, -2.2, 0.9, 0.5]
|
|
2850
|
+
];
|
|
2851
|
+
var inPuddle = (puddles, x, z) => puddles.some((p) => ((x - p[0]) / p[2]) ** 2 + ((z - p[1]) / p[3]) ** 2 < 1);
|
|
2852
|
+
var RainField = class {
|
|
2853
|
+
constructor(engine) {
|
|
2854
|
+
__publicField(this, "engine", engine);
|
|
2855
|
+
/** Two points per streak: x, y, z of the top and x, y, z of the bottom. */
|
|
2856
|
+
__publicField(this, "positions", new Float32Array(RAIN_CAPACITY * 6));
|
|
2857
|
+
/** Streaks alive. */
|
|
2858
|
+
__publicField(this, "count", 0);
|
|
2859
|
+
/** The slant (the wind along x in the Workshop's units). */
|
|
2860
|
+
__publicField(this, "wind", 1);
|
|
2861
|
+
__publicField(this, "on", false);
|
|
2862
|
+
/** Where the box is centred (the Workshop leaves it at the origin; a game follows the camera). */
|
|
2863
|
+
__publicField(this, "centerX", 0);
|
|
2864
|
+
__publicField(this, "centerZ", 0);
|
|
2865
|
+
__publicField(this, "puddles", WORKSHOP_PUDDLES);
|
|
2866
|
+
/** Replaces the puddle test (a game knows its own wet spots). */
|
|
2867
|
+
__publicField(this, "puddleAt");
|
|
2868
|
+
}
|
|
2869
|
+
/** `initRain` (W321): `count` streaks (thinned by the quality), each drawn at a random place in the box. */
|
|
2870
|
+
init(count, wind) {
|
|
2871
|
+
const { random } = this.engine;
|
|
2872
|
+
this.count = Math.min(RAIN_CAPACITY, Math.round(count * this.engine.context.quality.mult));
|
|
2873
|
+
this.wind = wind;
|
|
2874
|
+
this.on = true;
|
|
2875
|
+
for (let index = 0; index < this.count; index++) {
|
|
2876
|
+
const offset = index * 6;
|
|
2877
|
+
const x = random.between(BOX_X[0], BOX_X[1]);
|
|
2878
|
+
const y = random.between(START_HEIGHT[0], START_HEIGHT[1]);
|
|
2879
|
+
const z = random.between(BOX_Z[0], BOX_Z[1]);
|
|
2880
|
+
this.set(offset, x, y, z);
|
|
2881
|
+
}
|
|
2882
|
+
}
|
|
2883
|
+
/**
|
|
2884
|
+
* What a game does with the field every frame: the box follows the camera (`centerX`, `centerZ`), the streaks thin or thicken to `count` (a new streak
|
|
2885
|
+
* starts at a random place of the box, as `init` draws it) and the wind slants them. The golden never calls it.
|
|
2886
|
+
*/
|
|
2887
|
+
drive(count, wind, centerX, centerZ) {
|
|
2888
|
+
const { random } = this.engine;
|
|
2889
|
+
const target = Math.max(0, Math.min(RAIN_CAPACITY, Math.round(count * this.engine.context.quality.mult)));
|
|
2890
|
+
this.wind = wind;
|
|
2891
|
+
this.centerX = centerX;
|
|
2892
|
+
this.centerZ = centerZ;
|
|
2893
|
+
this.on = target > 0;
|
|
2894
|
+
for (let index = this.count; index < target; index++) {
|
|
2895
|
+
this.set(index * 6, random.between(BOX_X[0], BOX_X[1]) + centerX, random.between(START_HEIGHT[0], START_HEIGHT[1]), random.between(BOX_Z[0], BOX_Z[1]) + centerZ);
|
|
2896
|
+
}
|
|
2897
|
+
this.count = target;
|
|
2898
|
+
}
|
|
2899
|
+
/** `updateRain` (W322-329). `camera` is where the eye is; `splash` lets the drops that land leave a splash. */
|
|
2900
|
+
update(dt, splash, camera2) {
|
|
2901
|
+
if (!this.on) return;
|
|
2902
|
+
const { random, context } = this.engine;
|
|
2903
|
+
const positions = this.positions;
|
|
2904
|
+
const fall = FALL_SPEED * dt;
|
|
2905
|
+
const slant = this.wind * fall * WIND_PER_FALL;
|
|
2906
|
+
const reach = SPLASH_RANGE / (1 + context.quality.level);
|
|
2907
|
+
for (let index = 0; index < this.count; index++) {
|
|
2908
|
+
const o = index * 6;
|
|
2909
|
+
positions[o] += slant;
|
|
2910
|
+
positions[o + 3] += slant;
|
|
2911
|
+
positions[o + 1] -= fall;
|
|
2912
|
+
positions[o + 4] -= fall;
|
|
2913
|
+
const ground = context.groundAt(positions[o], positions[o + 2]);
|
|
2914
|
+
if (positions[o + 4] < ground) {
|
|
2915
|
+
const x = positions[o];
|
|
2916
|
+
const z = positions[o + 2];
|
|
2917
|
+
if (splash && random.next() < SPLASH_CHANCE) {
|
|
2918
|
+
const distance = Math.hypot(x - camera2[0], z - camera2[2]);
|
|
2919
|
+
if (distance < reach) {
|
|
2920
|
+
if (random.next() < SPRITE_CHANCE) {
|
|
2921
|
+
this.engine.spawn("normal", { p: [x, ground + 0.01, z], dir: UP9, cone: 0.6, sp: [0.6, 1.3], life: [0.18, 0.3], size: 0.035, c0: 12110044, a: 0.6, g: 9.8, fi: 0 });
|
|
2922
|
+
}
|
|
2923
|
+
if (this.puddleAt ? this.puddleAt(x, z) : inPuddle(this.puddles, x, z)) {
|
|
2924
|
+
this.engine.ring([[x, ground + 0.012, z], 0.01, random.between(0.12, 0.25), random.between(0.4, 0.6), 6978192]);
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
}
|
|
2928
|
+
const nx = random.between(BOX_X[0], BOX_X[1]) + this.centerX;
|
|
2929
|
+
const ny = random.between(REENTRY_HEIGHT[0], REENTRY_HEIGHT[1]);
|
|
2930
|
+
const nz = random.between(BOX_Z[0], BOX_Z[1]) + this.centerZ;
|
|
2931
|
+
this.set(o, nx, ny, nz);
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
/** `rain.visible = false; RN.on = false` (W440): the field stops; the streaks stay where they were. */
|
|
2936
|
+
clear() {
|
|
2937
|
+
this.on = false;
|
|
2938
|
+
}
|
|
2939
|
+
set(offset, x, y, z) {
|
|
2940
|
+
const positions = this.positions;
|
|
2941
|
+
positions[offset] = x;
|
|
2942
|
+
positions[offset + 1] = y;
|
|
2943
|
+
positions[offset + 2] = z;
|
|
2944
|
+
positions[offset + 3] = x + this.wind * STREAK_SLANT;
|
|
2945
|
+
positions[offset + 4] = y - STREAK_LENGTH;
|
|
2946
|
+
positions[offset + 5] = z;
|
|
2947
|
+
}
|
|
2948
|
+
};
|
|
2949
|
+
|
|
2950
|
+
// src/effects/world/rain.ts
|
|
2951
|
+
var DROPS = [900, 2200, 4e3];
|
|
2952
|
+
var SLANT = [0.3, 1.2, 4.5];
|
|
2953
|
+
var STORM = 2;
|
|
2954
|
+
var FLASH_STEPS = ite(lt(variable("flash"), 0.08), 1, ite(lt(variable("flash"), 0.16), 0.2, ite(lt(variable("flash"), 0.26), 0.8, 0)));
|
|
2955
|
+
var RAIN_AND_PUDDLES = {
|
|
2956
|
+
id: "rain_and_puddles",
|
|
2957
|
+
pageId: "chuva",
|
|
2958
|
+
team: "world",
|
|
2959
|
+
params: { id: "intensity", options: ["drizzle", "rain", "storm"], default: 1 },
|
|
2960
|
+
budget: { particles: 4e3, decals: 4 },
|
|
2961
|
+
loop: 0,
|
|
2962
|
+
view: { eye: [2, 2, 7], target: [-1, 0.6, 1] },
|
|
2963
|
+
setup: [
|
|
2964
|
+
cue("lamp_cone", { visible: true }),
|
|
2965
|
+
...WORKSHOP_PUDDLES.map(([x, z, radiusX, radiusZ]) => decal(x, 0, z, radiusX * 2, 790550, { grow: 0, life: 1e6, ar: radiusZ / radiusX }))
|
|
2966
|
+
],
|
|
2967
|
+
timeline: [
|
|
2968
|
+
behavior("rain", "init", { count: ite(eq(PARAM, 0), DROPS[0], ite(eq(PARAM, 1), DROPS[1], DROPS[2])), wind: ite(eq(PARAM, 0), SLANT[0], ite(eq(PARAM, 1), SLANT[1], SLANT[2])) }),
|
|
2969
|
+
set("nextStrike", rnd(2, 4)),
|
|
2970
|
+
set("flash", -1)
|
|
2971
|
+
],
|
|
2972
|
+
tick: [
|
|
2973
|
+
behavior("rain", "update", { dt: DELTA, splash: gt(PARAM, 0) }),
|
|
2974
|
+
when(eq(PARAM, STORM), [
|
|
2975
|
+
when(gt(TIME, variable("nextStrike")), [set("nextStrike", add(TIME, rnd(3.5, 6))), set("flash", 0)]),
|
|
2976
|
+
when(ge(variable("flash"), 0), [
|
|
2977
|
+
set("flash", add(variable("flash"), DELTA)),
|
|
2978
|
+
set("light", FLASH_STEPS),
|
|
2979
|
+
cue("lightning", { intensity: variable("light") }),
|
|
2980
|
+
screen({ max: { white: mul(variable("light"), 0.12) } }),
|
|
2981
|
+
when(gt(variable("flash"), 0.4), [set("flash", -1), cue("lightning", { intensity: 0 })])
|
|
2982
|
+
]),
|
|
2983
|
+
emit("sheet", "normal", 2.5, { p: [-12, 2.5, rnd(-1, 8)], box: [0, 2, 0], v: [7, -0.5, 0], sp: 0, life: [3, 4], size: [3, 5], grow: 1.3, c0: 9083568, a: 0.06, fi: 0.3 })
|
|
2984
|
+
])
|
|
2985
|
+
]
|
|
2986
|
+
};
|
|
2987
|
+
|
|
2988
|
+
// src/effects/vehicles/car.ts
|
|
2989
|
+
var CAR_ORIGIN2 = [5.6, 0, 0.8];
|
|
2990
|
+
var CAR_ROTATION2 = [0, -0.4, 0];
|
|
2991
|
+
var carPoint = (x, y, z) => localToWorld(CAR_ORIGIN2, CAR_ROTATION2, [x, y, z]);
|
|
2992
|
+
var carDirection = (from, to) => normalized([to[0] - from[0], to[1] - from[1], to[2] - from[2]]);
|
|
2993
|
+
|
|
2994
|
+
// src/effects/vehicles/headlights.ts
|
|
2995
|
+
var BEAM_FROM = carPoint(0, 0.74, 2.15);
|
|
2996
|
+
var BEAM_DIRECTION = carDirection(BEAM_FROM, carPoint(0, 0.74, 3.15));
|
|
2997
|
+
var BEAM_SIDE = [BEAM_DIRECTION[2], 0, -BEAM_DIRECTION[0]];
|
|
2998
|
+
var WALKERS = 6;
|
|
2999
|
+
var WALK_SPEED2 = 0.7;
|
|
3000
|
+
var DROPS2 = 1800;
|
|
3001
|
+
var SLANT2 = 0.8;
|
|
3002
|
+
var startWalking = [
|
|
3003
|
+
set("spot", query("car", "point", rnd(-2, 2), 0, rnd(8, 18))),
|
|
3004
|
+
set("goal", query("car", "point", rnd(-0.6, 0.6), 0, 2.6)),
|
|
3005
|
+
behavior("walkers", "place", { index: INDEX, x: pick(variable("spot"), 0), z: pick(variable("spot"), 2), facing: 0 }),
|
|
3006
|
+
behavior("walkers", "walk", { index: INDEX, to: variable("goal"), speed: WALK_SPEED2 })
|
|
3007
|
+
];
|
|
3008
|
+
var HEADLIGHTS_IN_RAIN = {
|
|
3009
|
+
id: "headlights_in_rain",
|
|
3010
|
+
pageId: "farol",
|
|
3011
|
+
team: "vehicles",
|
|
3012
|
+
budget: { particles: 600, lights: 2 },
|
|
3013
|
+
loop: 0,
|
|
3014
|
+
view: { eye: [-2.5, 2, 5.5], target: [4, 1, 6] },
|
|
3015
|
+
setup: [
|
|
3016
|
+
cue("fog", { density: 0.05 }),
|
|
3017
|
+
cue("headlights", { on: true, intensity: 2.4, color: 16773584 }),
|
|
3018
|
+
behavior("rain", "init", { count: DROPS2, wind: SLANT2 }),
|
|
3019
|
+
repeat(WALKERS, ...startWalking)
|
|
3020
|
+
],
|
|
3021
|
+
timeline: [],
|
|
3022
|
+
tick: [
|
|
3023
|
+
behavior("rain", "update", { dt: DELTA, splash: true }),
|
|
3024
|
+
emit(
|
|
3025
|
+
"lit",
|
|
3026
|
+
"streak",
|
|
3027
|
+
600,
|
|
3028
|
+
local(
|
|
3029
|
+
"depth",
|
|
3030
|
+
rnd(1, 13),
|
|
3031
|
+
local(
|
|
3032
|
+
"spread",
|
|
3033
|
+
mul(variable("depth"), 0.33, sqrt(rand())),
|
|
3034
|
+
local(
|
|
3035
|
+
"turn",
|
|
3036
|
+
rnd(0, 6.283),
|
|
3037
|
+
local("base", vadd(BEAM_FROM, vscale(BEAM_DIRECTION, variable("depth")), vscale(BEAM_SIDE, mul(cos(variable("turn")), variable("spread")))), {
|
|
3038
|
+
p: vwith(variable("base"), 1, add(vy(variable("base")), mul(sin(variable("turn")), variable("spread"), 0.6))),
|
|
3039
|
+
v: [0.8, -14, 0],
|
|
3040
|
+
sp: 0,
|
|
3041
|
+
life: 0.06,
|
|
3042
|
+
len: 0.035,
|
|
3043
|
+
c0: 13622512,
|
|
3044
|
+
a: 0.9
|
|
3045
|
+
})
|
|
3046
|
+
)
|
|
3047
|
+
)
|
|
3048
|
+
)
|
|
3049
|
+
),
|
|
3050
|
+
repeat(WALKERS, when(not(query("walkers", "is_walking", INDEX)), startWalking))
|
|
3051
|
+
]
|
|
3052
|
+
};
|
|
3053
|
+
|
|
2801
3054
|
// src/effects/vehicles/scraping-sparks.ts
|
|
2802
3055
|
var YAW = -Math.PI / 2;
|
|
2803
3056
|
var COS = Math.cos(YAW);
|
|
@@ -2827,12 +3080,6 @@ var SCRAPING_SPARKS = {
|
|
|
2827
3080
|
]
|
|
2828
3081
|
};
|
|
2829
3082
|
|
|
2830
|
-
// src/effects/vehicles/car.ts
|
|
2831
|
-
var CAR_ORIGIN2 = [5.6, 0, 0.8];
|
|
2832
|
-
var CAR_ROTATION2 = [0, -0.4, 0];
|
|
2833
|
-
var carPoint = (x, y, z) => localToWorld(CAR_ORIGIN2, CAR_ROTATION2, [x, y, z]);
|
|
2834
|
-
var carDirection = (from, to) => normalized([to[0] - from[0], to[1] - from[1], to[2] - from[2]]);
|
|
2835
|
-
|
|
2836
3083
|
// src/effects/vehicles/engine-smoke.ts
|
|
2837
3084
|
var HOOD = carPoint(0, 1.02, 1.4);
|
|
2838
3085
|
var EXHAUST = carPoint(0.5, 0.3, -2.2);
|
|
@@ -2869,7 +3116,7 @@ var ENGINE_SMOKE = {
|
|
|
2869
3116
|
};
|
|
2870
3117
|
|
|
2871
3118
|
// src/effects/vehicles/boom.ts
|
|
2872
|
-
var
|
|
3119
|
+
var UP10 = [0, 1, 0];
|
|
2873
3120
|
var doorVelocity = (side) => {
|
|
2874
3121
|
const out = carPoint(side * 4, 3, 0.3);
|
|
2875
3122
|
const centre = carPoint(0, 0, 0.3);
|
|
@@ -2879,7 +3126,7 @@ var VEHICLE_BOOM = [
|
|
|
2879
3126
|
call2("explode", vadd(query("car", "position"), [0, 0.6, 0]), 1.8, 2759188),
|
|
2880
3127
|
cue("car_burnt"),
|
|
2881
3128
|
behavior("car", "launch", { rise: 4.5, spin: 0.9 }),
|
|
2882
|
-
repeat(scaled(30), debris({ p: vadd(query("car", "position"), [0, 1.3, 0]), dir:
|
|
3129
|
+
repeat(scaled(30), debris({ p: vadd(query("car", "position"), [0, 1.3, 0]), dir: UP10, cone: 1.3, sp: [2, 6], size: [0.06, 6e-3, 0.06], c: 11061464, life: 20 })),
|
|
2883
3130
|
debris({ p: carPoint(0, 1, 1.4), v: [rnd(-1, 1), 9, rnd(-1, 1)], sp: 0, size: [1.6, 0.06, 1.2], c: 3808536, spin: 6, life: 20, bounce: 0.2 }),
|
|
2884
3131
|
...[-1, 1].map((side) => debris({ p: carPoint(side * 0.95, 0.7, 0.3), v: doorVelocity(side), sp: 0, size: [0.06, 0.7, 1.1], c: 3808536, spin: 5, life: 20, bounce: 0.2 })),
|
|
2885
3132
|
debris({ p: carPoint(0.95, 0.38, 1.35), v: [3, 4, 2], sp: 0, size: [0.3, 0.76, 0.76], c: 1118481, spin: 8, life: 20, bounce: 0.4 })
|
|
@@ -3061,7 +3308,7 @@ var INFECTION_PHASES = {
|
|
|
3061
3308
|
};
|
|
3062
3309
|
|
|
3063
3310
|
// src/effects/screen/panic.ts
|
|
3064
|
-
var
|
|
3311
|
+
var WALKERS2 = 6;
|
|
3065
3312
|
var NEAR = 9;
|
|
3066
3313
|
var RANGE = 7;
|
|
3067
3314
|
var RESTING_BPM = 70;
|
|
@@ -3077,7 +3324,7 @@ var PANIC = {
|
|
|
3077
3324
|
setup: [
|
|
3078
3325
|
cue("zombie_visible", { index: -1, visible: false }),
|
|
3079
3326
|
repeat(
|
|
3080
|
-
|
|
3327
|
+
WALKERS2,
|
|
3081
3328
|
set("startX", rnd(-4, 4)),
|
|
3082
3329
|
set("startZ", sub(rnd(-4, -2), mul(INDEX, 0.6))),
|
|
3083
3330
|
behavior("walkers", "place", { index: INDEX, x: variable("startX"), z: variable("startZ"), facing: 0 }),
|
|
@@ -3087,7 +3334,7 @@ var PANIC = {
|
|
|
3087
3334
|
timeline: [],
|
|
3088
3335
|
tick: [
|
|
3089
3336
|
set("nearest", 99),
|
|
3090
|
-
repeat(
|
|
3337
|
+
repeat(WALKERS2, set("nearest", min(variable("nearest"), vdist(walkerPoint, CAMERA_POSITION)))),
|
|
3091
3338
|
set("fear", clamp(div(sub(NEAR, variable("nearest")), RANGE), 0, 1)),
|
|
3092
3339
|
set("bpm", add(RESTING_BPM, mul(BPM_RISE, variable("fear")))),
|
|
3093
3340
|
when(lt(mod(div(mul(TIME, variable("bpm")), 60), 1), div(mul(DELTA, variable("bpm")), 60)), [screen({ set: { beat: add(0.4, mul(0.6, variable("fear"))) } })]),
|
|
@@ -3162,7 +3409,7 @@ var COUGH_AND_BREATH = {
|
|
|
3162
3409
|
|
|
3163
3410
|
// src/effects/events.ts
|
|
3164
3411
|
var FACING4 = [0, 0, 1];
|
|
3165
|
-
var
|
|
3412
|
+
var UP11 = [0, 1, 0];
|
|
3166
3413
|
var ORIGIN = [0, 0, 0];
|
|
3167
3414
|
var FORWARD4 = [0, 0, -1];
|
|
3168
3415
|
var IMPACT_MATERIALS = ["concrete", "metal", "wood", "glass", "flesh", "water"];
|
|
@@ -3292,14 +3539,152 @@ var EVENT_EFFECTS = [
|
|
|
3292
3539
|
team: "destruction",
|
|
3293
3540
|
budget: { particles: 20, debris: 8 },
|
|
3294
3541
|
loop: 2,
|
|
3295
|
-
timeline: [call2("chips", ORIGIN,
|
|
3542
|
+
timeline: [call2("chips", ORIGIN, UP11, 8, 0.9), call2("rust_at", ORIGIN, 6)]
|
|
3296
3543
|
}
|
|
3297
3544
|
];
|
|
3298
3545
|
|
|
3546
|
+
// src/effects/weapons/viewmodel.ts
|
|
3547
|
+
var PI = Math.PI;
|
|
3548
|
+
var SMOKE = { color: 9079430, width: 10, height: 8, gravity: -0.08, drag: 2.2, growth: 2.1 };
|
|
3549
|
+
var FLASH_SECONDS = 0.055;
|
|
3550
|
+
var FLASH_RAMP = [0.6, 0.9];
|
|
3551
|
+
var FLASH_OPACITY = 0.95;
|
|
3552
|
+
var FLAME_COLORS = [16742946, 16760896, 13121050, 16773296];
|
|
3553
|
+
var FLAME_ADDITIVE = 3;
|
|
3554
|
+
var ORIGIN2 = [0, 0, 0];
|
|
3555
|
+
var SIZE = variable("size");
|
|
3556
|
+
var wide = (width) => mul(sub(rand(), 0.5), width);
|
|
3557
|
+
var puff2 = (point, velocity, world, radius, life, opacity) => mesh({
|
|
3558
|
+
shape: "sphere",
|
|
3559
|
+
p: point,
|
|
3560
|
+
v: velocity,
|
|
3561
|
+
wv: world,
|
|
3562
|
+
r: radius,
|
|
3563
|
+
seg: SMOKE.width,
|
|
3564
|
+
seg2: SMOKE.height,
|
|
3565
|
+
life,
|
|
3566
|
+
c0: SMOKE.color,
|
|
3567
|
+
a: opacity,
|
|
3568
|
+
fade: true,
|
|
3569
|
+
lit: true,
|
|
3570
|
+
g: SMOKE.gravity,
|
|
3571
|
+
drag: SMOKE.drag,
|
|
3572
|
+
grow: SMOKE.growth
|
|
3573
|
+
});
|
|
3574
|
+
var flameBit = (point, velocity, world, radius, life) => [
|
|
3575
|
+
set("bitPoint", point),
|
|
3576
|
+
set("bitVelocity", velocity),
|
|
3577
|
+
set("bitWorld", world),
|
|
3578
|
+
set("bitRadius", radius),
|
|
3579
|
+
set("bitLife", life),
|
|
3580
|
+
set("bitColour", floor(mul(rand(), FLAME_COLORS.length))),
|
|
3581
|
+
mesh({
|
|
3582
|
+
shape: "icosahedron",
|
|
3583
|
+
p: variable("bitPoint"),
|
|
3584
|
+
v: variable("bitVelocity"),
|
|
3585
|
+
wv: variable("bitWorld"),
|
|
3586
|
+
r: variable("bitRadius"),
|
|
3587
|
+
seg: 1,
|
|
3588
|
+
rot: [mul(rand(), 3), mul(rand(), 3), 0],
|
|
3589
|
+
spin: [3, 4, 2],
|
|
3590
|
+
life: variable("bitLife"),
|
|
3591
|
+
c0: pick(FLAME_COLORS, variable("bitColour")),
|
|
3592
|
+
add: eq(variable("bitColour"), FLAME_ADDITIVE),
|
|
3593
|
+
a: 0.9,
|
|
3594
|
+
fade: true,
|
|
3595
|
+
g: -1.4,
|
|
3596
|
+
drag: 1.4,
|
|
3597
|
+
grow: 2.2
|
|
3598
|
+
})
|
|
3599
|
+
];
|
|
3600
|
+
var flashPiece = (shape, radius, height, width, at3, rot, color) => mesh({ shape, r: radius, ...height === void 0 ? {} : { h: height }, seg: width, seg2: shape === "sphere" ? 8 : 1, p: ORIGIN2, at: at3, rot, roll: variable("roll"), ramp: FLASH_RAMP, life: FLASH_SECONDS, c0: color, a: FLASH_OPACITY, add: true });
|
|
3601
|
+
var MUZZLE_FLASH2 = {
|
|
3602
|
+
id: "viewmodel_muzzle_flash",
|
|
3603
|
+
pageId: "event:viewmodel_muzzle_flash",
|
|
3604
|
+
team: "weapons",
|
|
3605
|
+
budget: { particles: 12, lights: 1 },
|
|
3606
|
+
loop: 0.1,
|
|
3607
|
+
timeline: [
|
|
3608
|
+
set("angles", []),
|
|
3609
|
+
repeat(4, append("angles", add(div(mul(INDEX, PI), 2), mul(rand(), 0.6)))),
|
|
3610
|
+
set("roll", mul(rand(), PI)),
|
|
3611
|
+
flash(ORIGIN2, 16756832, mul(4, SIZE), FLASH_SECONDS, mul(2, SIZE), true, true),
|
|
3612
|
+
flashPiece("cone_open", mul(0.013, SIZE), mul(0.085, SIZE), 10, [mul(0.042, SIZE), 0, 0], [0, 0, -PI / 2], 16757575),
|
|
3613
|
+
repeat(
|
|
3614
|
+
4,
|
|
3615
|
+
set("angle", pick(variable("angles"), INDEX)),
|
|
3616
|
+
flashPiece(
|
|
3617
|
+
"cone",
|
|
3618
|
+
mul(5e-3, SIZE),
|
|
3619
|
+
mul(0.04, SIZE),
|
|
3620
|
+
6,
|
|
3621
|
+
[mul(0.012, SIZE), mul(cos(variable("angle")), 0.016, SIZE), mul(sin(variable("angle")), 0.016, SIZE)],
|
|
3622
|
+
[variable("angle"), 0, -PI / 2],
|
|
3623
|
+
16757575
|
|
3624
|
+
)
|
|
3625
|
+
),
|
|
3626
|
+
flashPiece("sphere", mul(0.016, SIZE), void 0, 12, [mul(8e-3, SIZE), 0, 0], [0, 0, 0], 16773568),
|
|
3627
|
+
repeat(
|
|
3628
|
+
6,
|
|
3629
|
+
puff2(
|
|
3630
|
+
ORIGIN2,
|
|
3631
|
+
[add(0.15, mul(rand(), 0.35)), add(0.03, mul(rand(), 0.12)), mul(sub(rand(), 0.5), 0.14)],
|
|
3632
|
+
[0, 0, 0],
|
|
3633
|
+
mul(0.013, SIZE),
|
|
3634
|
+
add(1.3, mul(rand(), 0.6)),
|
|
3635
|
+
0.45
|
|
3636
|
+
)
|
|
3637
|
+
)
|
|
3638
|
+
]
|
|
3639
|
+
};
|
|
3640
|
+
var SMOKE_PUFF = {
|
|
3641
|
+
id: "weapon_smoke_puff",
|
|
3642
|
+
pageId: "event:weapon_smoke_puff",
|
|
3643
|
+
team: "weapons",
|
|
3644
|
+
budget: { particles: 1 },
|
|
3645
|
+
loop: 0.1,
|
|
3646
|
+
timeline: [puff2(ORIGIN2, void 0, [variable("vx"), variable("vy"), variable("vz")], variable("radius"), variable("life"), variable("opacity"))]
|
|
3647
|
+
};
|
|
3648
|
+
var BACKBLAST = {
|
|
3649
|
+
id: "launcher_backblast",
|
|
3650
|
+
pageId: "event:launcher_backblast",
|
|
3651
|
+
team: "weapons",
|
|
3652
|
+
budget: { particles: 40 },
|
|
3653
|
+
loop: 0.1,
|
|
3654
|
+
timeline: [
|
|
3655
|
+
repeat(26, puff2(ORIGIN2, [neg(add(1.5, mul(rand(), 3))), 0, 0], [wide(1.4), wide(0.8), wide(1.4)], add(0.03, mul(rand(), 0.03)), add(1.8, mul(rand(), 1.4)), 0.5)),
|
|
3656
|
+
repeat(14, ...flameBit(ORIGIN2, [neg(add(2, mul(rand(), 2))), 0, 0], [wide(1), wide(0.6), wide(1)], 0.02, 0.25))
|
|
3657
|
+
]
|
|
3658
|
+
};
|
|
3659
|
+
var FLAME_JET = {
|
|
3660
|
+
id: "flame_jet",
|
|
3661
|
+
pageId: "event:flame_jet",
|
|
3662
|
+
team: "weapons",
|
|
3663
|
+
budget: { particles: 30 },
|
|
3664
|
+
loop: 0.1,
|
|
3665
|
+
timeline: [
|
|
3666
|
+
repeat(
|
|
3667
|
+
floor(mul(420, variable("dt"), variable("scale"))),
|
|
3668
|
+
set("speed", mul(add(2.2, mul(rand(), 1.1)), variable("scale"))),
|
|
3669
|
+
...flameBit(
|
|
3670
|
+
[mul(rand(), variable("speed"), min(variable("dt"), 0.3)), 0, 0],
|
|
3671
|
+
[variable("speed"), 0, 0],
|
|
3672
|
+
[wide(0.35), mul(sub(rand(), 0.3), 0.3), wide(0.35)],
|
|
3673
|
+
add(0.02, mul(rand(), 0.022)),
|
|
3674
|
+
add(0.4, mul(rand(), 0.35))
|
|
3675
|
+
)
|
|
3676
|
+
),
|
|
3677
|
+
when(lt(rand(), 0.5), [
|
|
3678
|
+
puff2([add(mul(1.1, variable("scale")), mul(rand(), 0.4)), 0, 0], void 0, [mul(vx(DIRECTION), 0.6), 0.35, mul(vz(DIRECTION), 0.6)], 0.03, 1.6, 0.4)
|
|
3679
|
+
])
|
|
3680
|
+
]
|
|
3681
|
+
};
|
|
3682
|
+
var VIEWMODEL_EFFECTS = [MUZZLE_FLASH2, SMOKE_PUFF, BACKBLAST, FLAME_JET];
|
|
3683
|
+
|
|
3299
3684
|
// src/effects/catalog.ts
|
|
3300
|
-
var ALL_EFFECTS = [BLOOD_HIT, HEADSHOT, DISMEMBER, BLOATER_CLOUD, SCREAMER_SHRIEK, CORPSE_DECAY, REANIMATION, EYES_IN_FOG, MUZZLE_FLASH, IMPACT_BY_MATERIAL, PENETRATION, CASINGS_AND_MAGAZINE, MOLOTOV, GRENADE, EXPLOSIVE_BARREL, SHOPFRONT_GLASS, DOOR_STAGES, BUILDING_COLLAPSE, BLOCK_WALL, METAL_DOOR_EFFECT, IRON_RAILING, WOODEN_FENCE, HIT_POINT_BREAKAGE, PRESSURE_CYLINDERS, BUILDING_FIRE, SCRAPING_SPARKS, ENGINE_SMOKE, FUEL_LEAK, CAR_EXPLOSION, WINDSHIELD, DAMAGE_AND_BITE, INFECTION_PHASES, PANIC, BLOATER_BLINDNESS, CAMPFIRE, COUGH_AND_BREATH];
|
|
3685
|
+
var ALL_EFFECTS = [BLOOD_HIT, HEADSHOT, DISMEMBER, BLOATER_CLOUD, SCREAMER_SHRIEK, CORPSE_DECAY, REANIMATION, EYES_IN_FOG, MUZZLE_FLASH, IMPACT_BY_MATERIAL, PENETRATION, CASINGS_AND_MAGAZINE, MOLOTOV, GRENADE, EXPLOSIVE_BARREL, SHOPFRONT_GLASS, DOOR_STAGES, BUILDING_COLLAPSE, BLOCK_WALL, METAL_DOOR_EFFECT, IRON_RAILING, WOODEN_FENCE, HIT_POINT_BREAKAGE, PRESSURE_CYLINDERS, BUILDING_FIRE, RAIN_AND_PUDDLES, FOG_AND_ASH, SCRAPING_SPARKS, ENGINE_SMOKE, FUEL_LEAK, CAR_EXPLOSION, WINDSHIELD, HEADLIGHTS_IN_RAIN, DAMAGE_AND_BITE, INFECTION_PHASES, PANIC, BLOATER_BLINDNESS, CAMPFIRE, COUGH_AND_BREATH];
|
|
3301
3686
|
var WORKSHOP_EFFECTS = Object.fromEntries(ALL_EFFECTS.map((effect) => [effect.id, effect]));
|
|
3302
|
-
var GAME_EFFECTS = { ...WORKSHOP_EFFECTS, ...Object.fromEntries(EVENT_EFFECTS.map((effect) => [effect.id, effect])) };
|
|
3687
|
+
var GAME_EFFECTS = { ...WORKSHOP_EFFECTS, ...Object.fromEntries([...EVENT_EFFECTS, ...VIEWMODEL_EFFECTS].map((effect) => [effect.id, effect])) };
|
|
3303
3688
|
function patchEffects(base, changes) {
|
|
3304
3689
|
const result = { ...base };
|
|
3305
3690
|
for (const [id, change] of Object.entries(changes)) {
|
|
@@ -3437,7 +3822,7 @@ function impact(engine, material, point, normal, scale = 1, age = 0) {
|
|
|
3437
3822
|
// src/effects/behaviors/blocks.ts
|
|
3438
3823
|
var COLUMNS = 6;
|
|
3439
3824
|
var ROWS = 5;
|
|
3440
|
-
var
|
|
3825
|
+
var ORIGIN3 = [-2.2, 0, 2.6];
|
|
3441
3826
|
var BLOCK_SIZE = [0.5, 0.44, 0.25];
|
|
3442
3827
|
var OBJECT_ID_DRAWS2 = 4;
|
|
3443
3828
|
var FLOOR2 = 0.13;
|
|
@@ -3480,7 +3865,7 @@ function createBlocksBehavior() {
|
|
|
3480
3865
|
const chipScale = random.between(0.8, 1.3) * scale;
|
|
3481
3866
|
for (let draw = 0; draw < OBJECT_ID_DRAWS2; draw++) random.next();
|
|
3482
3867
|
best.holes.push({ x: offsetX, y: offsetY, scale, chipTurn, chipScale });
|
|
3483
|
-
impact(host.engine, "concrete", [
|
|
3868
|
+
impact(host.engine, "concrete", [ORIGIN3[0] + x, y, ORIGIN3[2] + 0.13], [0, 0, 1], 0.8);
|
|
3484
3869
|
} else if (action === "collapse") {
|
|
3485
3870
|
const { x, y } = args;
|
|
3486
3871
|
for (const block of blocks) {
|
|
@@ -3532,7 +3917,7 @@ function createBlocksBehavior() {
|
|
|
3532
3917
|
}
|
|
3533
3918
|
|
|
3534
3919
|
// src/effects/behaviors/car.ts
|
|
3535
|
-
var
|
|
3920
|
+
var ORIGIN4 = [5.6, 0, 0.8];
|
|
3536
3921
|
var MAX_TILT = 0.25;
|
|
3537
3922
|
function createCarBehavior() {
|
|
3538
3923
|
let y = 0;
|
|
@@ -3564,8 +3949,13 @@ function createCarBehavior() {
|
|
|
3564
3949
|
}
|
|
3565
3950
|
}
|
|
3566
3951
|
},
|
|
3567
|
-
query(_host, name) {
|
|
3568
|
-
if (name === "position") return [
|
|
3952
|
+
query(_host, name, args) {
|
|
3953
|
+
if (name === "position") return [ORIGIN4[0], y, ORIGIN4[2]];
|
|
3954
|
+
if (name === "point") {
|
|
3955
|
+
const [x, py, z] = args;
|
|
3956
|
+
const point = carPoint(x, py, z);
|
|
3957
|
+
return [point[0], point[1] + y, point[2]];
|
|
3958
|
+
}
|
|
3569
3959
|
if (name === "roll") return roll;
|
|
3570
3960
|
throw new Error(`car: unknown query ${name}`);
|
|
3571
3961
|
},
|
|
@@ -3774,6 +4164,31 @@ function createPlateBehavior(geometry = METAL_DOOR) {
|
|
|
3774
4164
|
};
|
|
3775
4165
|
}
|
|
3776
4166
|
|
|
4167
|
+
// src/effects/behaviors/rain.ts
|
|
4168
|
+
function createRainBehavior() {
|
|
4169
|
+
return {
|
|
4170
|
+
reset() {
|
|
4171
|
+
},
|
|
4172
|
+
act(host, action, args) {
|
|
4173
|
+
const { engine, camera: camera2 } = host;
|
|
4174
|
+
if (action === "init") {
|
|
4175
|
+
const { count, wind } = args;
|
|
4176
|
+
engine.rain.init(count, wind);
|
|
4177
|
+
} else if (action === "update") {
|
|
4178
|
+
const { dt, splash } = args;
|
|
4179
|
+
engine.rain.update(dt, splash, camera2.position);
|
|
4180
|
+
}
|
|
4181
|
+
},
|
|
4182
|
+
query(host, name) {
|
|
4183
|
+
if (name === "count") return host.engine.rain.count;
|
|
4184
|
+
if (name === "on") return host.engine.rain.on;
|
|
4185
|
+
throw new Error(`rain: unknown query ${name}`);
|
|
4186
|
+
},
|
|
4187
|
+
update() {
|
|
4188
|
+
}
|
|
4189
|
+
};
|
|
4190
|
+
}
|
|
4191
|
+
|
|
3777
4192
|
// src/effects/behaviors/walkers.ts
|
|
3778
4193
|
var WALKER_COUNT = 10;
|
|
3779
4194
|
var ARRIVAL_DISTANCE = 0.05;
|
|
@@ -3842,7 +4257,8 @@ var WORKSHOP_BEHAVIORS = {
|
|
|
3842
4257
|
blocks: () => createBlocksBehavior(),
|
|
3843
4258
|
plate: () => createPlateBehavior(),
|
|
3844
4259
|
cylinder: () => createCylinderBehavior(),
|
|
3845
|
-
car: () => createCarBehavior()
|
|
4260
|
+
car: () => createCarBehavior(),
|
|
4261
|
+
rain: () => createRainBehavior()
|
|
3846
4262
|
};
|
|
3847
4263
|
function createWorkshopBehaviors(factories = WORKSHOP_BEHAVIORS) {
|
|
3848
4264
|
return Object.fromEntries(Object.entries(factories).map(([id, make]) => [id, make()]));
|
|
@@ -3920,6 +4336,8 @@ function evaluateCall(name, args) {
|
|
|
3920
4336
|
return Math.abs(asNumber(first));
|
|
3921
4337
|
case "sqrt":
|
|
3922
4338
|
return Math.sqrt(asNumber(first));
|
|
4339
|
+
case "exp":
|
|
4340
|
+
return Math.exp(asNumber(first));
|
|
3923
4341
|
case "sin":
|
|
3924
4342
|
return Math.sin(asNumber(first));
|
|
3925
4343
|
case "cos":
|
|
@@ -4040,7 +4458,7 @@ function resolve(value, context) {
|
|
|
4040
4458
|
}
|
|
4041
4459
|
|
|
4042
4460
|
// src/effects/builders/fire.ts
|
|
4043
|
-
var
|
|
4461
|
+
var UP12 = [0, 1, 0];
|
|
4044
4462
|
var ZERO = [0, 0, 0];
|
|
4045
4463
|
var FULL_TURN_DRAWN = 6.283;
|
|
4046
4464
|
function scaledSizes(range, factor) {
|
|
@@ -4053,7 +4471,7 @@ function fireEmit(engine, key, dt, centre, radius, factor, options = {}) {
|
|
|
4053
4471
|
p: centre,
|
|
4054
4472
|
r: radius,
|
|
4055
4473
|
flat: true,
|
|
4056
|
-
dir: options.dir ??
|
|
4474
|
+
dir: options.dir ?? UP12,
|
|
4057
4475
|
cone: 0.35,
|
|
4058
4476
|
sp: [0.4, 1.4],
|
|
4059
4477
|
v: wind,
|
|
@@ -4070,7 +4488,7 @@ function fireEmit(engine, key, dt, centre, radius, factor, options = {}) {
|
|
|
4070
4488
|
p: centre,
|
|
4071
4489
|
r: radius * 0.6,
|
|
4072
4490
|
flat: true,
|
|
4073
|
-
dir:
|
|
4491
|
+
dir: UP12,
|
|
4074
4492
|
cone: 0.3,
|
|
4075
4493
|
sp: [0.3, 0.8],
|
|
4076
4494
|
life: [0.2, 0.4],
|
|
@@ -4085,14 +4503,14 @@ function fireEmit(engine, key, dt, centre, radius, factor, options = {}) {
|
|
|
4085
4503
|
if (engine.quality < 2) {
|
|
4086
4504
|
engine.emit(`${key}e`, "streak", 10 * factor, dt, () => {
|
|
4087
4505
|
const jitter = plus(wind, engine.random.between(-0.4, 0.4), 0, engine.random.between(-0.4, 0.4));
|
|
4088
|
-
return { p: centre, box: [radius, 0, radius], dir:
|
|
4506
|
+
return { p: centre, box: [radius, 0, radius], dir: UP12, cone: 0.5, sp: [1.5, 3.5], v: jitter, life: [0.8, 1.8], len: 0.03, c0: 16756816, c1: 6295552, g: -0.6, drag: 0.4 };
|
|
4089
4507
|
});
|
|
4090
4508
|
}
|
|
4091
4509
|
if (options.noSmoke) return;
|
|
4092
4510
|
engine.emit(`${key}s`, "normal", (options.smoke || 14) * factor, dt, () => ({
|
|
4093
4511
|
p: plus(centre, 0, 0.8 * sqrtFactor, 0),
|
|
4094
4512
|
r: radius * 0.7,
|
|
4095
|
-
dir:
|
|
4513
|
+
dir: UP12,
|
|
4096
4514
|
cone: 0.35,
|
|
4097
4515
|
sp: [0.6, 1.4],
|
|
4098
4516
|
v: wind,
|
|
@@ -4132,15 +4550,15 @@ function explode(engine, point, scale, cameraPosition, chipColor) {
|
|
|
4132
4550
|
engine.screen.shake += 0.7 * scale;
|
|
4133
4551
|
engine.screen.white += 0.18 * scale;
|
|
4134
4552
|
engine.burst("add", 55 * scale, { p: point, r: 0.3 * scale, sp: [2, 7 * scale], drag: 4, life: [0.25, 0.6], size: [0.7 * scale, 1.4 * scale], grow: 1.7, c0: 16773296, c1: 10103304, fi: 0.04 });
|
|
4135
|
-
engine.burst("add", 28 * scale, { p: plus(point, 0, 0.3, 0), r: 0.3, dir:
|
|
4553
|
+
engine.burst("add", 28 * scale, { p: plus(point, 0, 0.3, 0), r: 0.3, dir: UP12, cone: 0.7, sp: [2, 5 * scale], drag: 1.5, life: [0.6, 1.1], size: [0.6 * scale, 1 * scale], grow: 1.3, c0: 16760928, c1: 5902853, g: -2, fi: 0.05 });
|
|
4136
4554
|
engine.ring([plus(point, 0, 0.05, 0), 0.3, 7 * scale, 0.55, 16767136]);
|
|
4137
4555
|
const toCamera = normalized([cameraPosition[0] - point[0], cameraPosition[1] - point[1], cameraPosition[2] - point[2]]);
|
|
4138
4556
|
engine.ring([plus(point, 0, 1, 0), 0.3, 5 * scale, 0.35, 16773328, toCamera]);
|
|
4139
|
-
engine.burst("normal", 32 * scale, { p: plus(point, 0, 0.6, 0), r: 0.8 * scale, dir:
|
|
4557
|
+
engine.burst("normal", 32 * scale, { p: plus(point, 0, 0.6, 0), r: 0.8 * scale, dir: UP12, cone: 1.1, sp: [1, 3], drag: 1.2, life: [3, 6], size: [1 * scale, 1.8 * scale], grow: 2.6, c0: 2828068, c1: 987155, a: 0.6, fi: 0.18, g: -0.35 });
|
|
4140
4558
|
ringOfDust(engine, point, scale);
|
|
4141
|
-
if (engine.quality < 2) engine.burst("streak", 44 * scale, { p: point, dir:
|
|
4559
|
+
if (engine.quality < 2) engine.burst("streak", 44 * scale, { p: point, dir: UP12, cone: 1.45, sp: [10, 26], life: [0.3, 0.7], len: 0.03, c0: 16760944, c1: 8396800, g: 9.8, gnd: 2 });
|
|
4142
4560
|
for (let index = 0; index < engine.scaled(16 * scale); index++) {
|
|
4143
|
-
engine.debrisPiece({ p: point, dir:
|
|
4561
|
+
engine.debrisPiece({ p: point, dir: UP12, cone: 1.2, sp: [3, 9], size: [0.12, 0.06, 0.1], k: [0.6, 1.6], c: chipColor || 2762274, life: 9 });
|
|
4144
4562
|
}
|
|
4145
4563
|
engine.decal([point[0], engine.context.groundAt(point[0], point[2]), point[2], 3 * scale, 657930, { grow: 0.15, life: 60 }]);
|
|
4146
4564
|
}
|
|
@@ -4291,6 +4709,7 @@ var EffectInstance = class {
|
|
|
4291
4709
|
if (!def) return;
|
|
4292
4710
|
this.schedule.clear();
|
|
4293
4711
|
this.variables.clear();
|
|
4712
|
+
for (const [name, value] of Object.entries(this.setup.values ?? {})) this.variables.set(name, value);
|
|
4294
4713
|
for (const behavior2 of this.deps.behaviors()) behavior2.reset(this.host);
|
|
4295
4714
|
this.time = 0;
|
|
4296
4715
|
this.within(() => {
|
|
@@ -4349,6 +4768,10 @@ var EffectInstance = class {
|
|
|
4349
4768
|
return engine.spawn(step.system, this.value(step.spawn));
|
|
4350
4769
|
case "emit":
|
|
4351
4770
|
return engine.emit(step.key, step.system, this.value(step.rate), this.dt, () => this.value(step.spawn));
|
|
4771
|
+
case "mesh": {
|
|
4772
|
+
engine.mesh(this.value(step.spawn));
|
|
4773
|
+
return;
|
|
4774
|
+
}
|
|
4352
4775
|
case "debris":
|
|
4353
4776
|
return engine.debrisPiece(this.value(step.spawn));
|
|
4354
4777
|
case "decal":
|
|
@@ -4432,7 +4855,7 @@ var EffectInstance = class {
|
|
|
4432
4855
|
};
|
|
4433
4856
|
|
|
4434
4857
|
// src/effects/player.ts
|
|
4435
|
-
var
|
|
4858
|
+
var ORIGIN5 = [0, 0, 0];
|
|
4436
4859
|
var DEFAULT_HEADING = [0, 0, -1];
|
|
4437
4860
|
var DEFAULT_MAX_INSTANCES = 48;
|
|
4438
4861
|
var ENDLESS_SECONDS = 60;
|
|
@@ -4477,7 +4900,7 @@ function createEffectPlayer(options) {
|
|
|
4477
4900
|
}
|
|
4478
4901
|
function placementOf(entry) {
|
|
4479
4902
|
const origin = entry.follow ? [entry.origin[0] + positionOf2(entry.follow)[0], entry.origin[1] + positionOf2(entry.follow)[1], entry.origin[2] + positionOf2(entry.follow)[2]] : entry.origin;
|
|
4480
|
-
return { origin, anchor: entry.anchor, yaw: entry.yaw };
|
|
4903
|
+
return { origin, anchor: entry.anchor, yaw: entry.yaw, ...entry.orientation ? { orientation: entry.orientation } : {} };
|
|
4481
4904
|
}
|
|
4482
4905
|
function drawing(entry, action) {
|
|
4483
4906
|
const context = engine.context;
|
|
@@ -4501,8 +4924,9 @@ function createEffectPlayer(options) {
|
|
|
4501
4924
|
random: playOptions.seed !== void 0 ? streamOf(playOptions.seed) : void 0,
|
|
4502
4925
|
follow: playOptions.follow,
|
|
4503
4926
|
origin: point,
|
|
4504
|
-
anchor: def.anchor ??
|
|
4927
|
+
anchor: def.anchor ?? ORIGIN5,
|
|
4505
4928
|
yaw: yawOf(heading, playOptions.direction),
|
|
4929
|
+
orientation: playOptions.orientation,
|
|
4506
4930
|
seconds: playOptions.seconds ?? (def.loop && def.loop > 0 ? def.loop : ENDLESS_SECONDS)
|
|
4507
4931
|
};
|
|
4508
4932
|
playing.push(entry);
|
|
@@ -4511,7 +4935,8 @@ function createEffectPlayer(options) {
|
|
|
4511
4935
|
() => instance.begin(def, paramIndex(def, playOptions.param), {
|
|
4512
4936
|
placement: placementOf(entry),
|
|
4513
4937
|
...playOptions.direction ? { direction: playOptions.direction } : {},
|
|
4514
|
-
...playOptions.normal ? { normal: playOptions.normal } : {}
|
|
4938
|
+
...playOptions.normal ? { normal: playOptions.normal } : {},
|
|
4939
|
+
...playOptions.values ? { values: playOptions.values } : {}
|
|
4515
4940
|
})
|
|
4516
4941
|
);
|
|
4517
4942
|
return entry.handle;
|
|
@@ -4782,15 +5207,15 @@ function spawnShock(pool, spec) {
|
|
|
4782
5207
|
return shock;
|
|
4783
5208
|
}
|
|
4784
5209
|
function pushPuffs(puffs, shock, reach, dt, age) {
|
|
4785
|
-
for (const
|
|
4786
|
-
if (
|
|
4787
|
-
const dx =
|
|
4788
|
-
const dz =
|
|
5210
|
+
for (const puff3 of puffs) {
|
|
5211
|
+
if (puff3.ring || puff3.t > PUSH_AGE_LIMIT) continue;
|
|
5212
|
+
const dx = puff3.x - shock.x;
|
|
5213
|
+
const dz = puff3.z - shock.z;
|
|
4789
5214
|
const distance = Math.hypot(dx, dz) + 1e-3;
|
|
4790
|
-
if (Math.abs(distance - reach) < PUSH_BAND &&
|
|
5215
|
+
if (Math.abs(distance - reach) < PUSH_BAND && puff3.y < PUSH_CEILING) {
|
|
4791
5216
|
const strength = 4 * dt * (1 - age);
|
|
4792
|
-
|
|
4793
|
-
|
|
5217
|
+
puff3.vx += dx / distance * strength * 6;
|
|
5218
|
+
puff3.vz += dz / distance * strength * 6;
|
|
4794
5219
|
}
|
|
4795
5220
|
}
|
|
4796
5221
|
}
|
|
@@ -5092,10 +5517,10 @@ function composeMushroom(context, spec) {
|
|
|
5092
5517
|
const life = random.between(ring2.life * 0.75, ring2.life);
|
|
5093
5518
|
const h0 = random.between(1, 1.25);
|
|
5094
5519
|
const hl = random.between(0.9, 1.6);
|
|
5095
|
-
const
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5520
|
+
const puff3 = addPuff(core, random, { x, y, z, s0: spec.radius * 0.2, s1, sg: spec.radius * 0.06, gk: 3, life, h0, hl, color, kind: 0 });
|
|
5521
|
+
puff3.ring = ring2;
|
|
5522
|
+
puff3.ph = random.next() * Math.PI * 2;
|
|
5523
|
+
puff3.th = random.next() * Math.PI * 2;
|
|
5099
5524
|
}
|
|
5100
5525
|
const stemCount = Math.round((spec.stem || 18) * Math.max(lod, 0.4));
|
|
5101
5526
|
for (let index = 0; index < stemCount; index++) {
|
|
@@ -5919,7 +6344,7 @@ var SpriteKindSystem = class {
|
|
|
5919
6344
|
// src/workshop/direction.ts
|
|
5920
6345
|
var TWO_PI_ROUNDED = 6.2832;
|
|
5921
6346
|
var WIDE_CONE = 3.1;
|
|
5922
|
-
var
|
|
6347
|
+
var UP13 = [0, 1, 0];
|
|
5923
6348
|
function drawRange(random, range) {
|
|
5924
6349
|
if (Array.isArray(range)) return random.between(range[0], range[1]);
|
|
5925
6350
|
return range || 0;
|
|
@@ -5947,7 +6372,7 @@ function cross(out, a, b) {
|
|
|
5947
6372
|
}
|
|
5948
6373
|
function coneDirection(random, direction, cone, out) {
|
|
5949
6374
|
if (cone >= WIDE_CONE) return randomUnit(random, out);
|
|
5950
|
-
const [dx, dy, dz] = direction ??
|
|
6375
|
+
const [dx, dy, dz] = direction ?? UP13;
|
|
5951
6376
|
const cosTilt = 1 - random.next() * (1 - Math.cos(cone));
|
|
5952
6377
|
const sinTilt = Math.sqrt(1 - cosTilt * cosTilt);
|
|
5953
6378
|
const phase = random.next() * TWO_PI_ROUNDED;
|
|
@@ -6071,12 +6496,12 @@ var DebrisPool = class {
|
|
|
6071
6496
|
|
|
6072
6497
|
// src/workshop/decals.ts
|
|
6073
6498
|
var CAPACITY2 = 400;
|
|
6074
|
-
var
|
|
6499
|
+
var UP14 = [0, 1, 0];
|
|
6075
6500
|
var DEFAULT_LIFE2 = 60;
|
|
6076
6501
|
var DEFAULT_GROW = 1.2;
|
|
6077
6502
|
var EVAPORATION = { fuel: [6, 5], water: [40, 20] };
|
|
6078
6503
|
function createDecal() {
|
|
6079
|
-
return { on: false, x: 0, y: 0, z: 0, sx: 0, sy: 0, t: 0, life: 0, grow: 0, color: 0, normal:
|
|
6504
|
+
return { on: false, x: 0, y: 0, z: 0, sx: 0, sy: 0, t: 0, life: 0, grow: 0, color: 0, normal: UP14, fluid: void 0, dryColor: -1, dryAt: 0, dryTime: 0 };
|
|
6080
6505
|
}
|
|
6081
6506
|
var DecalPool = class {
|
|
6082
6507
|
constructor(context) {
|
|
@@ -6089,7 +6514,7 @@ var DecalPool = class {
|
|
|
6089
6514
|
const random = this.context.random;
|
|
6090
6515
|
const index = this.next++ % CAPACITY2;
|
|
6091
6516
|
const decal2 = this.decals[index];
|
|
6092
|
-
const normal = options.n ??
|
|
6517
|
+
const normal = options.n ?? UP14;
|
|
6093
6518
|
random.between(0, 6.28);
|
|
6094
6519
|
const offset = 4e-3 + index % 40 * 4e-4;
|
|
6095
6520
|
decal2.on = true;
|
|
@@ -6131,6 +6556,96 @@ var DecalPool = class {
|
|
|
6131
6556
|
}
|
|
6132
6557
|
};
|
|
6133
6558
|
|
|
6559
|
+
// src/workshop/meshes.ts
|
|
6560
|
+
var CAPACITY3 = 400;
|
|
6561
|
+
var IDENTITY = [0, 0, 0, 1];
|
|
6562
|
+
function multiply(a, b) {
|
|
6563
|
+
const [ax, ay, az, aw] = a;
|
|
6564
|
+
const [bx, by, bz, bw] = b;
|
|
6565
|
+
return [aw * bx + ax * bw + ay * bz - az * by, aw * by - ax * bz + ay * bw + az * bx, aw * bz + ax * by - ay * bx + az * bw, aw * bw - ax * bx - ay * by - az * bz];
|
|
6566
|
+
}
|
|
6567
|
+
var aboutX = (angle) => [Math.sin(angle / 2), 0, 0, Math.cos(angle / 2)];
|
|
6568
|
+
var MeshPool = class {
|
|
6569
|
+
constructor(capacity = CAPACITY3) {
|
|
6570
|
+
__publicField(this, "capacity", capacity);
|
|
6571
|
+
__publicField(this, "particles", []);
|
|
6572
|
+
__publicField(this, "serial", 0);
|
|
6573
|
+
}
|
|
6574
|
+
get count() {
|
|
6575
|
+
return this.particles.length;
|
|
6576
|
+
}
|
|
6577
|
+
spawn(options, frame = IDENTITY) {
|
|
6578
|
+
const velocity = options.v ?? [0, 0, 0];
|
|
6579
|
+
const world = options.wv ?? [0, 0, 0];
|
|
6580
|
+
const particle = {
|
|
6581
|
+
id: ++this.serial,
|
|
6582
|
+
shape: options.shape,
|
|
6583
|
+
radius: options.r,
|
|
6584
|
+
height: options.h ?? 0,
|
|
6585
|
+
segments: options.seg ?? 0,
|
|
6586
|
+
segments2: options.seg2 ?? 0,
|
|
6587
|
+
color: options.c0,
|
|
6588
|
+
additive: options.add === true,
|
|
6589
|
+
lit: options.lit === true,
|
|
6590
|
+
x: options.p[0],
|
|
6591
|
+
y: options.p[1],
|
|
6592
|
+
z: options.p[2],
|
|
6593
|
+
frame: options.roll ? multiply(frame, aboutX(options.roll)) : frame,
|
|
6594
|
+
at: options.at ?? [0, 0, 0],
|
|
6595
|
+
rx: options.rot?.[0] ?? 0,
|
|
6596
|
+
ry: options.rot?.[1] ?? 0,
|
|
6597
|
+
rz: options.rot?.[2] ?? 0,
|
|
6598
|
+
scale: 1,
|
|
6599
|
+
opacity: options.a,
|
|
6600
|
+
age: 0,
|
|
6601
|
+
life: options.life,
|
|
6602
|
+
vx: velocity[0] + world[0],
|
|
6603
|
+
vy: velocity[1] + world[1],
|
|
6604
|
+
vz: velocity[2] + world[2],
|
|
6605
|
+
spin: options.spin ?? [0, 0, 0],
|
|
6606
|
+
gravity: options.g ?? 0,
|
|
6607
|
+
drag: options.drag ?? 0,
|
|
6608
|
+
grow: options.grow ?? 0,
|
|
6609
|
+
ramp: options.ramp,
|
|
6610
|
+
fade: options.fade === true,
|
|
6611
|
+
startOpacity: options.a
|
|
6612
|
+
};
|
|
6613
|
+
this.particles.push(particle);
|
|
6614
|
+
if (this.particles.length > this.capacity) this.particles.shift();
|
|
6615
|
+
return particle;
|
|
6616
|
+
}
|
|
6617
|
+
update(dt) {
|
|
6618
|
+
const live = this.particles;
|
|
6619
|
+
for (let index = 0; index < live.length; index++) {
|
|
6620
|
+
const particle = live[index];
|
|
6621
|
+
particle.age += dt;
|
|
6622
|
+
if (particle.ramp ? particle.age >= particle.life : particle.age > particle.life) {
|
|
6623
|
+
live.splice(index--, 1);
|
|
6624
|
+
continue;
|
|
6625
|
+
}
|
|
6626
|
+
if (particle.fade) particle.opacity = Math.max(0, particle.startOpacity * (1 - particle.age / particle.life));
|
|
6627
|
+
particle.vy -= particle.gravity * dt;
|
|
6628
|
+
if (particle.drag) {
|
|
6629
|
+
const keep = Math.max(0, 1 - particle.drag * dt);
|
|
6630
|
+
particle.vx *= keep;
|
|
6631
|
+
particle.vy *= keep;
|
|
6632
|
+
particle.vz *= keep;
|
|
6633
|
+
}
|
|
6634
|
+
particle.x += particle.vx * dt;
|
|
6635
|
+
particle.y += particle.vy * dt;
|
|
6636
|
+
particle.z += particle.vz * dt;
|
|
6637
|
+
particle.rx += particle.spin[0] * dt;
|
|
6638
|
+
particle.ry += particle.spin[1] * dt;
|
|
6639
|
+
particle.rz += particle.spin[2] * dt;
|
|
6640
|
+
if (particle.grow) particle.scale *= 1 + particle.grow * dt;
|
|
6641
|
+
if (particle.ramp) particle.scale = particle.ramp[0] + Math.min(1, particle.age / particle.life) * particle.ramp[1];
|
|
6642
|
+
}
|
|
6643
|
+
}
|
|
6644
|
+
clear() {
|
|
6645
|
+
this.particles.length = 0;
|
|
6646
|
+
}
|
|
6647
|
+
};
|
|
6648
|
+
|
|
6134
6649
|
// src/workshop/sprites.ts
|
|
6135
6650
|
var DEFAULT_FADE_IN = 0.1;
|
|
6136
6651
|
var FLOATS_PER_VECTOR = 3;
|
|
@@ -6427,11 +6942,11 @@ var StreakPool = class {
|
|
|
6427
6942
|
// src/workshop/waves.ts
|
|
6428
6943
|
var RING_CAPACITY = 120;
|
|
6429
6944
|
var LIGHT_CAPACITY = 4;
|
|
6430
|
-
var
|
|
6945
|
+
var UP15 = [0, 1, 0];
|
|
6431
6946
|
var DEFAULT_LIGHT_DISTANCE = 14;
|
|
6432
6947
|
var WaveRingPool = class {
|
|
6433
6948
|
constructor() {
|
|
6434
|
-
__publicField(this, "rings", Array.from({ length: RING_CAPACITY }, () => ({ on: false, point:
|
|
6949
|
+
__publicField(this, "rings", Array.from({ length: RING_CAPACITY }, () => ({ on: false, point: UP15, from: 0, to: 0, t: 0, duration: 1, color: 0, normal: UP15, hold: 0 })));
|
|
6435
6950
|
__publicField(this, "count", 0);
|
|
6436
6951
|
__publicField(this, "next", 0);
|
|
6437
6952
|
}
|
|
@@ -6444,7 +6959,7 @@ var WaveRingPool = class {
|
|
|
6444
6959
|
ring2.t = 0;
|
|
6445
6960
|
ring2.duration = duration;
|
|
6446
6961
|
ring2.color = color;
|
|
6447
|
-
ring2.normal = normal ??
|
|
6962
|
+
ring2.normal = normal ?? UP15;
|
|
6448
6963
|
ring2.hold = hold || 0;
|
|
6449
6964
|
}
|
|
6450
6965
|
clear() {
|
|
@@ -6464,7 +6979,7 @@ var WaveRingPool = class {
|
|
|
6464
6979
|
var FlashLightPool = class {
|
|
6465
6980
|
constructor(context) {
|
|
6466
6981
|
__publicField(this, "context", context);
|
|
6467
|
-
__publicField(this, "lights", Array.from({ length: LIGHT_CAPACITY }, () => ({ x: 0, y: 0, z: 0, color: 16760944, distance: DEFAULT_LIGHT_DISTANCE, peak: 0, duration: 1, t: 0, intensity: 0 })));
|
|
6982
|
+
__publicField(this, "lights", Array.from({ length: LIGHT_CAPACITY }, () => ({ x: 0, y: 0, z: 0, color: 16760944, distance: DEFAULT_LIGHT_DISTANCE, peak: 0, duration: 1, t: 0, intensity: 0, steady: false })));
|
|
6468
6983
|
__publicField(this, "fire", [
|
|
6469
6984
|
{ x: 0, y: 0, z: 0, intensity: 0 },
|
|
6470
6985
|
{ x: 0, y: 0, z: 0, intensity: 0 }
|
|
@@ -6474,7 +6989,7 @@ var FlashLightPool = class {
|
|
|
6474
6989
|
get lit() {
|
|
6475
6990
|
return this.lights.filter((light) => light.intensity > 0).length;
|
|
6476
6991
|
}
|
|
6477
|
-
flash(point, color, intensity, duration, distance, force) {
|
|
6992
|
+
flash(point, color, intensity, duration, distance, force, steady) {
|
|
6478
6993
|
const { level } = this.context.quality;
|
|
6479
6994
|
if (level >= 1 && !force) return;
|
|
6480
6995
|
if (level >= 2 && force !== "boom") return;
|
|
@@ -6487,6 +7002,7 @@ var FlashLightPool = class {
|
|
|
6487
7002
|
light.peak = intensity;
|
|
6488
7003
|
light.duration = duration;
|
|
6489
7004
|
light.t = 0;
|
|
7005
|
+
light.steady = steady === true;
|
|
6490
7006
|
light.intensity = intensity;
|
|
6491
7007
|
}
|
|
6492
7008
|
clear() {
|
|
@@ -6498,7 +7014,7 @@ var FlashLightPool = class {
|
|
|
6498
7014
|
if (light.intensity <= 0) continue;
|
|
6499
7015
|
light.t += dt;
|
|
6500
7016
|
const age = light.t / light.duration;
|
|
6501
|
-
light.intensity = age >= 1 ? 0 : light.peak * (1 - age) * (1 - age);
|
|
7017
|
+
light.intensity = age >= 1 ? 0 : light.steady ? light.peak : light.peak * (1 - age) * (1 - age);
|
|
6502
7018
|
}
|
|
6503
7019
|
}
|
|
6504
7020
|
};
|
|
@@ -6508,6 +7024,14 @@ var QUALITY_MULTIPLIERS = [1, 0.5, 0.2];
|
|
|
6508
7024
|
var FIRE_FLICKER_SWAY = 0.25;
|
|
6509
7025
|
var FIRE_FLICKER_JITTER = 0.08;
|
|
6510
7026
|
var LENS_FADE = 0.16;
|
|
7027
|
+
function rotate(q, v) {
|
|
7028
|
+
const [qx, qy, qz, qw] = q;
|
|
7029
|
+
const ix = qw * v[0] + qy * v[2] - qz * v[1];
|
|
7030
|
+
const iy = qw * v[1] + qz * v[0] - qx * v[2];
|
|
7031
|
+
const iz = qw * v[2] + qx * v[1] - qy * v[0];
|
|
7032
|
+
const iw = -qx * v[0] - qy * v[1] - qz * v[2];
|
|
7033
|
+
return [ix * qw + iw * -qx + iy * -qz - iz * -qy, iy * qw + iw * -qy + iz * -qx - ix * -qz, iz * qw + iw * -qz + ix * -qy - iy * -qx];
|
|
7034
|
+
}
|
|
6511
7035
|
function workshopGround(x, z) {
|
|
6512
7036
|
return z < -2.9 && z > -4.5 && Math.abs(x) < 13 ? 0.12 : 0;
|
|
6513
7037
|
}
|
|
@@ -6521,6 +7045,8 @@ var WorkshopEngine = class {
|
|
|
6521
7045
|
__publicField(this, "decals");
|
|
6522
7046
|
__publicField(this, "rings", new WaveRingPool());
|
|
6523
7047
|
__publicField(this, "lights");
|
|
7048
|
+
__publicField(this, "rain", new RainField(this));
|
|
7049
|
+
__publicField(this, "meshes", new MeshPool());
|
|
6524
7050
|
__publicField(this, "screen", createScreenState());
|
|
6525
7051
|
__publicField(this, "lens", []);
|
|
6526
7052
|
__publicField(this, "post", {});
|
|
@@ -6554,7 +7080,11 @@ var WorkshopEngine = class {
|
|
|
6554
7080
|
place(point) {
|
|
6555
7081
|
const placement = this.placement;
|
|
6556
7082
|
if (!placement) return point;
|
|
6557
|
-
const { anchor, origin, yaw } = placement;
|
|
7083
|
+
const { anchor, origin, yaw, orientation } = placement;
|
|
7084
|
+
if (orientation) {
|
|
7085
|
+
const turned = rotate(orientation, [point[0] - anchor[0], point[1] - anchor[1], point[2] - anchor[2]]);
|
|
7086
|
+
return [origin[0] + turned[0], origin[1] + turned[1], origin[2] + turned[2]];
|
|
7087
|
+
}
|
|
6558
7088
|
const x = point[0] - anchor[0];
|
|
6559
7089
|
const z = point[2] - anchor[2];
|
|
6560
7090
|
const cos2 = Math.cos(yaw);
|
|
@@ -6565,6 +7095,7 @@ var WorkshopEngine = class {
|
|
|
6565
7095
|
turn(vector) {
|
|
6566
7096
|
const placement = this.placement;
|
|
6567
7097
|
if (!placement) return vector;
|
|
7098
|
+
if (placement.orientation) return rotate(placement.orientation, vector);
|
|
6568
7099
|
const cos2 = Math.cos(placement.yaw);
|
|
6569
7100
|
const sin2 = Math.sin(placement.yaw);
|
|
6570
7101
|
return [cos2 * vector[0] + sin2 * vector[2], vector[1], -sin2 * vector[0] + cos2 * vector[2]];
|
|
@@ -6593,6 +7124,14 @@ var WorkshopEngine = class {
|
|
|
6593
7124
|
}
|
|
6594
7125
|
this.accumulators.set(key, carried);
|
|
6595
7126
|
}
|
|
7127
|
+
/** A solid particle (a cone, a sphere): the group sits at `p` turned by the placement, `v` is turned with it and `wv` is not. */
|
|
7128
|
+
mesh(recipe) {
|
|
7129
|
+
const placement = this.placement;
|
|
7130
|
+
const options = placement ? { ...recipe, p: this.place(recipe.p), ...recipe.v ? { v: this.turn(recipe.v) } : {} } : recipe;
|
|
7131
|
+
this.context.trace?.("mesh", [options]);
|
|
7132
|
+
const grouped = recipe.at !== void 0 || recipe.roll !== void 0;
|
|
7133
|
+
return this.meshes.spawn(options, placement && grouped ? placement.orientation ?? [0, Math.sin(placement.yaw / 2), 0, Math.cos(placement.yaw / 2)] : void 0);
|
|
7134
|
+
}
|
|
6596
7135
|
debrisPiece(recipe) {
|
|
6597
7136
|
const options = this.placed(recipe);
|
|
6598
7137
|
this.context.trace?.("debris", [options]);
|
|
@@ -6613,10 +7152,11 @@ var WorkshopEngine = class {
|
|
|
6613
7152
|
this.context.trace?.("ring", args);
|
|
6614
7153
|
this.rings.add(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
6615
7154
|
}
|
|
7155
|
+
/** `steady` (a seventh number): the light holds its intensity for its duration and goes out, where the Workshop's fades with the square of its age. */
|
|
6616
7156
|
flash(recipe) {
|
|
6617
|
-
const args = this.placement ? [this.place(recipe[0]), recipe[1], recipe[2], recipe[3], recipe[4], recipe[5]] : recipe;
|
|
6618
|
-
this.context.trace?.("flash", args);
|
|
6619
|
-
this.lights.flash(args[0], args[1], args[2], args[3], args[4], args[5]);
|
|
7157
|
+
const args = this.placement ? [this.place(recipe[0]), recipe[1], recipe[2], recipe[3], recipe[4], recipe[5], recipe[6]] : recipe;
|
|
7158
|
+
this.context.trace?.("flash", args.slice(0, 6));
|
|
7159
|
+
this.lights.flash(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
6620
7160
|
}
|
|
6621
7161
|
/** `fireLight` (W400): sways with the clock and flickers with one draw. */
|
|
6622
7162
|
fireLight(slot, recipe, intensity, time) {
|
|
@@ -6641,6 +7181,7 @@ var WorkshopEngine = class {
|
|
|
6641
7181
|
this.debris.update(dt);
|
|
6642
7182
|
this.decals.update(dt);
|
|
6643
7183
|
this.rings.update(dt);
|
|
7184
|
+
this.meshes.update(dt);
|
|
6644
7185
|
this.lights.update(dt);
|
|
6645
7186
|
updateScreen(this.screen, dt);
|
|
6646
7187
|
for (let index = this.lens.length - 1; index >= 0; index--) {
|
|
@@ -6657,7 +7198,9 @@ var WorkshopEngine = class {
|
|
|
6657
7198
|
this.debris.clear();
|
|
6658
7199
|
this.decals.clear();
|
|
6659
7200
|
this.rings.clear();
|
|
7201
|
+
this.meshes.clear();
|
|
6660
7202
|
this.lights.clear();
|
|
7203
|
+
this.rain.clear();
|
|
6661
7204
|
this.accumulators.clear();
|
|
6662
7205
|
resetScreenState(this.screen);
|
|
6663
7206
|
this.lens.length = 0;
|
|
@@ -6807,16 +7350,16 @@ function createVfx(options = {}) {
|
|
|
6807
7350
|
},
|
|
6808
7351
|
push(point, radius, speed) {
|
|
6809
7352
|
spriteSystem.push(point, radius, speed);
|
|
6810
|
-
for (const
|
|
6811
|
-
const dx =
|
|
6812
|
-
const dy =
|
|
6813
|
-
const dz =
|
|
7353
|
+
for (const puff3 of core.puffs.items) {
|
|
7354
|
+
const dx = puff3.x - point[0];
|
|
7355
|
+
const dy = puff3.y - point[1];
|
|
7356
|
+
const dz = puff3.z - point[2];
|
|
6814
7357
|
const distance = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
6815
7358
|
if (distance >= radius) continue;
|
|
6816
7359
|
const strength = speed * (1 - distance / radius) / (distance + 1e-3);
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
7360
|
+
puff3.vx += dx * strength;
|
|
7361
|
+
puff3.vy += dy * strength;
|
|
7362
|
+
puff3.vz += dz * strength;
|
|
6820
7363
|
}
|
|
6821
7364
|
},
|
|
6822
7365
|
stop(handle) {
|
|
@@ -6833,6 +7376,12 @@ function createVfx(options = {}) {
|
|
|
6833
7376
|
camera2.y = position[1];
|
|
6834
7377
|
camera2.z = position[2];
|
|
6835
7378
|
},
|
|
7379
|
+
setWind(next) {
|
|
7380
|
+
wind.x = next[0];
|
|
7381
|
+
wind.y = next[1];
|
|
7382
|
+
wind.z = next[2];
|
|
7383
|
+
},
|
|
7384
|
+
wind: () => [wind.x, wind.y, wind.z],
|
|
6836
7385
|
forceLod(scale) {
|
|
6837
7386
|
core.clock.forcedLod = scale;
|
|
6838
7387
|
},
|
|
@@ -7184,6 +7733,27 @@ var en = {
|
|
|
7184
7733
|
budget: "Up to 600 particles per building and 2 fire lights. Beyond 80 m only the smoke column and the glow of the windows remain, which become a landmark.",
|
|
7185
7734
|
network: "A fire entity on the server per building, with a spread state."
|
|
7186
7735
|
},
|
|
7736
|
+
rain_and_puddles: {
|
|
7737
|
+
name: "Rain, splashes and puddles",
|
|
7738
|
+
short: "Drops with wind, splashes and rings only near the camera, lightning in the storm.",
|
|
7739
|
+
cost: "\u2264 4,000 drops",
|
|
7740
|
+
costNote: "splash up to 12 m",
|
|
7741
|
+
paramLabel: "Intensity",
|
|
7742
|
+
when: "The weather of the world. Rain raises the background noise and masks footsteps (it can be used for stealth).",
|
|
7743
|
+
look: "A fine drizzle, almost vertical. Rain with splashes on the asphalt and rings in the puddles, which are dark and mirror-like. A storm with drops slanted by the wind, sheets of water passing and a double flash of lightning that lights the scene for 0.2 s and reveals the horde.",
|
|
7744
|
+
budget: "Up to 4,000 drops tied to the camera in a 30 m box. Splashes and rings only within 12 m and only on what the camera sees.",
|
|
7745
|
+
network: "The server sends the weather and the lightning seed, so everyone sees the same flash."
|
|
7746
|
+
},
|
|
7747
|
+
fog_and_ash: {
|
|
7748
|
+
name: "Fog and ash",
|
|
7749
|
+
short: "Low layered mist, ash falling and the lamp post with its cone of light.",
|
|
7750
|
+
cost: "\u2264 120 sprites",
|
|
7751
|
+
costNote: "1 cone of light",
|
|
7752
|
+
when: "Before dawn, near the river and in burnt zones (ash). It cuts the sight of the zombies and of the player.",
|
|
7753
|
+
look: "The engine fog plus a layer of low mist that moves slowly, fine ash falling in a spiral and the beam of the lamp posts in view. Zombie silhouettes show before their details.",
|
|
7754
|
+
budget: "Up to 60 large mist sprites (half resolution) and 60 of ash. The lamp cone is an additive mesh, not real volumetric light.",
|
|
7755
|
+
network: "The weather comes from the server. The density is local, by zone."
|
|
7756
|
+
},
|
|
7187
7757
|
scraping_sparks: {
|
|
7188
7758
|
name: "Scraping sparks",
|
|
7189
7759
|
short: "A bumper dragging on the asphalt: a river of bouncing sparks and a mark on the ground.",
|
|
@@ -7235,6 +7805,16 @@ var en = {
|
|
|
7235
7805
|
budget: "Texture only: a crack mask with 4 stages and a blood decal on the glass. Glass dust: 6 particles per blow.",
|
|
7236
7806
|
network: "The server sends the glass health. Blood on the glass is local."
|
|
7237
7807
|
},
|
|
7808
|
+
headlights_in_rain: {
|
|
7809
|
+
name: "Headlights in the rain",
|
|
7810
|
+
short: "A visible beam, drops lit inside the cone and the horde walking into the light.",
|
|
7811
|
+
cost: "\u2264 600 lit drops",
|
|
7812
|
+
costNote: "2 spots, no shadow",
|
|
7813
|
+
when: "Headlights on at night, with rain or fog.",
|
|
7814
|
+
look: "Two cones of light in the air, rain drops that shine only inside the beam and zombie silhouettes that light up when they enter the light. Outside the cone the rain almost disappears.",
|
|
7815
|
+
budget: "2 spotlights without shadow, 2 additive cones and up to 600 extra drops only inside the cone. Headlights of cars beyond 40 m stay as a cone only, with no real light.",
|
|
7816
|
+
network: "The state of the headlights is already replicated with the car."
|
|
7817
|
+
},
|
|
7238
7818
|
damage_and_bite: {
|
|
7239
7819
|
name: "Damage and bite",
|
|
7240
7820
|
short: "A red edge on the side of the blow, blood on the lens and the pulse of the bite.",
|
|
@@ -7554,6 +8134,27 @@ var ptBR = {
|
|
|
7554
8134
|
budget: "At\xE9 600 part\xEDculas por pr\xE9dio e 2 luzes de fogo. Al\xE9m de 80 m fica s\xF3 a coluna de fuma\xE7a e o brilho das janelas, que viram ponto de refer\xEAncia.",
|
|
7555
8135
|
network: "Entidade de fogo no servidor por pr\xE9dio, com estado de espalhar."
|
|
7556
8136
|
},
|
|
8137
|
+
rain_and_puddles: {
|
|
8138
|
+
name: "Chuva, respingos e po\xE7as",
|
|
8139
|
+
short: "Gotas com vento, respingos e an\xE9is s\xF3 perto da c\xE2mera, rel\xE2mpago no temporal.",
|
|
8140
|
+
cost: "\u2264 4.000 gotas",
|
|
8141
|
+
costNote: "respingo at\xE9 12 m",
|
|
8142
|
+
paramLabel: "Intensidade",
|
|
8143
|
+
when: "Clima do mundo. Chuva aumenta o ru\xEDdo de fundo e mascara passos (d\xE1 para usar na furtividade).",
|
|
8144
|
+
look: "Garoa fina quase vertical. Chuva com respingos no asfalto e an\xE9is nas po\xE7as, que ficam escuras e espelhadas. Temporal com gotas inclinadas pelo vento, cortinas de \xE1gua passando e rel\xE2mpago duplo que clareia a cena por 0,2 s e revela a horda.",
|
|
8145
|
+
budget: "At\xE9 4.000 gotas presas \xE0 c\xE2mera numa caixa de 30 m. Respingos e an\xE9is s\xF3 a menos de 12 m e s\xF3 em cima do que a c\xE2mera v\xEA.",
|
|
8146
|
+
network: "O servidor manda o clima e a semente do rel\xE2mpago, para todos verem o mesmo clar\xE3o."
|
|
8147
|
+
},
|
|
8148
|
+
fog_and_ash: {
|
|
8149
|
+
name: "Neblina e cinzas",
|
|
8150
|
+
short: "N\xE9voa rasteira em camadas, cinza caindo e o poste com cone de luz.",
|
|
8151
|
+
cost: "\u2264 120 sprites",
|
|
8152
|
+
costNote: "1 cone de luz",
|
|
8153
|
+
when: "Madrugada, perto de rio e em zonas queimadas (cinza). Reduz a vis\xE3o dos zumbis e do jogador.",
|
|
8154
|
+
look: "Neblina do motor mais uma camada de n\xE9voa baixa que se move devagar, cinza fina caindo em espiral e o feixe dos postes vis\xEDvel. Silhuetas de zumbis aparecem antes dos detalhes.",
|
|
8155
|
+
budget: "At\xE9 60 sprites grandes de n\xE9voa (meia resolu\xE7\xE3o) e 60 de cinza. O cone do poste \xE9 uma malha aditiva, n\xE3o luz volum\xE9trica real.",
|
|
8156
|
+
network: "Clima vem do servidor. Densidade \xE9 local por zona."
|
|
8157
|
+
},
|
|
7557
8158
|
scraping_sparks: {
|
|
7558
8159
|
name: "Fa\xEDscas de raspagem",
|
|
7559
8160
|
short: "Para-choque arrastando no asfalto: rio de fa\xEDscas que quicam e marca no ch\xE3o.",
|
|
@@ -7605,6 +8206,16 @@ var ptBR = {
|
|
|
7605
8206
|
budget: "S\xF3 textura: uma m\xE1scara de rachadura com 4 est\xE1gios e um decal de sangue no vidro. P\xF3 de vidro: 6 part\xEDculas por golpe.",
|
|
7606
8207
|
network: "O servidor manda a vida do vidro. Sangue no vidro \xE9 local."
|
|
7607
8208
|
},
|
|
8209
|
+
headlights_in_rain: {
|
|
8210
|
+
name: "Far\xF3is na chuva",
|
|
8211
|
+
short: "Feixe vis\xEDvel, gotas acesas dentro do cone e a horda entrando na luz.",
|
|
8212
|
+
cost: "\u2264 600 gotas acesas",
|
|
8213
|
+
costNote: "2 spots sem sombra",
|
|
8214
|
+
when: "Far\xF3is ligados \xE0 noite, com chuva ou neblina.",
|
|
8215
|
+
look: "Dois cones de luz vis\xEDveis no ar, gotas de chuva que brilham s\xF3 dentro do feixe e silhuetas de zumbi que acendem quando entram na luz. Fora do cone, a chuva quase some.",
|
|
8216
|
+
budget: "2 spotlights sem sombra, 2 cones aditivos e at\xE9 600 gotas extras s\xF3 dentro do cone. Far\xF3is de carros a mais de 40 m ficam s\xF3 como cone, sem luz real.",
|
|
8217
|
+
network: "Estado do farol j\xE1 \xE9 replicado com o carro."
|
|
8218
|
+
},
|
|
7608
8219
|
damage_and_bite: {
|
|
7609
8220
|
name: "Dano e mordida",
|
|
7610
8221
|
short: "Borda vermelha do lado do golpe, sangue na lente e o pulso da mordida.",
|
|
@@ -7704,7 +8315,7 @@ function ease3(value) {
|
|
|
7704
8315
|
function mix(from, to, amount) {
|
|
7705
8316
|
return [from[0] + (to[0] - from[0]) * amount, from[1] + (to[1] - from[1]) * amount, from[2] + (to[2] - from[2]) * amount];
|
|
7706
8317
|
}
|
|
7707
|
-
function
|
|
8318
|
+
function rotate2(local2, x, y, z, w) {
|
|
7708
8319
|
const [vx2, vy2, vz2] = local2;
|
|
7709
8320
|
const ix = w * vx2 + y * vz2 - z * vy2;
|
|
7710
8321
|
const iy = w * vy2 + z * vx2 - x * vz2;
|
|
@@ -7762,7 +8373,7 @@ var EffectCamera = class {
|
|
|
7762
8373
|
/** A direction given in the camera's own axes, in world axes. */
|
|
7763
8374
|
forward(local2) {
|
|
7764
8375
|
const [x, y, z, w] = lookAtQuaternion(this.position, this.target);
|
|
7765
|
-
return
|
|
8376
|
+
return rotate2(local2, x, y, z, w);
|
|
7766
8377
|
}
|
|
7767
8378
|
};
|
|
7768
8379
|
|
|
@@ -7924,15 +8535,20 @@ export {
|
|
|
7924
8535
|
GAME_EFFECTS,
|
|
7925
8536
|
LOD_GAME,
|
|
7926
8537
|
LOD_LAB,
|
|
8538
|
+
MeshPool,
|
|
7927
8539
|
OrderedPool,
|
|
7928
8540
|
PROFILES,
|
|
8541
|
+
RAIN_CAPACITY,
|
|
8542
|
+
RainField,
|
|
7929
8543
|
SMOKE_COLORS,
|
|
7930
8544
|
SPRITE_KINDS,
|
|
7931
8545
|
SpriteKindPool,
|
|
7932
8546
|
SpriteKindSystem,
|
|
7933
8547
|
VFX_LAYERS,
|
|
8548
|
+
VIEWMODEL_EFFECTS,
|
|
7934
8549
|
WORKSHOP_BEHAVIORS,
|
|
7935
8550
|
WORKSHOP_EFFECTS,
|
|
8551
|
+
WORKSHOP_PUDDLES,
|
|
7936
8552
|
WorkshopEngine,
|
|
7937
8553
|
colorOfChunk,
|
|
7938
8554
|
composeExplosion,
|
|
@@ -7947,6 +8563,7 @@ export {
|
|
|
7947
8563
|
estimateCost,
|
|
7948
8564
|
hexToLinearRgb,
|
|
7949
8565
|
hexToRgb,
|
|
8566
|
+
inPuddle,
|
|
7950
8567
|
lcg,
|
|
7951
8568
|
lehmer,
|
|
7952
8569
|
locales,
|