Fix the Ammo oopsie.

This commit is contained in:
VforValens 2022-08-18 16:17:57 -04:00
parent 37e9e9becb
commit fd596acbb6
11 changed files with 44 additions and 84 deletions

View File

@ -2,7 +2,7 @@
"stacks":
{
"grenades": 1,
"a338Lapua": 30,
"a86x70": 30,
"a127x55": 30,
"a762x54": 40,
"a762x51": 40,
@ -14,7 +14,7 @@
"a545x39": 60,
"a57x28": 60,
"a46x30": 70,
"a357Mag": 30,
"a9x33R": 30,
"a1143x23ACP": 50,
"a762x25": 50,
"a9x21": 50,

View File

@ -6,7 +6,7 @@ export interface AmmoConfig
export interface Ammo
{
grenades: number
a338Lapua: number
a86x70: number
a127x55: number
a762x54: number
a762x51: number
@ -18,7 +18,7 @@ export interface Ammo
a545x39: number
a57x28: number
a46x30: number
a357Mag: number
a9x33R: number
a1143x23ACP: number
a762x25: number
a9x21: number

View File

@ -1,6 +1,6 @@
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
import { Logger } from "./logger";
import { Grenade, Ammo762x51, Ammo762x54, Ammo86x70, Ammo46x30, Ammo57x28, Ammo762x25, Ammo9x18, Ammo9x19, Ammo9x21, Ammo9x33R, Ammo1143x23ACP, Ammo545x39, Ammo556x45, Ammo762x35, Ammo762x39, Ammo9x39, Ammo366TKM, Ammo127x55, Ammo12Gauge, Ammo20Gauge, Ammo23x75, Ammo30x29, Ammo26x75 } from "@spt-aki/models/enums/AmmoTypes";
import { Grenade, Ammo762x51, Ammo762x54, Ammo338Lapua, Ammo46x30, Ammo57x28, Ammo762x25, Ammo9x18, Ammo9x19, Ammo9x21, Ammo357Mag, Ammo45ACP, Ammo545x39, Ammo556x45, Ammo300Blackout, Ammo762x39, Ammo9x39, Ammo366TKM, Ammo127x55, Ammo12Gauge, Ammo20Gauge, Ammo23x75, Ammo30x29, Ammo26x75 } from "@spt-aki/models/enums/AmmoTypes";
import { AmmoConfig } from "../config/ts/ammo";
export class Ammo
@ -26,18 +26,18 @@ export class Ammo
{
for (const value of Object.values(Grenade))
{
items[value]._props.StackMaxSize = mod.grenades
items[value]._props.StackMaxSize = mod.grenades;
this.logger.info(`Grenade Max Stacks set to ${mod.grenades}`);
}
}
// Sets .338 Lapua Magnum max stacks.
if (mod.a338Lapua != 30)
if (mod.a86x70 != 30)
{
for (const value of Object.values(Ammo86x70))
for (const value of Object.values(Ammo338Lapua))
{
items[value]._props.StackMaxSize = mod.a338Lapua
this.logger.info(`.338 Lapua Magnum Max Stacks set to ${mod.a338Lapua}`);
items[value]._props.StackMaxSize = mod.a86x70;
this.logger.info(`.338 Lapua Magnum Max Stacks set to ${mod.a86x70}`);
}
}
@ -46,7 +46,7 @@ export class Ammo
{
for (const value of Object.values(Ammo127x55))
{
items[value]._props.StackMaxSize = mod.a127x55
items[value]._props.StackMaxSize = mod.a127x55;
this.logger.info(`12.7x55mm Max Stacks set to ${mod.a127x55}`);
}
}
@ -56,7 +56,7 @@ export class Ammo
{
for (const value of Object.values(Ammo762x54))
{
items[value]._props.StackMaxSize = mod.a762x54
items[value]._props.StackMaxSize = mod.a762x54;
this.logger.info(`7.62x54R Max Stacks set to ${mod.a762x54}`);
}
}
@ -66,7 +66,7 @@ export class Ammo
{
for (const value of Object.values(Ammo762x51))
{
items[value]._props.StackMaxSize = mod.a762x51
items[value]._props.StackMaxSize = mod.a762x51;
this.logger.info(`7.62x51mm Max Stacks set to ${mod.a762x51}`);
}
}
@ -76,7 +76,7 @@ export class Ammo
{
for (const value of Object.values(Ammo9x39))
{
items[value]._props.StackMaxSize = mod.a9x39
items[value]._props.StackMaxSize = mod.a9x39;
this.logger.info(`9x39mm Max Stacks set to ${mod.a9x39}`);
}
}
@ -86,7 +86,7 @@ export class Ammo
{
for (const value of Object.values(Ammo366TKM))
{
items[value]._props.StackMaxSize = mod.a366TKM
items[value]._props.StackMaxSize = mod.a366TKM;
this.logger.info(`.366 TKM Max Stacks set to ${mod.a366TKM}`);
}
}
@ -96,7 +96,7 @@ export class Ammo
{
for (const value of Object.values(Ammo762x39))
{
items[value]._props.StackMaxSize = mod.a762x39
items[value]._props.StackMaxSize = mod.a762x39;
this.logger.info(`7.62x39mm Max Stacks set to ${mod.a762x39}`);
}
}
@ -104,9 +104,9 @@ export class Ammo
// Sets 7.62x35mm (.300 Blackout) max stacks.
if (mod.a762x35 != 60)
{
for (const value of Object.values(Ammo762x35))
for (const value of Object.values(Ammo300Blackout))
{
items[value]._props.StackMaxSize = mod.a762x35
items[value]._props.StackMaxSize = mod.a762x35;
this.logger.info(`762x35mm Max Stacks set to ${mod.a762x35}`);
}
}
@ -116,7 +116,7 @@ export class Ammo
{
for (const value of Object.values(Ammo556x45))
{
items[value]._props.StackMaxSize = mod.a556x45
items[value]._props.StackMaxSize = mod.a556x45;
this.logger.info(`5.56x45mm Max Stacks set to ${mod.a556x45}`);
}
}
@ -126,7 +126,7 @@ export class Ammo
{
for (const value of Object.values(Ammo545x39))
{
items[value]._props.StackMaxSize = mod.a545x39
items[value]._props.StackMaxSize = mod.a545x39;
this.logger.info(`5.45x39mm Max Stacks set to ${mod.a545x39}`);
}
}
@ -136,7 +136,7 @@ export class Ammo
{
for (const value of Object.values(Ammo57x28))
{
items[value]._props.StackMaxSize = mod.a57x28
items[value]._props.StackMaxSize = mod.a57x28;
this.logger.info(`5.7x28mm Max Stacks set to ${mod.a57x28}`);
}
}
@ -146,27 +146,27 @@ export class Ammo
{
for (const value of Object.values(Ammo46x30))
{
items[value]._props.StackMaxSize = mod.a46x30
items[value]._props.StackMaxSize = mod.a46x30;
this.logger.info(`4.6x30mm Max Stacks set to ${mod.a46x30}`);
}
}
if (mod.a357Mag != 30)
if (mod.a9x33R != 30)
{
for (const value of Object.values(Ammo9x33R))
for (const value of Object.values(Ammo357Mag))
{
items[value]._props.StackMaxSize = mod.a357Mag
this.logger.info(`.357 Magnum Max Stacks set to ${mod.a357Mag}`);
items[value]._props.StackMaxSize = mod.a9x33R;
this.logger.info(`.357 Magnum Max Stacks set to ${mod.a9x33R}`);
}
}
if (mod.a1143x23ACP != 50)
{
for (const value of Object.values(Ammo1143x23ACP))
for (const value of Object.values(Ammo45ACP))
{
items[value]._props.StackMaxSize = mod.a1143x23ACP
items[value]._props.StackMaxSize = mod.a1143x23ACP;
this.logger.info(`.45 ACP Max Stacks set to ${mod.a1143x23ACP}`);
}
}
@ -176,7 +176,7 @@ export class Ammo
{
for (const value of Object.values(Ammo762x25))
{
items[value]._props.StackMaxSize = mod.a762x25
items[value]._props.StackMaxSize = mod.a762x25;
this.logger.info(`7.62x25mm TT Max Stacks set to ${mod.a762x25}`);
}
}
@ -186,7 +186,7 @@ export class Ammo
{
for (const value of Object.values(Ammo9x21))
{
items[value]._props.StackMaxSize = mod.a9x21
items[value]._props.StackMaxSize = mod.a9x21;
this.logger.info(`9x21mm Max Stacks set to ${mod.a9x21}`);
}
}
@ -196,7 +196,7 @@ export class Ammo
{
for (const value of Object.values(Ammo9x19))
{
items[value]._props.StackMaxSize = mod.a9x19
items[value]._props.StackMaxSize = mod.a9x19;
this.logger.info(`9x19mm Max Stacks set to ${mod.a9x19}`);
}
}
@ -206,7 +206,7 @@ export class Ammo
{
for (const value of Object.values(Ammo9x18))
{
items[value]._props.StackMaxSize = mod.a9x18
items[value]._props.StackMaxSize = mod.a9x18;
this.logger.info(`9x18mm Max Stacks set to ${mod.a9x18}`);
}
}
@ -216,7 +216,7 @@ export class Ammo
{
for (const value of Object.values(Ammo23x75))
{
items[value]._props.StackMaxSize = mod.a23x75
items[value]._props.StackMaxSize = mod.a23x75;
this.logger.info(`23x75mm KS-23 Max Stacks set to ${mod.a23x75}`);
}
}
@ -226,7 +226,7 @@ export class Ammo
{
for (const value of Object.values(Ammo12Gauge))
{
items[value]._props.StackMaxSize = mod.a12Gauge
items[value]._props.StackMaxSize = mod.a12Gauge;
this.logger.info(`12 Gauge Max Stacks set to ${mod.a12Gauge}`);
}
}
@ -236,7 +236,7 @@ export class Ammo
{
for (const value of Object.values(Ammo20Gauge))
{
items[value]._props.StackMaxSize = mod.a20Gauge
items[value]._props.StackMaxSize = mod.a20Gauge;
this.logger.info(`20 Gauge Max Stacks set to ${mod.a20Gauge}`);
}
}
@ -246,7 +246,7 @@ export class Ammo
{
for (const value of Object.values(Ammo30x29))
{
items[value]._props.StackMaxSize = mod.a30x29
items[value]._props.StackMaxSize = mod.a30x29;
this.logger.info(`VOG-30x29mm Max Stacks set to ${mod.a30x29}`);
}
}
@ -256,7 +256,7 @@ export class Ammo
{
for (const value of Object.values(Ammo26x75))
{
items[value]._props.StackMaxSize = mod.a26x75
items[value]._props.StackMaxSize = mod.a26x75;
this.logger.info(`Flare Max Stacks set to ${mod.a26x75}`);
}
}

View File

@ -49,15 +49,6 @@ export declare class HideoutHelper {
protected updateWaterCollector(sessionId: string, pmcData: IPmcData, area: HideoutArea, isGeneratorOn: boolean): void;
protected doesWaterCollectorHaveFilter(waterCollector: HideoutArea): boolean;
protected updateFuel(generatorArea: HideoutArea, pmcData: IPmcData): HideoutArea;
/**
*
* Filters are deleted when reaching 0 resourceValue
* @param waterFilterArea
* @param pwProd
* @param isGeneratorOn
* @param pmcData
* @returns
*/
protected updateWaterFilters(waterFilterArea: HideoutArea, pwProd: Production, isGeneratorOn: boolean, pmcData: IPmcData): HideoutArea;
protected getAreaUpdObject(stackCount: number, resourceValue: number, resourceUnitsConsumed: number): Upd;
protected updateAirFilters(airFilterArea: HideoutArea, pmcData: IPmcData): HideoutArea;

View File

@ -24,19 +24,6 @@ export declare class ProfileHelper {
constructor(logger: ILogger, jsonUtil: JsonUtil, watermark: Watermark, timeUtil: TimeUtil, saveServer: SaveServer, databaseServer: DatabaseServer, itemHelper: ItemHelper, profileSnapshotService: ProfileSnapshotService, fenceService: FenceService);
resetProfileQuestCondition(sessionID: string, conditionId: string): void;
getCompleteProfile(sessionID: string): IPmcData[];
/**
* Fix xp doubling on post-raid xp reward screen by sending a 'dummy' profile to the post-raid screen
* Server saves the post-raid changes prior to the xp screen getting the profile, this results in the xp screen using
* the now updated profile values as a base, meaning it shows x2 xp gained
* Instead, clone the post-raid profile (so we dont alter its values), apply the pre-raid xp values to the cloned objects and return
* Delete snapshot of pre-raid profile prior to returning profile data
* @param sessionId Session id
* @param output pmc and scav profiles array
* @param pmcProfile post-raid pmc profile
* @param scavProfile post-raid scav profile
* @returns updated profile array
*/
postRaidXpWorkaroundFix(sessionId: string, output: IPmcData[], pmcProfile: IPmcData, scavProfile: IPmcData): IPmcData[];
isNicknameTaken(info: IValidateNicknameRequestData, sessionID: string): boolean;
/**
* Add experience to a PMC inside the players profile

View File

@ -46,7 +46,7 @@ export declare class RagfairOfferHelper {
constructor(logger: ILogger, timeUtil: TimeUtil, hashUtil: HashUtil, itemEventRouter: ItemEventRouter, databaseServer: DatabaseServer, saveServer: SaveServer, dialogueHelper: DialogueHelper, itemHelper: ItemHelper, paymentHelper: PaymentHelper, presetHelper: PresetHelper, profileHelper: ProfileHelper, ragfairServerHelper: RagfairServerHelper, ragfairSortHelper: RagfairSortHelper, ragfairHelper: RagfairHelper, ragfairOfferService: RagfairOfferService, localeService: LocaleService, configServer: ConfigServer);
getValidOffers(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
getOffersForBuild(info: ISearchRequestData, itemsToAdd: string[], assorts: Record<string, ITraderAssort>, pmcProfile: IPmcData): IRagfairOffer[];
processOffersOnProfile(sessionID: string): boolean;
processOffers(sessionID: string): boolean;
protected getProfileOffers(sessionID: string): IRagfairOffer[];
protected deleteOfferByOfferId(sessionID: string, offerId: string): void;
protected completeOffer(sessionID: string, offer: IRagfairOffer, boughtAmount: number): IItemEventRouterResponse;

View File

@ -11,12 +11,6 @@ export declare class RagfairSellHelper {
protected configServer: ConfigServer;
protected ragfairConfig: IRagfairConfig;
constructor(logger: ILogger, randomUtil: RandomUtil, timeUtil: TimeUtil, configServer: ConfigServer);
calculateSellChance(baseChancePercent: number, offerPriceRub: number, playerListedPriceRub: number): number;
/**
* Determine if the offer being listed will be sold
* @param sellChancePercent chance item will sell
* @param itemSellCount count of items to sell
* @returns Array of purchases of item(s) lsited
*/
rollForSale(sellChancePercent: number, itemSellCount: number): SellResult[];
calculateSellChance(baseChance: number, offerPrice: number, requirementsPriceInRub: number): number;
rollForSale(sellChance: number, count: number): SellResult[];
}

View File

@ -23,7 +23,7 @@ export declare enum Ammo762x54 {
BT_GZH = "5e023d34e8a400319a28ed44",
BS_GZH = "5e023d48186a883be655e551"
}
export declare enum Ammo86x70 {
export declare enum Ammo338Lapua {
TAC_X = "5fc382b6d6fa9c00c571bbc3",
UCW = "5fc382c1016cce60e8341b20",
AP = "5fc382a9d724d907e2077dab",
@ -85,13 +85,13 @@ export declare enum Ammo9x21 {
PE_GZH = "5a26ac06c4a282000c5a90a8",
BT_GZH = "5a26ac0ec4a28200741e1e18"
}
export declare enum Ammo9x33R {
export declare enum Ammo357Mag {
FMJ = "62330b3ed4dc74626d570b95",
HOLLOW_POINT = "62330bfadc5883093563729b",
SOFT_POINT = "62330c40bdd19b369e1e53d1",
JACKET_HP = "62330c18744e5e31df12f516"
}
export declare enum Ammo1143x23ACP {
export declare enum Ammo45ACP {
MATCH_FMJ = "5e81f423763d9f754677bf2e",
HYDRA_SHOK = "5efb0fc6aeb21837e749c801",
LASERMATCH_FMJ = "5efb0d4f4bc50b58e81710f3",
@ -126,7 +126,7 @@ export declare enum Ammo556x45 {
MK_318_MOD_0_SOST = "60194943740c5d77f6705eea",
SSA_AP = "601949593ae8f707c4608daa"
}
export declare enum Ammo762x35 {
export declare enum Ammo300Blackout {
M62_TRACER = "619636be6db0f2477964e710",
BCP_FMJ = "5fbe3ffdf8b6a877a729ea82",
AP = "5fd20ff893a8961fc660a954",

View File

@ -12,7 +12,6 @@ export interface Sell {
chance: Chance;
time: Time;
reputation: Reputation;
simulatedSellHours: number;
}
export interface Chance {
base: number;

View File

@ -45,11 +45,6 @@ export declare class ProfileFixerService {
* @param pmcProfile Profile to find and remove slots from
*/
protected removeResourcesFromSlotsInHideoutWithoutLocationIndexValue(pmcProfile: IPmcData): void;
/**
* Hideout slots need to be in a specific order, locationIndex in ascending order
* @param pmcProfile profile to edit
*/
protected reorderHideoutAreasWithResouceInputs(pmcProfile: IPmcData): void;
/**
* add in objects equal to the number of slots
* @param areaType area to check

View File

@ -19,10 +19,4 @@ export declare class TimeUtil {
* @returns current date in format: 00.00.0000 (dd.mm.yyyy)
*/
getDateMailFormat(): string;
/**
* Convert hours into seconds
* @param hours hours to convert to seconds
* @returns number
*/
getHoursAsSeconds(hours: number): number;
}