quake2ts 0.0.518 → 0.0.519

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.
@@ -7693,6 +7693,17 @@ function useTargetAchievement(self, other, activator, context) {
7693
7693
  function useTargetStory(self, other, activator, context) {
7694
7694
  context.entities.imports.configstring(ConfigStringIndex.Story, self.message || "");
7695
7695
  }
7696
+ function target_delay_think(self, context) {
7697
+ context.entities.useTargets(self, self.activator);
7698
+ }
7699
+ function useTargetDelay(self, other, activator, context) {
7700
+ self.activator = activator;
7701
+ self.think = (s) => target_delay_think(s, context);
7702
+ let time = self.wait;
7703
+ if (!time && self.delay) time = self.delay;
7704
+ if (!time) time = 1;
7705
+ self.nextthink = context.entities.timeSeconds + time;
7706
+ }
7696
7707
  var SPAWNFLAG_TARGET_LIGHT_START_ON = 1;
7697
7708
  var SPAWNFLAG_TARGET_LIGHT_NO_LERP = 2;
7698
7709
  var SPAWNFLAG_TARGET_LIGHT_FLICKER = 4;
@@ -8063,6 +8074,11 @@ function registerTargetSpawns(registry) {
8063
8074
  }
8064
8075
  entity.use = (self, other, activator) => useTargetStory(self, other, activator ?? null, context);
8065
8076
  });
8077
+ registry.register("target_delay", (entity, context) => {
8078
+ if (!entity.wait) entity.wait = 1;
8079
+ entity.use = (self, other, activator) => useTargetDelay(self, other, activator ?? null, context);
8080
+ entity.svflags |= 1 /* NoClient */;
8081
+ });
8066
8082
  registry.register("target_light", (entity, context) => {
8067
8083
  entity.modelindex = 1;
8068
8084
  entity.renderfx = RenderFx.CustomLight;
@@ -15234,6 +15250,11 @@ function SP_monster_floater(self, context) {
15234
15250
  if (self2.health < self2.max_health / 2) {
15235
15251
  self2.monsterinfo.current_move = pain_move;
15236
15252
  }
15253
+ if (context.entities.rng.frandom() < 0.5) {
15254
+ context.entities.sound?.(self2, 0, "floater/fltpain1.wav", 1, 1, 0);
15255
+ } else {
15256
+ context.entities.sound?.(self2, 0, "floater/fltpain2.wav", 1, 1, 0);
15257
+ }
15237
15258
  };
15238
15259
  self.die = (self2, inflictor, attacker, damage, point) => {
15239
15260
  self2.deadflag = 2 /* Dead */;
@@ -15243,6 +15264,7 @@ function SP_monster_floater(self, context) {
15243
15264
  context.entities.free(self2);
15244
15265
  return;
15245
15266
  }
15267
+ context.entities.sound?.(self2, 0, "floater/fltdeth1.wav", 1, 1, 0);
15246
15268
  floater_die(self2);
15247
15269
  };
15248
15270
  self.monsterinfo.stand = floater_stand;
@@ -16368,6 +16390,11 @@ function SP_monster_icarus(self, context) {
16368
16390
  if (self2.health < self2.max_health / 2) {
16369
16391
  self2.monsterinfo.current_move = pain_move5;
16370
16392
  }
16393
+ if (context.entities.rng.frandom() < 0.5) {
16394
+ context.entities.sound?.(self2, 0, "icarus/icrpain1.wav", 1, 1, 0);
16395
+ } else {
16396
+ context.entities.sound?.(self2, 0, "icarus/icrpain2.wav", 1, 1, 0);
16397
+ }
16371
16398
  };
16372
16399
  self.die = (self2, inflictor, attacker, damage, point) => {
16373
16400
  self2.deadflag = 2 /* Dead */;
@@ -16377,6 +16404,7 @@ function SP_monster_icarus(self, context) {
16377
16404
  context.entities.free(self2);
16378
16405
  return;
16379
16406
  }
16407
+ context.entities.sound?.(self2, 0, "icarus/icrdeth1.wav", 1, 1, 0);
16380
16408
  icarus_die(self2);
16381
16409
  };
16382
16410
  self.monsterinfo.stand = icarus_stand;
@@ -19042,6 +19070,7 @@ function SP_monster_medic(self, context) {
19042
19070
  context.entities.free(self2);
19043
19071
  return;
19044
19072
  }
19073
+ context.entities.sound?.(self2, 0, "medic/meddeth1.wav", 1, 1, 0);
19045
19074
  medic_die(self2);
19046
19075
  };
19047
19076
  self.monsterinfo.stand = medic_stand;
@@ -20785,6 +20814,7 @@ function SP_monster_tank(self, context) {
20785
20814
  context.entities.free(self2);
20786
20815
  return;
20787
20816
  }
20817
+ context.entities.sound?.(self2, 0, "tank/tnkdeth2.wav", 1, 1, 0);
20788
20818
  tank_die(self2);
20789
20819
  };
20790
20820
  self.monsterinfo.stand = tank_stand;