diff --git a/TemporalTempestLight/TemporalTempestLight/ModConfig.cs b/TemporalTempestLight/TemporalTempestLight/ModConfig.cs index db015fd..5972e87 100644 --- a/TemporalTempestLight/TemporalTempestLight/ModConfig.cs +++ b/TemporalTempestLight/TemporalTempestLight/ModConfig.cs @@ -1,6 +1,4 @@ -using System.ComponentModel; - -namespace TemporalTempestLight; +namespace TemporalTempestLight; public class ModConfig { @@ -8,7 +6,7 @@ public class ModConfig public double StormDurationGrowthPerYear = 12; public double StormDurationLimit = 42; - public double InitialStormDurationReductionMul = 0.2; - public double StormDurationReductionMulDecreasePerYear = 0.09; - public double StormDurationReductionMulLimit = 0.02; + public double InitialKillsForStormEnd = 5; + public double KillsForStormEndGrowthPerYear = 15; + public double KillsForStormEndLimit = 50; } \ No newline at end of file diff --git a/TemporalTempestLight/TemporalTempestLight/Patches/TemporalStabilityPatches.cs b/TemporalTempestLight/TemporalTempestLight/Patches/TemporalStabilityPatches.cs index a8ac8fe..0155c82 100644 --- a/TemporalTempestLight/TemporalTempestLight/Patches/TemporalStabilityPatches.cs +++ b/TemporalTempestLight/TemporalTempestLight/Patches/TemporalStabilityPatches.cs @@ -1,12 +1,8 @@ using System; -using System.Globalization; using HarmonyLib; using Vintagestory.API.Common; using Vintagestory.API.Common.Entities; -using Vintagestory.API.Config; -using Vintagestory.API.Server; using Vintagestory.GameContent; -using Vintagestory.Server; namespace TemporalTempestLight.Patches; @@ -17,7 +13,6 @@ internal class TemporalStabilityPatches private const int MonthsPerYear = 12; private const int HoursPerDay = 24; - [HarmonyPostfix] [HarmonyPatch(typeof(SystemTemporalStability), "Event_OnEntityDeath")] public static void OnEntityDeathPatch(SystemTemporalStability __instance, ICoreAPI ___api, Entity entity, DamageSource damageSource) @@ -37,10 +32,6 @@ internal class TemporalStabilityPatches if (entityIsNotDrifter || damageSourceIsDrifter) return; system.StormData.stormActiveTotalDays -= tempest.CurrentStormDurationReduction; - - // TODO REMOVE ON RELEASE - ((IServerPlayer)(((EntityPlayer)(damageSource.GetCauseEntity())).Player)).SendMessage(GlobalConstants.GeneralChatGroup, (system.StormData.stormActiveTotalDays - api.World.Calendar.TotalDays).ToString(), EnumChatType.Notification); - ((IServerPlayer)(((EntityPlayer)(damageSource.GetCauseEntity())).Player)).SendMessage(GlobalConstants.GeneralChatGroup, (tempest.CurrentStormDurationReduction).ToString(), EnumChatType.Notification); } [HarmonyPostfix] @@ -77,7 +68,7 @@ internal class TemporalStabilityPatches private static double CalcStormReduction(ICoreAPI api, TemporalTempestLightModSystem tempest, double stormActiveDays) { - return stormActiveDays * CalcStormDurationReductionMul(api, tempest); + return stormActiveDays / CalcKillsForStormEndl(api, tempest); } private static double CalcStormActiveDays(ICoreAPI api, TemporalTempestLightModSystem tempest) @@ -89,11 +80,11 @@ internal class TemporalStabilityPatches return stormActiveInHours / HoursPerDay; } - private static double CalcStormDurationReductionMul(ICoreAPI api, TemporalTempestLightModSystem tempest) + private static double CalcKillsForStormEndl(ICoreAPI api, TemporalTempestLightModSystem tempest) { - return Math.Max( - tempest.Config.InitialStormDurationReductionMul - tempest.Config.StormDurationReductionMulDecreasePerYear * - CalcYearsFromWorldStart(api), tempest.Config.StormDurationReductionMulLimit + return Math.Min( + tempest.Config.InitialKillsForStormEnd + tempest.Config.KillsForStormEndGrowthPerYear * + CalcYearsFromWorldStart(api), tempest.Config.KillsForStormEndLimit ); } } \ No newline at end of file diff --git a/TemporalTempestLight/TemporalTempestLight/modicon.png b/TemporalTempestLight/TemporalTempestLight/modicon.png index 4183d4b..e88d1c1 100644 Binary files a/TemporalTempestLight/TemporalTempestLight/modicon.png and b/TemporalTempestLight/TemporalTempestLight/modicon.png differ diff --git a/TemporalTempestLight/TemporalTempestLight/modinfo.json b/TemporalTempestLight/TemporalTempestLight/modinfo.json index c0aefd9..627d5f1 100644 --- a/TemporalTempestLight/TemporalTempestLight/modinfo.json +++ b/TemporalTempestLight/TemporalTempestLight/modinfo.json @@ -1,11 +1,11 @@ { "type": "code", "modid": "temporaltempestlight", - "name": "TemporalTempestLight", + "name": "Temporal Tempest Light", "authors": [ "Dencher12" ], - "description": "To be added", + "description": "Fight like a hero or wait like a slave", "version": "1.0.0", "dependencies": { "game": ""