From 5b3e3e33dfc308911decd70dd02c1a92a1a9ba34 Mon Sep 17 00:00:00 2001 From: Dev Date: Tue, 18 Jul 2023 15:18:01 +0100 Subject: [PATCH] extend MinMax for a number of interfaces --- project/src/models/eft/common/IGlobals.ts | 120 +++++++++--------- .../src/models/eft/common/ILocationBase.ts | 23 ++-- project/src/models/eft/common/ILooseLoot.ts | 16 +-- project/src/models/eft/common/Ixyz.ts | 7 + .../eft/common/tables/ICustomizationItem.ts | 13 +- .../src/models/eft/common/tables/ILootBase.ts | 20 +-- .../models/eft/common/tables/ITemplateItem.ts | 31 ++--- .../models/eft/ragfair/IGetItemPriceResult.ts | 6 +- .../src/models/spt/config/ILocationConfig.ts | 5 +- .../src/models/spt/config/IRagfairConfig.ts | 8 +- 10 files changed, 107 insertions(+), 142 deletions(-) create mode 100644 project/src/models/eft/common/Ixyz.ts diff --git a/project/src/models/eft/common/IGlobals.ts b/project/src/models/eft/common/IGlobals.ts index 0f2580b2..62f92e2a 100644 --- a/project/src/models/eft/common/IGlobals.ts +++ b/project/src/models/eft/common/IGlobals.ts @@ -1,13 +1,14 @@ /* eslint-disable @typescript-eslint/naming-convention */ +import { Ixyz } from "./Ixyz"; import { Item } from "./tables/IItem"; export interface IGlobals { time: number config: Config - bot_presets: BotPreset[] + bot_presets: IBotPreset[] AudioSettings: IAudioSettings - BotWeaponScatterings: BotWeaponScattering[] + BotWeaponScatterings: IBotWeaponScattering[] ItemPresets: Record } @@ -74,15 +75,15 @@ export interface Config SkillFatigueReset: number DiscardLimitsEnabled: boolean EventType: string[] - WalkSpeed: xyz - SprintSpeed: xyz + WalkSpeed: Ixyz + SprintSpeed: Ixyz SquadSettings: ISquadSettings SkillEnduranceWeightThreshold: number TeamSearchingTimeout: number Insurance: Insurance SkillExpPerLevel: number GameSearchingTimeout: number - WallContusionAbsorption: xyz + WallContusionAbsorption: Ixyz SkillsSettings: SkillsSettings AzimuthPanelShowsPlayerOrientation: boolean Aiming: Aiming @@ -903,27 +904,27 @@ export interface Stamina AimRangeFinderDrainRate: number OxygenCapacity: number OxygenRestoration: number - WalkOverweightLimits: xyz - BaseOverweightLimits: xyz - SprintOverweightLimits: xyz - WalkSpeedOverweightLimits: xyz - CrouchConsumption: xyz - WalkConsumption: xyz - StandupConsumption: xyz - TransitionSpeed: xyz + WalkOverweightLimits: Ixyz + BaseOverweightLimits: Ixyz + SprintOverweightLimits: Ixyz + WalkSpeedOverweightLimits: Ixyz + CrouchConsumption: v + WalkConsumption: Ixyz + StandupConsumption: Ixyz + TransitionSpeed: Ixyz SprintAccelerationLowerLimit: number SprintSpeedLowerLimit: number SprintSensitivityLowerLimit: number - AimConsumptionByPose: xyz - RestorationMultiplierByPose: xyz - OverweightConsumptionByPose: xyz + AimConsumptionByPose: Ixyz + RestorationMultiplierByPose: Ixyz + OverweightConsumptionByPose: Ixyz AimingSpeedMultiplier: number WalkVisualEffectMultiplier: number HandsCapacity: number HandsRestoration: number ProneConsumption: number BaseHoldBreathConsumption: number - SoundRadius: xyz + SoundRadius: Ixyz ExhaustedMeleeSpeed: number FatigueRestorationRate: number FatigueAmountToCreateEffect: number @@ -934,10 +935,10 @@ export interface Stamina StaminaExhaustionCausesJiggle: boolean StaminaExhaustionStartsBreathSound: boolean StaminaExhaustionRocksCamera: boolean - HoldBreathStaminaMultiplier: xyz - PoseLevelIncreaseSpeed: xyz - PoseLevelDecreaseSpeed: xyz - PoseLevelConsumptionPerNotch: xyz + HoldBreathStaminaMultiplier: Ixyz + PoseLevelIncreaseSpeed: Ixyz + PoseLevelDecreaseSpeed: Ixyz + PoseLevelConsumptionPerNotch: Ixyz } export interface StaminaRestoration @@ -1386,7 +1387,7 @@ export interface TroubleShooting export interface Aiming { - ProceduralIntensityByPose: xyz + ProceduralIntensityByPose: Ixyz AimProceduralIntensity: number HeavyWeight: number LightWeight: number @@ -1397,9 +1398,9 @@ export interface Aiming RecoilScaling: number RecoilDamping: number CameraSnapGlobalMult: number - RecoilXIntensityByPose: xyz - RecoilYIntensityByPose: xyz - RecoilZIntensityByPose: xyz + RecoilXIntensityByPose: Ixyz + RecoilYIntensityByPose: Ixyz + RecoilZIntensityByPose: Ixyz RecoilCrank: boolean RecoilHandDamping: number RecoilConvergenceMult: number @@ -1420,7 +1421,7 @@ export interface Malfunction OutToIdleSpeedMultForPistol: number IdleToOutSpeedMultOnMalf: number TimeToQuickdrawPistol: number - DurRangeToIgnoreMalfs: xyz + DurRangeToIgnoreMalfs: Ixyz DurFeedWt: number DurMisfireWt: number DurJamWt: number @@ -1494,51 +1495,44 @@ export interface FenceLevel export interface Inertia { - InertiaLimits: xyz + InertiaLimits: Ixyz InertiaLimitsStep: number - ExitMovementStateSpeedThreshold: xyz - WalkInertia: xyz + ExitMovementStateSpeedThreshold: Ixyz + WalkInertia: Ixyz FallThreshold: number - SpeedLimitAfterFallMin: xyz - SpeedLimitAfterFallMax: xyz - SpeedLimitDurationMin: xyz - SpeedLimitDurationMax: xyz - SpeedInertiaAfterJump: xyz + SpeedLimitAfterFallMin: Ixyz + SpeedLimitAfterFallMax: Ixyz + SpeedLimitDurationMin: Ixyz + SpeedLimitDurationMax: Ixyz + SpeedInertiaAfterJump: Ixyz BaseJumpPenaltyDuration: number DurationPower: number BaseJumpPenalty: number PenaltyPower: number - InertiaTiltCurveMin: xyz - InertiaTiltCurveMax: xyz - InertiaBackwardCoef: xyz - TiltInertiaMaxSpeed: xyz - TiltStartSideBackSpeed: xyz - TiltMaxSideBackSpeed: xyz - TiltAcceleration: xyz + InertiaTiltCurveMin: Ixyz + InertiaTiltCurveMax: Ixyz + InertiaBackwardCoef: Ixyz + TiltInertiaMaxSpeed: Ixyz + TiltStartSideBackSpeed: Ixyz + TiltMaxSideBackSpeed: Ixyz + TiltAcceleration: Ixyz AverageRotationFrameSpan: number - SprintSpeedInertiaCurveMin: xyz - SprintSpeedInertiaCurveMax: xyz - SprintBrakeInertia: xyz - SprintTransitionMotionPreservation: xyz - WeaponFlipSpeed: xyz - PreSprintAccelerationLimits: xyz - SprintAccelerationLimits: xyz - SideTime: xyz - DiagonalTime: xyz - MaxTimeWithoutInput: xyz + SprintSpeedInertiaCurveMin: Ixyz + SprintSpeedInertiaCurveMax: Ixyz + SprintBrakeInertia: Ixyz + SprintTransitionMotionPreservation: Ixyz + WeaponFlipSpeed: Ixyz + PreSprintAccelerationLimits: Ixyz + SprintAccelerationLimits: Ixyz + SideTime: Ixyz + DiagonalTime: Ixyz + MaxTimeWithoutInput: Ixyz MinDirectionBlendTime: number - MoveTimeRange: xyz - ProneDirectionAccelerationRange: xyz - ProneSpeedAccelerationRange: xyz - MinMovementAccelerationRangeRight: xyz - MaxMovementAccelerationRangeRight: xyz -} - -export interface xyz -{ - x: number - y: number - z: number + MoveTimeRange: Ixyz + ProneDirectionAccelerationRange: Ixyz + ProneSpeedAccelerationRange: Ixyz + MinMovementAccelerationRangeRight: Ixyz + MaxMovementAccelerationRangeRight: Ixyz } export interface Ballistic diff --git a/project/src/models/eft/common/ILocationBase.ts b/project/src/models/eft/common/ILocationBase.ts index 9b01ad21..c28b1a15 100644 --- a/project/src/models/eft/common/ILocationBase.ts +++ b/project/src/models/eft/common/ILocationBase.ts @@ -1,3 +1,6 @@ +import { MinMax } from "../../../models/common/MinMax"; +import { Ixyz } from "./Ixyz"; + /* eslint-disable @typescript-eslint/naming-convention */ export interface ILocationBase { @@ -84,10 +87,8 @@ export interface ILocationBase waves: Wave[] } -export interface ILimit +export interface ILimit extends MinMax { - min: number - max: number items: any[] } @@ -158,11 +159,9 @@ export interface BotLocationModifier VisibleDistance: number } -export interface MinMaxBot +export interface MinMaxBot extends MinMax { WildSpawnType: WildSpawnType | string - max: number - min: number } export interface Preview @@ -185,7 +184,7 @@ export interface SpawnPointParam DelayToCanSpawnSec: number Id: string Infiltration: string - Position: xyz + Position: Ixyz Rotation: number Sides: string[] } @@ -198,16 +197,10 @@ export interface ColliderParams export interface Props { - Center: xyz + Center: Ixyz Radius: number } - -export interface xyz -{ - x: number - y: number - z: number -} + export interface Exit { diff --git a/project/src/models/eft/common/ILooseLoot.ts b/project/src/models/eft/common/ILooseLoot.ts index aaa805b2..3f55dbec 100644 --- a/project/src/models/eft/common/ILooseLoot.ts +++ b/project/src/models/eft/common/ILooseLoot.ts @@ -1,3 +1,4 @@ +import { Ixyz } from "./Ixyz"; import { Item } from "./tables/IItem"; export interface ILooseLoot @@ -26,11 +27,11 @@ export interface SpawnpointTemplate IsStatic: boolean useGravity: boolean randomRotation: boolean - Position: Xyz - Rotation: Xyz + Position: Ixyz + Rotation: Ixyz IsGroupPosition: boolean GroupPositions: any[] - Root: any + Root: string Items: Item[] } @@ -42,15 +43,6 @@ export interface Spawnpoint itemDistribution: ItemDistribution[] } - - -export interface Xyz -{ - x: number - y: number - z: number -} - export interface ItemDistribution { composedKey: ComposedKey diff --git a/project/src/models/eft/common/Ixyz.ts b/project/src/models/eft/common/Ixyz.ts new file mode 100644 index 00000000..3b5023f6 --- /dev/null +++ b/project/src/models/eft/common/Ixyz.ts @@ -0,0 +1,7 @@ + +export interface Ixyz +{ + x: number; + y: number; + z: number; +} diff --git a/project/src/models/eft/common/tables/ICustomizationItem.ts b/project/src/models/eft/common/tables/ICustomizationItem.ts index 5def43c3..3236be7d 100644 --- a/project/src/models/eft/common/tables/ICustomizationItem.ts +++ b/project/src/models/eft/common/tables/ICustomizationItem.ts @@ -1,3 +1,5 @@ +import { Ixyz } from "../Ixyz"; + export interface ICustomizationItem { _id: string @@ -22,19 +24,12 @@ export interface Props Prefab: Prefab WatchPrefab: Prefab IntegratedArmorVest: boolean - WatchPosition: Xyz - WatchRotation: Xyz + WatchPosition: Ixyz + WatchRotation: Ixyz } export interface Prefab { path: string rcid: string -} - -export interface Xyz -{ - x: number - y: number - z: number } \ No newline at end of file diff --git a/project/src/models/eft/common/tables/ILootBase.ts b/project/src/models/eft/common/tables/ILootBase.ts index 544180af..eda8d6c8 100644 --- a/project/src/models/eft/common/tables/ILootBase.ts +++ b/project/src/models/eft/common/tables/ILootBase.ts @@ -1,3 +1,4 @@ +import { Ixyz } from "../Ixyz"; import { Item } from "./IItem"; export interface ILootBase @@ -26,8 +27,8 @@ export interface IStaticWeaponProps IsStatic: boolean useGravity: boolean randomRotation: boolean - Position: Xyz - Rotation: Xyz + Position: Ixyz + Rotation: Ixyz IsGroupPosition: boolean GroupPositions: any[] Root: string @@ -40,24 +41,17 @@ export interface IStaticContainerProps IsStatic: boolean useGravity: boolean randomRotation: boolean - Position: Xyz - Rotation: Xyz + Position: Ixyz + Rotation: Ixyz IsGroupPosition: boolean GroupPositions: any[] - Root: any + Root: string Items: StaticItem[] } -export interface Xyz -{ - x: number - y: number - z: number -} - export interface StaticItem { - _id: any + _id: string _tpl: string } diff --git a/project/src/models/eft/common/tables/ITemplateItem.ts b/project/src/models/eft/common/tables/ITemplateItem.ts index 4bbc0c8d..21ebd1f8 100644 --- a/project/src/models/eft/common/tables/ITemplateItem.ts +++ b/project/src/models/eft/common/tables/ITemplateItem.ts @@ -1,3 +1,5 @@ +import { Ixyz } from "../Ixyz"; + export interface ITemplateItem { _id: string @@ -204,11 +206,11 @@ export interface Props CameraSnap?: number ReloadMode?: string AimPlane?: number - TacticalReloadStiffnes?: Xyz + TacticalReloadStiffnes?: Ixyz TacticalReloadFixation?: number - RecoilCenter?: Xyz - RotationCenter?: Xyz - RotationCenterNoStock?: Xyz + RecoilCenter?: Ixyz + RotationCenter?: Ixyz + RotationCenterNoStock?: Ixyz FoldedSlot?: string CompactHandling?: boolean MinRepairDegradation?: number @@ -250,7 +252,7 @@ export interface Props FaceShieldComponent?: boolean FaceShieldMask?: string MaterialType?: string - RicochetParams?: Xyz + RicochetParams?: Ixyz DeafStrength?: string BlindnessProtection?: number Distortion?: number @@ -288,12 +290,12 @@ export interface Props PrimaryConsumption?: number SecondryConsumption?: number DeflectionConsumption?: number - AppliedTrunkRotation?: Xyz - AppliedHeadRotation?: Xyz + AppliedTrunkRotation?: Ixyz + AppliedHeadRotation?: Ixyz DisplayOnModel?: boolean AdditionalAnimationLayer?: number StaminaBurnRate?: number - ColliderScaleMultiplier?: Xyz + ColliderScaleMultiplier?: Ixyz ConfigPathStr?: string MaxMarkersCount?: number scaleMin?: number @@ -358,9 +360,9 @@ export interface Props ShowHitEffectOnExplode?: boolean ExplosionType?: string AmmoLifeTimeSec?: number - Contusion?: Xyz - ArmorDistanceDistanceDamage?: Xyz - Blindness?: Xyz + Contusion?: Ixyz + ArmorDistanceDistanceDamage?: Ixyz + Blindness?: Ixyz IsLightAndSoundShot?: boolean LightAndSoundShotAngle?: number LightAndSoundShotSelfContusionTime?: number @@ -450,13 +452,6 @@ export interface SlotFilter AnimationIndex?: number } -export interface Xyz -{ - x: number - y: number - z: number -} - export interface StackSlot { _name?: string diff --git a/project/src/models/eft/ragfair/IGetItemPriceResult.ts b/project/src/models/eft/ragfair/IGetItemPriceResult.ts index 43dc23a7..a4c0862c 100644 --- a/project/src/models/eft/ragfair/IGetItemPriceResult.ts +++ b/project/src/models/eft/ragfair/IGetItemPriceResult.ts @@ -1,6 +1,6 @@ -export interface IGetItemPriceResult +import { MinMax } from "../../../models/common/MinMax"; + +export interface IGetItemPriceResult extends MinMax { avg: number - min: number - max: number } \ No newline at end of file diff --git a/project/src/models/spt/config/ILocationConfig.ts b/project/src/models/spt/config/ILocationConfig.ts index 823ce4fd..d759923f 100644 --- a/project/src/models/spt/config/ILocationConfig.ts +++ b/project/src/models/spt/config/ILocationConfig.ts @@ -1,3 +1,4 @@ +import { MinMax } from "../../../models/common/MinMax"; import { BossLocationSpawn, Wave } from "../../../models/eft/common/ILocationBase"; import { IBaseConfig } from "./IBaseConfig"; @@ -50,11 +51,9 @@ export interface CustomWaves normal: Record } -export interface IBotTypeLimit +export interface IBotTypeLimit extends MinMax { type: string - min: number - max: number } export interface LootMultiplier diff --git a/project/src/models/spt/config/IRagfairConfig.ts b/project/src/models/spt/config/IRagfairConfig.ts index 4a15f4b2..73e2b784 100644 --- a/project/src/models/spt/config/IRagfairConfig.ts +++ b/project/src/models/spt/config/IRagfairConfig.ts @@ -36,11 +36,9 @@ export interface Chance underpriced: number } -export interface Time +export interface Time extends MinMax { base: number - min: number - max: number } export interface Reputation @@ -119,12 +117,10 @@ export interface OfferAdjustment priceThreshholdRub: number } -export interface Condition +export interface Condition extends MinMax { /** Percentage change durability is altered */ conditionChance: number - min: number - max: number } export interface Blacklist