Ammo price overhaul, some price changes

This commit is contained in:
Platinum 2023-02-11 15:06:37 +11:00
parent 1ba5c61ef8
commit e80754050b
3 changed files with 18 additions and 11 deletions

View File

@ -1,5 +1,7 @@
{
"baselineBulletId": "59e68f6f86f7746c9f75e846",
"baselineBulletId": "59e6906286f7746c9f75e847",
"baselineBulletPrice": 2000,
"bulletDamageMultiplierRedutionFactor": 0.7,
"baselineArmourId": "5c0e655586f774045612eeb2",
"baselineArmourWeight": 10,
"percentageOfInitialArmourPriceToAdd": 50

View File

@ -3,23 +3,23 @@
"disableBsgBlacklist": true,
"canSellBlacklistedItemsOnFlea": true,
"blacklistedItemPriceMultiplier": 2,
"blacklistedAmmoAdditionalPriceMultiplier": 1.8,
"blacklistedAmmoAdditionalPriceMultiplier": 1,
"blacklistedArmourAdditionalPriceMultiplier": 1.8,
"customItemConfigs": [
{
"itemIdHint": "Just a human friendly description that isn't used in code to help you remember. This item is the .338 AP round",
"itemId": "5fc382a9d724d907e2077dab",
"priceMultiplier": 1.5
"priceMultiplier": 1
},
{
"itemIdHint": "MK-18 .338 rifle",
"itemId": "5fc22d7c187fea44d52eda44",
"priceMultiplier": 3
"fleaPriceOverride": 400000
},
{
"itemIdHint": "AXMC .338 rifle. This gun has no flea price by default. We can use the price override to avoid any issues",
"itemId": "627e14b21713922ded6f2c15",
"priceOverride": 150000
"fleaPriceOverride": 300000
}
]
}

View File

@ -77,8 +77,8 @@ class TheBlacklistMod implements IPostDBLoadMod {
const customItemConfig = config.customItemConfigs.find(conf => conf.itemId === item._id);
// We found a custom price override to use. That's all we care about for this item. Move on to the next item.
if (customItemConfig?.priceOverride) {
prices[item._id] = customItemConfig.priceOverride;
if (customItemConfig?.fleaPriceOverride) {
prices[item._id] = customItemConfig.fleaPriceOverride;
return;
}
@ -114,7 +114,7 @@ class TheBlacklistMod implements IPostDBLoadMod {
let newPrice: number;
if (item._props.ammoType === "bullet") {
newPrice = this.getUpdatedAmmoPrice(item, currentFleaPrice);
newPrice = this.getUpdatedAmmoPrice(item);
} else if (Number(item._props.armorClass) > 0) {
newPrice = this.getUpdatedArmourPrice(item, prices);
}
@ -122,14 +122,19 @@ class TheBlacklistMod implements IPostDBLoadMod {
return newPrice ? newPrice * config.blacklistedItemPriceMultiplier : currentFleaPrice;
}
private getUpdatedAmmoPrice(item: ITemplateItem, currentFleaPrice: number) {
private getUpdatedAmmoPrice(item: ITemplateItem) {
const baselinePen = this.baselineBullet._props.PenetrationPower;
const baselineDamage = this.baselineBullet._props.Damage;
const penetrationMultiplier = item._props.PenetrationPower / baselinePen;
const damageMultiplier = item._props.Damage / baselineDamage;
const baseDamageMultiplier = item._props.Damage / baselineDamage;
return currentFleaPrice * config.blacklistedAmmoAdditionalPriceMultiplier * penetrationMultiplier * damageMultiplier;
// Reduces the effect of the damage multiplier so high DMG rounds aren't super expensive.
// Eg. let baseDamageMultiplier = 2 & bulletDamageMultiplierRedutionFactor = 0.7. Instead of a 2x price when a bullet is 2x damage, we instead get:
// 2 + (1 - 2) * 0.7 = 2 - 0.7 = 1.3x the price.
const damageMultiplier = baseDamageMultiplier + (1 - baseDamageMultiplier) * advancedConfig.bulletDamageMultiplierRedutionFactor;
return advancedConfig.baselineBulletPrice * penetrationMultiplier * damageMultiplier * config.blacklistedAmmoAdditionalPriceMultiplier;
}
// Armour price balancing is tricky. The default prices for some armours like the Zabralo is too high imo.