quake2ts 0.0.491 → 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.
@@ -10429,7 +10429,11 @@ var MZ_GRENADE = 8;
10429
10429
  var MZ_SSHOTGUN = 11;
10430
10430
  var MZ_BFG = 12;
10431
10431
  var MZ_HYPERBLASTER = 13;
10432
+ var MZ_IONRIPPER = 16;
10432
10433
  var MZ_BLUEHYPERBLASTER = 17;
10434
+ var MZ_PHALANX = 18;
10435
+ var MZ_ETF_RIFLE = 30;
10436
+ var MZ_HEATBEAM = 33;
10433
10437
  function readUint16LE(stats, startIndex, byteOffset) {
10434
10438
  const elementIndex = Math.floor(byteOffset / 2);
10435
10439
  const isOdd = byteOffset % 2 !== 0;
@@ -14179,11 +14183,34 @@ var vectorMA = (start, scale3, dir) => ({
14179
14183
  y: start.y + dir.y * scale3,
14180
14184
  z: start.z + dir.z * scale3
14181
14185
  });
14186
+ var FLASH_OFFSETS = {
14187
+ [MZ_BLASTER]: { x: 24, y: 8, z: 0 },
14188
+ [MZ_MACHINEGUN]: { x: 28, y: 8, z: 0 },
14189
+ [MZ_SHOTGUN]: { x: 24, y: 8, z: 0 },
14190
+ [MZ_SSHOTGUN]: { x: 20, y: 8, z: 0 },
14191
+ [MZ_CHAINGUN1]: { x: 30, y: 8, z: -4 },
14192
+ [MZ_CHAINGUN2]: { x: 30, y: 8, z: -4 },
14193
+ [MZ_CHAINGUN3]: { x: 30, y: 8, z: -4 },
14194
+ [MZ_RAILGUN]: { x: 32, y: 8, z: 0 },
14195
+ [MZ_ROCKET]: { x: 30, y: 8, z: 0 },
14196
+ [MZ_GRENADE]: { x: 24, y: 8, z: 0 },
14197
+ [MZ_BFG]: { x: 32, y: 8, z: -2 },
14198
+ [MZ_HYPERBLASTER]: { x: 30, y: 8, z: 0 },
14199
+ [MZ_BLUEHYPERBLASTER]: { x: 30, y: 8, z: 0 },
14200
+ [MZ_PHALANX]: { x: 28, y: 8, z: 0 },
14201
+ [MZ_IONRIPPER]: { x: 28, y: 8, z: 0 },
14202
+ [MZ_ETF_RIFLE]: { x: 30, y: 8, z: 0 },
14203
+ [MZ_HEATBEAM]: { x: 24, y: 8, z: 0 }
14204
+ };
14205
+ var getFlashOffset = (weapon) => {
14206
+ return FLASH_OFFSETS[weapon] || { x: 18, y: 16, z: 0 };
14207
+ };
14182
14208
  var ClientEffectSystem = class {
14183
- constructor(dlightManager, engine, entityProvider) {
14209
+ constructor(dlightManager, engine, entityProvider, configStrings) {
14184
14210
  this.dlightManager = dlightManager;
14185
14211
  this.engine = engine;
14186
14212
  this.entityProvider = entityProvider;
14213
+ this.configStrings = configStrings;
14187
14214
  }
14188
14215
  // Helper to add dlight
14189
14216
  addLight(key, origin, color, radius, minLight, die, radiusSpeed = 0) {
@@ -14212,17 +14239,17 @@ var ClientEffectSystem = class {
14212
14239
  if (!ent) return;
14213
14240
  const origin = { x: ent.origin.x, y: ent.origin.y, z: ent.origin.z };
14214
14241
  const angles = { x: ent.angles.x, y: ent.angles.y, z: ent.angles.z };
14215
- const vectors = angleVectors(angles);
14216
- let flashOrigin = vectorMA(origin, 18, vectors.forward);
14217
- flashOrigin = vectorMA(flashOrigin, 16, vectors.right);
14218
14242
  const silenced = (weapon & 128) !== 0;
14219
14243
  weapon &= ~128;
14220
- const minLight = 32;
14221
- const duration = 0.1;
14222
- const die = time + duration;
14223
- const volume = silenced ? 0.2 : 1;
14244
+ let flashOrigin = { ...origin };
14245
+ const vectors = angleVectors(angles);
14246
+ const offset = getFlashOffset(weapon);
14247
+ flashOrigin = vectorMA(flashOrigin, offset.x, vectors.forward);
14248
+ flashOrigin = vectorMA(flashOrigin, offset.y, vectors.right);
14249
+ flashOrigin = vectorMA(flashOrigin, offset.z, vectors.up);
14224
14250
  let radius = silenced ? 100 : 200;
14225
- if (Math.random() < 0.5) radius += Math.random() * 31;
14251
+ let duration = 0.1;
14252
+ let minLight = 32;
14226
14253
  let color = { x: 1, y: 1, z: 0 };
14227
14254
  switch (weapon) {
14228
14255
  case MZ_BLASTER:
@@ -14252,6 +14279,7 @@ var ClientEffectSystem = class {
14252
14279
  case MZ_RAILGUN:
14253
14280
  radius = 150;
14254
14281
  color = { x: 0.5, y: 0.5, z: 1 };
14282
+ duration = 0.15;
14255
14283
  break;
14256
14284
  case MZ_ROCKET:
14257
14285
  case MZ_GRENADE:
@@ -14261,9 +14289,13 @@ var ClientEffectSystem = class {
14261
14289
  case MZ_BFG:
14262
14290
  radius = 400;
14263
14291
  color = { x: 0, y: 1, z: 0 };
14292
+ duration = 0.2;
14264
14293
  break;
14265
14294
  }
14266
14295
  if (silenced) radius *= 0.75;
14296
+ if (Math.random() < 0.5) radius += Math.random() * 31;
14297
+ const die = time + duration;
14298
+ const volume = silenced ? 0.2 : 1;
14267
14299
  this.addLight(entNum, flashOrigin, color, radius, minLight, die);
14268
14300
  let soundName = "";
14269
14301
  switch (weapon) {