take into accout Charisma skill at elite level when calculating daily quest count
This commit is contained in:
parent
00fbc813ac
commit
1510237b01
@ -14,6 +14,7 @@ import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
|||||||
import { ELocationName } from "@spt-aki/models/enums/ELocationName";
|
import { ELocationName } from "@spt-aki/models/enums/ELocationName";
|
||||||
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
import { HideoutAreas } from "@spt-aki/models/enums/HideoutAreas";
|
||||||
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
|
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
|
||||||
|
import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
|
||||||
import { IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
import { IQuestConfig, IRepeatableQuestConfig } from "@spt-aki/models/spt/config/IQuestConfig";
|
||||||
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
|
import { IQuestTypePool } from "@spt-aki/models/spt/repeatable/IQuestTypePool";
|
||||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
@ -131,7 +132,7 @@ export class RepeatableQuestController
|
|||||||
const questTypePool = this.generateQuestPool(repeatableConfig, pmcData.Info.Level);
|
const questTypePool = this.generateQuestPool(repeatableConfig, pmcData.Info.Level);
|
||||||
|
|
||||||
// Add daily quests
|
// Add daily quests
|
||||||
for (let i = 0; i < repeatableConfig.numQuests; i++)
|
for (let i = 0; i < this.getQuestCount(repeatableConfig, pmcData); i++)
|
||||||
{
|
{
|
||||||
let quest = null;
|
let quest = null;
|
||||||
let lifeline = 0;
|
let lifeline = 0;
|
||||||
@ -188,6 +189,23 @@ export class RepeatableQuestController
|
|||||||
return returnData;
|
return returnData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of quests to generate - takes into account charisma state of player
|
||||||
|
* @param repeatableConfig Config
|
||||||
|
* @param pmcData Player profile
|
||||||
|
* @returns Quest count
|
||||||
|
*/
|
||||||
|
protected getQuestCount(repeatableConfig: IRepeatableQuestConfig, pmcData: IPmcData): number
|
||||||
|
{
|
||||||
|
if (repeatableConfig.name.toLowerCase() === "daily" && this.profileHelper.hasEliteSkillLevel(SkillTypes.CHARISMA, pmcData))
|
||||||
|
{
|
||||||
|
// Elite charisma skill gives 1 extra daily quest
|
||||||
|
return repeatableConfig.numQuests + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return repeatableConfig.numQuests;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
|
* Get repeatable quest data from profile from name (daily/weekly), creates base repeatable quest object if none exists
|
||||||
* @param repeatableConfig daily/weekly config
|
* @param repeatableConfig daily/weekly config
|
||||||
|
@ -794,7 +794,7 @@ export class HideoutHelper
|
|||||||
{
|
{
|
||||||
const bitcoinProduction = this.databaseServer.getTables().hideout.production.find(p => p._id === HideoutHelper.bitcoinFarm);
|
const bitcoinProduction = this.databaseServer.getTables().hideout.production.find(p => p._id === HideoutHelper.bitcoinFarm);
|
||||||
const productionSlots = bitcoinProduction?.productionLimitCount || 3;
|
const productionSlots = bitcoinProduction?.productionLimitCount || 3;
|
||||||
const hasManagementSkillSlots = this.hasEliteHideoutManagementSkill(pmcData);
|
const hasManagementSkillSlots = this.profileHelper.hasEliteSkillLevel(SkillTypes.HIDEOUT_MANAGEMENT, pmcData);
|
||||||
const managementSlotsCount = this.getBitcoinMinerContainerSlotSize() || 2;
|
const managementSlotsCount = this.getBitcoinMinerContainerSlotSize() || 2;
|
||||||
|
|
||||||
return productionSlots + (hasManagementSkillSlots ? managementSlotsCount : 0);
|
return productionSlots + (hasManagementSkillSlots ? managementSlotsCount : 0);
|
||||||
|
@ -5,6 +5,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
|
|||||||
import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase";
|
import { CounterKeyValue, Stats } from "@spt-aki/models/eft/common/tables/IBotBase";
|
||||||
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
import { IAkiProfile } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||||
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
||||||
|
import { SkillTypes } from "@spt-aki/models/enums/SkillTypes";
|
||||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
import { DatabaseServer } from "@spt-aki/servers/DatabaseServer";
|
||||||
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
import { SaveServer } from "@spt-aki/servers/SaveServer";
|
||||||
@ -341,4 +342,28 @@ export class ProfileHelper
|
|||||||
stat.Value++;
|
stat.Value++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if player has a skill at elite level
|
||||||
|
* @param skillType Skill to check
|
||||||
|
* @param pmcProfile Profile to find skill in
|
||||||
|
* @returns True if player has skill at elite level
|
||||||
|
*/
|
||||||
|
public hasEliteSkillLevel(skillType: SkillTypes, pmcProfile: IPmcData): boolean
|
||||||
|
{
|
||||||
|
const profileSkills = pmcProfile?.Skills?.Common;
|
||||||
|
if (!profileSkills)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const profileSkill = profileSkills.find(x => x.Id === skillType);
|
||||||
|
if (!profileSkill)
|
||||||
|
{
|
||||||
|
this.logger.warning(`Unable to check for elite skill ${skillType}, not found in profile`);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return profileSkill.Progress >= 5100; // level 51
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user