v1.5.3 including new recoil tweaks, and the ability to wear both armor, and armor vests.

This commit is contained in:
VforValens 2022-09-03 21:10:23 -04:00
parent 2c37fd2276
commit 1a80b7b26e
6 changed files with 52 additions and 1 deletions

View File

@ -1,4 +1,6 @@
{
"armorPlusArmorVests": false,
"armorMaterials":
{
"uhmwpe":

View File

@ -1,5 +1,6 @@
export interface ArmorConfig
{
armorPlusArmorVests: boolean
armorMaterials: Armor
}

View File

@ -1,6 +1,7 @@
export interface WeaponsConfig
{
malfunctions: Malfunctions
recoilTweaks: boolean
smgInHolsters: boolean
}

View File

@ -8,5 +8,6 @@
"slide": false
},
"recoilTweaks": true,
"smgInHolsters": false
}

View File

@ -29,6 +29,14 @@ export class Armor
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)

View File

@ -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)