quake2ts 0.0.275 → 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.
@@ -4073,6 +4073,7 @@ function T_RadiusDamage(entities, inflictor, attacker, damage, ignore, radius, d
4073
4073
  }
4074
4074
 
4075
4075
  // src/entities/misc.ts
4076
+ var random = createRandomGenerator();
4076
4077
  var SPAWNFLAGS_OBJECT_TRIGGER_SPAWN = 1;
4077
4078
  var SPAWNFLAGS_OBJECT_ANIMATED = 2;
4078
4079
  function func_object_touch(self, other, plane, surf) {
@@ -4124,6 +4125,24 @@ var func_object = (entity, context) => {
4124
4125
  if (entity.spawnflags & SPAWNFLAGS_OBJECT_ANIMATED) {
4125
4126
  }
4126
4127
  };
4128
+ function gib_die(self, inflictor, attacker, damage) {
4129
+ }
4130
+ function spawn_gib(entity, model, context) {
4131
+ context.entities.modelIndex(model);
4132
+ entity.solid = 0 /* Not */;
4133
+ entity.takedamage = true;
4134
+ entity.die = gib_die;
4135
+ entity.movetype = 7 /* Toss */;
4136
+ entity.deadflag = 2;
4137
+ entity.avelocity = {
4138
+ x: random.frandom() * 200,
4139
+ y: random.frandom() * 200,
4140
+ z: random.frandom() * 200
4141
+ };
4142
+ entity.think = (self) => context.entities.free(self);
4143
+ context.entities.scheduleThink(entity, context.entities.timeSeconds + 10);
4144
+ context.entities.linkentity(entity);
4145
+ }
4127
4146
  function registerMiscSpawns(registry) {
4128
4147
  registry.register("misc_teleporter", (entity) => {
4129
4148
  });
@@ -4141,9 +4160,14 @@ function registerMiscSpawns(registry) {
4141
4160
  entity.movetype = 0 /* None */;
4142
4161
  entity.solid = 3 /* Bsp */;
4143
4162
  });
4144
- registry.register("misc_gib_arm", (entity) => {
4145
- entity.movetype = 7 /* Toss */;
4146
- entity.solid = 0 /* Not */;
4163
+ registry.register("misc_gib_arm", (entity, context) => {
4164
+ spawn_gib(entity, "models/objects/gibs/arm/tris.md2", context);
4165
+ });
4166
+ registry.register("misc_gib_leg", (entity, context) => {
4167
+ spawn_gib(entity, "models/objects/gibs/leg/tris.md2", context);
4168
+ });
4169
+ registry.register("misc_gib_head", (entity, context) => {
4170
+ spawn_gib(entity, "models/objects/gibs/head/tris.md2", context);
4147
4171
  });
4148
4172
  registry.register("func_object", func_object);
4149
4173
  }
@@ -6124,6 +6148,66 @@ function registerItemSpawns(game, registry) {
6124
6148
  }
6125
6149
  }
6126
6150
 
6151
+ // src/entities/gibs.ts
6152
+ var random2 = createRandomGenerator();
6153
+ var GIB_METALLIC = 1;
6154
+ var GIB_DEBRIS = 2;
6155
+ function spawnGib(sys, origin, damage, model, type) {
6156
+ const gib = sys.spawn();
6157
+ gib.classname = "gib";
6158
+ gib.origin = {
6159
+ x: origin.x + (random2.frandom() - 0.5) * 20,
6160
+ y: origin.y + (random2.frandom() - 0.5) * 20,
6161
+ z: origin.z + (random2.frandom() - 0.5) * 20
6162
+ };
6163
+ gib.velocity = {
6164
+ x: (random2.frandom() - 0.5) * 300,
6165
+ y: (random2.frandom() - 0.5) * 300,
6166
+ z: 200 + random2.frandom() * 100
6167
+ };
6168
+ gib.movetype = 9 /* Bounce */;
6169
+ gib.solid = 0 /* Not */;
6170
+ gib.clipmask = 1;
6171
+ gib.avelocity = {
6172
+ x: random2.crandom() * 600,
6173
+ y: random2.crandom() * 600,
6174
+ z: random2.crandom() * 600
6175
+ };
6176
+ const defaultModels = [
6177
+ "models/objects/gibs/bone/tris.md2",
6178
+ "models/objects/gibs/meat/tris.md2",
6179
+ "models/objects/gibs/sm_meat/tris.md2"
6180
+ ];
6181
+ const modelName = model || defaultModels[Math.floor(random2.frandom() * defaultModels.length)];
6182
+ gib.modelindex = sys.modelIndex(modelName);
6183
+ gib.mins = { x: -2, y: -2, z: -2 };
6184
+ gib.maxs = { x: 2, y: 2, z: 2 };
6185
+ if (type && type & GIB_METALLIC) {
6186
+ }
6187
+ gib.think = (self) => {
6188
+ sys.free(self);
6189
+ };
6190
+ sys.scheduleThink(gib, sys.timeSeconds + 10 + random2.frandom() * 10);
6191
+ sys.finalizeSpawn(gib);
6192
+ return gib;
6193
+ }
6194
+ function throwGibs(sys, origin, damageOrDefs) {
6195
+ if (typeof damageOrDefs === "number") {
6196
+ const damage = damageOrDefs;
6197
+ const count = 4 + Math.floor(random2.frandom() * 4);
6198
+ for (let i = 0; i < count; i++) {
6199
+ spawnGib(sys, origin, damage);
6200
+ }
6201
+ } else {
6202
+ const defs = damageOrDefs;
6203
+ for (const def of defs) {
6204
+ for (let i = 0; i < def.count; i++) {
6205
+ spawnGib(sys, origin, 0, def.model, def.flags);
6206
+ }
6207
+ }
6208
+ }
6209
+ }
6210
+
6127
6211
  // src/entities/funcs.ts
6128
6212
  function move_calc(ent, dest, context, done) {
6129
6213
  const dt = 0.1;
@@ -6768,15 +6852,99 @@ var func_water = (entity, context) => {
6768
6852
  entity.solid = 3 /* Bsp */;
6769
6853
  entity.movetype = 2 /* Push */;
6770
6854
  };
6855
+ var SPAWNFLAGS_EXPLOSIVE_TRIGGER_SPAWN = 1;
6856
+ var SPAWNFLAGS_EXPLOSIVE_ANIMATED = 2;
6857
+ var SPAWNFLAGS_EXPLOSIVE_ANIMATED_FAST = 4;
6858
+ var SPAWNFLAGS_EXPLOSIVE_INACTIVE = 8;
6859
+ var SPAWNFLAGS_EXPLOSIVE_ALWAYS_SHOOTABLE = 16;
6771
6860
  var func_explosive = (entity, context) => {
6772
- entity.solid = 3 /* Bsp */;
6861
+ const sys = context.entities;
6773
6862
  entity.movetype = 2 /* Push */;
6774
- if (!entity.health) entity.health = 100;
6775
- if (!entity.dmg) entity.dmg = 120;
6776
- entity.takedamage = true;
6777
- entity.die = (self, inflictor, attacker, damage) => {
6778
- context.entities.free(self);
6863
+ const func_explosive_spawn = (self, other, activator) => {
6864
+ self.solid = 3 /* Bsp */;
6865
+ self.svflags &= ~1 /* NoClient */;
6866
+ self.use = void 0;
6867
+ sys.linkentity(self);
6868
+ sys.killBox(self);
6779
6869
  };
6870
+ const func_explosive_explode = (self, inflictor, attacker, damage) => {
6871
+ self.takedamage = false;
6872
+ const ent = self;
6873
+ if (ent.dmg) {
6874
+ const radius = ent.dmg + 40;
6875
+ const candidates = sys.findByRadius(ent.origin, radius);
6876
+ const damageables = candidates;
6877
+ T_RadiusDamage(damageables, ent, attacker, ent.dmg, null, radius, 0 /* NONE */, 26 /* EXPLOSIVE */, sys.timeSeconds, {}, sys.multicast.bind(sys));
6878
+ }
6879
+ const mass = ent.mass || 75;
6880
+ if (mass >= 100) {
6881
+ let count2 = Math.floor(mass / 100);
6882
+ if (count2 > 8) count2 = 8;
6883
+ throwGibs(sys, ent.origin, [
6884
+ { count: count2, model: "models/objects/debris1/tris.md2", flags: GIB_METALLIC | GIB_DEBRIS }
6885
+ ]);
6886
+ }
6887
+ let count = Math.floor(mass / 25);
6888
+ if (count > 16) count = 16;
6889
+ throwGibs(sys, ent.origin, [
6890
+ { count, model: "models/objects/debris2/tris.md2", flags: GIB_METALLIC | GIB_DEBRIS }
6891
+ ]);
6892
+ sys.useTargets(ent, attacker);
6893
+ if (ent.noise_index) {
6894
+ sys.sound(ent, 0, ent.noise_index, 1, 1, 0);
6895
+ }
6896
+ if (ent.dmg) {
6897
+ sys.free(ent);
6898
+ } else {
6899
+ sys.free(ent);
6900
+ }
6901
+ };
6902
+ const func_explosive_use = (self, other, activator) => {
6903
+ func_explosive_explode(self, self, activator || null, self.health);
6904
+ };
6905
+ const func_explosive_activate = (self, other, activator) => {
6906
+ let approved = false;
6907
+ if (other && other.target && self.targetname && other.target === self.targetname) {
6908
+ approved = true;
6909
+ }
6910
+ if (!approved && activator && activator.target && self.targetname && activator.target === self.targetname) {
6911
+ approved = true;
6912
+ }
6913
+ if (!approved) return;
6914
+ self.use = func_explosive_use;
6915
+ if (!self.health) self.health = 100;
6916
+ self.die = func_explosive_explode;
6917
+ self.takedamage = true;
6918
+ };
6919
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_TRIGGER_SPAWN) {
6920
+ entity.svflags |= 1 /* NoClient */;
6921
+ entity.solid = 0 /* Not */;
6922
+ entity.use = func_explosive_spawn;
6923
+ } else if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_INACTIVE) {
6924
+ entity.solid = 3 /* Bsp */;
6925
+ if (entity.targetname) {
6926
+ entity.use = func_explosive_activate;
6927
+ }
6928
+ } else {
6929
+ entity.solid = 3 /* Bsp */;
6930
+ if (entity.targetname) {
6931
+ entity.use = func_explosive_use;
6932
+ }
6933
+ }
6934
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_ANIMATED) {
6935
+ entity.effects |= EF_ANIM_ALL;
6936
+ }
6937
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_ANIMATED_FAST) {
6938
+ entity.effects |= EF_ANIM_ALLFAST;
6939
+ }
6940
+ if (entity.spawnflags & SPAWNFLAGS_EXPLOSIVE_ALWAYS_SHOOTABLE || entity.use !== func_explosive_use && entity.use !== func_explosive_activate) {
6941
+ if (!entity.health) entity.health = 100;
6942
+ entity.die = func_explosive_explode;
6943
+ entity.takedamage = true;
6944
+ }
6945
+ if (entity.sounds === 1) {
6946
+ entity.noise_index = "world/brkglas.wav";
6947
+ }
6780
6948
  };
