diff --git a/Live/CWX_DebugTool/config/config.json b/Live/CWX_DebugTool/config/config.json index ea4ba67..1a84035 100644 --- a/Live/CWX_DebugTool/config/config.json +++ b/Live/CWX_DebugTool/config/config.json @@ -15,5 +15,9 @@ }, "inraidConfig": { "turnPVEOff": true + }, + "itemsConfig": { + "changeShrapProps": true, + "changeMaxAmmoForKS23": true } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/config/config.json b/Live/CWX_DebugTool/dist/config/config.json index ea4ba67..1a84035 100644 --- a/Live/CWX_DebugTool/dist/config/config.json +++ b/Live/CWX_DebugTool/dist/config/config.json @@ -15,5 +15,9 @@ }, "inraidConfig": { "turnPVEOff": true + }, + "itemsConfig": { + "changeShrapProps": true, + "changeMaxAmmoForKS23": true } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/models/IConfig.ts b/Live/CWX_DebugTool/dist/models/IConfig.ts index 6083ee7..3f160f3 100644 --- a/Live/CWX_DebugTool/dist/models/IConfig.ts +++ b/Live/CWX_DebugTool/dist/models/IConfig.ts @@ -5,6 +5,7 @@ export interface IConfig ragfairConfig: ragfairConfig locationConfig: locationConfig inraidConfig: inraidConfig + itemsConfig: itemsConfig } export interface globalsConfig @@ -29,4 +30,10 @@ export interface locationConfig export interface inraidConfig { turnPVEOff: boolean +} + +export interface itemsConfig +{ + changeShrapProps: boolean + changeMaxAmmoForKS23: boolean } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/src/itemsConfig.ts b/Live/CWX_DebugTool/dist/src/itemsConfig.ts new file mode 100644 index 0000000..d1f7258 --- /dev/null +++ b/Live/CWX_DebugTool/dist/src/itemsConfig.ts @@ -0,0 +1,49 @@ +import { inject, injectable } from "tsyringe"; + +import { CWX_ConfigHandler } from "./configHandler"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; +import { IConfig } from "models/IConfig"; + +@injectable() +export class CWX_ItemsConfig +{ + private tables: Record; + private config: IConfig; + + constructor( + @inject("DatabaseServer") private databaseServer: DatabaseServer, + @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + ) + {} + + public applyChanges(): void + { + this.tables = this.databaseServer.getTables().templates.items; + this.config = this.configHandler.getConfig(); + + this.changeShrapProps(); + this.changeMaxAmmoForKS23(); + } + + private changeShrapProps(): void + { + const shrap = this.tables["5e85a9a6eacf8c039e4e2ac1"]; + + if (this.config.itemsConfig.changeShrapProps) + { + shrap._props.Damage = 200; + shrap._props.InitialSpeed = 1000; + } + } + + private changeMaxAmmoForKS23(): void + { + const ks23 = this.tables["5f647d9f8499b57dc40ddb93"]; + + if (this.config.itemsConfig.changeMaxAmmoForKS23) + { + ks23._props.Cartridges[0]._max_count = 30; + } + } +} \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/src/logging.ts b/Live/CWX_DebugTool/dist/src/logging.ts index b289817..bd2f5ae 100644 --- a/Live/CWX_DebugTool/dist/src/logging.ts +++ b/Live/CWX_DebugTool/dist/src/logging.ts @@ -33,6 +33,11 @@ export class CWX_Logging // inraid this.TurnPVEOff(); + + // items + this.changeShrapProps(); + this.changeMaxAmmoForKS23(); + } private NoFallDamage(): void @@ -63,7 +68,7 @@ export class CWX_Logging { if (this.config.ragfairConfig.staticTrader) { - this.logger.info("Static Trader Activated") + this.logger.info("Static Trader Activated"); } } @@ -71,7 +76,7 @@ export class CWX_Logging { if (this.config.ragfairConfig.roublesOnly) { - this.logger.info("Roubles Only Activated") + this.logger.info("Roubles Only Activated"); } } @@ -79,7 +84,7 @@ export class CWX_Logging { if (this.config.ragfairConfig.disableBSGBlacklist) { - this.logger.info("Disable BSG Blacklist Activated") + this.logger.info("Disable BSG Blacklist Activated"); } } @@ -87,7 +92,7 @@ export class CWX_Logging { if (this.config.locationConfig.turnLootOff) { - this.logger.info("Turn Loot Off Activated") + this.logger.info("Turn Loot Off Activated"); } } @@ -95,7 +100,23 @@ export class CWX_Logging { if (this.config.inraidConfig.turnPVEOff) { - this.logger.info("Turn PVE Off Activated") + this.logger.info("Turn PVE Off Activated"); + } + } + + private changeShrapProps():void + { + if (this.config.itemsConfig.changeShrapProps) + { + this.logger.info("Change Shrap Props Activated"); + } + } + + private changeMaxAmmoForKS23():void + { + if (this.config.itemsConfig.changeMaxAmmoForKS23) + { + this.logger.info("Change Max Ammo For KS23 Activated"); } } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/dist/src/mod.ts b/Live/CWX_DebugTool/dist/src/mod.ts index 3c62528..774a88a 100644 --- a/Live/CWX_DebugTool/dist/src/mod.ts +++ b/Live/CWX_DebugTool/dist/src/mod.ts @@ -7,6 +7,7 @@ import { CWX_Logging } from "./logging"; import { CWX_RagfairConfig } from "./ragfairConfig"; import { CWX_LocationConfig } from "./locationConfig"; import { CWX_InraidConfig } from "./inraidConfig"; +import { CWX_ItemsConfig } from "./itemsConfig"; class CWX_DebugTool implements IPostDBLoadMod @@ -18,6 +19,7 @@ class CWX_DebugTool implements IPostDBLoadMod container.register("CWX_RagfairConfig", CWX_RagfairConfig); container.register("CWX_LocationConfig", CWX_LocationConfig); container.register("CWX_InraidConfig", CWX_InraidConfig); + container.register("CWX_ItemsConfig", CWX_ItemsConfig); container.register("CWX_Logging", CWX_Logging); @@ -25,6 +27,7 @@ class CWX_DebugTool implements IPostDBLoadMod container.resolve("CWX_RagfairConfig").applyChanges(); container.resolve("CWX_LocationConfig").applyChanges(); container.resolve("CWX_InraidConfig").applyChanges(); + container.resolve("CWX_ItemsConfig").applyChanges(); if (container.resolve("CWX_ConfigHandler").getConfig().showLogs) { diff --git a/Live/CWX_DebugTool/models/IConfig.ts b/Live/CWX_DebugTool/models/IConfig.ts index 6083ee7..3f160f3 100644 --- a/Live/CWX_DebugTool/models/IConfig.ts +++ b/Live/CWX_DebugTool/models/IConfig.ts @@ -5,6 +5,7 @@ export interface IConfig ragfairConfig: ragfairConfig locationConfig: locationConfig inraidConfig: inraidConfig + itemsConfig: itemsConfig } export interface globalsConfig @@ -29,4 +30,10 @@ export interface locationConfig export interface inraidConfig { turnPVEOff: boolean +} + +export interface itemsConfig +{ + changeShrapProps: boolean + changeMaxAmmoForKS23: boolean } \ No newline at end of file diff --git a/Live/CWX_DebugTool/src/itemsConfig.ts b/Live/CWX_DebugTool/src/itemsConfig.ts new file mode 100644 index 0000000..d1f7258 --- /dev/null +++ b/Live/CWX_DebugTool/src/itemsConfig.ts @@ -0,0 +1,49 @@ +import { inject, injectable } from "tsyringe"; + +import { CWX_ConfigHandler } from "./configHandler"; +import { DatabaseServer } from "@spt-aki/servers/DatabaseServer"; +import { ITemplateItem } from "@spt-aki/models/eft/common/tables/ITemplateItem"; +import { IConfig } from "models/IConfig"; + +@injectable() +export class CWX_ItemsConfig +{ + private tables: Record; + private config: IConfig; + + constructor( + @inject("DatabaseServer") private databaseServer: DatabaseServer, + @inject("CWX_ConfigHandler") private configHandler: CWX_ConfigHandler + ) + {} + + public applyChanges(): void + { + this.tables = this.databaseServer.getTables().templates.items; + this.config = this.configHandler.getConfig(); + + this.changeShrapProps(); + this.changeMaxAmmoForKS23(); + } + + private changeShrapProps(): void + { + const shrap = this.tables["5e85a9a6eacf8c039e4e2ac1"]; + + if (this.config.itemsConfig.changeShrapProps) + { + shrap._props.Damage = 200; + shrap._props.InitialSpeed = 1000; + } + } + + private changeMaxAmmoForKS23(): void + { + const ks23 = this.tables["5f647d9f8499b57dc40ddb93"]; + + if (this.config.itemsConfig.changeMaxAmmoForKS23) + { + ks23._props.Cartridges[0]._max_count = 30; + } + } +} \ No newline at end of file diff --git a/Live/CWX_DebugTool/src/logging.ts b/Live/CWX_DebugTool/src/logging.ts index b289817..bd2f5ae 100644 --- a/Live/CWX_DebugTool/src/logging.ts +++ b/Live/CWX_DebugTool/src/logging.ts @@ -33,6 +33,11 @@ export class CWX_Logging // inraid this.TurnPVEOff(); + + // items + this.changeShrapProps(); + this.changeMaxAmmoForKS23(); + } private NoFallDamage(): void @@ -63,7 +68,7 @@ export class CWX_Logging { if (this.config.ragfairConfig.staticTrader) { - this.logger.info("Static Trader Activated") + this.logger.info("Static Trader Activated"); } } @@ -71,7 +76,7 @@ export class CWX_Logging { if (this.config.ragfairConfig.roublesOnly) { - this.logger.info("Roubles Only Activated") + this.logger.info("Roubles Only Activated"); } } @@ -79,7 +84,7 @@ export class CWX_Logging { if (this.config.ragfairConfig.disableBSGBlacklist) { - this.logger.info("Disable BSG Blacklist Activated") + this.logger.info("Disable BSG Blacklist Activated"); } } @@ -87,7 +92,7 @@ export class CWX_Logging { if (this.config.locationConfig.turnLootOff) { - this.logger.info("Turn Loot Off Activated") + this.logger.info("Turn Loot Off Activated"); } } @@ -95,7 +100,23 @@ export class CWX_Logging { if (this.config.inraidConfig.turnPVEOff) { - this.logger.info("Turn PVE Off Activated") + this.logger.info("Turn PVE Off Activated"); + } + } + + private changeShrapProps():void + { + if (this.config.itemsConfig.changeShrapProps) + { + this.logger.info("Change Shrap Props Activated"); + } + } + + private changeMaxAmmoForKS23():void + { + if (this.config.itemsConfig.changeMaxAmmoForKS23) + { + this.logger.info("Change Max Ammo For KS23 Activated"); } } } \ No newline at end of file diff --git a/Live/CWX_DebugTool/src/mod.ts b/Live/CWX_DebugTool/src/mod.ts index 3c62528..774a88a 100644 --- a/Live/CWX_DebugTool/src/mod.ts +++ b/Live/CWX_DebugTool/src/mod.ts @@ -7,6 +7,7 @@ import { CWX_Logging } from "./logging"; import { CWX_RagfairConfig } from "./ragfairConfig"; import { CWX_LocationConfig } from "./locationConfig"; import { CWX_InraidConfig } from "./inraidConfig"; +import { CWX_ItemsConfig } from "./itemsConfig"; class CWX_DebugTool implements IPostDBLoadMod @@ -18,6 +19,7 @@ class CWX_DebugTool implements IPostDBLoadMod container.register("CWX_RagfairConfig", CWX_RagfairConfig); container.register("CWX_LocationConfig", CWX_LocationConfig); container.register("CWX_InraidConfig", CWX_InraidConfig); + container.register("CWX_ItemsConfig", CWX_ItemsConfig); container.register("CWX_Logging", CWX_Logging); @@ -25,6 +27,7 @@ class CWX_DebugTool implements IPostDBLoadMod container.resolve("CWX_RagfairConfig").applyChanges(); container.resolve("CWX_LocationConfig").applyChanges(); container.resolve("CWX_InraidConfig").applyChanges(); + container.resolve("CWX_ItemsConfig").applyChanges(); if (container.resolve("CWX_ConfigHandler").getConfig().showLogs) {