diff --git a/config/armor.json b/config/armor.json index a4bee65..1683579 100644 --- a/config/armor.json +++ b/config/armor.json @@ -1,4 +1,6 @@ { + "armorPlusArmorVests": false, + "armorMaterials": { "uhmwpe": diff --git a/config/ts/armor.ts b/config/ts/armor.ts index 2b9a69b..e21c23e 100644 --- a/config/ts/armor.ts +++ b/config/ts/armor.ts @@ -1,5 +1,6 @@ export interface ArmorConfig { + armorPlusArmorVests: boolean armorMaterials: Armor } diff --git a/config/ts/weapons.ts b/config/ts/weapons.ts index e0dd957..62920f5 100644 --- a/config/ts/weapons.ts +++ b/config/ts/weapons.ts @@ -1,6 +1,7 @@ export interface WeaponsConfig { malfunctions: Malfunctions + recoilTweaks: boolean smgInHolsters: boolean } diff --git a/config/weapons.json b/config/weapons.json index 248942e..4e797b4 100644 --- a/config/weapons.json +++ b/config/weapons.json @@ -8,5 +8,6 @@ "slide": false }, + "recoilTweaks": true, "smgInHolsters": false } \ No newline at end of file diff --git a/src/armor.ts b/src/armor.ts index 93545b5..c368295 100644 --- a/src/armor.ts +++ b/src/armor.ts @@ -28,7 +28,15 @@ export class Armor const ceramic = this.modConfig.armorMaterials.ceramic; const glass = this.modConfig.armorMaterials.glass; const armor = this.tables.getTables().globals.config.ArmorMaterials; - + + if (mod.armorPlusArmorVests) + { + const armors = this.tables.getTables().templates.items; + for (const armor in armors) + { + armors[armor]._props.BlocksArmorVest = false; + } + } if (uhmwpe.destructibility != 0.45 || uhmwpe.minRepairDegradation != 0.01 || uhmwpe.maxRepairDegradation != 0.03 || uhmwpe.explosionDestructibility != 0.4 || uhmwpe.minRepairKitDegradation != 0.005 || uhmwpe.maxRepairKitDegradation != 0.025) diff --git a/src/weapons.ts b/src/weapons.ts index 114a527..84d8a30 100644 --- a/src/weapons.ts +++ b/src/weapons.ts @@ -1,5 +1,6 @@ import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; import { WeaponsConfig } from "../config/ts/weapons"; +import { GlobalsConfig } from "../config/ts/globals; import { Logger } from "./logger"; export class Weapons @@ -19,6 +20,7 @@ export class Weapons { const mod = this.modConfig; this.weapons = this.tables.getTables().templates.items; + const global = this.tables.getTables().globals; if (mod.malfunctions.overheat || mod.malfunctions.jam || mod.malfunctions.slide || mod.malfunctions.misfeed || mod.malfunctions.misfire) { @@ -26,6 +28,12 @@ export class Weapons this.logger.info("Weapon Malfunctions Patched"); } + if (mod.recoilTweaks) + { + this.recoilTweaks(); + this.logger.info("Weapon Recoil has been tweaked"); + } + if (mod.smgInHolsters) { this.smgInHolsters(); @@ -72,6 +80,36 @@ export class Weapons } } + private recoilTweaks(): void + { + const weapons = this.tables.getTables().templates.items; + const globals = this.tables.getTables().globals.config; + + for (let weapon in weapons) { + let fileData = weapons[weapon]; + if (fileData._props.weapClass != null && fileData._props.weapClass !== undefined) + { + if (fileData._props.weapClass !== "pistol") + { + fileData._props.CameraRecoil *= 0.25; + fileData._props.CameraSnap = 3.5; + } + else + { + fileData._props.CameraRecoil *= 0.45; + fileData._props.CameraSnap = 3.5; + } + } + } + globals.Aiming.RecoilCrank = true; + globals.Aiming.AimProceduralIntensity = 0.7; + globals.Aiming.RecoilHandDamping = 0.6; + globals.Aiming.RecoilDamping = 0.5; + globals.Aiming.RecoilConvergenceMult *= 5; + globals.Aiming.RecoilVertBonus = 30; + globals.Aiming.RecoilBackBonus = 80; + } + private smgInHolsters(): void { for (const weaponId in this.weapons)