quake2ts 0.0.221 → 0.0.223

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 (33) hide show
  1. package/package.json +1 -1
  2. package/packages/cgame/dist/index.cjs +7 -0
  3. package/packages/cgame/dist/index.cjs.map +1 -1
  4. package/packages/cgame/dist/index.js +8 -1
  5. package/packages/cgame/dist/index.js.map +1 -1
  6. package/packages/client/dist/browser/index.global.js +13 -13
  7. package/packages/client/dist/browser/index.global.js.map +1 -1
  8. package/packages/client/dist/cjs/index.cjs +23 -3
  9. package/packages/client/dist/cjs/index.cjs.map +1 -1
  10. package/packages/client/dist/esm/index.js +23 -3
  11. package/packages/client/dist/esm/index.js.map +1 -1
  12. package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
  13. package/packages/client/dist/types/demo/handler.d.ts.map +1 -1
  14. package/packages/client/dist/types/index.d.ts.map +1 -1
  15. package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
  16. package/packages/game/dist/browser/index.global.js +2 -2
  17. package/packages/game/dist/browser/index.global.js.map +1 -1
  18. package/packages/game/dist/cjs/index.cjs +313 -145
  19. package/packages/game/dist/cjs/index.cjs.map +1 -1
  20. package/packages/game/dist/esm/index.js +313 -145
  21. package/packages/game/dist/esm/index.js.map +1 -1
  22. package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
  23. package/packages/game/dist/types/entities/monsters/gunner.d.ts.map +1 -1
  24. package/packages/game/dist/types/index.d.ts +6 -0
  25. package/packages/game/dist/types/index.d.ts.map +1 -1
  26. package/packages/game/dist/types/inventory/playerInventory.d.ts +6 -0
  27. package/packages/game/dist/types/inventory/playerInventory.d.ts.map +1 -1
  28. package/packages/server/dist/index.cjs +18 -10
  29. package/packages/server/dist/index.js +18 -10
  30. package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
  31. package/packages/shared/dist/types/protocol/player-state.d.ts +6 -0
  32. package/packages/shared/dist/types/protocol/player-state.d.ts.map +1 -1
  33. package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
@@ -8429,33 +8429,68 @@ function monster_ai_move9(self, dist, context) {
8429
8429
  ai_move(self, dist);
8430
8430
  }
8431
8431
  var stand_move8;
8432
+ var fidget_move2;
8432
8433
  var walk_move7;
8433
8434
  var run_move7;
8435
+ var runandshoot_move;
8434
8436
  var attack_chain_move;
8435
8437
  var attack_grenade_move;
8436
- var pain_move4;
8438
+ var fire_chain_move;
8439
+ var endfire_chain_move;
8440
+ var pain1_move4;
8441
+ var pain2_move4;
8442
+ var pain3_move3;
8437
8443
  var death_move6;
8444
+ var duck_move3;
8445
+ function gunner_idlesound(self, context) {
8446
+ context.engine.sound?.(self, 0, "gunner/gunidle1.wav", 1, 1, 0);
8447
+ }
8438
8448
  function gunner_stand(self) {
8439
8449
  self.monsterinfo.current_move = stand_move8;
8440
8450
  }
8451
+ function gunner_fidget(self) {
8452
+ if (self.monsterinfo.aiflags & 1 /* StandGround */) {
8453
+ return;
8454
+ }
8455
+ if (Math.random() <= 0.05) {
8456
+ self.monsterinfo.current_move = fidget_move2;
8457
+ }
8458
+ }
8441
8459
  function gunner_walk(self) {
8442
8460
  self.monsterinfo.current_move = walk_move7;
8443
8461
  }
