quake2ts 0.0.289 → 0.0.291
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.
- package/package.json +1 -1
- package/packages/client/dist/browser/index.global.js +11 -11
- package/packages/client/dist/browser/index.global.js.map +1 -1
- package/packages/client/dist/cjs/index.cjs +22 -12
- package/packages/client/dist/cjs/index.cjs.map +1 -1
- package/packages/client/dist/esm/index.js +22 -12
- package/packages/client/dist/esm/index.js.map +1 -1
- package/packages/client/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/client/dist/types/net/connection.d.ts +1 -0
- package/packages/client/dist/types/net/connection.d.ts.map +1 -1
- package/packages/engine/dist/browser/index.global.js +16 -16
- package/packages/engine/dist/browser/index.global.js.map +1 -1
- package/packages/engine/dist/cjs/index.cjs +33 -35
- package/packages/engine/dist/cjs/index.cjs.map +1 -1
- package/packages/engine/dist/esm/index.js +33 -35
- package/packages/engine/dist/esm/index.js.map +1 -1
- package/packages/engine/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/engine/dist/types/audio/constants.d.ts +1 -23
- package/packages/engine/dist/types/audio/constants.d.ts.map +1 -1
- package/packages/game/dist/browser/index.global.js +3 -3
- package/packages/game/dist/browser/index.global.js.map +1 -1
- package/packages/game/dist/cjs/index.cjs +65 -19
- package/packages/game/dist/cjs/index.cjs.map +1 -1
- package/packages/game/dist/esm/index.js +65 -19
- package/packages/game/dist/esm/index.js.map +1 -1
- package/packages/game/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/game/dist/types/entities/monsters/actor.d.ts.map +1 -1
- package/packages/game/dist/types/entities/monsters/arachnid.d.ts.map +1 -1
- package/packages/game/dist/types/entities/system.d.ts +1 -0
- package/packages/game/dist/types/entities/system.d.ts.map +1 -1
- package/packages/game/dist/types/index.d.ts +2 -0
- package/packages/game/dist/types/index.d.ts.map +1 -1
- package/packages/shared/dist/browser/index.global.js +1 -1
- package/packages/shared/dist/browser/index.global.js.map +1 -1
- package/packages/shared/dist/cjs/index.cjs +53 -0
- package/packages/shared/dist/cjs/index.cjs.map +1 -1
- package/packages/shared/dist/esm/index.js +42 -0
- package/packages/shared/dist/esm/index.js.map +1 -1
- package/packages/shared/dist/tsconfig.tsbuildinfo +1 -1
- package/packages/shared/dist/types/audio/constants.d.ts +24 -0
- package/packages/shared/dist/types/audio/constants.d.ts.map +1 -0
- package/packages/shared/dist/types/index.d.ts +1 -0
- package/packages/shared/dist/types/index.d.ts.map +1 -1
- package/packages/tools/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -4872,10 +4872,46 @@ var WEAPON_AMMO_MAP = {
|
|
|
4872
4872
|
["disruptor" /* Disruptor */]: 10 /* Disruptor */,
|
|
4873
4873
|
["trap" /* Trap */]: 7 /* Trap */
|
|
4874
4874
|
};
|
|
4875
|
+
|
|
4876
|
+
// src/audio/constants.ts
|
|
4877
|
+
var MAX_SOUND_CHANNELS = 32;
|
|
4878
|
+
var SoundChannel = /* @__PURE__ */ ((SoundChannel2) => {
|
|
4879
|
+
SoundChannel2[SoundChannel2["Auto"] = 0] = "Auto";
|
|
4880
|
+
SoundChannel2[SoundChannel2["Weapon"] = 1] = "Weapon";
|
|
4881
|
+
SoundChannel2[SoundChannel2["Voice"] = 2] = "Voice";
|
|
4882
|
+
SoundChannel2[SoundChannel2["Item"] = 3] = "Item";
|
|
4883
|
+
SoundChannel2[SoundChannel2["Body"] = 4] = "Body";
|
|
4884
|
+
SoundChannel2[SoundChannel2["Aux"] = 5] = "Aux";
|
|
4885
|
+
SoundChannel2[SoundChannel2["Footstep"] = 6] = "Footstep";
|
|
4886
|
+
SoundChannel2[SoundChannel2["Aux3"] = 7] = "Aux3";
|
|
4887
|
+
SoundChannel2[SoundChannel2["NoPhsAdd"] = 8] = "NoPhsAdd";
|
|
4888
|
+
SoundChannel2[SoundChannel2["Reliable"] = 16] = "Reliable";
|
|
4889
|
+
SoundChannel2[SoundChannel2["ForcePos"] = 32] = "ForcePos";
|
|
4890
|
+
return SoundChannel2;
|
|
4891
|
+
})(SoundChannel || {});
|
|
4892
|
+
var ATTN_LOOP_NONE = -1;
|
|
4893
|
+
var ATTN_NONE = 0;
|
|
4894
|
+
var ATTN_NORM = 1;
|
|
4895
|
+
var ATTN_IDLE = 2;
|
|
4896
|
+
var ATTN_STATIC = 3;
|
|
4897
|
+
var SOUND_FULLVOLUME = 80;
|
|
4898
|
+
var SOUND_LOOP_ATTENUATE = 3e-3;
|
|
4899
|
+
function attenuationToDistanceMultiplier(attenuation) {
|
|
4900
|
+
return attenuation === ATTN_STATIC ? attenuation * 1e-3 : attenuation * 5e-4;
|
|
4901
|
+
}
|
|
4902
|
+
function calculateMaxAudibleDistance(attenuation) {
|
|
4903
|
+
const distMult = attenuationToDistanceMultiplier(attenuation);
|
|
4904
|
+
return distMult <= 0 ? Number.POSITIVE_INFINITY : SOUND_FULLVOLUME + 1 / distMult;
|
|
4905
|
+
}
|
|
4875
4906
|
export {
|
|
4876
4907
|
AMMO_MAX,
|
|
4877
4908
|
AMMO_TYPE_COUNT,
|
|
4878
4909
|
ANORMS,
|
|
4910
|
+
ATTN_IDLE,
|
|
4911
|
+
ATTN_LOOP_NONE,
|
|
4912
|
+
ATTN_NONE,
|
|
4913
|
+
ATTN_NORM,
|
|
4914
|
+
ATTN_STATIC,
|
|
4879
4915
|
AmmoItemId,
|
|
4880
4916
|
AmmoType,
|
|
4881
4917
|
BinaryStream,
|
|
@@ -4964,6 +5000,7 @@ export {
|
|
|
4964
5000
|
MAX_QPATH,
|
|
4965
5001
|
MAX_SHADOW_LIGHTS,
|
|
4966
5002
|
MAX_SOUNDS,
|
|
5003
|
+
MAX_SOUND_CHANNELS,
|
|
4967
5004
|
MAX_STRING_CHARS,
|
|
4968
5005
|
MAX_STRING_TOKENS,
|
|
4969
5006
|
MAX_TOKEN_CHARS,
|
|
@@ -5004,6 +5041,8 @@ export {
|
|
|
5004
5041
|
replay_exports as Replay,
|
|
5005
5042
|
SLIDEMOVE_BLOCKED_FLOOR,
|
|
5006
5043
|
SLIDEMOVE_BLOCKED_WALL,
|
|
5044
|
+
SOUND_FULLVOLUME,
|
|
5045
|
+
SOUND_LOOP_ATTENUATE,
|
|
5007
5046
|
STOP_EPSILON,
|
|
5008
5047
|
SURF_ALPHATEST,
|
|
5009
5048
|
SURF_FLOWING,
|
|
@@ -5020,6 +5059,7 @@ export {
|
|
|
5020
5059
|
SURF_TRANS66,
|
|
5021
5060
|
SURF_WARP,
|
|
5022
5061
|
ServerCommand,
|
|
5062
|
+
SoundChannel,
|
|
5023
5063
|
TempEntity,
|
|
5024
5064
|
UPDATE_BACKUP,
|
|
5025
5065
|
WEAPON_AMMO_MAP,
|
|
@@ -5045,12 +5085,14 @@ export {
|
|
|
5045
5085
|
applyPmoveFriction,
|
|
5046
5086
|
applyPmoveWaterMove,
|
|
5047
5087
|
assertContract,
|
|
5088
|
+
attenuationToDistanceMultiplier,
|
|
5048
5089
|
boxContents,
|
|
5049
5090
|
boxOnPlaneSide,
|
|
5050
5091
|
boxesIntersect,
|
|
5051
5092
|
buildAirGroundWish,
|
|
5052
5093
|
buildCollisionModel,
|
|
5053
5094
|
buildWaterWish,
|
|
5095
|
+
calculateMaxAudibleDistance,
|
|
5054
5096
|
categorizePosition,
|
|
5055
5097
|
checkDuckState,
|
|
5056
5098
|
checkJump,
|