Adjustments for Int/Cha progression in Hideout (#737)
* Fixup of some skill handling in hideout * fix format * add limited backwards compat and fix repair int value * more logging and fixes * fix charisma gain from repair * revert divisor into multiplier * run csharpier format * undo formating/unnecessary files * add debug guards --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
This commit is contained in:
@@ -3,12 +3,8 @@
|
||||
"applyRandomizeDurabilityLoss": true,
|
||||
"armorKitSkillPointGainPerRepairPointMultiplier": 0.05,
|
||||
"repairKitIntellectGainMultiplier": {
|
||||
"weapon": 0.045,
|
||||
"armor": 0.03
|
||||
},
|
||||
"maxIntellectGainPerRepair": {
|
||||
"kit": 0.6,
|
||||
"trader": 0.6
|
||||
"weapon": 0.111,
|
||||
"armor": 0.077
|
||||
},
|
||||
"weaponTreatment": {
|
||||
"critSuccessChance": 0.1,
|
||||
|
||||
@@ -687,6 +687,9 @@ public class HideoutController(
|
||||
);
|
||||
pmcData.Hideout.Production[request.RecipeId].SptIsScavCase = true;
|
||||
|
||||
// reward charisma based on skill progress rate for each scav production start
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Charisma, 1, true);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
||||
@@ -774,7 +774,10 @@ public class InsuranceController(
|
||||
}
|
||||
}
|
||||
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Charisma, itemsToInsureCount * 0.01);
|
||||
// give charisma skill points based on the total price of the insured items divded by 200000rub, multiplied by skill progress rate
|
||||
double intSkillPoints = (itemsToPay.Sum(c => c.Count ?? 0) / 200000);
|
||||
logger.Debug($"Insured {itemsToPay.Sum(c => c.Count ?? 0)} value, granting {intSkillPoints} {SkillTypes.Charisma} skill points.");
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Charisma, intSkillPoints, true);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using SPTarkov.Server.Core.Models.Eft.Common.Tables;
|
||||
using SPTarkov.Server.Core.Models.Eft.Profile;
|
||||
using SPTarkov.Server.Core.Models.Enums;
|
||||
using SPTarkov.Server.Core.Models.Spt.Config;
|
||||
using SPTarkov.Server.Core.Models.Spt.Logging;
|
||||
using SPTarkov.Server.Core.Models.Utils;
|
||||
using SPTarkov.Server.Core.Servers;
|
||||
using SPTarkov.Server.Core.Services;
|
||||
@@ -509,6 +510,11 @@ public class ProfileHelper(
|
||||
|
||||
profileSkill.PointsEarnedDuringSession += pointsToAddToSkill;
|
||||
|
||||
if (logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
logger.Debug($"Added: {pointsToAddToSkill} points to skill: {skill}, new progress value is: {profileSkill.Progress}");
|
||||
}
|
||||
|
||||
profileSkill.LastAccess = timeUtil.GetTimeStamp();
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,9 @@ public record RepairConfig : BaseConfig
|
||||
/// <summary>
|
||||
/// How much INT can be given to player per repair action
|
||||
/// </summary>
|
||||
[JsonPropertyName("maxIntellectGainPerRepair")]
|
||||
public required MaxIntellectGainValues MaxIntellectGainPerRepair { get; set; }
|
||||
[Obsolete("Only for backwards compatibility, does nothing")]
|
||||
[JsonIgnore]
|
||||
public MaxIntellectGainValues MaxIntellectGainPerRepair { get; set; } = new();
|
||||
|
||||
[JsonPropertyName("weaponTreatment")]
|
||||
public required WeaponTreatmentRepairValues WeaponTreatment { get; set; }
|
||||
|
||||
@@ -191,12 +191,26 @@ public class RepairService(
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, vestSkillToLevel, pointsToAddToVestSkill.GetValueOrDefault(0));
|
||||
}
|
||||
|
||||
// Handle trader repair - gives charisma based on (repair cost/10 * skill progress rate)
|
||||
if (!repairDetails.RepairedByKit.GetValueOrDefault(true) && repairDetails.RepairCost.HasValue)
|
||||
{
|
||||
var charismaFromRepair = repairDetails.RepairCost.Value / 10000;
|
||||
logger.Debug($"Added: {charismaFromRepair} {SkillTypes.Charisma}");
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Charisma, charismaFromRepair, true);
|
||||
}
|
||||
|
||||
// Handle giving INT to player - differs if using kit/trader and weapon vs armor
|
||||
var intellectGainedFromRepair = GetIntellectGainedFromRepair(repairDetails);
|
||||
if (intellectGainedFromRepair > 0)
|
||||
{
|
||||
logger.Debug($"Added: {intellectGainedFromRepair} intellect skill");
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Intellect, intellectGainedFromRepair);
|
||||
if (logger.IsLogEnabled(LogLevel.Debug))
|
||||
{
|
||||
logger.Debug(
|
||||
$"Added: {intellectGainedFromRepair} {SkillTypes.Intellect}, {intellectGainedFromRepair * 0.1} {SkillTypes.Charisma}"
|
||||
);
|
||||
}
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Intellect, intellectGainedFromRepair, true);
|
||||
profileHelper.AddSkillPointsToPlayer(pmcData, SkillTypes.Charisma, intellectGainedFromRepair * 0.1, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,12 +218,11 @@ public class RepairService(
|
||||
{
|
||||
if (repairDetails.RepairedByKit.GetValueOrDefault(false))
|
||||
{
|
||||
// Weapons/armor have different multipliers
|
||||
// Weapons/armor have different divisors
|
||||
var intRepairMultiplier = itemHelper.IsOfBaseclass(repairDetails.RepairedItem.Template, BaseClasses.WEAPON)
|
||||
? RepairConfig.RepairKitIntellectGainMultiplier.Weapon
|
||||
: RepairConfig.RepairKitIntellectGainMultiplier.Armor;
|
||||
|
||||
// Limit gain to a max value defined in config.maxIntellectGainPerRepair
|
||||
if (repairDetails.RepairPoints is null)
|
||||
{
|
||||
logger.Error(
|
||||
@@ -217,11 +230,11 @@ public class RepairService(
|
||||
);
|
||||
}
|
||||
|
||||
return Math.Min(repairDetails.RepairPoints.Value * intRepairMultiplier, RepairConfig.MaxIntellectGainPerRepair.Kit);
|
||||
return repairDetails.RepairAmount.Value * intRepairMultiplier;
|
||||
}
|
||||
|
||||
// Trader repair - Not as accurate as kit, needs data from live
|
||||
return Math.Min(repairDetails.RepairAmount.Value / 10, RepairConfig.MaxIntellectGainPerRepair.Trader);
|
||||
// Trader repair does not give INT
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user