quake2ts 0.0.276 → 0.0.277

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.
@@ -3907,6 +3907,7 @@ function T_RadiusDamage(entities, inflictor, attacker, damage, ignore, radius, d
3907
3907
  }
3908
3908
 
3909
3909
  // src/entities/misc.ts
3910
+ var random = createRandomGenerator();
3910
3911
  var SPAWNFLAGS_OBJECT_TRIGGER_SPAWN = 1;
3911
3912
  var SPAWNFLAGS_OBJECT_ANIMATED = 2;
3912
3913
  function func_object_touch(self, other, plane, surf) {
@@ -3958,6 +3959,24 @@ var func_object = (entity, context) => {
3958
3959
  if (entity.spawnflags & SPAWNFLAGS_OBJECT_ANIMATED) {
3959
3960
  }
3960
3961
  };
3962
+ function gib_die(self, inflictor, attacker, damage) {
3963
+ }
3964
+ function spawn_gib(entity, model, context) {
3965
+ context.entities.modelIndex(model);
3966
+ entity.solid = 0 /* Not */;
3967
+ entity.takedamage = true;
3968
+ entity.die = gib_die;
3969
+ entity.movetype = 7 /* Toss */;
3970
+ entity.deadflag = 2;
3971
+ entity.avelocity = {
3972
+ x: random.frandom() * 200,
3973
+ y: random.frandom() * 200,
3974
+ z: random.frandom() * 200
3975
+ };
3976
+ entity.think = (self) => context.entities.free(self);
3977
+ context.entities.scheduleThink(entity, context.entities.timeSeconds + 10);
3978
+ context.entities.linkentity(entity);
3979
+ }
3961
3980
  function registerMiscSpawns(registry) {
3962
3981
  registry.register("misc_teleporter", (entity) => {
3963
3982
  });
@@ -3975,9 +3994,14 @@ function registerMiscSpawns(registry) {
3975
3994
  entity.movetype = 0 /* None */;
3976
3995
  entity.solid = 3 /* Bsp */;
3977
3996
  });
3978
- registry.register("misc_gib_arm", (entity) => {
3979
- entity.movetype = 7 /* Toss */;
3980
- entity.solid = 0 /* Not */;
3997
+ registry.register("misc_gib_arm", (entity, context) => {
3998
+ spawn_gib(entity, "models/objects/gibs/arm/tris.md2", context);
3999
+ });
4000
+ registry.register("misc_gib_leg", (entity, context) => {
4001
+ spawn_gib(entity, "models/objects/gibs/leg/tris.md2", context);
4002
+ });
4003
+ registry.register("misc_gib_head", (entity, context) => {
4004
+ spawn_gib(entity, "models/objects/gibs/head/tris.md2", context);
3981
4005
  });
3982
4006
  registry.register("func_object", func_object);
3983
4007
  }
@@ -5958,6 +5982,66 @@ function registerItemSpawns(game, registry) {
5958
5982
  }
5959
5983
  }
5960
5984
 
5985
+ // src/entities/gibs.ts
5986
+ var random2 = createRandomGenerator();
5987
+ var GIB_METALLIC = 1;
5988
+ var GIB_DEBRIS = 2;
5989
+ function spawnGib(sys, origin, damage, model, type) {
5990
+ const gib = sys.spawn();
5991
+ gib.classname = "gib";
5992
+ gib.origin = {
5993
+ x: origin.x + (random2.frandom() - 0.5) * 20,
5994
+ y: origin.y + (random2.frandom() - 0.5) * 20,
5995
+ z: origin.z + (random2.frandom() - 0.5) * 20
5996
+ };
5997
+ gib.velocity = {
5998
+ x: (random2.frandom() - 0.5) * 300,
5999
+ y: (random2.frandom() - 0.5) * 300,
6000
+ z: 200 + random2.frandom() * 100
6001
+ };
6002
+ gib.movetype = 9 /* Bounce */;
6003
+ gib.solid = 0 /* Not */;
6004
+ gib.clipmask = 1;
6005
+ gib.avelocity = {
6006
+ x: random2.crandom() * 600,
6007
+ y: random2.crandom() * 600,
6008
+ z: random2.crandom() * 600
6009
+ };
6010
+ const defaultModels = [
6011
+ "models/objects/gibs/bone/tris.md2",
6012
+ "models/objects/gibs/meat/tris.md2",
6013
+ "models/objects/gibs/sm_meat/tris.md2"
6014
+ ];
6015
+ const modelName = model || defaultModels[Math.floor(random2.frandom() * defaultModels.length)];
6016
+ gib.modelindex = sys.modelIndex(modelName);
6017
+ gib.mins = { x: -2, y: -2, z: -2 };
6018
+ gib.maxs = { x: 2, y: 2, z: 2 };
6019
+ if (type && type & GIB_METALLIC) {
6020
+ }
6021
+ gib.think = (self) => {
6022
+ sys.free(self);
6023
+ };
6024
+ sys.scheduleThink(gib, sys.timeSeconds + 10 + random2.frandom() * 10);
6025
+ sys.finalizeSpawn(gib);
6026
+ return gib;
6027
+ }
6028
+ function throwGibs(sys, origin, damageOrDefs) {
6029
+ if (typeof damageOrDefs === "number") {
6030
+ const damage = damageOrDefs;
6031
+ const count = 4 + Math.floor(random2.frandom() * 4);
6032
+ for (let i = 0; i < count; i++) {
6033
+ spawnGib(sys, origin, damage);
6034
+ }
6035
+ } else {
6036
+ const defs = damageOrDefs;
6037
+ for (const def of defs) {
6038
+ for (let i = 0; i < def.count; i++) {
6039
+ spawnGib(sys, origin, 0, def.model, def.flags);
6040
+ }
6041
+ }
6042
+ }
6043
+ }
6044
+
5961
6045
  // src/entities/funcs.ts
5962
6046
  function move_calc(ent, dest, context, done) {
5963
6047
  const dt = 0.1;
@@ -6602,15 +6686,99 @@ var func_water = (entity, context) => {
6602
6686
  entity.solid = 3 /* Bsp */;
6603
6687
  entity.movetype = 2 /* Push */;
6604
6688
  };
6689
+ var SPAWNFLAGS_EXPLOSIVE_TRIGGER_SPAWN = 1;
6690
+ var SPAWNFLAGS_EXPLOSIVE_ANIMATED = 2;
6691
+ var SPAWNFLAGS_EXPLOSIVE_ANIMATED_FAST = 4;
6692
+ var SPAWNFLAGS_EXPLOSIVE_INACTIVE = 8;
6693
+ var SPAWNFLAGS_EXPLOSIVE_ALWAYS_SHOOTABLE = 16;
6605
6694
  var func_explosive = (entity, context) => {
6606
- entity.solid = 3 /* Bsp */;
6695
+ const sys = context.entities;
6607
6696
  entity.movetype = 2 /* Push */;
6608
- if (!entity.health) entity.health = 100;
6609
- if (!entity.dmg) entity.dmg = 120;
6610
- entity.takedamage = true;
6611
- entity.die = (self, inflictor, attacker, damage) => {
6612
- context.entities.free(self);
6697
+ const func_explosive_spawn = (self, other, activator) => {
6698
+ self.solid = 3 /* Bsp */;
6699
+ self.svflags &= ~1 /* NoClient */;
6700
+ self.use = void 0;
6701
+ sys.linkentity(self);
6702
+ sys.killBox(self);
6613
6703
  };
6704
+ const func_explosive_explode = (self, inflictor, attacker, damage) => {
6705
+ self.takedamage = false;
6706
+ const ent = self;
6707
+ if (ent.dmg) {
6708
+ const radius = ent.dmg + 40;
6709
+ const candidates = sys.findByRadius(ent.origin, radius);
6710
+ const damageables = candidates;
6711
+ T_RadiusDamage(damageables, ent, attacker, ent.dmg, null, radius, 0 /* NONE */, 26 /* EXPLOSIVE */, sys.timeSeconds, {}, sys.multicast.bind(sys));
6712
+ }
6713
+ const mass = ent.mass || 75;
6714
+ if (mass >= 100) {
6715
+ let count2 = Math.floor(mass / 100);
6716
+ if (count2 > 8) count2 = 8;
6717
+ throwGibs(sys, ent.origin, [
6718
+ { count: count2, model: "models/objects/debris1/tris.md2", flags: GIB_METALLIC | GIB_DEBRIS }
6719
+ ]);
6720
+ }
6721
+ let count = Math.floor(mass / 25);
6722
+ if (count > 16) count = 16;
6723
+ throwGibs(sys, ent.origin, [
6724
+ { count, model: "models/objects/debris2/tris.md2", flags: GIB_METALLIC | GIB_DEBRIS }
6725
+ ]);
6726
+ sys.useTargets(ent, attacker);
6727
+ if (ent.noise_index) {
6728
+ sys.sound(ent, 0, ent.noise_index, 1, 1, 0);
6729
+ }
6730
+ if (ent.dmg) {
6731
+ sys.free(ent);
6732
+ } else {
6733
+ sys.free(ent);
6734
+ }
6735
+ };
6736
+ const func_explosive_use = (self, other, activator) => {
6737
+ func_explosive_explode(self, self, activator || null, self.health);
6738
+ };
6739
+ const func_explosive_activate = (self, other, activator) => {
6740
+ let approved = false;
6741
+ if (other && other.target && self.targetname && other.target === self.targetname) {
6742
+ approved = true;
6743
+ }
6744
+ if (!approved && activator && activator.target && self.targetname && activator.target === self.targetname) {
6745
+ approved = true;
6746
+ }
6747
+ if (!approved) return;
6748
+ self.use = func_explosive_use;
6749
+ if (!self.health) self.health = 100;
6750
+ self.die = func_explosive_explode;
6751
+ self.takedamage = true;
6752
+ };
6753
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_TRIGGER_SPAWN) {
6754
+ entity.svflags |= 1 /* NoClient */;
6755
+ entity.solid = 0 /* Not */;
6756
+ entity.use = func_explosive_spawn;
6757
+ } else if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_INACTIVE) {
6758
+ entity.solid = 3 /* Bsp */;
6759
+ if (entity.targetname) {
6760
+ entity.use = func_explosive_activate;
6761
+ }
6762
+ } else {
6763
+ entity.solid = 3 /* Bsp */;
6764
+ if (entity.targetname) {
6765
+ entity.use = func_explosive_use;
6766
+ }
6767
+ }
6768
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_ANIMATED) {
6769
+ entity.effects |= EF_ANIM_ALL;
6770
+ }
6771
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_ANIMATED_FAST) {
6772
+ entity.effects |= EF_ANIM_ALLFAST;
6773
+ }
6774
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_ALWAYS_SHOOTABLE || entity.use !== func_explosive_use && entity.use !== func_explosive_activate) {
6775
+ if (!entity.health) entity.health = 100;
6776
+ entity.die = func_explosive_explode;
6777
+ entity.takedamage = true;
6778
+ }
6779
+ if (entity.sounds === 1) {
6780
+ entity.noise_index = "world/brkglas.wav";
6781
+ }
6614
6782
  };
