@adatechnology/game-vfx 0.2.0 → 0.3.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.d.ts +1 -1
- package/dist/index.global.js +12 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1685,7 +1685,7 @@ declare function patchExplosions(base: Readonly<Record<string, ExplosionDef>>, c
|
|
|
1685
1685
|
|
|
1686
1686
|
/** Every effect of the Workshop by id. A game adds, changes or removes entries with `patchEffects`. */
|
|
1687
1687
|
declare const WORKSHOP_EFFECTS: Readonly<Record<string, EffectDef>>;
|
|
1688
|
-
/** The Workshop's recipes plus the one-shot effects the destruction events play (`event-effects.json`) and the ones of the weapon in the player's hands: what a world plays by default. */
|
|
1688
|
+
/** The Workshop's recipes plus the one-shot effects the destruction events play (`event-effects.json`) and the ones of the weapon in the player's hands and the vehicle ones (`vehicle_fire`, `vehicle_exhaust`, `vehicle_leak`, written around a car): what a world plays by default. */
|
|
1689
1689
|
declare const GAME_EFFECTS: Readonly<Record<string, EffectDef>>;
|
|
1690
1690
|
/** A copy of the recipes with some changed (a partial replaces the fields it names), added or removed (`null`); a game tunes the Workshop's effects without touching the core. */
|
|
1691
1691
|
declare function patchEffects(base: Readonly<Record<string, EffectDef>>, changes: Readonly<Record<string, Partial<EffectDef> | EffectDef | null>>): Record<string, EffectDef>;
|
package/dist/index.global.js
CHANGED
|
@@ -3756,10 +3756,21 @@ var GameVfx = (() => {
|
|
|
3756
3756
|
};
|
|
3757
3757
|
var VIEWMODEL_EFFECTS = [MUZZLE_FLASH2, SMOKE_PUFF, BACKBLAST, FLAME_JET];
|
|
3758
3758
|
|
|
3759
|
+
// src/effects/vehicles/game-effects.ts
|
|
3760
|
+
var aliasOf = (base, id, changes) => ({ ...base, id, pageId: `vehicle:${id}`, anchor: CAR_ORIGIN2, ...changes });
|
|
3761
|
+
var VEHICLE_EFFECTS = [
|
|
3762
|
+
/** The engine on fire: `engine_smoke` at its worst condition (black smoke, flames in the hood, a light). */
|
|
3763
|
+
aliasOf(ENGINE_SMOKE, "vehicle_fire", { params: { id: "condition", options: ["100", "60", "30", "10"], default: 3 }, loop: 12 }),
|
|
3764
|
+
/** The exhaust of a car under way: `engine_smoke` in the best condition, for half a second so a moving car asks again. */
|
|
3765
|
+
aliasOf(ENGINE_SMOKE, "vehicle_exhaust", { params: { id: "condition", options: ["100", "60", "30", "10"], default: 0 }, loop: 0.5 }),
|
|
3766
|
+
/** A hole in the tank: the page's own petrol leak (drips, pool, sparks, fire running to the tank). */
|
|
3767
|
+
aliasOf(FUEL_LEAK, "vehicle_leak", {})
|
|
3768
|
+
];
|
|
3769
|
+
|
|
3759
3770
|
// src/effects/catalog.ts
|
|
3760
3771
|
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];
|
|
3761
3772
|
var WORKSHOP_EFFECTS = Object.fromEntries(ALL_EFFECTS.map((effect) => [effect.id, effect]));
|
|
3762
|
-
var GAME_EFFECTS = { ...WORKSHOP_EFFECTS, ...Object.fromEntries([...EVENT_EFFECTS, ...VIEWMODEL_EFFECTS].map((effect) => [effect.id, effect])) };
|
|
3773
|
+
var GAME_EFFECTS = { ...WORKSHOP_EFFECTS, ...Object.fromEntries([...EVENT_EFFECTS, ...VIEWMODEL_EFFECTS, ...VEHICLE_EFFECTS].map((effect) => [effect.id, effect])) };
|
|
3763
3774
|
function patchEffects(base, changes) {
|
|
3764
3775
|
const result = { ...base };
|
|
3765
3776
|
for (const [id, change] of Object.entries(changes)) {
|