6781
6949
  var func_killbox = (entity, context) => {
6782
6950
  entity.solid = 0 /* Not */;
@@ -6912,64 +7080,19 @@ function monster_think(self, context) {
6912
7080
  self.nextthink = context.timeSeconds + 0.1;
6913
7081
  }
6914
7082
 
6915
- // src/entities/gibs.ts
6916
- var random = createRandomGenerator();
6917
- function spawnGib(sys, origin, damage) {
6918
- const gib = sys.spawn();
6919
- gib.classname = "gib";
6920
- gib.origin = {
6921
- x: origin.x + (random.frandom() - 0.5) * 20,
6922
- y: origin.y + (random.frandom() - 0.5) * 20,
6923
- z: origin.z + (random.frandom() - 0.5) * 20
6924
- };
6925
- gib.velocity = {
6926
- x: (random.frandom() - 0.5) * 300,
6927
- y: (random.frandom() - 0.5) * 300,
6928
- z: 200 + random.frandom() * 100
6929
- };
6930
- gib.movetype = 9 /* Bounce */;
6931
- gib.solid = 0 /* Not */;
6932
- gib.clipmask = 1;
6933
- gib.avelocity = {
6934
- x: random.crandom() * 600,
6935
- y: random.crandom() * 600,
6936
- z: random.crandom() * 600
6937
- };
6938
- const models = [
6939
- "models/objects/gibs/bone/tris.md2",
6940
- "models/objects/gibs/meat/tris.md2",
6941
- "models/objects/gibs/sm_meat/tris.md2"
6942
- ];
6943
- const modelName = models[Math.floor(random.frandom() * models.length)];
6944
- gib.modelindex = sys.modelIndex(modelName);
6945
- gib.mins = { x: -2, y: -2, z: -2 };
6946
- gib.maxs = { x: 2, y: 2, z: 2 };
6947
- gib.think = (self) => {
6948
- sys.free(self);
6949
- };
6950
- sys.scheduleThink(gib, sys.timeSeconds + 10 + random.frandom() * 10);
6951
- sys.finalizeSpawn(gib);
6952
- }
6953
- function throwGibs(sys, origin, damage) {
6954
- const count = 4 + Math.floor(random.frandom() * 4);
6955
- for (let i = 0; i < count; i++) {
6956
- spawnGib(sys, origin, damage);
6957
- }
6958
- }
6959
-
6960
7083
  // src/entities/monsters/berserk.ts
6961
7084
  var MONSTER_TICK = 0.1;
6962
7085
  var MELEE_DISTANCE = 80;
6963
7086
  var SPAWNFLAG_BERSERK_NOJUMPING = 16;
6964
- var random2 = createRandomGenerator();
7087
+ var random3 = createRandomGenerator();
6965
7088
  function frandom() {
6966
- return random2.frandom();
7089
+ return random3.frandom();
6967
7090
  }
6968
7091
  function brandom() {
6969
- return random2.frandom() > 0.5;
7092
+ return random3.frandom() > 0.5;
6970
7093
  }
6971
7094
  function irandom(min, max) {
6972
- return Math.floor(random2.frandom() * (max - min + 1) + min);
7095
+ return Math.floor(random3.frandom() * (max - min + 1) + min);
6973
7096
  }
6974
7097
  function monster_ai_stand(self, dist, context) {
6975
7098
  ai_stand(self, MONSTER_TICK, context);
@@ -7844,7 +7967,7 @@ function registerBoss2Spawns(registry) {
7844
7967
  // src/entities/monsters/brain.ts
7845
7968
  var MONSTER_TICK3 = 0.1;
7846
7969
  var MELEE_DISTANCE2 = 80;
7847
- var random3 = Math.random;
7970
+ var random4 = Math.random;
7848
7971
  function monster_ai_stand3(self, dist, context) {
7849
7972
  ai_stand(self, MONSTER_TICK3, context);
7850
7973
  }
@@ -7897,7 +8020,7 @@ function brain_swing_right(self, context) {
7897
8020
  }
7898
8021
  function brain_hit_right(self, context) {
7899
8022
  const aim = { x: MELEE_DISTANCE2, y: self.maxs.x, z: 8 };
7900
- if (monster_fire_hit(self, aim, 15 + Math.floor(random3() * 5), 40, context)) {
8023
+ if (monster_fire_hit(self, aim, 15 + Math.floor(random4() * 5), 40, context)) {
7901
8024
  context.engine.sound?.(self, 0, "brain/melee3.wav", 1, 1, 0);
7902
8025
  } else {
7903
8026
  self.monsterinfo.melee_debounce_time = context.timeSeconds + 3;
@@ -7908,7 +8031,7 @@ function brain_swing_left(self, context) {
7908
8031
  }
7909
8032
  function brain_hit_left(self, context) {
7910
8033
  const aim = { x: MELEE_DISTANCE2, y: self.mins.x, z: 8 };
7911
- if (monster_fire_hit(self, aim, 15 + Math.floor(random3() * 5), 40, context)) {
8034
+ if (monster_fire_hit(self, aim, 15 + Math.floor(random4() * 5), 40, context)) {
7912
8035
  context.engine.sound?.(self, 0, "brain/melee3.wav", 1, 1, 0);
7913
8036
  } else {
7914
8037
  self.monsterinfo.melee_debounce_time = context.timeSeconds + 3;
@@ -7921,7 +8044,7 @@ function brain_chest_open(self, context) {
7921
8044
  }
7922
8045
  function brain_tentacle_attack(self, context) {
7923
8046
  const aim = { x: MELEE_DISTANCE2, y: 0, z: 8 };
7924
- if (monster_fire_hit(self, aim, 10 + Math.floor(random3() * 5), -600, context)) {
8047
+ if (monster_fire_hit(self, aim, 10 + Math.floor(random4() * 5), -600, context)) {
7925
8048
  self.count = 1;
7926
8049
  } else {
7927
8050
  self.monsterinfo.melee_debounce_time = context.timeSeconds + 3;
@@ -7936,7 +8059,7 @@ function brain_chest_closed(self) {
7936
8059
  }
7937
8060
  }
7938
8061
  function brain_melee(self) {
7939
- if (random3() <= 0.5) {
8062
+ if (random4() <= 0.5) {
7940
8063
  self.monsterinfo.current_move = attack1_move;
7941
8064
  } else {
7942
8065
  self.monsterinfo.current_move = attack2_move;
@@ -8019,7 +8142,7 @@ function brain_laserbeam(self, context) {
8019
8142
  monster_fire_dabeam(self, 1, true, brain_left_eye_laser_update, context);
8020
8143
  }
8021
8144
  function brain_laserbeam_reattack(self) {
8022
- if (random3() < 0.5) {
8145
+ if (random4() < 0.5) {
8023
8146
  if (self.enemy && self.enemy.health > 0) {
8024
8147
  self.frame = 0;
8025
8148
  }
@@ -8028,7 +8151,7 @@ function brain_laserbeam_reattack(self) {
8028
8151
  function brain_attack(self, context) {
8029
8152
  const r = rangeTo(self, self.enemy);
8030
8153
  if (r <= RANGE_NEAR) {
8031
- if (random3() < 0.5) {
8154
+ if (random4() < 0.5) {
8032
8155
  self.monsterinfo.current_move = attack3_move;
8033
8156
  } else {
8034
8157
  self.monsterinfo.current_move = attack4_move;
@@ -8048,7 +8171,7 @@ function brain_duck_up(self) {
8048
8171
  self.monsterinfo.aiflags &= ~16;
8049
8172
  }
8050
8173
  function brain_dodge(self, attacker, eta) {
8051
- if (random3() > 0.25) return;
8174
+ if (random4() > 0.25) return;
8052
8175
  if (!self.enemy) self.enemy = attacker;
8053
8176
  self.monsterinfo.pausetime = self.timestamp + eta + 0.5;
8054
8177
  self.monsterinfo.current_move = duck_move;
@@ -8304,7 +8427,7 @@ function brain_pain(self, other, kick, damage, context) {
8304
8427
  return;
8305
8428
  }
8306
8429
  self.pain_debounce_time = self.timestamp + 3;
8307
- const r = random3();
8430
+ const r = random4();
8308
8431
  if (r < 0.33) {
8309
8432
  context.engine.sound?.(self, 0, "brain/brnpain1.wav", 1, 1, 0);
8310
8433
  self.monsterinfo.current_move = pain1_move;
@@ -8328,7 +8451,7 @@ function brain_die(self, inflictor, attacker, damage, point, context) {
8328
8451
  context.engine.sound?.(self, 0, "brain/brndeth1.wav", 1, 1, 0);
8329
8452
  self.deadflag = 2 /* Dead */;
8330
8453
  self.takedamage = true;
8331
- if (random3() <= 0.5) {
8454
+ if (random4() <= 0.5) {
8332
8455
  self.monsterinfo.current_move = death1_move;
8333
8456
  } else {
8334
8457
  self.monsterinfo.current_move = death2_move;
@@ -8365,7 +8488,7 @@ function SP_monster_brain(self, context) {
8365
8488
  context.entities.sound?.(s, 2, "brain/brnsght1.wav", 1, 1, 0);
8366
8489
  };
8367
8490
  self.monsterinfo.search = (s) => {
8368
- if (random3() < 0.5) {
8491
+ if (random4() < 0.5) {
8369
8492
  context.entities.sound?.(s, 2, "brain/brnidle2.wav", 1, 1, 0);
8370
8493
  } else {
8371
8494
  context.entities.sound?.(s, 2, "brain/brnsrch1.wav", 1, 1, 0);
@@ -8385,7 +8508,7 @@ function registerBrainSpawns(registry) {
8385
8508
  // src/entities/monsters/chick.ts
8386
8509
  var MONSTER_TICK4 = 0.1;
8387
8510
  var MELEE_DISTANCE3 = 80;
8388
- var random4 = Math.random;
8511
+ var random5 = Math.random;
8389
8512
  function monster_ai_stand4(self, dist, context) {
8390
8513
  ai_stand(self, MONSTER_TICK4, context);
8391
8514
  }
@@ -8433,12 +8556,12 @@ function chick_run(self) {
8433
8556
  function chick_fidget(self) {
8434
8557
  if (self.monsterinfo.aiflags & 4) return;
8435
8558
  if (self.enemy) return;
8436
- if (random4() <= 0.3) {
8559
+ if (random5() <= 0.3) {
8437
8560
  self.monsterinfo.current_move = fidget_move;
8438
8561
  }
8439
8562
  }
8440
8563
  function ChickMoan(self, context) {
8441
- if (random4() < 0.5) {
8564
+ if (random5() < 0.5) {
8442
8565
  context.engine.sound?.(self, 2, "chick/chkidle1.wav", 1, 0, 0);
8443
8566
  } else {
8444
8567
  context.engine.sound?.(self, 2, "chick/chkidle2.wav", 1, 0, 0);
@@ -8447,7 +8570,7 @@ function ChickMoan(self, context) {
8447
8570
  function chick_slash(self, context) {
8448
8571
  const aim = { x: MELEE_DISTANCE3, y: self.mins.x, z: 10 };
8449
8572
  context.engine.sound?.(self, 0, "chick/chkatck3.wav", 1, 1, 0);
8450
- monster_fire_hit(self, aim, 10 + Math.floor(random4() * 6), 100, context);
8573
+ monster_fire_hit(self, aim, 10 + Math.floor(random5() * 6), 100, context);
8451
8574
  }
8452
8575
  function chick_rocket(self, context) {
8453
8576
  const { forward, right } = angleVectors(self.angles);
@@ -8468,7 +8591,7 @@ function chick_rocket(self, context) {
8468
8591
  }
8469
8592
  let dir = subtractVec3(target, finalStart);
8470
8593
  if (!blindfire && self.enemy) {
8471
- if (random4() < 0.33 || finalStart.z < self.enemy.absmin.z) {
8594
+ if (random5() < 0.33 || finalStart.z < self.enemy.absmin.z) {
8472
8595
  const tempDir = { ...dir, z: dir.z + self.enemy.viewheight };
8473
8596
  dir = tempDir;
8474
8597
  } else {
@@ -8503,7 +8626,7 @@ function chick_rerocket(self) {
8503
8626
  return;
8504
8627
  }
8505
8628
  if (self.enemy && self.enemy.health > 0) {
8506
- if (random4() <= 0.6) {
8629
+ if (random5() <= 0.6) {
8507
8630
  self.monsterinfo.current_move = attack1_move2;
8508
8631
  return;
8509
8632
  }
@@ -8512,7 +8635,7 @@ function chick_rerocket(self) {
8512
8635
  }
8513
8636
  function chick_reslash(self) {
8514
8637
  if (self.enemy && self.enemy.health > 0) {
8515
- if (random4() <= 0.9) {
8638
+ if (random5() <= 0.9) {
8516
8639
  self.monsterinfo.current_move = slash_move;
8517
8640
  return;
8518
8641
  }
@@ -8590,7 +8713,7 @@ function chick_pain(self, other, kick, damage, context) {
8590
8713
  }
8591
8714
  if (self.timestamp < (self.pain_debounce_time || 0)) return;
8592
8715
  self.pain_debounce_time = self.timestamp + 3;
8593
- const r = random4();
8716
+ const r = random5();
8594
8717
  if (r < 0.33) context.engine.sound?.(self, 0, "chick/chkpain1.wav", 1, 1, 0);
8595
8718
  else if (r < 0.66) context.engine.sound?.(self, 0, "chick/chkpain2.wav", 1, 1, 0);
8596
8719
  else context.engine.sound?.(self, 0, "chick/chkpain3.wav", 1, 1, 0);
@@ -8619,7 +8742,7 @@ function chick_die(self, inflictor, attacker, damage, point, context) {
8619
8742
  if (self.deadflag === 2 /* Dead */) return;
8620
8743
  self.deadflag = 2 /* Dead */;
8621
8744
  self.takedamage = true;
8622
- if (random4() <= 0.5) {
8745
+ if (random5() <= 0.5) {
8623
8746
  self.monsterinfo.current_move = death1_move2;
8624
8747
  context.engine.sound?.(self, 0, "chick/chkdeth1.wav", 1, 1, 0);
8625
8748
  } else {
@@ -8739,7 +8862,7 @@ function registerChickSpawns(registry) {
8739
8862
  var MONSTER_TICK5 = 0.1;
8740
8863
  var MELEE_DISTANCE4 = 80;
8741
8864
  var FLIPPER_RUN_SPEED = 24;
8742
- var random5 = Math.random;
8865
+ var random6 = Math.random;
8743
8866
  function monster_ai_stand5(self, dist, context) {
8744
8867
  ai_stand(self, MONSTER_TICK5, context);
8745
8868
  }
@@ -8856,7 +8979,7 @@ function flipper_pain(self, other, kick, damage, context) {
8856
8979
  return;
8857
8980
  }
8858
8981
  self.pain_debounce_time = self.timestamp + 3;
8859
- if (random5() < 0.5) {
8982
+ if (random6() < 0.5) {
8860
8983
  context.engine.sound?.(self, 0, "flipper/flppain1.wav", 1, 1, 0);
8861
8984
  self.monsterinfo.current_move = pain1_move3;
8862
8985
  } else {
@@ -11674,8 +11797,8 @@ function actor_pain(self, other, kick, damage) {
11674
11797
  if (context.timeSeconds < self.pain_debounce_time)
11675
11798
  return;
11676
11799
  self.pain_debounce_time = context.timeSeconds + 3;
11677
- const random12 = Math.random();
11678
- if (other && other.client && random12 < 0.4) {
11800
+ const random13 = Math.random();
11801
+ if (other && other.client && random13 < 0.4) {
11679
11802
  const v = subtractVec3(other.origin, self.origin);
11680
11803
  self.ideal_yaw = vectorToYaw(v);
11681
11804
  if (Math.random() < 0.5)
@@ -12505,7 +12628,7 @@ function registerMedicSpawns(registry) {
12505
12628
 
12506
12629
  // src/entities/monsters/mutant.ts
12507
12630
  var MONSTER_TICK18 = 0.1;
12508
- var random6 = () => Math.random();
12631
+ var random7 = () => Math.random();
12509
12632
  function monster_ai_stand16(self, dist, context) {
12510
12633
  ai_stand(self, MONSTER_TICK18, context);
12511
12634
  }
@@ -12618,11 +12741,11 @@ function mutant_check_attack(self, context) {
12618
12741
  if (self.enemy && self.enemy.health > 0) {
12619
12742
  const diff = subtractVec3(self.enemy.origin, self.origin);
12620
12743
  const dist = lengthVec3(diff);
12621
- if (dist < 128 && random6() < 0.5) {
12744
+ if (dist < 128 && random7() < 0.5) {
12622
12745
  self.monsterinfo.current_move = attack_move7;
12623
12746
  return true;
12624
12747
  }
12625
- if (dist >= 128 && dist < 512 && random6() < 0.3) {
12748
+ if (dist >= 128 && dist < 512 && random7() < 0.3) {
12626
12749
  self.monsterinfo.current_move = jump_move2;
12627
12750
  return true;
12628
12751
  }
@@ -12635,10 +12758,10 @@ function mutant_pain_func(self, other, kick, damage, context) {
12635
12758
  }
12636
12759
  if (self.timestamp < (self.pain_finished_time || 0)) return;
12637
12760
  self.pain_finished_time = self.timestamp + 3;
12638
- if (random6() < 0.5) {
12761
+ if (random7() < 0.5) {
12639
12762
  context.engine.sound?.(self, 0, "mutant/mutpain1.wav", 1, 1, 0);
12640
12763
  self.monsterinfo.current_move = pain1_move6;
12641
- } else if (random6() < 0.5) {
12764
+ } else if (random7() < 0.5) {
12642
12765
  context.engine.sound?.(self, 0, "mutant/mutpain2.wav", 1, 1, 0);
12643
12766
  self.monsterinfo.current_move = pain2_move6;
12644
12767
  } else {
@@ -12894,7 +13017,7 @@ function registerMutantSpawns(registry) {
12894
13017
 
12895
13018
  // src/entities/monsters/parasite.ts
12896
13019
  var MONSTER_TICK19 = 0.1;
12897
- var random7 = () => Math.random();
13020
+ var random8 = () => Math.random();
12898
13021
  function monster_ai_stand17(self, dist, context) {
12899
13022
  ai_stand(self, MONSTER_TICK19, context);
12900
13023
  }
@@ -12939,7 +13062,7 @@ function parasite_do_fidget(self) {
12939
13062
  self.monsterinfo.current_move = fidget_move3;
12940
13063
  }
12941
13064
  function parasite_refidget(self) {
12942
- if (random7() <= 0.8) {
13065
+ if (random8() <= 0.8) {
12943
13066
  self.monsterinfo.current_move = fidget_move3;
12944
13067
  } else {
12945
13068
  self.monsterinfo.current_move = end_fidget_move;
@@ -13052,7 +13175,7 @@ function parasite_pain_func(self, other, kick, damage, context) {
13052
13175
  }
13053
13176
  if (self.timestamp < (self.pain_finished_time || 0)) return;
13054
13177
  self.pain_finished_time = self.timestamp + 3;
13055
- if (random7() < 0.5) {
13178
+ if (random8() < 0.5) {
13056
13179
  context.engine.sound?.(self, 0, "parasite/parpain1.wav", 1, 1, 0);
13057
13180
  } else {
13058
13181
  context.engine.sound?.(self, 0, "parasite/parpain2.wav", 1, 1, 0);
@@ -14373,7 +14496,7 @@ function registerTurretSpawns(registry) {
14373
14496
 
14374
14497
  // src/entities/monsters/gekk.ts
14375
14498
  var MONSTER_TICK24 = 0.1;
14376
- var random8 = () => Math.random();
14499
+ var random9 = () => Math.random();
14377
14500
  var frandom2 = () => Math.random();
14378
14501
  var irandom2 = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
14379
14502
  function monster_ai_stand22(self, dist, context) {
@@ -14882,7 +15005,7 @@ function gekk_pain(self, other, kick, damage, context) {
14882
15005
  }
14883
15006
  self.monsterinfo.current_move = gekk_move_pain;
14884
15007
  } else {
14885
- if (random8() > 0.5) self.monsterinfo.current_move = gekk_move_pain1;
15008
+ if (random9() > 0.5) self.monsterinfo.current_move = gekk_move_pain1;
14886
15009
  else self.monsterinfo.current_move = gekk_move_pain2;
14887
15010
  }
14888
15011
  }
@@ -15015,7 +15138,7 @@ function registerGekkSpawns(registry) {
15015
15138
 
15016
15139
  // src/entities/monsters/fixbot.ts
15017
15140
  var MONSTER_TICK25 = 0.1;
15018
- var random9 = () => Math.random();
15141
+ var random10 = () => Math.random();
15019
15142
  var frandom3 = () => Math.random();
15020
15143
  function monster_ai_walk21(self, dist, context) {
15021
15144
  ai_walk(self, dist, MONSTER_TICK25, context);
@@ -15078,7 +15201,7 @@ function fixbot_search(self, context) {
15078
15201
  fixbot_run(self);
15079
15202
  fixbot_set_fly_parameters(self, true, false);
15080
15203
  } else {
15081
- if (random9() < 0.1) {
15204
+ if (random10() < 0.1) {
15082
15205
  context.engine.sound?.(self, 0, "flyer/flysght1.wav", 1, 1, 0);
15083
15206
  }
15084
15207
  }
@@ -16637,7 +16760,7 @@ function PlayerNoise(who, where, type, context) {
16637
16760
  }
16638
16761
 
16639
16762
  // src/combat/obituary.ts
16640
- var random10 = createRandomGenerator();
16763
+ var random11 = createRandomGenerator();
16641
16764
  var PRINT_MEDIUM = 1;
16642
16765
  function getGender(ent) {
16643
16766
  return "male";
@@ -16800,7 +16923,7 @@ var ANIM_PAIN = 2;
16800
16923
  var ANIM_DEATH = 3;
16801
16924
 
16802
16925
  // src/combat/weapons/firing.ts
16803
- var random11 = createRandomGenerator();
16926
+ var random12 = createRandomGenerator();
16804
16927
 
16805
16928
  // src/entities/player.ts
16806
16929
  function P_PlayerThink(ent, sys) {
@@ -16857,7 +16980,7 @@ function player_pain(self, damage) {
16857
16980
  return;
16858
16981
  }
16859
16982
  self.client.anim_priority = ANIM_PAIN;
16860
- const r = random11.frandom();
16983
+ const r = random12.frandom();
16861
16984
  if (r < 0.33) {
16862
16985
  self.frame = FRAME_pain1012;
16863
16986
  self.client.anim_end = FRAME_pain104;
@@ -16880,7 +17003,7 @@ function player_die(self, inflictor, attacker, damage, point, mod, sys) {
16880
17003
  }
16881
17004
  if (self.client) {
16882
17005
  self.client.anim_priority = ANIM_DEATH;
16883
- const r = random11.frandom();
17006
+ const r = random12.frandom();
16884
17007
  if (r < 0.33) {
16885
17008
  self.frame = FRAME_death1012;
16886
17009
  self.client.anim_end = FRAME_death106;