Skip to content

Commit

Permalink
Merge pull request #629 from healiha/feature/difficulty-percent
Browse files Browse the repository at this point in the history
Change difficulty value from multiplier to percent
  • Loading branch information
nxPublic committed Sep 17, 2021
2 parents 04055c3 + 45620ee commit 8723785
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ValheimPlus/Configurations/Sections/GameConfiguration.cs
Expand Up @@ -2,8 +2,8 @@
{
public class GameConfiguration : ServerSyncConfig<GameConfiguration>
{
public float gameDifficultyDamageScale { get; internal set; } = 0.04f;
public float gameDifficultyHealthScale { get; internal set; } = 0.4f;
public float gameDifficultyDamageScale { get; internal set; } = 4f;
public float gameDifficultyHealthScale { get; internal set; } = 40f;
public int extraPlayerCountNearby { get; internal set; } = 0;
public int setFixedPlayerCountTo { get; internal set; } = 0;
public int difficultyScaleRange { get; internal set; } = 200;
Expand Down
4 changes: 2 additions & 2 deletions ValheimPlus/GameClasses/Game.cs
Expand Up @@ -35,7 +35,7 @@ public static class Game_GetDifficultyDamageScale_Patch
private static void Postfix(ref float __result)
{
if (Configuration.Current.Game.IsEnabled)
__result = ((__result - 1f) / baseDifficultyDamageScale * Configuration.Current.Game.gameDifficultyDamageScale) + 1f;
__result = ((__result - 1f) / baseDifficultyDamageScale * Configuration.Current.Game.gameDifficultyDamageScale / 100f) + 1f;
}
}

Expand Down Expand Up @@ -64,7 +64,7 @@ public static class Game_GetDifficultyHealthScale_Patch
private static void Postfix(ref float __result)
{
if (Configuration.Current.Game.IsEnabled)
__result = ((__result - 1f) / baseDifficultyHealthScale * Configuration.Current.Game.gameDifficultyHealthScale) + 1f;
__result = ((__result - 1f) / baseDifficultyHealthScale * Configuration.Current.Game.gameDifficultyHealthScale / 100f) + 1f;
}
}

Expand Down
8 changes: 4 additions & 4 deletions valheim_plus.cfg
Expand Up @@ -340,12 +340,12 @@ allowAllOres=false
enabled=false

; The games damage multiplier per person nearby in difficultyScaleRange(m) radius.
; Default is 0.04, 4% monster damage increase per player in radius.
gameDifficultyDamageScale=0.04
; Default is 4% monster damage increase per player in radius.
gameDifficultyDamageScale=4

; The games health multiplier per person nearby in difficultyScaleRange(m) radius.
; Default is 0.40%, 40% monster health increase per player in radius.
gameDifficultyHealthScale=0.4
; Default is 40% monster health increase per player in radius.
gameDifficultyHealthScale=40

; Adds additional players to the difficulty calculation in multiplayer unrelated to the actual amount.
; This option is disabled if its set to 0.
Expand Down
8 changes: 4 additions & 4 deletions vplusconfig.json
Expand Up @@ -626,13 +626,13 @@
"defaultType": "bool"
},
"gameDifficultyDamageScale": {
"description": "The games damage multiplier per person nearby in difficultyScaleRange(m) radius.",
"defaultValue": "0.04",
"description": "The games damage increase in percent per person nearby in difficultyScaleRange(m) radius.",
"defaultValue": "4",
"defaultType": "float"
},
"gameDifficultyHealthScale": {
"description": "The games health multiplier per person nearby in difficultyScaleRange(m) radius.",
"defaultValue": "0.4",
"description": "The games health increase in percent per person nearby in difficultyScaleRange(m) radius.",
"defaultValue": "40",
"defaultType": "float"
},
"extraPlayerCountNearby": {
Expand Down

0 comments on commit 8723785

Please sign in to comment.