Implemented inclusion of standx
items when updating/installing hideout equipment area
Set area to level 0 for USEC Removed unnecessary mannequin pose array from dev profiles
This commit is contained in:
parent
9418095f03
commit
557dc55a33
@ -40757,8 +40757,7 @@
|
||||
],
|
||||
"Improvement": {},
|
||||
"Production": {},
|
||||
"HideoutCounters": null,
|
||||
"MannequinPoses": ["standing", "boxing", "fingerguns", "fingerguns2", "spreadinghands"]
|
||||
"HideoutCounters": null
|
||||
},
|
||||
"Info": {
|
||||
"AccountType": 0,
|
||||
@ -43868,7 +43867,7 @@
|
||||
"completeTime": 0,
|
||||
"constructing": false,
|
||||
"lastRecipe": "",
|
||||
"level": 1,
|
||||
"level": 0,
|
||||
"passiveBonusesEnabled": true,
|
||||
"slots": [],
|
||||
"type": 26
|
||||
@ -43927,7 +43926,6 @@
|
||||
"16": "5d494a295b56502f18c98a08",
|
||||
"24": "63db64cbf9963741dc0d741f",
|
||||
"25": "640b2d867f4185aa520d08ba",
|
||||
"26": "640b2d867f4185aa520d08bb",
|
||||
"27": "66c5bfd48a24042f1006eadc"
|
||||
},
|
||||
"items": [{
|
||||
@ -43948,14 +43946,6 @@
|
||||
"_id": "640b2d867f4185aa520d08ba",
|
||||
"_tpl": "64381b6e44b37a080d0245b9"
|
||||
}, {
|
||||
"_id": "640b2d867f4185aa520d08bb",
|
||||
"_tpl": "65e5957613227bb7690ce9f6"
|
||||
}, {
|
||||
"_id": "66c8f2c0584b8fef8201d0e8",
|
||||
"_tpl": "55d7217a4bdc2d86028b456d",
|
||||
"parentId": "640b2d867f4185aa520d08bb",
|
||||
"slotId": "Stand1"
|
||||
}, {
|
||||
"_id": "63db64cbf9963741dc0d741f",
|
||||
"_tpl": "64381b6e44b37a080d0245b9"
|
||||
}, {
|
||||
@ -46979,8 +46969,7 @@
|
||||
],
|
||||
"Improvement": {},
|
||||
"Production": {},
|
||||
"HideoutCounters": null,
|
||||
"MannequinPoses": ["standing", "boxing", "fingerguns", "fingerguns2", "spreadinghands"]
|
||||
"HideoutCounters": null
|
||||
},
|
||||
"Info": {
|
||||
"AccountType": 0,
|
||||
|
@ -282,16 +282,10 @@ export class HideoutController {
|
||||
}
|
||||
|
||||
// Add/upgrade stash item in player inventory
|
||||
this.addUpdateInventoryItemToProfile(pmcData, dbHideoutArea, hideoutStage);
|
||||
this.addUpdateInventoryItemToProfile(sessionID, pmcData, dbHideoutArea, hideoutStage, output);
|
||||
|
||||
// Dont inform client when upgraded area is hall of fame/cult circle, BSG doesn't inform client upgrade has occurred, will break client if data is sent
|
||||
if (
|
||||
![
|
||||
HideoutAreas.PLACE_OF_FAME,
|
||||
HideoutAreas.CIRCLE_OF_CULTISTS,
|
||||
HideoutAreas.EQUIPMENT_PRESETS_STAND,
|
||||
].includes(dbHideoutArea.type)
|
||||
) {
|
||||
if (![HideoutAreas.PLACE_OF_FAME].includes(dbHideoutArea.type)) {
|
||||
// Inform client of changes
|
||||
this.addContainerUpgradeToClientOutput(output, sessionID, dbHideoutArea.type, dbHideoutArea, hideoutStage);
|
||||
}
|
||||
@ -312,7 +306,7 @@ export class HideoutController {
|
||||
|
||||
// Add/upgrade stash item in player inventory
|
||||
const childDbAreaStage = childDbArea.stages[profileParentHideoutArea.level];
|
||||
this.addUpdateInventoryItemToProfile(pmcData, childDbArea, childDbAreaStage);
|
||||
this.addUpdateInventoryItemToProfile(sessionID, pmcData, childDbArea, childDbAreaStage, output);
|
||||
|
||||
// Inform client of the changes
|
||||
this.addContainerUpgradeToClientOutput(output, sessionID, childDbArea.type, childDbArea, childDbAreaStage);
|
||||
@ -326,20 +320,64 @@ export class HideoutController {
|
||||
* @param hideoutStage Stage area upgraded to
|
||||
*/
|
||||
protected addUpdateInventoryItemToProfile(
|
||||
sessionId: string,
|
||||
pmcData: IPmcData,
|
||||
dbHideoutData: IHideoutArea,
|
||||
hideoutStage: Stage,
|
||||
output: IItemEventRouterResponse,
|
||||
): void {
|
||||
const existingInventoryItem = pmcData.Inventory.items.find((item) => item._id === dbHideoutData._id);
|
||||
if (existingInventoryItem) {
|
||||
// Update existing items container tpl to point to new id (tpl)
|
||||
existingInventoryItem._tpl = hideoutStage.container;
|
||||
|
||||
// Edge case, update `standx` children
|
||||
if (dbHideoutData.type === HideoutAreas.EQUIPMENT_PRESETS_STAND) {
|
||||
// Can have multiple 'standx' children depending on upgrade level
|
||||
const slots = this.itemHelper.getItem(hideoutStage.container)[1]._props.Slots;
|
||||
for (const slot of slots) {
|
||||
// Dont add duplicate 'standx' child
|
||||
const existingChild = pmcData.Inventory.items.find(
|
||||
(item) => item.parentId === dbHideoutData._id && item.slotId === slot._name,
|
||||
);
|
||||
|
||||
// No child, add it
|
||||
if (!existingChild) {
|
||||
const itemToAdd = {
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: ItemTpl.INVENTORY_DEFAULT,
|
||||
parentId: dbHideoutData._id,
|
||||
slotId: slot._name,
|
||||
};
|
||||
pmcData.Inventory.items.push(itemToAdd);
|
||||
output.profileChanges[sessionId].items.new.push(itemToAdd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update complete
|
||||
return;
|
||||
}
|
||||
|
||||
// Add new item as none exists
|
||||
pmcData.Inventory.items.push({ _id: dbHideoutData._id, _tpl: hideoutStage.container });
|
||||
// Add new item as none exists (don't inform client of newContainerItem, will be done in `profileChanges.changedHideoutStashes`)
|
||||
const newContainerItem = { _id: dbHideoutData._id, _tpl: hideoutStage.container };
|
||||
pmcData.Inventory.items.push(newContainerItem);
|
||||
|
||||
// Edge case, add `standx` children as none exist
|
||||
if (dbHideoutData.type === HideoutAreas.EQUIPMENT_PRESETS_STAND) {
|
||||
// Get all slots we need to add a child for
|
||||
const slots = this.itemHelper.getItem(hideoutStage.container)[1]._props.Slots;
|
||||
for (const slot of slots) {
|
||||
const childItemToAdd = {
|
||||
_id: this.hashUtil.generate(),
|
||||
_tpl: ItemTpl.INVENTORY_DEFAULT,
|
||||
parentId: dbHideoutData._id,
|
||||
slotId: slot._name,
|
||||
};
|
||||
pmcData.Inventory.items.push(childItemToAdd);
|
||||
output.profileChanges[sessionId].items.new.push(childItemToAdd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user