quake2ts 0.0.271 → 0.0.275

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 (46) hide show
  1. package/package.json +1 -1
  2. package/packages/cgame/dist/index.cjs +29 -5
  3. package/packages/cgame/dist/index.cjs.map +1 -1
  4. package/packages/cgame/dist/index.js +30 -6
  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.map +1 -1
  9. package/packages/client/dist/esm/index.js.map +1 -1
  10. package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
  11. package/packages/engine/dist/browser/index.global.js +6 -6
  12. package/packages/engine/dist/browser/index.global.js.map +1 -1
  13. package/packages/engine/dist/cjs/index.cjs.map +1 -1
  14. package/packages/engine/dist/esm/index.js.map +1 -1
  15. package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
  16. package/packages/game/dist/browser/index.global.js +3 -3
  17. package/packages/game/dist/browser/index.global.js.map +1 -1
  18. package/packages/game/dist/cjs/index.cjs +1058 -119
  19. package/packages/game/dist/cjs/index.cjs.map +1 -1
  20. package/packages/game/dist/esm/index.js +1058 -119
  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/fixbot.d.ts +5 -0
  24. package/packages/game/dist/types/entities/monsters/fixbot.d.ts.map +1 -0
  25. package/packages/game/dist/types/entities/monsters/gekk.d.ts +5 -0
  26. package/packages/game/dist/types/entities/monsters/gekk.d.ts.map +1 -0
  27. package/packages/game/dist/types/entities/monsters/index.d.ts.map +1 -1
  28. package/packages/game/dist/types/entities/playerStats.d.ts.map +1 -1
  29. package/packages/game/dist/types/inventory/playerInventory.d.ts +4 -48
  30. package/packages/game/dist/types/inventory/playerInventory.d.ts.map +1 -1
  31. package/packages/server/dist/index.cjs +73 -5
  32. package/packages/server/dist/index.js +73 -5
  33. package/packages/shared/dist/browser/index.global.js +1 -1
  34. package/packages/shared/dist/browser/index.global.js.map +1 -1
  35. package/packages/shared/dist/cjs/index.cjs +47 -4
  36. package/packages/shared/dist/cjs/index.cjs.map +1 -1
  37. package/packages/shared/dist/esm/index.js +45 -4
  38. package/packages/shared/dist/esm/index.js.map +1 -1
  39. package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
  40. package/packages/shared/dist/types/items/index.d.ts +1 -0
  41. package/packages/shared/dist/types/items/index.d.ts.map +1 -1
  42. package/packages/shared/dist/types/items/weaponInfo.d.ts +5 -0
  43. package/packages/shared/dist/types/items/weaponInfo.d.ts.map +1 -0
  44. package/packages/shared/dist/types/items/weapons.d.ts +8 -7
  45. package/packages/shared/dist/types/items/weapons.d.ts.map +1 -1
  46. package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
- import { angleVectors, clampViewAngles, ZERO_VEC3, hasPmFlag, PmFlag, dotVec3, PmType, WaterLevel, angleMod, applyPmove, ConfigStringIndex, MAX_MODELS, MAX_SOUNDS, MAX_IMAGES, PlayerStat } from '@quake2ts/shared';
1
+ import { angleVectors, clampViewAngles, ZERO_VEC3, hasPmFlag, PmFlag, dotVec3, PmType, WaterLevel, angleMod, applyPmove, PlayerStat, PowerupId, G_GetPowerupStat, WEAPON_WHEEL_ORDER, WEAPON_AMMO_MAP, G_GetAmmoStat, ConfigStringIndex, MAX_MODELS, MAX_SOUNDS, MAX_IMAGES } from '@quake2ts/shared';
2
2
 
3
3
  var __defProp = Object.defineProperty;
4
4
  var __export = (target, all) => {
@@ -1109,19 +1109,43 @@ function GetLayoutFlags(ps) {
1109
1109
  return 0;
1110
1110
  }
1111
1111
  function GetActiveWeaponWheelWeapon(ps) {
1112
- return 0;
1112
+ return ps.stats[PlayerStat.STAT_ACTIVE_WHEEL_WEAPON] ?? 0;
1113
1113
  }
1114
1114
  function GetOwnedWeaponWheelWeapons(ps) {
1115
- return [];
1115
+ const owned = [];
1116
+ const bits1 = ps.stats[PlayerStat.STAT_WEAPONS_OWNED_1] || 0;
1117
+ const bits2 = ps.stats[PlayerStat.STAT_WEAPONS_OWNED_2] || 0;
1118
+ const fullBits = bits1 | bits2 << 16;
1119
+ for (let i = 0; i < WEAPON_WHEEL_ORDER.length; i++) {
1120
+ if (fullBits & 1 << i) {
1121
+ owned.push(i);
1122
+ }
1123
+ }
1124
+ return owned;
1116
1125
  }
1117
1126
  function GetWeaponWheelAmmoCount(ps, weapon) {
1118
- return 0;
1127
+ if (weapon < 0 || weapon >= WEAPON_WHEEL_ORDER.length) {
1128
+ return 0;
1129
+ }
1130
+ const weaponId = WEAPON_WHEEL_ORDER[weapon];
1131
+ const ammoType = WEAPON_AMMO_MAP[weaponId];
1132
+ if (ammoType === null) {
1133
+ return -1;
1134
+ }
1135
+ return G_GetAmmoStat(ps.stats, ammoType);
1119
1136
  }
1120
1137
  function GetPowerupWheelCount(ps) {
1121
- return 0;
1138
+ let count = 0;
1139
+ const powerups = Object.values(PowerupId);
1140
+ for (const id of powerups) {
1141
+ if (G_GetPowerupStat(ps.stats, id) > 0) {
1142
+ count++;
1143
+ }
1144
+ }
1145
+ return count;
1122
1146
  }
1123
1147
  function GetHitMarkerDamage(ps) {
1124
- return 0;
1148
+ return ps.stats[PlayerStat.STAT_HIT_MARKER] ?? 0;
1125
1149
  }
1126
1150
  function Pmove(pmove) {
1127
1151
  const pm = pmove;