release
This commit is contained in:
@ -1,6 +1,4 @@
|
|||||||
using System.ComponentModel;
|
namespace TemporalTempestLight;
|
||||||
|
|
||||||
namespace TemporalTempestLight;
|
|
||||||
|
|
||||||
public class ModConfig
|
public class ModConfig
|
||||||
{
|
{
|
||||||
@ -8,7 +6,7 @@ public class ModConfig
|
|||||||
public double StormDurationGrowthPerYear = 12;
|
public double StormDurationGrowthPerYear = 12;
|
||||||
public double StormDurationLimit = 42;
|
public double StormDurationLimit = 42;
|
||||||
|
|
||||||
public double InitialStormDurationReductionMul = 0.2;
|
public double InitialKillsForStormEnd = 5;
|
||||||
public double StormDurationReductionMulDecreasePerYear = 0.09;
|
public double KillsForStormEndGrowthPerYear = 15;
|
||||||
public double StormDurationReductionMulLimit = 0.02;
|
public double KillsForStormEndLimit = 50;
|
||||||
}
|
}
|
@ -1,12 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using Vintagestory.API.Common;
|
using Vintagestory.API.Common;
|
||||||
using Vintagestory.API.Common.Entities;
|
using Vintagestory.API.Common.Entities;
|
||||||
using Vintagestory.API.Config;
|
|
||||||
using Vintagestory.API.Server;
|
|
||||||
using Vintagestory.GameContent;
|
using Vintagestory.GameContent;
|
||||||
using Vintagestory.Server;
|
|
||||||
|
|
||||||
namespace TemporalTempestLight.Patches;
|
namespace TemporalTempestLight.Patches;
|
||||||
|
|
||||||
@ -17,7 +13,6 @@ internal class TemporalStabilityPatches
|
|||||||
private const int MonthsPerYear = 12;
|
private const int MonthsPerYear = 12;
|
||||||
private const int HoursPerDay = 24;
|
private const int HoursPerDay = 24;
|
||||||
|
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch(typeof(SystemTemporalStability), "Event_OnEntityDeath")]
|
[HarmonyPatch(typeof(SystemTemporalStability), "Event_OnEntityDeath")]
|
||||||
public static void OnEntityDeathPatch(SystemTemporalStability __instance, ICoreAPI ___api, Entity entity, DamageSource damageSource)
|
public static void OnEntityDeathPatch(SystemTemporalStability __instance, ICoreAPI ___api, Entity entity, DamageSource damageSource)
|
||||||
@ -37,10 +32,6 @@ internal class TemporalStabilityPatches
|
|||||||
if (entityIsNotDrifter || damageSourceIsDrifter) return;
|
if (entityIsNotDrifter || damageSourceIsDrifter) return;
|
||||||
|
|
||||||
system.StormData.stormActiveTotalDays -= tempest.CurrentStormDurationReduction;
|
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]
|
[HarmonyPostfix]
|
||||||
@ -77,7 +68,7 @@ internal class TemporalStabilityPatches
|
|||||||
|
|
||||||
private static double CalcStormReduction(ICoreAPI api, TemporalTempestLightModSystem tempest, double stormActiveDays)
|
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)
|
private static double CalcStormActiveDays(ICoreAPI api, TemporalTempestLightModSystem tempest)
|
||||||
@ -89,11 +80,11 @@ internal class TemporalStabilityPatches
|
|||||||
return stormActiveInHours / HoursPerDay;
|
return stormActiveInHours / HoursPerDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static double CalcStormDurationReductionMul(ICoreAPI api, TemporalTempestLightModSystem tempest)
|
private static double CalcKillsForStormEndl(ICoreAPI api, TemporalTempestLightModSystem tempest)
|
||||||
{
|
{
|
||||||
return Math.Max(
|
return Math.Min(
|
||||||
tempest.Config.InitialStormDurationReductionMul - tempest.Config.StormDurationReductionMulDecreasePerYear *
|
tempest.Config.InitialKillsForStormEnd + tempest.Config.KillsForStormEndGrowthPerYear *
|
||||||
CalcYearsFromWorldStart(api), tempest.Config.StormDurationReductionMulLimit
|
CalcYearsFromWorldStart(api), tempest.Config.KillsForStormEndLimit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 154 KiB |
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"type": "code",
|
"type": "code",
|
||||||
"modid": "temporaltempestlight",
|
"modid": "temporaltempestlight",
|
||||||
"name": "TemporalTempestLight",
|
"name": "Temporal Tempest Light",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Dencher12"
|
"Dencher12"
|
||||||
],
|
],
|
||||||
"description": "To be added",
|
"description": "Fight like a hero or wait like a slave",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"game": ""
|
"game": ""
|
||||||
|
Reference in New Issue
Block a user