6615
6783
  var func_killbox = (entity, context) => {
6616
6784
  entity.solid = 0 /* Not */;
@@ -6746,64 +6914,19 @@ function monster_think(self, context) {
6746
6914
  self.nextthink = context.timeSeconds + 0.1;
6747
6915
  }
6748
6916
 
6749
- // src/entities/gibs.ts
6750
- var random = createRandomGenerator();
6751
- function spawnGib(sys, origin, damage) {
6752
- const gib = sys.spawn();
6753
- gib.classname = "gib";
6754
- gib.origin = {
6755
- x: origin.x + (random.frandom() - 0.5) * 20,
6756
- y: origin.y + (random.frandom() - 0.5) * 20,
6757
- z: origin.z + (random.frandom() - 0.5) * 20
6758
- };
6759
- gib.velocity = {
6760
- x: (random.frandom() - 0.5) * 300,
6761
- y: (random.frandom() - 0.5) * 300,
6762
- z: 200 + random.frandom() * 100
6763
- };
6764
- gib.movetype = 9 /* Bounce */;
6765
- gib.solid = 0 /* Not */;
6766
- gib.clipmask = 1;
6767
- gib.avelocity = {
6768
- x: random.crandom() * 600,
6769
- y: random.crandom() * 600,
6770
- z: random.crandom() * 600
6771
- };
6772
- const models = [
6773
- "models/objects/gibs/bone/tris.md2",
6774
- "models/objects/gibs/meat/tris.md2",
6775
- "models/objects/gibs/sm_meat/tris.md2"
6776
- ];
6777
- const modelName = models[Math.floor(random.frandom() * models.length)];
6778
- gib.modelindex = sys.modelIndex(modelName);
6779
- gib.mins = { x: -2, y: -2, z: -2 };
6780
- gib.maxs = { x: 2, y: 2, z: 2 };
6781
- gib.think = (self) => {
6782
- sys.free(self);
6783
- };
6784
- sys.scheduleThink(gib, sys.timeSeconds + 10 + random.frandom() * 10);
6785
- sys.finalizeSpawn(gib);
6786
- }
6787
- function throwGibs(sys, origin, damage) {
6788
- const count = 4 + Math.floor(random.frandom() * 4);
6789
- for (let i = 0; i < count; i++) {
6790
- spawnGib(sys, origin, damage);
6791
- }
6792
- }
6793
-
6794
6917
  // src/entities/monsters/berserk.ts
6795
6918
  var MONSTER_TICK = 0.1;
6796
6919
  var MELEE_DISTANCE = 80;
6797
6920
  var SPAWNFLAG_BERSERK_NOJUMPING = 16;
6798
- var random2 = createRandomGenerator();
6921
+ var random3 = createRandomGenerator();
6799
6922
  function frandom() {
6800
- return random2.frandom();
6923
+ return random3.frandom();
6801
6924
  }
6802
6925
  function brandom() {
6803
- return random2.frandom() > 0.5;
6926
+ return random3.frandom() > 0.5;
6804
6927
  }
6805
6928
  function irandom(min, max) {
6806
- return Math.floor(random2.frandom() * (max - min + 1) + min);
6929
+ return Math.floor(random3.frandom() * (max - min + 1) + min);
6807
6930
  }
6808
6931
  function monster_ai_stand(self, dist, context) {
6809
6932
  ai_stand(self, MONSTER_TICK, context);
@@ -7678,7 +7801,7 @@ function registerBoss2Spawns(registry) {
7678
7801
  // src/entities/monsters/brain.ts
7679
7802
  var MONSTER_TICK3 = 0.1;
7680
7803
  var MELEE_DISTANCE2 = 80;
7681
- var random3 = Math.random;
7804
+ var random4 = Math.random;
7682
7805
  function monster_ai_stand3(self, dist, context) {
7683
7806
  ai_stand(self, MONSTER_TICK3, context);
7684
7807
  }
@@ -7731,7 +7854,7 @@ function brain_swing_right(self, context) {
7731
7854
  }
7732
7855
  function brain_hit_right(self, context) {
7733
7856
  const aim = { x: MELEE_DISTANCE2, y: self.maxs.x, z: 8 };
7734
- if (monster_fire_hit(self, aim, 15 + Math.floor(random3() * 5), 40, context)) {
7857
+ if (monster_fire_hit(self, aim, 15 + Math.floor(random4() * 5), 40, context)) {
7735
7858
  context.engine.sound?.(self, 0, "brain/melee3.wav", 1, 1, 0);
7736
7859
  } else {
7737
7860
  self.monsterinfo.melee_debounce_time = context.timeSeconds + 3;
@@ -7742,7 +7865,7 @@ function brain_swing_left(self, context) {
7742
7865
  }
7743
7866
  function brain_hit_left(self, context) {
7744
7867
  const aim = { x: MELEE_DISTANCE2, y: self.mins.x, z: 8 };
7745
- if (monster_fire_hit(self, aim, 15 + Math.floor(random3() * 5), 40, context)) {
7868
+ if (monster_fire_hit(self, aim, 15 + Math.floor(random4() * 5), 40, context)) {
7746
7869
  context.engine.sound?.(self, 0, "brain/melee3.wav", 1, 1, 0);
7747
7870
  } else {
7748
7871
  self.monsterinfo.melee_debounce_time = context.timeSeconds + 3;
@@ -7755,7 +7878,7 @@ function brain_chest_open(self, context) {
7755
7878
  }
7756
7879
  function brain_tentacle_attack(self, context) {
7757
7880
  const aim = { x: MELEE_DISTANCE2, y: 0, z: 8 };
7758
- if (monster_fire_hit(self, aim, 10 + Math.floor(random3() * 5), -600, context)) {
7881
+ if (monster_fire_hit(self, aim, 10 + Math.floor(random4() * 5), -600, context)) {
7759
7882
  self.count = 1;
7760
7883
  } else {
7761
7884
  self.monsterinfo.melee_debounce_time = context.timeSeconds + 3;
@@ -7770,7 +7893,7 @@ function brain_chest_closed(self) {
7770
7893
  }
7771
7894
  }
7772
7895
  function brain_melee(self) {
7773
- if (random3() <= 0.5) {
7896
+ if (random4() <= 0.5) {
7774
7897
  self.monsterinfo.current_move = attack1_move;
7775
7898
  } else {
7776
7899
  self.monsterinfo.current_move = attack2_move;
@@ -7853,7 +7976,7 @@ function brain_laserbeam(self, context) {
7853
7976
  monster_fire_dabeam(self, 1, true, brain_left_eye_laser_update, context);
7854
7977
  }
7855
7978
  function brain_laserbeam_reattack(self) {
7856
- if (random3() < 0.5) {
7979
+ if (random4() < 0.5) {
7857
7980
  if (self.enemy && self.enemy.health > 0) {
7858
7981
  self.frame = 0;
7859
7982
  }
@@ -7862,7 +7985,7 @@ function brain_laserbeam_reattack(self) {
7862
7985
  function brain_attack(self, context) {
7863
7986
  const r = rangeTo(self, self.enemy);
7864
7987
  if (r <= RANGE_NEAR) {
7865
- if (random3() < 0.5) {
7988
+ if (random4() < 0.5) {
7866
7989
  self.monsterinfo.current_move = attack3_move;
7867
7990
  } else {
7868
7991
  self.monsterinfo.current_move = attack4_move;
@@ -7882,7 +8005,7 @@ function brain_duck_up(self) {
7882
8005
  self.monsterinfo.aiflags &= ~16;
7883
8006
  }
7884
8007
  function brain_dodge(self, attacker, eta) {
7885
- if (random3() > 0.25) return;
8008
+ if (random4() > 0.25) return;
7886
8009
  if (!self.enemy) self.enemy = attacker;
7887
8010
  self.monsterinfo.pausetime = self.timestamp + eta + 0.5;
7888
8011
  self.monsterinfo.current_move = duck_move;
@@ -8138,7 +8261,7 @@ function brain_pain(self, other, kick, damage, context) {
8138
8261
  return;
8139
8262
  }
8140
8263
  self.pain_debounce_time = self.timestamp + 3;
8141
- const r = random3();
8264
+ const r = random4();
8142
8265
  if (r < 0.33) {
8143
8266
  context.engine.sound?.(self, 0, "brain/brnpain1.wav", 1, 1, 0);
8144
8267
  self.monsterinfo.current_move = pain1_move;
@@ -8162,7 +8285,7 @@ function brain_die(self, inflictor, attacker, damage, point, context) {
8162
8285
  context.engine.sound?.(self, 0, "brain/brndeth1.wav", 1, 1, 0);
8163
8286
  self.deadflag = 2 /* Dead */;
8164
8287
  self.takedamage = true;
8165
- if (random3() <= 0.5) {
8288
+ if (random4() <= 0.5) {
8166
8289
  self.monsterinfo.current_move = death1_move;
8167
8290
  } else {
8168
8291
  self.monsterinfo.current_move = death2_move;
@@ -8199,7 +8322,7 @@ function SP_monster_brain(self, context) {
8199
8322
  context.entities.sound?.(s, 2, "brain/brnsght1.wav", 1, 1, 0);
8200
8323
  };
8201
8324
  self.monsterinfo.search = (s) => {
8202
- if (random3() < 0.5) {
8325
+ if (random4() < 0.5) {
8203
8326
  context.entities.sound?.(s, 2, "brain/brnidle2.wav", 1, 1, 0);
8204
8327
  } else {
8205
8328
  context.entities.sound?.(s, 2, "brain/brnsrch1.wav", 1, 1, 0);
@@ -8219,7 +8342,7 @@ function registerBrainSpawns(registry) {
8219
8342
  // src/entities/monsters/chick.ts
8220
8343
  var MONSTER_TICK4 = 0.1;
8221
8344
  var MELEE_DISTANCE3 = 80;
8222
- var random4 = Math.random;
8345
+ var random5 = Math.random;
8223
8346
  function monster_ai_stand4(self, dist, context) {
8224
8347
  ai_stand(self, MONSTER_TICK4, context);
8225
8348
  }
@@ -8267,12 +8390,12 @@ function chick_run(self) {
8267
8390
  function chick_fidget(self) {
8268
8391
  if (self.monsterinfo.aiflags & 4) return;
8269
8392
  if (self.enemy) return;
8270
- if (random4() <= 0.3) {
8393
+ if (random5() <= 0.3) {
8271
8394
  self.monsterinfo.current_move = fidget_move;
8272
8395
  }
8273
8396
  }
8274
8397
  function ChickMoan(self, context) {
8275
- if (random4() < 0.5) {
8398
+ if (random5() < 0.5) {
8276
8399
  context.engine.sound?.(self, 2, "chick/chkidle1.wav", 1, 0, 0);
8277
8400
  } else {
8278
8401
  context.engine.sound?.(self, 2, "chick/chkidle2.wav", 1, 0, 0);
@@ -8281,7 +8404,7 @@ function ChickMoan(self, context) {
8281
8404
  function chick_slash(self, context) {
8282
8405
  const aim = { x: MELEE_DISTANCE3, y: self.mins.x, z: 10 };
8283
8406
  context.engine.sound?.(self, 0, "chick/chkatck3.wav", 1, 1, 0);
8284
- monster_fire_hit(self, aim, 10 + Math.floor(random4() * 6), 100, context);
8407
+ monster_fire_hit(self, aim, 10 + Math.floor(random5() * 6), 100, context);
8285
8408
  }
8286
8409
  function chick_rocket(self, context) {
8287
8410
  const { forward, right } = angleVectors(self.angles);
@@ -8302,7 +8425,7 @@ function chick_rocket(self, context) {
8302
8425
  }
8303
8426
  let dir = subtractVec3(target, finalStart);
8304
8427
  if (!blindfire && self.enemy) {
8305
- if (random4() < 0.33 || finalStart.z < self.enemy.absmin.z) {
8428
+ if (random5() < 0.33 || finalStart.z < self.enemy.absmin.z) {
8306
8429
  const tempDir = { ...dir, z: dir.z + self.enemy.viewheight };
8307
8430
  dir = tempDir;
8308
8431
  } else {
@@ -8337,7 +8460,7 @@ function chick_rerocket(self) {
8337
8460
  return;
8338
8461
  }
8339
8462
  if (self.enemy && self.enemy.health > 0) {
8340
- if (random4() <= 0.6) {
8463
+ if (random5() <= 0.6) {
8341
8464
  self.monsterinfo.current_move = attack1_move2;
8342
8465
  return;
8343
8466
  }
@@ -8346,7 +8469,7 @@ function chick_rerocket(self) {
8346
8469
  }
8347
8470
  function chick_reslash(self) {
8348
8471
  if (self.enemy && self.enemy.health > 0) {
8349
- if (random4() <= 0.9) {
8472
+ if (random5() <= 0.9) {
8350
8473
  self.monsterinfo.current_move = slash_move;
8351
8474
  return;
8352
8475
  }
@@ -8424,7 +8547,7 @@ function chick_pain(self, other, kick, damage, context) {
8424
8547
  }
8425
8548
  if (self.timestamp < (self.pain_debounce_time || 0)) return;
8426
8549
  self.pain_debounce_time = self.timestamp + 3;
8427
- const r = random4();
8550
+ const r = random5();
8428
8551
  if (r < 0.33) context.engine.sound?.(self, 0, "chick/chkpain1.wav", 1, 1, 0);
8429
8552
  else if (r < 0.66) context.engine.sound?.(self, 0, "chick/chkpain2.wav", 1, 1, 0);
8430
8553
  else context.engine.sound?.(self, 0, "chick/chkpain3.wav", 1, 1, 0);
@@ -8453,7 +8576,7 @@ function chick_die(self, inflictor, attacker, damage, point, context) {
8453
8576
  if (self.deadflag === 2 /* Dead */) return;
8454
8577
  self.deadflag = 2 /* Dead */;
8455
8578
  self.takedamage = true;
8456
- if (random4() <= 0.5) {
8579
+ if (random5() <= 0.5) {
8457
8580
  self.monsterinfo.current_move = death1_move2;
8458
8581
  context.engine.sound?.(self, 0, "chick/chkdeth1.wav", 1, 1, 0);
8459
8582
  } else {
@@ -8573,7 +8696,7 @@ function registerChickSpawns(registry) {
8573
8696
  var MONSTER_TICK5 = 0.1;
8574
8697
  var MELEE_DISTANCE4 = 80;
8575
8698
  var FLIPPER_RUN_SPEED = 24;
8576
- var random5 = Math.random;
8699
+ var random6 = Math.random;
8577
8700
  function monster_ai_stand5(self, dist, context) {
8578
8701
  ai_stand(self, MONSTER_TICK5, context);
8579
8702
  }
@@ -8690,7 +8813,7 @@ function flipper_pain(self, other, kick, damage, context) {
8690
8813
  return;
8691
8814
  }
8692
8815
  self.pain_debounce_time = self.timestamp + 3;
8693
- if (random5() < 0.5) {
8816
+ if (random6() < 0.5) {
8694
8817
  context.engine.sound?.(self, 0, "flipper/flppain1.wav", 1, 1, 0);
8695
8818
  self.monsterinfo.current_move = pain1_move3;
8696
8819
  } else {
@@ -11508,8 +11631,8 @@ function actor_pain(self, other, kick, damage) {
11508
11631
  if (context.timeSeconds < self.pain_debounce_time)
11509
11632
  return;
11510
11633
  self.pain_debounce_time = context.timeSeconds + 3;
11511
- const random12 = Math.random();
11512
- if (other && other.client && random12 < 0.4) {
11634
+ const random13 = Math.random();
11635
+ if (other && other.client && random13 < 0.4) {
11513
11636
  const v = subtractVec3(other.origin, self.origin);
11514
11637
  self.ideal_yaw = vectorToYaw(v);
11515
11638
  if (Math.random() < 0.5)
@@ -12339,7 +12462,7 @@ function registerMedicSpawns(registry) {
12339
12462
 
12340
12463
  // src/entities/monsters/mutant.ts
12341
12464
  var MONSTER_TICK18 = 0.1;
12342
- var random6 = () => Math.random();
12465
+ var random7 = () => Math.random();
12343
12466
  function monster_ai_stand16(self, dist, context) {
12344
12467
  ai_stand(self, MONSTER_TICK18, context);
12345
12468
  }
@@ -12452,11 +12575,11 @@ function mutant_check_attack(self, context) {
12452
12575
  if (self.enemy && self.enemy.health > 0) {
12453
12576
  const diff = subtractVec3(self.enemy.origin, self.origin);
12454
12577
  const dist = lengthVec3(diff);
12455
- if (dist < 128 && random6() < 0.5) {
12578
+ if (dist < 128 && random7() < 0.5) {
12456
12579
  self.monsterinfo.current_move = attack_move7;
12457
12580
  return true;
12458
12581
  }
12459
- if (dist >= 128 && dist < 512 && random6() < 0.3) {
12582
+ if (dist >= 128 && dist < 512 && random7() < 0.3) {
12460
12583
  self.monsterinfo.current_move = jump_move2;
12461
12584
  return true;
12462
12585
  }
@@ -12469,10 +12592,10 @@ function mutant_pain_func(self, other, kick, damage, context) {
12469
12592
  }
12470
12593
  if (self.timestamp < (self.pain_finished_time || 0)) return;
12471
12594
  self.pain_finished_time = self.timestamp + 3;
12472
- if (random6() < 0.5) {
12595
+ if (random7() < 0.5) {
12473
12596
  context.engine.sound?.(self, 0, "mutant/mutpain1.wav", 1, 1, 0);
12474
12597
  self.monsterinfo.current_move = pain1_move6;
12475
- } else if (random6() < 0.5) {
12598
+ } else if (random7() < 0.5) {
12476
12599
  context.engine.sound?.(self, 0, "mutant/mutpain2.wav", 1, 1, 0);
12477
12600
  self.monsterinfo.current_move = pain2_move6;
12478
12601
  } else {
@@ -12728,7 +12851,7 @@ function registerMutantSpawns(registry) {
12728
12851
 
12729
12852
  // src/entities/monsters/parasite.ts
12730
12853
  var MONSTER_TICK19 = 0.1;
12731
- var random7 = () => Math.random();
12854
+ var random8 = () => Math.random();
12732
12855
  function monster_ai_stand17(self, dist, context) {
12733
12856
  ai_stand(self, MONSTER_TICK19, context);
12734
12857
  }
@@ -12773,7 +12896,7 @@ function parasite_do_fidget(self) {
12773
12896
  self.monsterinfo.current_move = fidget_move3;
12774
12897
  }
12775
12898
  function parasite_refidget(self) {
12776
- if (random7() <= 0.8) {
12899
+ if (random8() <= 0.8) {
12777
12900
  self.monsterinfo.current_move = fidget_move3;
12778
12901
  } else {
12779
12902
  self.monsterinfo.current_move = end_fidget_move;
@@ -12886,7 +13009,7 @@ function parasite_pain_func(self, other, kick, damage, context) {
12886
13009
  }
12887
13010
  if (self.timestamp < (self.pain_finished_time || 0)) return;
12888
13011
  self.pain_finished_time = self.timestamp + 3;
12889
- if (random7() < 0.5) {
13012
+ if (random8() < 0.5) {
12890
13013
  context.engine.sound?.(self, 0, "parasite/parpain1.wav", 1, 1, 0);
12891
13014
  } else {
12892
13015
  context.engine.sound?.(self, 0, "parasite/parpain2.wav", 1, 1, 0);
@@ -14207,7 +14330,7 @@ function registerTurretSpawns(registry) {
14207
14330
 
14208
14331
  // src/entities/monsters/gekk.ts
14209
14332
  var MONSTER_TICK24 = 0.1;
14210
- var random8 = () => Math.random();
14333
+ var random9 = () => Math.random();
14211
14334
  var frandom2 = () => Math.random();
14212
14335
  var irandom2 = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
14213
14336
  function monster_ai_stand22(self, dist, context) {
@@ -14716,7 +14839,7 @@ function gekk_pain(self, other, kick, damage, context) {
14716
14839
  }
14717
14840
  self.monsterinfo.current_move = gekk_move_pain;
14718
14841
  } else {
14719
- if (random8() > 0.5) self.monsterinfo.current_move = gekk_move_pain1;
14842
+ if (random9() > 0.5) self.monsterinfo.current_move = gekk_move_pain1;
14720
14843
  else self.monsterinfo.current_move = gekk_move_pain2;
14721
14844
  }
14722
14845
  }
@@ -14849,7 +14972,7 @@ function registerGekkSpawns(registry) {
14849
14972
 
14850
14973
  // src/entities/monsters/fixbot.ts
14851
14974
  var MONSTER_TICK25 = 0.1;
14852
- var random9 = () => Math.random();
14975
+ var random10 = () => Math.random();
14853
14976
  var frandom3 = () => Math.random();
14854
14977
  function monster_ai_walk21(self, dist, context) {
14855
14978
  ai_walk(self, dist, MONSTER_TICK25, context);
@@ -14912,7 +15035,7 @@ function fixbot_search(self, context) {
14912
15035
  fixbot_run(self);
14913
15036
  fixbot_set_fly_parameters(self, true, false);
14914
15037
  } else {
14915
- if (random9() < 0.1) {
15038
+ if (random10() < 0.1) {
14916
15039
  context.engine.sound?.(self, 0, "flyer/flysght1.wav", 1, 1, 0);
14917
15040
  }
14918
15041
  }
@@ -16471,7 +16594,7 @@ function PlayerNoise(who, where, type, context) {
16471
16594
  }
16472
16595
 
16473
16596
  // src/combat/obituary.ts
16474
- var random10 = createRandomGenerator();
16597
+ var random11 = createRandomGenerator();
16475
16598
  var PRINT_MEDIUM = 1;
16476
16599
  function getGender(ent) {
16477
16600
  return "male";
@@ -16634,7 +16757,7 @@ var ANIM_PAIN = 2;
16634
16757
  var ANIM_DEATH = 3;
16635
16758
 
16636
16759
  // src/combat/weapons/firing.ts
16637
- var random11 = createRandomGenerator();
16760
+ var random12 = createRandomGenerator();
16638
16761
 
16639
16762
  // src/entities/player.ts
16640
16763
  function P_PlayerThink(ent, sys) {
@@ -16691,7 +16814,7 @@ function player_pain(self, damage) {
16691
16814
  return;
16692
16815
  }
16693
16816
  self.client.anim_priority = ANIM_PAIN;
16694
- const r = random11.frandom();
16817
+ const r = random12.frandom();
16695
16818
  if (r < 0.33) {
16696
16819
  self.frame = FRAME_pain1012;
16697
16820
  self.client.anim_end = FRAME_pain104;
@@ -16714,7 +16837,7 @@ function player_die(self, inflictor, attacker, damage, point, mod, sys) {
16714
16837
  }
16715
16838
  if (self.client) {
16716
16839
  self.client.anim_priority = ANIM_DEATH;
16717
- const r = random11.frandom();
16840
+ const r = random12.frandom();
16718
16841
  if (r < 0.33) {
16719
16842
  self.frame = FRAME_death1012;
16720
16843
  self.client.anim_end = FRAME_death106;