quake2ts 0.0.490 → 0.0.493

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.
@@ -10465,7 +10465,11 @@ var MZ_GRENADE = 8;
10465
10465
  var MZ_SSHOTGUN = 11;
10466
10466
  var MZ_BFG = 12;
10467
10467
  var MZ_HYPERBLASTER = 13;
10468
+ var MZ_IONRIPPER = 16;
10468
10469
  var MZ_BLUEHYPERBLASTER = 17;
10470
+ var MZ_PHALANX = 18;
10471
+ var MZ_ETF_RIFLE = 30;
10472
+ var MZ_HEATBEAM = 33;
10469
10473
  function readUint16LE(stats, startIndex, byteOffset) {
10470
10474
  const elementIndex = Math.floor(byteOffset / 2);
10471
10475
  const isOdd = byteOffset % 2 !== 0;
@@ -14215,11 +14219,34 @@ var vectorMA = (start, scale3, dir) => ({
14215
14219
  y: start.y + dir.y * scale3,
14216
14220
  z: start.z + dir.z * scale3
14217
14221
  });
14222
+ var FLASH_OFFSETS = {
14223
+ [MZ_BLASTER]: { x: 24, y: 8, z: 0 },
14224
+ [MZ_MACHINEGUN]: { x: 28, y: 8, z: 0 },
14225
+ [MZ_SHOTGUN]: { x: 24, y: 8, z: 0 },
14226
+ [MZ_SSHOTGUN]: { x: 20, y: 8, z: 0 },
14227
+ [MZ_CHAINGUN1]: { x: 30, y: 8, z: -4 },
14228
+ [MZ_CHAINGUN2]: { x: 30, y: 8, z: -4 },
14229
+ [MZ_CHAINGUN3]: { x: 30, y: 8, z: -4 },
14230
+ [MZ_RAILGUN]: { x: 32, y: 8, z: 0 },
14231
+ [MZ_ROCKET]: { x: 30, y: 8, z: 0 },
14232
+ [MZ_GRENADE]: { x: 24, y: 8, z: 0 },
14233
+ [MZ_BFG]: { x: 32, y: 8, z: -2 },
14234
+ [MZ_HYPERBLASTER]: { x: 30, y: 8, z: 0 },
14235
+ [MZ_BLUEHYPERBLASTER]: { x: 30, y: 8, z: 0 },
14236
+ [MZ_PHALANX]: { x: 28, y: 8, z: 0 },
14237
+ [MZ_IONRIPPER]: { x: 28, y: 8, z: 0 },
14238
+ [MZ_ETF_RIFLE]: { x: 30, y: 8, z: 0 },
14239
+ [MZ_HEATBEAM]: { x: 24, y: 8, z: 0 }
14240
+ };
14241
+ var getFlashOffset = (weapon) => {
14242
+ return FLASH_OFFSETS[weapon] || { x: 18, y: 16, z: 0 };
14243
+ };
14218
14244
  var ClientEffectSystem = class {
14219
- constructor(dlightManager, engine, entityProvider) {
14245
+ constructor(dlightManager, engine, entityProvider, configStrings) {
14220
14246
  this.dlightManager = dlightManager;
14221
14247
  this.engine = engine;
14222
14248
  this.entityProvider = entityProvider;
14249
+ this.configStrings = configStrings;
14223
14250
  }
14224
14251
  // Helper to add dlight
14225
14252
  addLight(key, origin, color, radius, minLight, die, radiusSpeed = 0) {
@@ -14248,17 +14275,17 @@ var ClientEffectSystem = class {
14248
14275
  if (!ent) return;
14249
14276
  const origin = { x: ent.origin.x, y: ent.origin.y, z: ent.origin.z };
14250
14277
  const angles = { x: ent.angles.x, y: ent.angles.y, z: ent.angles.z };
14251
- const vectors = angleVectors(angles);
14252
- let flashOrigin = vectorMA(origin, 18, vectors.forward);
14253
- flashOrigin = vectorMA(flashOrigin, 16, vectors.right);
14254
14278
  const silenced = (weapon & 128) !== 0;
14255
14279
  weapon &= ~128;
14256
- const minLight = 32;
14257
- const duration = 0.1;
14258
- const die = time + duration;
14259
- const volume = silenced ? 0.2 : 1;
14280
+ let flashOrigin = { ...origin };
14281
+ const vectors = angleVectors(angles);
14282
+ const offset = getFlashOffset(weapon);
14283
+ flashOrigin = vectorMA(flashOrigin, offset.x, vectors.forward);
14284
+ flashOrigin = vectorMA(flashOrigin, offset.y, vectors.right);
14285
+ flashOrigin = vectorMA(flashOrigin, offset.z, vectors.up);
14260
14286
  let radius = silenced ? 100 : 200;
14261
- if (Math.random() < 0.5) radius += Math.random() * 31;
14287
+ let duration = 0.1;
14288
+ let minLight = 32;
14262
14289
  let color = { x: 1, y: 1, z: 0 };
14263
14290
  switch (weapon) {
14264
14291
  case MZ_BLASTER:
@@ -14288,6 +14315,7 @@ var ClientEffectSystem = class {
14288
14315
  case MZ_RAILGUN:
14289
14316
  radius = 150;
14290
14317
  color = { x: 0.5, y: 0.5, z: 1 };
14318
+ duration = 0.15;
14291
14319
  break;
14292
14320
  case MZ_ROCKET:
14293
14321
  case MZ_GRENADE:
@@ -14297,9 +14325,13 @@ var ClientEffectSystem = class {
14297
14325
  case MZ_BFG:
14298
14326
  radius = 400;
14299
14327
  color = { x: 0, y: 1, z: 0 };
14328
+ duration = 0.2;
14300
14329
  break;
14301
14330
  }
14302
14331
  if (silenced) radius *= 0.75;
14332
+ if (Math.random() < 0.5) radius += Math.random() * 31;
14333
+ const die = time + duration;
14334
+ const volume = silenced ? 0.2 : 1;
14303
14335
  this.addLight(entNum, flashOrigin, color, radius, minLight, die);
14304
14336
  let soundName = "";
14305
14337
  switch (weapon) {