You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR aims to further adjust a variety of skill progression as provided through the SPT server to align it with the values as described in the Tarkov Wiki.
Following adjustments have been made:
HideoutManagement skill in HideoutController.UpgradeComplete now gives 12 points per completed upgrade
Crafting skill in HideoutController.HandleRecipe now gives 5 points per alternating craft and 1.5 points per 8h of crafting
A TODO was added to check whether or not Crafting an item still gives Intellect on live
A TODO was added to InventoryController.FlagItemsAsInspectedAndRewardXp whether it still gives Intellect on live
PrestigeHelper and RewardHelper applying Skill rewards were adjusted to not use low level scaling and no progress rate multiplier, now yielding skill rewards always being +1 level
RepairService.AddRepairSkillPoints was adjusted to more accurately represent live
Repairing a weapon with kit now gives 0.8 points of WeaponTreatment skill per 5 durability repaired
Repairing a Light/Heavy vest with kit now gives 0.4 points of Light/HeavyVest skill per 10 durability repaired
Intellect gain for armor and weapon repair was adjusted to 0.4 points per 10 durability repaired
HideoutHelperUpdateFuelUpdateWaterFilters and UpdateAirFilters should now give 0.8 points per 10 points durability consumed
HideoutHelper.ScavCaseProductionStart now gives 0.4 points of HideoutManagement for starting scav case
All skill points changes except Prestige/RewardHelper are now scalable via SkillProgressRate
Open points as of now are still the two TODO's I've added and whether HideoutManagement skill progression in HideoutHelperUpdateFuel, UpdateWaterFilters and UpdateAirFilters is correct (there are values in globals but who knows how accurate they are), also it seems like when having SolarPower it should yield 1.2 points per 50 fuel consumed (?).
It is also not 100% clear how many points of HideoutManagement should be provided for sending out scav case. I set it to 0.4 as per default skill progression rate for now.
Replace the local new Random() instance with the injected randomUtil to prevent potential issues with random number generation when the method is called in quick succession.
protected double GetWeaponRepairSkillPoints(RepairDetails repairDetails)
{
- var random = new Random();
// Every 5 points repaired with kit should give 0.4 skill points, so PointGainMultiplier is 0.2
// The return value is later scaled in AddSkillPointsToPlayer, i.e. 1 skill point returned here = 0.4 skill points added
var skillPoints = repairDetails.RepairAmount.GetValueOrDefault(0) * RepairConfig.WeaponTreatment.PointGainMultiplier;
// You can both crit fail and succeed at the same time, for fun (Balances out to 0 with default settings)
// Add a random chance to crit-fail
- if (random.NextDouble() <= RepairConfig.WeaponTreatment.CritFailureChance)+ if (randomUtil.GetDouble() <= RepairConfig.WeaponTreatment.CritFailureChance)
{
skillPoints -= RepairConfig.WeaponTreatment.CritFailureAmount;
}
// Add a random chance to crit-succeed
- if (random.NextDouble() <= RepairConfig.WeaponTreatment.CritSuccessChance)+ if (randomUtil.GetDouble() <= RepairConfig.WeaponTreatment.CritSuccessChance)
{
skillPoints += RepairConfig.WeaponTreatment.CritSuccessAmount;
}
return Math.Max(skillPoints, 0);
}
Suggestion importance[1-10]: 7
__
Why: This is a valid and important best practice for using Random. The suggestion correctly identifies the potential issue and proposes using the already injected randomUtil for consistency and correctness.
Medium
General
Use named boolean parameter
Use the named argument useSkillProgressRateMultiplier: true in the AddSkillPointsToPlayer call to improve code clarity and explicitly state the purpose of the boolean flag.
Why: The suggestion correctly identifies that using a named argument for the boolean parameter useSkillProgressRateMultiplier significantly improves code readability and makes the intent of the true value explicit.
Low
Ensure skill points are integers
Ensure intellectAmountToGive is an integer by applying Math.Floor to the calculation, preventing the assignment of fractional skill points.
Why: The suggestion correctly identifies that the calculation can produce fractional skill points and proposes using Math.Floor to ensure integer values, which improves the predictability of skill progression.
Low
Round repair skill points
Round the calculated skillPoints to a fixed precision before applying critical success or failure adjustments to prevent floating-point inaccuracies.
Why: The suggestion correctly points out potential floating-point inaccuracies. Rounding the value after the initial calculation but before applying critical adjustments improves the predictability and stability of the skill point calculation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aims to further adjust a variety of skill progression as provided through the SPT server to align it with the values as described in the Tarkov Wiki.
Following adjustments have been made:
HideoutController.UpgradeCompletenow gives 12 points per completed upgradeHideoutController.HandleRecipenow gives 5 points per alternating craft and 1.5 points per 8h of craftingInventoryController.FlagItemsAsInspectedAndRewardXpwhether it still gives Intellect on livePrestigeHelperandRewardHelperapplying Skill rewards were adjusted to not use low level scaling and no progress rate multiplier, now yielding skill rewards always being +1 levelRepairService.AddRepairSkillPointswas adjusted to more accurately represent liveHideoutHelperUpdateFuelUpdateWaterFiltersandUpdateAirFiltersshould now give 0.8 points per 10 points durability consumedHideoutHelper.ScavCaseProductionStartnow gives 0.4 points of HideoutManagement for starting scav casePrestige/RewardHelperare now scalable viaSkillProgressRateOpen points as of now are still the two TODO's I've added and whether HideoutManagement skill progression in
HideoutHelperUpdateFuel,UpdateWaterFiltersandUpdateAirFiltersis correct (there are values in globals but who knows how accurate they are), also it seems like when having SolarPower it should yield 1.2 points per 50 fuel consumed (?).It is also not 100% clear how many points of HideoutManagement should be provided for sending out scav case. I set it to 0.4 as per default skill progression rate for now.