Changed flea rep gain code to use globals data instead of ragfair json

This commit is contained in:
Dev 2024-02-29 12:19:43 +00:00
parent c64e5f7239
commit 002279c787
3 changed files with 4 additions and 18 deletions

View File

@ -12,10 +12,6 @@
"min": 0, "min": 0,
"max": 1.0 "max": 1.0
}, },
"reputation": {
"gain": 0.0000002,
"loss": 0.0000002
},
"expireSeconds": 71 "expireSeconds": 71
}, },
"traders": { "traders": {

View File

@ -359,7 +359,8 @@ export class RagfairOfferHelper
return; return;
} }
profile.characters.pmc.RagfairInfo.rating += this.ragfairConfig.sell.reputation.gain * amountToIncrementBy; profile.characters.pmc.RagfairInfo.rating +=
this.databaseServer.getTables().globals.config.RagFair.ratingIncreaseCount + amountToIncrementBy;
} }
/** /**
@ -670,10 +671,7 @@ export class RagfairOfferHelper
* @param offer The flea offer * @param offer The flea offer
* @returns True if the given item is functional * @returns True if the given item is functional
*/ */
public isItemFunctional( public isItemFunctional(offerRootItem: Item, offer: IRagfairOffer): boolean
offerRootItem: Item,
offer: IRagfairOffer
): boolean
{ {
// Non-presets are always functional // Non-presets are always functional
if (!this.presetHelper.hasPreset(offerRootItem._tpl)) if (!this.presetHelper.hasPreset(offerRootItem._tpl))
@ -685,7 +683,7 @@ export class RagfairOfferHelper
if (this.itemHelper.armorItemCanHoldMods(offerRootItem._tpl)) if (this.itemHelper.armorItemCanHoldMods(offerRootItem._tpl))
{ {
const offerRootTemplate = this.itemHelper.getItem(offerRootItem._tpl)[1]; const offerRootTemplate = this.itemHelper.getItem(offerRootItem._tpl)[1];
const requiredPlateCount = offerRootTemplate._props.Slots?.filter(item => item._required)?.length; const requiredPlateCount = offerRootTemplate._props.Slots?.filter((item) => item._required)?.length;
return offer.items.length > requiredPlateCount; return offer.items.length > requiredPlateCount;
} }

View File

@ -21,8 +21,6 @@ export interface Sell
chance: Chance; chance: Chance;
/** Settings to control how long it takes for a player offer to sell */ /** Settings to control how long it takes for a player offer to sell */
time: MinMax; time: MinMax;
/** Player offer reputation gain/loss settings */
reputation: Reputation;
/**Seconds from clicking remove to remove offer from market */ /**Seconds from clicking remove to remove offer from market */
expireSeconds: number; expireSeconds: number;
} }
@ -39,12 +37,6 @@ export interface Chance
minSellChancePercent: number; minSellChancePercent: number;
} }
export interface Reputation
{
gain: number;
loss: number;
}
export interface Dynamic export interface Dynamic
{ {
// Should a purchased dynamic offers items be flagged as found in raid // Should a purchased dynamic offers items be flagged as found in raid