refactor: update if statement for getUpdatedPrices
This commit is contained in:
parent
627a256671
commit
7b30b35166
13
src/mod.ts
13
src/mod.ts
@ -161,9 +161,9 @@ class TheBlacklistMod implements IPostDBLoadMod {
|
||||
const currentFleaPrice = prices[item._id];
|
||||
let newPrice: number;
|
||||
|
||||
if (item._props.ammoType === "bullet") {
|
||||
if (this.isAmmo(item)) {
|
||||
newPrice = this.getUpdatedAmmoPrice(item);
|
||||
} else if (Number(item._props.armorClass) > 0 && item._props.armorZone?.some(zone => zone === "Chest")) {
|
||||
} else if (this.isArmour(item)) {
|
||||
newPrice = this.getUpdatedArmourPrice(item);
|
||||
}
|
||||
|
||||
@ -172,6 +172,15 @@ class TheBlacklistMod implements IPostDBLoadMod {
|
||||
return price && price * config.blacklistedItemPriceMultiplier;
|
||||
}
|
||||
|
||||
private isAmmo(item: ITemplateItem): boolean {
|
||||
const ammoRoundsHandbookId = "5485a8684bdc2da71d8b4567";
|
||||
return item._parent === ammoRoundsHandbookId;
|
||||
}
|
||||
|
||||
private isArmour(item: ITemplateItem): boolean {
|
||||
return Number(item._props.armorClass) > 0 && item._props.armorZone?.some(zone => zone === "Chest")
|
||||
}
|
||||
|
||||
private getUpdatedAmmoPrice(item: ITemplateItem) {
|
||||
const baselinePen = this.baselineBullet._props.PenetrationPower;
|
||||
const baselineDamage = this.baselineBullet._props.Damage;
|
||||
|
Loading…
x
Reference in New Issue
Block a user