8444
8462
  function gunner_run(self) {
8445
- if (self.enemy && self.enemy.health > 0) {
8446
- self.monsterinfo.current_move = run_move7;
8447
- } else {
8463
+ if (self.monsterinfo.aiflags & 1 /* StandGround */) {
8448
8464
  self.monsterinfo.current_move = stand_move8;
8465
+ } else {
8466
+ self.monsterinfo.current_move = run_move7;
8449
8467
  }
8450
8468
  }
8451
- function gunner_attack(self) {
8469
+ function gunner_attack(self, context) {
8452
8470
  if (Math.random() > 0.5) {
8453
8471
  self.monsterinfo.current_move = attack_chain_move;
8454
8472
  } else {
8455
8473
  self.monsterinfo.current_move = attack_grenade_move;
8456
8474
  }
8457
8475
  }
8476
+ function gunner_opengun(self, context) {
8477
+ context.engine.sound?.(self, 0, "gunner/gunatck1.wav", 1, 1, 0);
8478
+ }
8458
8479
  function gunner_fire_chain(self, context) {
8480
+ self.monsterinfo.current_move = fire_chain_move;
8481
+ }
8482
+ function gunner_refire_chain(self, context) {
8483
+ if (self.enemy && self.enemy.health > 0) {
8484
+ if (visible(self, self.enemy, context.trace)) {
8485
+ if (Math.random() <= 0.5) {
8486
+ self.monsterinfo.current_move = fire_chain_move;
8487
+ return;
8488
+ }
8489
+ }
8490
+ }
8491
+ self.monsterinfo.current_move = endfire_chain_move;
8492
+ }
8493
+ function gunner_fire_bullet_logic(self, context) {
8459
8494
  if (!self.enemy) return;
8460
8495
  const start = {
8461
8496
  x: self.origin.x,
@@ -8463,10 +8498,10 @@ function gunner_fire_chain(self, context) {
8463
8498
  z: self.origin.z + self.viewheight - 8
8464
8499
  };
8465
8500
  const forward = normalizeVec3(subtractVec3(self.enemy.origin, start));
8466
- const damage = 10;
8467
- const kick = 2;
8501
+ const damage = 3;
8502
+ const kick = 4;
8468
8503
  context.engine.sound?.(self, 0, "gunner/gunatck2.wav", 1, 1, 0);
8469
- monster_fire_bullet(self, start, forward, damage, kick, 0, 0, 0, context, 5 /* CHAINGUN */);
8504
+ monster_fire_bullet(self, start, forward, damage, kick, 300, 500, 0, context, 5 /* CHAINGUN */);
8470
8505
  }
8471
8506
  function gunner_fire_grenade(self, context) {
8472
8507
  if (!self.enemy) return;
@@ -8482,93 +8517,218 @@ function gunner_fire_grenade(self, context) {
8482
8517
  createGrenade(context, self, start, forward, damage, speed);
8483
8518
  }
8484
8519
  function gunner_pain(self, context) {
8520
+ if (self.health < self.max_health / 2) {
8521
+ }
8522
+ if (self.pain_debounce_time && context.timeSeconds < self.pain_debounce_time) return;
8523
+ self.pain_debounce_time = context.timeSeconds + 3;
8485
8524
  if (Math.random() < 0.5) {
8486
8525
  context.engine.sound?.(self, 0, "gunner/gunpain1.wav", 1, 1, 0);
8487
8526
  } else {
8488
8527
  context.engine.sound?.(self, 0, "gunner/gunpain2.wav", 1, 1, 0);
8489
8528
  }
8490
- self.monsterinfo.current_move = pain_move4;
8529
+ const r = Math.random();
8530
+ if (r < 0.33) {
8531
+ self.monsterinfo.current_move = pain3_move3;
8532
+ } else if (r < 0.66) {
8533
+ self.monsterinfo.current_move = pain2_move4;
8534
+ } else {
8535
+ self.monsterinfo.current_move = pain1_move4;
8536
+ }
8491
8537
  }
8492
8538
  function gunner_die(self, context) {
8493
8539
  context.engine.sound?.(self, 0, "gunner/death1.wav", 1, 1, 0);
8494
8540
  self.monsterinfo.current_move = death_move6;
8495
8541
  }
8496
- var stand_frames8 = Array.from({ length: 30 }, () => ({
8542
+ function gunner_duck_down(self, context) {
8543
+ if (self.monsterinfo.aiflags & 2048 /* Ducked */) return;
8544
+ self.monsterinfo.aiflags |= 2048 /* Ducked */;
8545
+ if (Math.random() > 0.5) {
8546
+ gunner_fire_grenade(self, context);
8547
+ }
8548
+ self.maxs = { ...self.maxs, z: self.maxs.z - 32 };
8549
+ self.takedamage = true;
8550
+ self.monsterinfo.pausetime = context.timeSeconds + 1;
8551
+ }
8552
+ function gunner_duck_hold(self, context) {
8553
+ if (context.timeSeconds >= self.monsterinfo.pausetime) {
8554
+ self.monsterinfo.aiflags &= ~128 /* HoldFrame */;
8555
+ } else {
8556
+ self.monsterinfo.aiflags |= 128 /* HoldFrame */;
8557
+ }
8558
+ }
8559
+ function gunner_duck_up(self, context) {
8560
+ self.monsterinfo.aiflags &= ~2048 /* Ducked */;
8561
+ self.maxs = { ...self.maxs, z: self.maxs.z + 32 };
8562
+ self.takedamage = true;
8563
+ }
8564
+ function gunner_dodge(self, attacker, eta, context) {
8565
+ if (Math.random() > 0.25) return;
8566
+ if (!self.enemy) self.enemy = attacker;
8567
+ self.monsterinfo.current_move = duck_move3;
8568
+ }
8569
+ var stand_frames8 = Array.from({ length: 30 }, (_, i) => ({
8497
8570
  ai: monster_ai_stand9,
8498
- dist: 0
8571
+ dist: 0,
8572
+ think: i === 29 ? gunner_fidget : null
8499
8573
  }));
8500
8574
  stand_move8 = {
8501
8575
  firstframe: 0,
8502
8576
  lastframe: 29,
8503
8577
  frames: stand_frames8,
8578
+ endfunc: null
8579
+ };
8580
+ var fidget_frames2 = Array.from({ length: 40 }, (_, i) => ({
8581
+ ai: monster_ai_stand9,
8582
+ dist: 0,
8583
+ think: i === 7 ? gunner_idlesound : null
8584
+ }));
8585
+ fidget_move2 = {
8586
+ firstframe: 30,
8587
+ lastframe: 69,
8588
+ frames: fidget_frames2,
8504
8589
  endfunc: gunner_stand
8505
8590
  };
8506
- var walk_frames7 = Array.from({ length: 40 }, () => ({
8591
+ var walk_dists = [0, 3, 4, 5, 7, 2, 6, 4, 2, 7, 5, 7, 4];
8592
+ var walk_frames7 = walk_dists.map((d) => ({
8507
8593
  ai: monster_ai_walk9,
8508
- dist: 2
8594
+ dist: d
8509
8595
  }));
8510
8596
  walk_move7 = {
8511
- firstframe: 30,
8512
- lastframe: 69,
8597
+ firstframe: 76,
8598
+ lastframe: 88,
8513
8599
  frames: walk_frames7,
8514
- endfunc: gunner_walk
8600
+ endfunc: null
8515
8601
  };
8516
- var run_frames6 = Array.from({ length: 20 }, () => ({
8602
+ var run_dists = [26, 9, 9, 9, 15, 10, 13, 6];
8603
+ var run_frames6 = run_dists.map((d) => ({
8517
8604
  ai: monster_ai_run8,
8518
- dist: 10
8605
+ dist: d
8519
8606
  }));
8520
8607
  run_move7 = {
8521
- firstframe: 70,
8522
- lastframe: 89,
8608
+ firstframe: 94,
8609
+ lastframe: 101,
8523
8610
  frames: run_frames6,
8611
+ endfunc: null
8612
+ };
8613
+ var runshoot_dists = [32, 15, 10, 18, 8, 20];
8614
+ var runshoot_frames = runshoot_dists.map((d) => ({
8615
+ ai: monster_ai_run8,
8616
+ dist: d
8617
+ }));
8618
+ runandshoot_move = {
8619
+ firstframe: 102,
8620
+ lastframe: 107,
8621
+ frames: runshoot_frames,
8622
+ endfunc: null
8623
+ };
8624
+ var attack_grenade_frames = Array.from({ length: 21 }, (_, i) => ({
8625
+ ai: monster_ai_charge9,
8626
+ dist: 0,
8627
+ think: [4, 7, 10, 13].includes(i) ? gunner_fire_grenade : null
8628
+ }));
8629
+ attack_grenade_move = {
8630
+ firstframe: 108,
8631
+ lastframe: 128,
8632
+ frames: attack_grenade_frames,
8524
8633
  endfunc: gunner_run
8525
8634
  };
8526
- var attack_chain_frames = Array.from({ length: 10 }, (_, i) => ({
8635
+ var attack_chain_frames = Array.from({ length: 7 }, (_, i) => ({
8527
8636
  ai: monster_ai_charge9,
8528
8637
  dist: 0,
8529
- think: i >= 2 && i <= 8 ? gunner_fire_chain : null
8638
+ think: i === 0 ? gunner_opengun : null
8530
8639
  }));
8531
8640
  attack_chain_move = {
8532
- firstframe: 90,
8533
- lastframe: 99,
8641
+ firstframe: 137,
8642
+ lastframe: 143,
8534
8643
  frames: attack_chain_frames,
8535
- endfunc: gunner_run
8644
+ endfunc: gunner_fire_chain
8536
8645
  };
8537
- var attack_grenade_frames = Array.from({ length: 10 }, (_, i) => ({
8646
+ var fire_chain_frames = Array.from({ length: 8 }, () => ({
8538
8647
  ai: monster_ai_charge9,
8539
8648
  dist: 0,
8540
- think: i === 5 ? gunner_fire_grenade : null
8649
+ think: gunner_fire_bullet_logic
8541
8650
  }));
8542
- attack_grenade_move = {
8543
- firstframe: 100,
8544
- lastframe: 109,
8545
- frames: attack_grenade_frames,
8651
+ fire_chain_move = {
8652
+ firstframe: 144,
8653
+ lastframe: 151,
8654
+ frames: fire_chain_frames,
8655
+ endfunc: gunner_refire_chain
8656
+ };
8657
+ var endfire_chain_frames = Array.from({ length: 7 }, () => ({
8658
+ ai: monster_ai_charge9,
8659
+ dist: 0
8660
+ }));
8661
+ endfire_chain_move = {
8662
+ firstframe: 152,
8663
+ lastframe: 158,
8664
+ frames: endfire_chain_frames,
8546
8665
  endfunc: gunner_run
8547
8666
  };
8548
- var pain_frames4 = Array.from({ length: 8 }, () => ({
8667
+ var pain1_dists = [2, 0, -5, 3, -1, 0, 0, 0, 0, 1, 1, 2, 1, 0, -2, -2, 0, 0];
8668
+ var pain1_frames4 = pain1_dists.map((d) => ({
8549
8669
  ai: monster_ai_move9,
8550
- dist: 0
8670
+ dist: d
8551
8671
  }));
8552
- pain_move4 = {
8553
- firstframe: 110,
8554
- lastframe: 117,
8555
- frames: pain_frames4,
8672
+ pain1_move4 = {
8673
+ firstframe: 159,
8674
+ lastframe: 176,
8675
+ frames: pain1_frames4,
8556
8676
  endfunc: gunner_run
8557
8677
  };
8558
- var death_frames6 = Array.from({ length: 15 }, () => ({
8678
+ var pain2_dists = [-2, 11, 6, 2, -1, -7, -2, -7];
8679
+ var pain2_frames4 = pain2_dists.map((d) => ({
8559
8680
  ai: monster_ai_move9,
8560
- dist: 0
8681
+ dist: d
8682
+ }));
8683
+ pain2_move4 = {
8684
+ firstframe: 177,
8685
+ lastframe: 184,
8686
+ frames: pain2_frames4,
8687
+ endfunc: gunner_run
8688
+ };
8689
+ var pain3_dists = [-3, 1, 1, 0, 1];
8690
+ var pain3_frames3 = pain3_dists.map((d) => ({
8691
+ ai: monster_ai_move9,
8692
+ dist: d
8693
+ }));
8694
+ pain3_move3 = {
8695
+ firstframe: 185,
8696
+ lastframe: 189,
8697
+ frames: pain3_frames3,
8698
+ endfunc: gunner_run
8699
+ };
8700
+ var death_dists = [0, 0, 0, -7, -3, -5, 8, 6, 0, 0, 0];
8701
+ var death_frames6 = death_dists.map((d) => ({
8702
+ ai: monster_ai_move9,
8703
+ dist: d
8561
8704
  }));
8562
8705
  function gunner_dead(self) {
8563
8706
  self.monsterinfo.nextframe = death_move6.lastframe;
8564
8707
  self.nextthink = -1;
8708
+ self.solid = 0 /* Not */;
8565
8709
  }
8566
8710
  death_move6 = {
8567
- firstframe: 118,
8568
- lastframe: 132,
8711
+ firstframe: 190,
8712
+ lastframe: 200,
8569
8713
  frames: death_frames6,
8570
8714
  endfunc: gunner_dead
8571
8715
  };
8716
+ var duck_frames3 = [
8717
+ { ai: monster_ai_move9, dist: 1, think: gunner_duck_down },
8718
+ { ai: monster_ai_move9, dist: 1 },
8719
+ { ai: monster_ai_move9, dist: 1, think: gunner_duck_hold },
8720
+ { ai: monster_ai_move9, dist: 0 },
8721
+ { ai: monster_ai_move9, dist: -1 },
8722
+ { ai: monster_ai_move9, dist: -1 },
8723
+ { ai: monster_ai_move9, dist: 0, think: gunner_duck_up },
8724
+ { ai: monster_ai_move9, dist: -1 }
8725
+ ];
8726
+ duck_move3 = {
8727
+ firstframe: 201,
8728
+ lastframe: 208,
8729
+ frames: duck_frames3,
8730
+ endfunc: gunner_run
8731
+ };
8572
8732
  function SP_monster_gunner(self, context) {
8573
8733
  self.model = "models/monsters/gunner/tris.md2";
8574
8734
  self.mins = { x: -16, y: -16, z: -24 };
@@ -8580,11 +8740,7 @@ function SP_monster_gunner(self, context) {
8580
8740
  self.mass = 200;
8581
8741
  self.takedamage = true;
8582
8742
  self.pain = (self2, other, kick, damage) => {
8583
- if (self2.health < self2.max_health / 2) {
8584
- gunner_pain(self2, context.entities);
8585
- } else if (Math.random() < 0.2) {
8586
- gunner_pain(self2, context.entities);
8587
- }
8743
+ gunner_pain(self2, context.entities);
8588
8744
  };
8589
8745
  self.die = (self2, inflictor, attacker, damage, point) => {
8590
8746
  self2.deadflag = 2 /* Dead */;
@@ -8601,6 +8757,7 @@ function SP_monster_gunner(self, context) {
8601
8757
  self.monsterinfo.walk = gunner_walk;
8602
8758
  self.monsterinfo.run = gunner_run;
8603
8759
  self.monsterinfo.attack = gunner_attack;
8760
+ self.monsterinfo.dodge = (self2, attacker, eta) => gunner_dodge(self2, attacker, eta, context.entities);
8604
8761
  self.monsterinfo.sight = (self2, other) => {
8605
8762
  context.entities.sound?.(self2, 0, "gunner/sight1.wav", 1, 1, 0);
8606
8763
  };
@@ -8633,7 +8790,7 @@ var stand_move9;
8633
8790
  var walk_move8;
8634
8791
  var run_move8;
8635
8792
  var attack_move4;
8636
- var pain_move5;
8793
+ var pain_move4;
8637
8794
  var death_move7;
8638
8795
  function hover_stand(self) {
8639
8796
  self.monsterinfo.current_move = stand_move9;
@@ -8709,14 +8866,14 @@ attack_move4 = {
8709
8866
  frames: attack_frames4,
8710
8867
  endfunc: hover_run
8711
8868
  };
8712
- var pain_frames5 = Array.from({ length: 6 }, () => ({
8869
+ var pain_frames4 = Array.from({ length: 6 }, () => ({
8713
8870
  ai: monster_ai_move10,
8714
8871
  dist: 0
8715
8872
  }));
8716
- pain_move5 = {
8873
+ pain_move4 = {
8717
8874
  firstframe: 66,
8718
8875
  lastframe: 71,
8719
- frames: pain_frames5,
8876
+ frames: pain_frames4,
8720
8877
  endfunc: hover_run
8721
8878
  };
8722
8879
  var death_frames7 = Array.from({ length: 10 }, () => ({
@@ -8744,7 +8901,7 @@ function SP_monster_hover(self, context) {
8744
8901
  self.viewheight = 18;
8745
8902
  self.pain = (self2, other, kick, damage) => {
8746
8903
  if (self2.health < self2.max_health / 2) {
8747
- self2.monsterinfo.current_move = pain_move5;
8904
+ self2.monsterinfo.current_move = pain_move4;
8748
8905
  }
8749
8906
  };
8750
8907
  self.die = (self2, inflictor, attacker, damage, point) => {
@@ -8790,7 +8947,7 @@ var stand_move10;
8790
8947
  var walk_move9;
8791
8948
  var run_move9;
8792
8949
  var attack_move5;
8793
- var pain_move6;
8950
+ var pain_move5;
8794
8951
  var death_move8;
8795
8952
  function icarus_stand(self) {
8796
8953
  self.monsterinfo.current_move = stand_move10;
@@ -8866,14 +9023,14 @@ attack_move5 = {
8866
9023
  frames: attack_frames5,
8867
9024
  endfunc: icarus_run
8868
9025
  };
8869
- var pain_frames6 = Array.from({ length: 6 }, () => ({
9026
+ var pain_frames5 = Array.from({ length: 6 }, () => ({
8870
9027
  ai: monster_ai_move11,
8871
9028
  dist: 0
8872
9029
  }));
8873
- pain_move6 = {
9030
+ pain_move5 = {
8874
9031
  firstframe: 66,
8875
9032
  lastframe: 71,
8876
- frames: pain_frames6,
9033
+ frames: pain_frames5,
8877
9034
  endfunc: icarus_run
8878
9035
  };
8879
9036
  var death_frames8 = Array.from({ length: 10 }, () => ({
@@ -8901,7 +9058,7 @@ function SP_monster_icarus(self, context) {
8901
9058
  self.viewheight = 18;
8902
9059
  self.pain = (self2, other, kick, damage) => {
8903
9060
  if (self2.health < self2.max_health / 2) {
8904
- self2.monsterinfo.current_move = pain_move6;
9061
+ self2.monsterinfo.current_move = pain_move5;
8905
9062
  }
8906
9063
  };
8907
9064
  self.die = (self2, inflictor, attacker, damage, point) => {
@@ -8947,9 +9104,9 @@ var stand_move11;
8947
9104
  var walk_move10;
8948
9105
  var run_move10;
8949
9106
  var attack_move6;
8950
- var pain_move7;
9107
+ var pain_move6;
8951
9108
  var death_move9;
8952
- var duck_move3;
9109
+ var duck_move4;
8953
9110
  function infantry_stand(self) {
8954
9111
  self.monsterinfo.current_move = stand_move11;
8955
9112
  }
@@ -8989,7 +9146,7 @@ function infantry_die(self) {
8989
9146
  self.monsterinfo.current_move = death_move9;
8990
9147
  }
8991
9148
  function infantry_duck(self) {
8992
- self.monsterinfo.current_move = duck_move3;
9149
+ self.monsterinfo.current_move = duck_move4;
8993
9150
  }
8994
9151
  var stand_frames11 = Array.from({ length: 22 }, () => ({
8995
9152
  ai: monster_ai_stand12,
@@ -9032,14 +9189,14 @@ attack_move6 = {
9032
9189
  frames: attack_frames6,
9033
9190
  endfunc: infantry_run
9034
9191
  };
9035
- var pain_frames7 = Array.from({ length: 10 }, () => ({
9192
+ var pain_frames6 = Array.from({ length: 10 }, () => ({
9036
9193
  ai: monster_ai_move12,
9037
9194
  dist: 0
9038
9195
  }));
9039
- pain_move7 = {
9196
+ pain_move6 = {
9040
9197
  firstframe: 60,
9041
9198
  lastframe: 69,
9042
- frames: pain_frames7,
9199
+ frames: pain_frames6,
9043
9200
  endfunc: infantry_run
9044
9201
  };
9045
9202
  var death_frames9 = Array.from({ length: 20 }, () => ({
@@ -9056,19 +9213,19 @@ death_move9 = {
9056
9213
  frames: death_frames9,
9057
9214
  endfunc: infantry_dead
9058
9215
  };
9059
- var duck_frames3 = Array.from({ length: 5 }, () => ({
9216
+ var duck_frames4 = Array.from({ length: 5 }, () => ({
9060
9217
  ai: monster_ai_move12,
9061
9218
  dist: 0
9062
9219
  }));
9063
- duck_move3 = {
9220
+ duck_move4 = {
9064
9221
  firstframe: 90,
9065
9222
  lastframe: 94,
9066
- frames: duck_frames3,
9223
+ frames: duck_frames4,
9067
9224
  endfunc: infantry_run
9068
9225
  };
9069
9226
  function infantry_dodge(self, context) {
9070
9227
  if (!self.enemy) return false;
9071
- if (self.monsterinfo.current_move === duck_move3 || self.monsterinfo.current_move === death_move9 || self.monsterinfo.current_move === pain_move7) {
9228
+ if (self.monsterinfo.current_move === duck_move4 || self.monsterinfo.current_move === death_move9 || self.monsterinfo.current_move === pain_move6) {
9072
9229
  return false;
9073
9230
  }
9074
9231
  if (Math.random() > 0.3) return false;
@@ -9100,7 +9257,7 @@ function SP_monster_infantry(self, context) {
9100
9257
  self.takedamage = true;
9101
9258
  self.pain = (self2, other, kick, damage) => {
9102
9259
  if (self2.health < self2.max_health / 2) {
9103
- self2.monsterinfo.current_move = pain_move7;
9260
+ self2.monsterinfo.current_move = pain_move6;
9104
9261
  }
9105
9262
  };
9106
9263
  self.die = (self2, inflictor, attacker, damage, point) => {
@@ -9152,9 +9309,9 @@ var run_move11;
9152
9309
  var attack1_move3;
9153
9310
  var attack1_end_move;
9154
9311
  var attack2_move2;
9155
- var pain1_move4;
9156
- var pain2_move4;
9157
- var pain3_move3;
9312
+ var pain1_move5;
9313
+ var pain2_move5;
9314
+ var pain3_move4;
9158
9315
  var death_move10;
9159
9316
  function jorg_stand(self) {
9160
9317
  self.monsterinfo.current_move = stand_move12;
@@ -9231,14 +9388,14 @@ function jorg_pain(self, other, kick, damage, context) {
9231
9388
  self.pain_finished_time = self.timestamp + 3;
9232
9389
  if (damage <= 50) {
9233
9390
  context.engine.sound?.(self, 0, "boss3/bs3pain1.wav", 1, 1, 0);
9234
- self.monsterinfo.current_move = pain1_move4;
9391
+ self.monsterinfo.current_move = pain1_move5;
9235
9392
  } else if (damage <= 100) {
9236
9393
  context.engine.sound?.(self, 0, "boss3/bs3pain2.wav", 1, 1, 0);
9237
- self.monsterinfo.current_move = pain2_move4;
9394
+ self.monsterinfo.current_move = pain2_move5;
9238
9395
  } else {
9239
9396
  if (Math.random() <= 0.3) {
9240
9397
  context.engine.sound?.(self, 0, "boss3/bs3pain3.wav", 1, 1, 0);
9241
- self.monsterinfo.current_move = pain3_move3;
9398
+ self.monsterinfo.current_move = pain3_move4;
9242
9399
  }
9243
9400
  }
9244
9401
  }
@@ -9277,12 +9434,12 @@ var attack2_frames2 = Array.from({ length: 13 }, (_, i) => ({
9277
9434
  think: i === 6 ? jorg_fire_bfg : null
9278
9435
  }));
9279
9436
  attack2_move2 = { firstframe: 83, lastframe: 95, frames: attack2_frames2, endfunc: jorg_run };
9280
- var pain1_frames4 = Array.from({ length: 3 }, () => ({ ai: monster_ai_move13, dist: 0 }));
9281
- pain1_move4 = { firstframe: 96, lastframe: 98, frames: pain1_frames4, endfunc: jorg_run };
9282
- var pain2_frames4 = Array.from({ length: 3 }, () => ({ ai: monster_ai_move13, dist: 0 }));
9283
- pain2_move4 = { firstframe: 99, lastframe: 101, frames: pain2_frames4, endfunc: jorg_run };
9284
- var pain3_frames3 = Array.from({ length: 25 }, () => ({ ai: monster_ai_move13, dist: 0 }));
9285
- pain3_move3 = { firstframe: 102, lastframe: 126, frames: pain3_frames3, endfunc: jorg_run };
9437
+ var pain1_frames5 = Array.from({ length: 3 }, () => ({ ai: monster_ai_move13, dist: 0 }));
9438
+ pain1_move5 = { firstframe: 96, lastframe: 98, frames: pain1_frames5, endfunc: jorg_run };
9439
+ var pain2_frames5 = Array.from({ length: 3 }, () => ({ ai: monster_ai_move13, dist: 0 }));
9440
+ pain2_move5 = { firstframe: 99, lastframe: 101, frames: pain2_frames5, endfunc: jorg_run };
9441
+ var pain3_frames4 = Array.from({ length: 25 }, () => ({ ai: monster_ai_move13, dist: 0 }));
9442
+ pain3_move4 = { firstframe: 102, lastframe: 126, frames: pain3_frames4, endfunc: jorg_run };
9286
9443
  var death_frames10 = Array.from({ length: 50 }, (_, i) => ({
9287
9444
  ai: monster_ai_move13,
9288
9445
  dist: 0,
@@ -9575,7 +9732,7 @@ var run_move13;
9575
9732
  var attack_hyper_move;
9576
9733
  var attack_cable_move;
9577
9734
  var spawn_move;
9578
- var pain_move8;
9735
+ var pain_move7;
9579
9736
  var death_move12;
9580
9737
  function medic_stand(self) {
9581
9738
  self.monsterinfo.current_move = stand_move14;
@@ -9832,14 +9989,14 @@ attack_cable_move = {
9832
9989
  frames: attack_cable_frames,
9833
9990
  endfunc: medic_run
9834
9991
  };
9835
- var pain_frames8 = Array.from({ length: 6 }, () => ({
9992
+ var pain_frames7 = Array.from({ length: 6 }, () => ({
9836
9993
  ai: monster_ai_move15,
9837
9994
  dist: 0
9838
9995
  }));
9839
- pain_move8 = {
9996
+ pain_move7 = {
9840
9997
  firstframe: 116,
9841
9998
  lastframe: 121,
9842
- frames: pain_frames8,
9999
+ frames: pain_frames7,
9843
10000
  endfunc: medic_run
9844
10001
  };
9845
10002
  var spawn_frames = Array.from({ length: 23 }, (_, i) => ({
@@ -9877,7 +10034,7 @@ function SP_monster_medic(self, context) {
9877
10034
  self.takedamage = true;
9878
10035
  self.pain = (self2, other, kick, damage) => {
9879
10036
  if (self2.health < self2.max_health / 2) {
9880
- self2.monsterinfo.current_move = pain_move8;
10037
+ self2.monsterinfo.current_move = pain_move7;
9881
10038
  if (Math.random() < 0.5) {
9882
10039
  const sound = self2.classname === "monster_medic_commander" ? "medic/medpain2.wav" : "medic/medpain1.wav";
9883
10040
  context.entities.sound?.(self2, 0, sound, 1, 1, 0);
@@ -9939,9 +10096,9 @@ var stand_move15;
9939
10096
  var walk_move14;
9940
10097
  var run_move14;
9941
10098
  var attack_move7;
9942
- var pain1_move5;
9943
- var pain2_move5;
9944
- var pain3_move4;
10099
+ var pain1_move6;
10100
+ var pain2_move6;
10101
+ var pain3_move5;
9945
10102
  var death_move13;
9946
10103
  var jump_move;
9947
10104
  function mutant_step(self) {
@@ -10048,13 +10205,13 @@ function mutant_pain_func(self, other, kick, damage, context) {
10048
10205
  self.pain_finished_time = self.timestamp + 3;
10049
10206
  if (random6() < 0.5) {
10050
10207
  context.engine.sound?.(self, 0, "mutant/mutpain1.wav", 1, 1, 0);
10051
- self.monsterinfo.current_move = pain1_move5;
10208
+ self.monsterinfo.current_move = pain1_move6;
10052
10209
  } else if (random6() < 0.5) {
10053
10210
  context.engine.sound?.(self, 0, "mutant/mutpain2.wav", 1, 1, 0);
10054
- self.monsterinfo.current_move = pain2_move5;
10211
+ self.monsterinfo.current_move = pain2_move6;
10055
10212
  } else {
10056
10213
  context.engine.sound?.(self, 0, "mutant/mutpain3.wav", 1, 1, 0);
10057
- self.monsterinfo.current_move = pain3_move4;
10214
+ self.monsterinfo.current_move = pain3_move5;
10058
10215
  }
10059
10216
  }
10060
10217
  function mutant_die(self) {
@@ -10202,32 +10359,32 @@ jump_move.frames[3].ai = (self, dist, context) => {
10202
10359
  }
10203
10360
  }
10204
10361
  };
10205
- var pain1_frames5 = [
10362
+ var pain1_frames6 = [
10206
10363
  { ai: monster_ai_move16, dist: 4 },
10207
10364
  { ai: monster_ai_move16, dist: -3 },
10208
10365
  { ai: monster_ai_move16, dist: -8 },
10209
10366
  { ai: monster_ai_move16, dist: 2 },
10210
10367
  { ai: monster_ai_move16, dist: 5 }
10211
10368
  ];
10212
- pain1_move5 = {
10369
+ pain1_move6 = {
10213
10370
  firstframe: 78,
10214
10371
  lastframe: 82,
10215
- frames: pain1_frames5,
10372
+ frames: pain1_frames6,
10216
10373
  endfunc: mutant_run
10217
10374
  };
10218
- var pain2_frames5 = [
10375
+ var pain2_frames6 = [
10219
10376
  { ai: monster_ai_move16, dist: -24 },
10220
10377
  { ai: monster_ai_move16, dist: 11 },
10221
10378
  { ai: monster_ai_move16, dist: 5 },
10222
10379
  { ai: monster_ai_move16, dist: -2 }
10223
10380
  ];
10224
- pain2_move5 = {
10381
+ pain2_move6 = {
10225
10382
  firstframe: 83,
10226
10383
  lastframe: 86,
10227
- frames: pain2_frames5,
10384
+ frames: pain2_frames6,
10228
10385
  endfunc: mutant_run
10229
10386
  };
10230
- var pain3_frames4 = [
10387
+ var pain3_frames5 = [
10231
10388
  { ai: monster_ai_move16, dist: 11 },
10232
10389
  { ai: monster_ai_move16, dist: 0 },
10233
10390
  { ai: monster_ai_move16, dist: -2 },
@@ -10235,10 +10392,10 @@ var pain3_frames4 = [
10235
10392
  { ai: monster_ai_move16, dist: 0 },
10236
10393
  { ai: monster_ai_move16, dist: 0 }
10237
10394
  ];
10238
- pain3_move4 = {
10395
+ pain3_move5 = {
10239
10396
  firstframe: 87,
10240
10397
  lastframe: 92,
10241
- frames: pain3_frames4,
10398
+ frames: pain3_frames5,
10242
10399
  endfunc: mutant_run
10243
10400
  };
10244
10401
  var death_frames13 = [
@@ -10325,12 +10482,12 @@ var stand_move16;
10325
10482
  var walk_move15;
10326
10483
  var run_move15;
10327
10484
  var drain_move;
10328
- var pain_move9;
10485
+ var pain_move8;
10329
10486
  var death_move14;
10330
10487
  var start_run_move;
10331
10488
  var start_walk_move;
10332
10489
  var start_fidget_move;
10333
- var fidget_move2;
10490
+ var fidget_move3;
10334
10491
  var end_fidget_move;
10335
10492
  function parasite_launch(self, context) {
10336
10493
  context.engine.sound?.(self, 0, "parasite/paratck1.wav", 1, 1, 0);
@@ -10347,11 +10504,11 @@ function parasite_scratch(self, context) {
10347
10504
  context.engine.sound?.(self, 0, "parasite/paridle2.wav", 1, 2, 0);
10348
10505
  }
10349
10506
  function parasite_do_fidget(self) {
10350
- self.monsterinfo.current_move = fidget_move2;
10507
+ self.monsterinfo.current_move = fidget_move3;
10351
10508
  }
10352
10509
  function parasite_refidget(self) {
10353
10510
  if (random7() <= 0.8) {
10354
- self.monsterinfo.current_move = fidget_move2;
10511
+ self.monsterinfo.current_move = fidget_move3;
10355
10512
  } else {
10356
10513
  self.monsterinfo.current_move = end_fidget_move;
10357
10514
  }
@@ -10468,7 +10625,7 @@ function parasite_pain_func(self, other, kick, damage, context) {
10468
10625
  } else {
10469
10626
  context.engine.sound?.(self, 0, "parasite/parpain2.wav", 1, 1, 0);
10470
10627
  }
10471
- self.monsterinfo.current_move = pain_move9;
10628
+ self.monsterinfo.current_move = pain_move8;
10472
10629
  }
10473
10630
  function parasite_die(self) {
10474
10631
  self.monsterinfo.current_move = death_move14;
@@ -10516,7 +10673,7 @@ start_fidget_move = {
10516
10673
  frames: start_fidget_frames,
10517
10674
  endfunc: parasite_do_fidget
10518
10675
  };
10519
- var fidget_frames2 = [
10676
+ var fidget_frames3 = [
10520
10677
  { ai: monster_ai_stand17, dist: 0, think: parasite_scratch },
10521
10678
  { ai: monster_ai_stand17, dist: 0 },
10522
10679
  { ai: monster_ai_stand17, dist: 0 },
@@ -10524,10 +10681,10 @@ var fidget_frames2 = [
10524
10681
  { ai: monster_ai_stand17, dist: 0 },
10525
10682
  { ai: monster_ai_stand17, dist: 0 }
10526
10683
  ];
10527
- fidget_move2 = {
10684
+ fidget_move3 = {
10528
10685
  firstframe: 104,
10529
10686
  lastframe: 109,
10530
- frames: fidget_frames2,
10687
+ frames: fidget_frames3,
10531
10688
  endfunc: parasite_refidget
10532
10689
  };
10533
10690
  var end_fidget_frames = [
@@ -10596,7 +10753,7 @@ walk_move15 = {
10596
10753
  frames: walk_frames15,
10597
10754
  endfunc: parasite_walk
10598
10755
  };
10599
- var pain_frames9 = [
10756
+ var pain_frames8 = [
10600
10757
  { ai: monster_ai_move17, dist: 0 },
10601
10758
  { ai: monster_ai_move17, dist: 0 },
10602
10759
  { ai: monster_ai_move17, dist: 0 },
@@ -10609,10 +10766,10 @@ var pain_frames9 = [
10609
10766
  { ai: monster_ai_move17, dist: -7 },
10610
10767
  { ai: monster_ai_move17, dist: 0 }
10611
10768
  ];
10612
- pain_move9 = {
10769
+ pain_move8 = {
10613
10770
  firstframe: 57,
10614
10771
  lastframe: 67,
10615
- frames: pain_frames9,
10772
+ frames: pain_frames8,
10616
10773
  endfunc: parasite_start_run
10617
10774
  };
10618
10775
  var drain_frames = [
@@ -10724,7 +10881,7 @@ var walk_move16;
10724
10881
  var run_move16;
10725
10882
  var attack_move8;
10726
10883
  var attack_move_mg;
10727
- var pain_move10;
10884
+ var pain_move9;
10728
10885
  var death_move15;
10729
10886
  function soldier_stand(self) {
10730
10887
  self.monsterinfo.current_move = stand_move17;
@@ -10915,14 +11072,14 @@ attack_move_mg = {
10915
11072
  frames: attack_frames_mg,
10916
11073
  endfunc: soldier_run
10917
11074
  };
10918
- var pain_frames10 = Array.from({ length: 6 }, () => ({
11075
+ var pain_frames9 = Array.from({ length: 6 }, () => ({
10919
11076
  ai: monster_ai_move18,
10920
11077
  dist: 0
10921
11078
  }));
10922
- pain_move10 = {
11079
+ pain_move9 = {
10923
11080
  firstframe: 100,
10924
11081
  lastframe: 105,
10925
- frames: pain_frames10,
11082
+ frames: pain_frames9,
10926
11083
  endfunc: soldier_run
10927
11084
  };
10928
11085
  var death_frames15 = Array.from({ length: 10 }, () => ({
@@ -10966,7 +11123,7 @@ function SP_monster_soldier(self, context) {
10966
11123
  }
10967
11124
  self.pain = (self2, other, kick, damage) => {
10968
11125
  if (self2.health < self2.max_health / 2) {
10969
- self2.monsterinfo.current_move = pain_move10;
11126
+ self2.monsterinfo.current_move = pain_move9;
10970
11127
  }
10971
11128
  if (Math.random() < 0.5) {
10972
11129
  context.entities.sound?.(self2, 0, "soldier/pain1.wav", 1, 1, 0);
@@ -11064,9 +11221,9 @@ var attack_rocket_move2;
11064
11221
  var attack_grenade_move2;
11065
11222
  var attack_chain_move2;
11066
11223
  var attack_chain_end_move;
11067
- var pain1_move6;
11068
- var pain2_move6;
11069
- var pain3_move5;
11224
+ var pain1_move7;
11225
+ var pain2_move7;
11226
+ var pain3_move6;
11070
11227
  var death_move16;
11071
11228
  function supertank_stand(self) {
11072
11229
  self.monsterinfo.current_move = stand_move18;
@@ -11168,12 +11325,12 @@ run_move17 = {
11168
11325
  frames: run_frames16,
11169
11326
  endfunc: supertank_run
11170
11327
  };
11171
- var pain3_frames5 = Array.from({ length: 4 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11172
- pain3_move5 = { firstframe: 78, lastframe: 81, frames: pain3_frames5, endfunc: supertank_run };
11173
- var pain2_frames6 = Array.from({ length: 4 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11174
- pain2_move6 = { firstframe: 82, lastframe: 85, frames: pain2_frames6, endfunc: supertank_run };
11175
- var pain1_frames6 = Array.from({ length: 4 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11176
- pain1_move6 = { firstframe: 86, lastframe: 89, frames: pain1_frames6, endfunc: supertank_run };
11328
+ var pain3_frames6 = Array.from({ length: 4 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11329
+ pain3_move6 = { firstframe: 78, lastframe: 81, frames: pain3_frames6, endfunc: supertank_run };
11330
+ var pain2_frames7 = Array.from({ length: 4 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11331
+ pain2_move7 = { firstframe: 82, lastframe: 85, frames: pain2_frames7, endfunc: supertank_run };
11332
+ var pain1_frames7 = Array.from({ length: 4 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11333
+ pain1_move7 = { firstframe: 86, lastframe: 89, frames: pain1_frames7, endfunc: supertank_run };
11177
11334
  var death_frames16 = Array.from({ length: 24 }, () => ({ ai: monster_ai_move19, dist: 0 }));
11178
11335
  death_move16 = { firstframe: 90, lastframe: 113, frames: death_frames16, endfunc: supertank_dead };
11179
11336
  var attack_grenade_frames2 = Array.from({ length: 6 }, (_, i) => ({
@@ -11220,13 +11377,13 @@ function SP_monster_supertank(self, context) {
11220
11377
  if (self2.monsterinfo.current_move === attack_rocket_move2 && (self2.monsterinfo.nextframe || 0) < attack_rocket_move2.firstframe + 14) return;
11221
11378
  if (damage <= 10) {
11222
11379
  context.entities.sound?.(self2, 0, "boss1/b1pain1.wav", 1, 1, 0);
11223
- self2.monsterinfo.current_move = pain1_move6;
11380
+ self2.monsterinfo.current_move = pain1_move7;
11224
11381
  } else if (damage <= 25) {
11225
11382
  context.entities.sound?.(self2, 0, "boss1/b1pain3.wav", 1, 1, 0);
11226
- self2.monsterinfo.current_move = pain3_move5;
11383
+ self2.monsterinfo.current_move = pain3_move6;
11227
11384
  } else {
11228
11385
  context.entities.sound?.(self2, 0, "boss1/b1pain2.wav", 1, 1, 0);
11229
- self2.monsterinfo.current_move = pain2_move6;
11386
+ self2.monsterinfo.current_move = pain2_move7;
11230
11387
  }
11231
11388
  };
11232
11389
  self.die = (self2, inflictor, attacker, damage, point) => {
@@ -11313,7 +11470,7 @@ var run_move18;
11313
11470
  var attack_blaster_move;
11314
11471
  var attack_machinegun_move;
11315
11472
  var attack_rocket_move3;
11316
- var pain_move11;
11473
+ var pain_move10;
11317
11474
  var death_move17;
11318
11475
  function tank_stand(self) {
11319
11476
  self.monsterinfo.current_move = stand_move19;
@@ -11551,14 +11708,14 @@ attack_rocket_move3 = {
11551
11708
  frames: attack_rocket_frames3,
11552
11709
  endfunc: tank_refire_rocket
11553
11710
  };
11554
- var pain_frames11 = Array.from({ length: 6 }, () => ({
11711
+ var pain_frames10 = Array.from({ length: 6 }, () => ({
11555
11712
  ai: monster_ai_move20,
11556
11713
  dist: 0
11557
11714
  }));
11558
- pain_move11 = {
11715
+ pain_move10 = {
11559
11716
  firstframe: 116,
11560
11717
  lastframe: 121,
11561
- frames: pain_frames11,
11718
+ frames: pain_frames10,
11562
11719
  endfunc: tank_run
11563
11720
  };
11564
11721
  var death_frames17 = Array.from({ length: 16 }, () => ({
@@ -11592,7 +11749,7 @@ function SP_monster_tank(self, context) {
11592
11749
  }
11593
11750
  self2.pain_finished_time = self2.timestamp + 3;
11594
11751
  if (damage <= 10 && Math.random() < 0.5) return;
11595
- self2.monsterinfo.current_move = pain_move11;
11752
+ self2.monsterinfo.current_move = pain_move10;
11596
11753
  };
11597
11754
  self.die = (self2, inflictor, attacker, damage, point) => {
11598
11755
  self2.deadflag = 2 /* Dead */;
@@ -11645,7 +11802,7 @@ function monster_ai_charge21(self, dist, context) {
11645
11802
  var stand_move20;
11646
11803
  var run_move19;
11647
11804
  var attack_move9;
11648
- var pain_move12;
11805
+ var pain_move11;
11649
11806
  var death_move18;
11650
11807
  function turret_stand(self) {
11651
11808
  self.monsterinfo.current_move = stand_move20;
@@ -11708,14 +11865,14 @@ attack_move9 = {
11708
11865
  frames: attack_frames9,
11709
11866
  endfunc: turret_run
11710
11867
  };
11711
- var pain_frames12 = Array.from({ length: 2 }, () => ({
11868
+ var pain_frames11 = Array.from({ length: 2 }, () => ({
11712
11869
  ai: monster_ai_run20,
11713
11870
  dist: 0
11714
11871
  }));
11715
- pain_move12 = {
11872
+ pain_move11 = {
11716
11873
  firstframe: 9,
11717
11874
  lastframe: 10,
11718
- frames: pain_frames12,
11875
+ frames: pain_frames11,
11719
11876
  endfunc: turret_run
11720
11877
  };
11721
11878
  var death_frames18 = Array.from({ length: 4 }, () => ({
@@ -11751,7 +11908,7 @@ function SP_monster_turret(self, context) {
11751
11908
  if (context.entities.timeSeconds < self2.pain_debounce_time) return;
11752
11909
  self2.pain_debounce_time = context.entities.timeSeconds + 3;
11753
11910
  context.entities.sound?.(self2, 0, "turret/pain.wav", 1, 1, 0);
11754
- self2.monsterinfo.current_move = pain_move12;
11911
+ self2.monsterinfo.current_move = pain_move11;
11755
11912
  };
11756
11913
  self.die = (self2, inflictor, attacker, damage, point) => {
11757
11914
  self2.takedamage = false;
@@ -13775,9 +13932,9 @@ function createGame(imports, engine, options) {
13775
13932
  worldClassname: entities.world.classname
13776
13933
  },
13777
13934
  packetEntities,
13778
- pmFlags: 0,
13779
- // TODO: get from player
13780
- pmType: 0,
13935
+ pmFlags: player?.client?.pm_flags ?? 0,
13936
+ pmType: player?.client?.pm_type ?? 0,
13937
+ pm_time: player?.client?.pm_time ?? 0,
13781
13938
  waterlevel: player ? player.waterlevel : 0,
13782
13939
  deltaAngles: { x: 0, y: 0, z: 0 },
13783
13940
  client: player?.client,
@@ -13790,12 +13947,17 @@ function createGame(imports, engine, options) {
13790
13947
  damageAlpha: 0,
13791
13948
  // TODO
13792
13949
  damageIndicators: [],
13793
- // Stubs for new PlayerState fields
13794
13950
  stats: player ? populatePlayerStats(player, levelClock.current.timeSeconds) : [],
13795
- kick_angles: ZERO_VEC37,
13951
+ kick_angles: player?.client?.kick_angles ?? ZERO_VEC37,
13796
13952
  gunoffset: ZERO_VEC37,
13797
13953
  gunangles: ZERO_VEC37,
13798
- gunindex: 0
13954
+ gunindex: 0,
13955
+ gun_frame: player?.client?.gun_frame ?? 0,
13956
+ rdflags: player?.client?.rdflags ?? 0,
13957
+ fov: player?.client?.fov ?? 90,
13958
+ // Populate new compatibility fields
13959
+ pm_type: player?.client?.pm_type ?? 0,
13960
+ pm_flags: player?.client?.pm_flags ?? 0
13799
13961
  }
13800
13962
  };
13801
13963
  };
@@ -13834,7 +13996,13 @@ function createGame(imports, engine, options) {
13834
13996
  kick_angles: ZERO_VEC37,
13835
13997
  gunoffset: ZERO_VEC37,
13836
13998
  gunangles: ZERO_VEC37,
13837
- gunindex: 0
13999
+ gunindex: 0,
14000
+ pm_type: 0,
14001
+ pm_time: 0,
14002
+ pm_flags: 0,
14003
+ gun_frame: 0,
14004
+ rdflags: 0,
14005
+ fov: 90
13838
14006
  };
13839
14007
  const traceAdapter = (start, end) => {
13840
14008
  const result = trace(start, player.mins, player.maxs, end, player, 268435457);
@@ -13864,7 +14032,7 @@ function createGame(imports, engine, options) {
13864
14032
  if (!deathmatch) {
13865
14033
  const player = entities.spawn();
13866
14034
  player.classname = "player";
13867
- this.clientBegin({ inventory: createPlayerInventory(), weaponStates: createPlayerWeaponStates(), buttons: 0 });
14035
+ this.clientBegin({ inventory: createPlayerInventory(), weaponStates: createPlayerWeaponStates(), buttons: 0, pm_type: 0, pm_time: 0, pm_flags: 0, gun_frame: 0, rdflags: 0, fov: 90 });
13868
14036
  }
13869
14037
  },
13870
14038
  clientConnect(ent, userInfo) {