Update PMC encyclopedia post-raid
Update scav encyclopedia during generation to be pmc encyclopedia Remove redundant return statements from function
This commit is contained in:
parent
1c63d85649
commit
2e3f624131
@ -123,12 +123,15 @@ export class InraidController
|
|||||||
protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void
|
protected savePmcProgress(sessionID: string, postRaidRequest: ISaveProgressRequestData): void
|
||||||
{
|
{
|
||||||
const serverProfile = this.saveServer.getProfile(sessionID);
|
const serverProfile = this.saveServer.getProfile(sessionID);
|
||||||
|
|
||||||
const locationName = serverProfile.inraid.location.toLowerCase();
|
const locationName = serverProfile.inraid.location.toLowerCase();
|
||||||
|
|
||||||
const map: ILocationBase = this.databaseServer.getTables().locations[locationName].base;
|
const map: ILocationBase = this.databaseServer.getTables().locations[locationName].base;
|
||||||
const mapHasInsuranceEnabled = map.Insurance;
|
const mapHasInsuranceEnabled = map.Insurance;
|
||||||
|
|
||||||
let serverPmcProfile = serverProfile.characters.pmc;
|
const serverPmcProfile = serverProfile.characters.pmc;
|
||||||
|
const serverScavProfile = serverProfile.characters.scav;
|
||||||
|
|
||||||
const isDead = this.isPlayerDead(postRaidRequest.exit);
|
const isDead = this.isPlayerDead(postRaidRequest.exit);
|
||||||
const preRaidGear = this.inRaidHelper.getPlayerGear(serverPmcProfile.Inventory.items);
|
const preRaidGear = this.inRaidHelper.getPlayerGear(serverPmcProfile.Inventory.items);
|
||||||
|
|
||||||
@ -137,6 +140,8 @@ export class InraidController
|
|||||||
this.inRaidHelper.updateProfileBaseStats(serverPmcProfile, postRaidRequest, sessionID);
|
this.inRaidHelper.updateProfileBaseStats(serverPmcProfile, postRaidRequest, sessionID);
|
||||||
this.inRaidHelper.updatePmcProfileDataPostRaid(serverPmcProfile, postRaidRequest, sessionID);
|
this.inRaidHelper.updatePmcProfileDataPostRaid(serverPmcProfile, postRaidRequest, sessionID);
|
||||||
|
|
||||||
|
this.mergePmcAndScavEncyclopedias(serverPmcProfile.Encyclopedia, serverScavProfile.Encyclopedia);
|
||||||
|
|
||||||
// Check for exit status
|
// Check for exit status
|
||||||
this.markOrRemoveFoundInRaidItems(postRaidRequest);
|
this.markOrRemoveFoundInRaidItems(postRaidRequest);
|
||||||
|
|
||||||
@ -149,7 +154,7 @@ export class InraidController
|
|||||||
this.inRaidHelper.addUpdToMoneyFromRaid(postRaidRequest.profile.Inventory.items);
|
this.inRaidHelper.addUpdToMoneyFromRaid(postRaidRequest.profile.Inventory.items);
|
||||||
|
|
||||||
// Purge profile of equipment/container items
|
// Purge profile of equipment/container items
|
||||||
serverPmcProfile = this.inRaidHelper.setInventory(sessionID, serverPmcProfile, postRaidRequest.profile);
|
this.inRaidHelper.setInventory(sessionID, serverPmcProfile, postRaidRequest.profile);
|
||||||
|
|
||||||
this.healthHelper.saveVitality(serverPmcProfile, postRaidRequest.health, sessionID);
|
this.healthHelper.saveVitality(serverPmcProfile, postRaidRequest.health, sessionID);
|
||||||
|
|
||||||
@ -191,7 +196,7 @@ export class InraidController
|
|||||||
);
|
);
|
||||||
this.matchBotDetailsCacheService.clearCache();
|
this.matchBotDetailsCacheService.clearCache();
|
||||||
|
|
||||||
serverPmcProfile = this.performPostRaidActionsWhenDead(postRaidRequest, serverPmcProfile, sessionID);
|
this.performPostRaidActionsWhenDead(postRaidRequest, serverPmcProfile, sessionID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -504,11 +509,11 @@ export class InraidController
|
|||||||
): void
|
): void
|
||||||
{
|
{
|
||||||
// Update scav profile inventory
|
// Update scav profile inventory
|
||||||
const updatedScavData = this.inRaidHelper.setInventory(sessionID, scavData, offraidData.profile);
|
this.inRaidHelper.setInventory(sessionID, scavData, offraidData.profile);
|
||||||
|
|
||||||
// Reset scav hp and save to json
|
// Reset scav hp and save to json
|
||||||
this.healthHelper.resetVitality(sessionID);
|
this.healthHelper.resetVitality(sessionID);
|
||||||
this.saveServer.getProfile(sessionID).characters.scav = updatedScavData;
|
this.saveServer.getProfile(sessionID).characters.scav = scavData;
|
||||||
|
|
||||||
// Scav karma
|
// Scav karma
|
||||||
this.handlePostRaidPlayerScavKarmaChanges(pmcData, offraidData);
|
this.handlePostRaidPlayerScavKarmaChanges(pmcData, offraidData);
|
||||||
|
@ -119,7 +119,7 @@ export class PlayerScavGenerator
|
|||||||
scavData.TaskConditionCounters = existingScavDataClone.TaskConditionCounters ?? {};
|
scavData.TaskConditionCounters = existingScavDataClone.TaskConditionCounters ?? {};
|
||||||
scavData.Notes = existingScavDataClone.Notes ?? { Notes: [] };
|
scavData.Notes = existingScavDataClone.Notes ?? { Notes: [] };
|
||||||
scavData.WishList = existingScavDataClone.WishList ?? [];
|
scavData.WishList = existingScavDataClone.WishList ?? [];
|
||||||
scavData.Encyclopedia = existingScavDataClone.Encyclopedia ?? {};
|
scavData.Encyclopedia = pmcDataClone.Encyclopedia;
|
||||||
|
|
||||||
// Add an extra labs card to pscav backpack based on config chance
|
// Add an extra labs card to pscav backpack based on config chance
|
||||||
if (this.randomUtil.getChance100(playerScavKarmaSettings.labsAccessCardChancePercent))
|
if (this.randomUtil.getChance100(playerScavKarmaSettings.labsAccessCardChancePercent))
|
||||||
|
@ -181,6 +181,7 @@ export class InRaidHelper
|
|||||||
profileData.Info.Level = saveProgressRequest.profile.Info.Level;
|
profileData.Info.Level = saveProgressRequest.profile.Info.Level;
|
||||||
profileData.Skills = saveProgressRequest.profile.Skills;
|
profileData.Skills = saveProgressRequest.profile.Skills;
|
||||||
profileData.Stats.Eft = saveProgressRequest.profile.Stats.Eft;
|
profileData.Stats.Eft = saveProgressRequest.profile.Stats.Eft;
|
||||||
|
|
||||||
profileData.Encyclopedia = saveProgressRequest.profile.Encyclopedia;
|
profileData.Encyclopedia = saveProgressRequest.profile.Encyclopedia;
|
||||||
profileData.TaskConditionCounters = saveProgressRequest.profile.TaskConditionCounters;
|
profileData.TaskConditionCounters = saveProgressRequest.profile.TaskConditionCounters;
|
||||||
|
|
||||||
@ -593,9 +594,8 @@ export class InRaidHelper
|
|||||||
* @param sessionID Session id
|
* @param sessionID Session id
|
||||||
* @param serverProfile Profile to update
|
* @param serverProfile Profile to update
|
||||||
* @param postRaidProfile Profile returned by client after a raid
|
* @param postRaidProfile Profile returned by client after a raid
|
||||||
* @returns Updated profile
|
|
||||||
*/
|
*/
|
||||||
public setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData): IPmcData
|
public setInventory(sessionID: string, serverProfile: IPmcData, postRaidProfile: IPmcData): void
|
||||||
{
|
{
|
||||||
// Store insurance (as removeItem() removes insurance also)
|
// Store insurance (as removeItem() removes insurance also)
|
||||||
const insured = this.jsonUtil.clone(serverProfile.InsuredItems);
|
const insured = this.jsonUtil.clone(serverProfile.InsuredItems);
|
||||||
@ -609,8 +609,6 @@ export class InRaidHelper
|
|||||||
serverProfile.Inventory.items = [...postRaidProfile.Inventory.items, ...serverProfile.Inventory.items];
|
serverProfile.Inventory.items = [...postRaidProfile.Inventory.items, ...serverProfile.Inventory.items];
|
||||||
serverProfile.Inventory.fastPanel = postRaidProfile.Inventory.fastPanel; // Quick access items bar
|
serverProfile.Inventory.fastPanel = postRaidProfile.Inventory.fastPanel; // Quick access items bar
|
||||||
serverProfile.InsuredItems = insured;
|
serverProfile.InsuredItems = insured;
|
||||||
|
|
||||||
return serverProfile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user