quake2ts 0.0.165 → 0.0.167

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.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/packages/client/dist/browser/index.global.js +1 -1
  3. package/packages/client/dist/browser/index.global.js.map +1 -1
  4. package/packages/client/dist/cjs/index.cjs.map +1 -1
  5. package/packages/client/dist/esm/index.js.map +1 -1
  6. package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
  7. package/packages/engine/dist/browser/index.global.js.map +1 -1
  8. package/packages/engine/dist/cjs/index.cjs.map +1 -1
  9. package/packages/engine/dist/esm/index.js.map +1 -1
  10. package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
  11. package/packages/game/dist/browser/index.global.js +2 -2
  12. package/packages/game/dist/browser/index.global.js.map +1 -1
  13. package/packages/game/dist/cjs/index.cjs +10 -6
  14. package/packages/game/dist/cjs/index.cjs.map +1 -1
  15. package/packages/game/dist/esm/index.js +10 -6
  16. package/packages/game/dist/esm/index.js.map +1 -1
  17. package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
  18. package/packages/game/dist/types/combat/weapons/firing.d.ts +2 -0
  19. package/packages/game/dist/types/combat/weapons/firing.d.ts.map +1 -1
  20. package/packages/game/dist/types/entities/entity.d.ts +1 -0
  21. package/packages/game/dist/types/entities/entity.d.ts.map +1 -1
  22. package/packages/game/dist/types/entities/monsters/tank.d.ts.map +1 -1
  23. package/packages/game/dist/types/entities/projectiles.d.ts +1 -1
  24. package/packages/game/dist/types/entities/projectiles.d.ts.map +1 -1
  25. package/packages/game/dist/types/index.d.ts +2 -0
  26. package/packages/game/dist/types/index.d.ts.map +1 -1
  27. package/packages/shared/dist/browser/index.global.js +1 -1
  28. package/packages/shared/dist/browser/index.global.js.map +1 -1
  29. package/packages/shared/dist/cjs/index.cjs +3 -0
  30. package/packages/shared/dist/cjs/index.cjs.map +1 -1
  31. package/packages/shared/dist/esm/index.js +3 -0
  32. package/packages/shared/dist/esm/index.js.map +1 -1
  33. package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
  34. package/packages/shared/dist/types/math/random.d.ts +1 -0
  35. package/packages/shared/dist/types/math/random.d.ts.map +1 -1
  36. package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
@@ -307,6 +307,9 @@ var RandomGenerator = class {
307
307
  constructor(options = {}) {
308
308
  this.mt = new MersenneTwister19937(options.seed);
309
309
  }
310
+ seed(seed) {
311
+ this.mt.seed(seed);
312
+ }
310
313
  /** Uniform float in [0, 1). */
311
314
  frandom() {
312
315
  return this.mt.nextUint32() / TWO_POW_32;
@@ -5477,7 +5480,7 @@ function registerBerserkSpawns(registry) {
5477
5480
  }
5478
5481
 
5479
5482
  // src/entities/projectiles.ts
5480
- function createRocket(sys, owner, start, dir, damage, speed, flashtype = 0) {
5483
+ function createRocket(sys, owner, start, dir, damage, radiusDamage, speed, flashtype = 0) {
5481
5484
  const rocket = sys.spawn();
5482
5485
  rocket.classname = "rocket";
5483
5486
  rocket.movetype = 8 /* FlyMissile */;
@@ -5507,7 +5510,7 @@ function createRocket(sys, owner, start, dir, damage, speed, flashtype = 0) {
5507
5510
  );
5508
5511
  }
5509
5512
  const entities = sys.findByRadius(self.origin, 120);
5510
- T_RadiusDamage(entities, self, self.owner, 120, self.owner, 120, 0 /* NONE */, 9 /* R_SPLASH */, {}, sys.multicast.bind(sys));
5513
+ T_RadiusDamage(entities, self, self.owner, radiusDamage, self.owner, 120, 0 /* NONE */, 9 /* R_SPLASH */, {}, sys.multicast.bind(sys));
5511
5514
  sys.multicast(self.origin, 2 /* Phs */, ServerCommand.temp_entity, TempEntity.ROCKET_EXPLOSION, self.origin);
5512
5515
  sys.free(self);
5513
5516
  };
@@ -5601,7 +5604,7 @@ function createBfgBall(sys, owner, start, dir, damage, speed, damageRadius) {
5601
5604
  return;
5602
5605
  }
5603
5606
  const entities = sys.findByRadius(self.origin, damageRadius);
5604
- T_RadiusDamage(entities, self, self.owner, 200, self.owner, damageRadius, 0 /* NONE */, 13 /* BFG_BLAST */, {}, sys.multicast.bind(sys));
5607
+ T_RadiusDamage(entities, self, self.owner, damage, self.owner, damageRadius, 0 /* NONE */, 13 /* BFG_BLAST */, {}, sys.multicast.bind(sys));
5605
5608
  sys.multicast(self.origin, 2 /* Phs */, ServerCommand.temp_entity, TempEntity.BFG_EXPLOSION, self.origin);
5606
5609
  if (self.owner) {
5607
5610
  const targets = sys.findByRadius(self.origin, 1e3);
@@ -5688,7 +5691,7 @@ function monster_fire_grenade(self, start, aim, damage, speed, flashtype, contex
5688
5691
  createGrenade(context, self, start, aim, damage, speed);
5689
5692
  }
5690
5693
  function monster_fire_rocket(self, start, dir, damage, speed, flashtype, context) {
5691
- createRocket(context, self, start, dir, damage, speed);
5694
+ createRocket(context, self, start, dir, damage, 120, speed);
5692
5695
  }
5693
5696
  function monster_fire_bfg(self, start, dir, damage, speed, kick, damage_radius, flashtype, context) {
5694
5697
  createBfgBall(context, self, start, dir, damage, speed, damage_radius);
@@ -10333,7 +10336,7 @@ function tank_fire_machinegun(self, context) {
10333
10336
  z: self.origin.z + (self.viewheight || 0)
10334
10337
  };
10335
10338
  const dir = normalizeVec3(subtractVec3(self.enemy.origin, start));
10336
- const damage = 10;
10339
+ const damage = 20;
10337
10340
  const kick = 2;
10338
10341
  monster_fire_bullet(self, start, dir, damage, kick, 0.05, 0.05, 0, context, 4 /* MACHINEGUN */);
10339
10342
  }
@@ -10479,6 +10482,7 @@ function SP_monster_tank(self, context) {
10479
10482
  self.monsterinfo.walk = tank_walk;
10480
10483
  self.monsterinfo.run = tank_run;
10481
10484
  self.monsterinfo.attack = tank_attack;
10485
+ self.monsterinfo.attack_machinegun = attack_machinegun_move;
10482
10486
  self.think = monster_think;
10483
10487
  tank_stand(self);
10484
10488
  self.nextthink = self.timestamp + MONSTER_TICK20;
@@ -12441,7 +12445,7 @@ function createGame({ trace, pointcontents, multicast, unicast }, engine, option
12441
12445
  const deathmatch = options.deathmatch ?? false;
12442
12446
  const levelClock = new LevelClock();
12443
12447
  const frameLoop = new GameFrameLoop();
12444
- const rng = new RandomGenerator();
12448
+ const rng = options.random ?? new RandomGenerator();
12445
12449
  const linkentity = (ent) => {
12446
12450
  ent.absmin = {
12447
12451
  x: ent.origin.x + ent.mins.x,