From a68959d6989db62aaa5967ef9b272e0f28a48913 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 22 Jan 2019 21:21:50 +0900 Subject: update orb vallis weather calculation --- WarframeClock/Clock.cs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/WarframeClock/Clock.cs b/WarframeClock/Clock.cs index 688781b..956cfaa 100644 --- a/WarframeClock/Clock.cs +++ b/WarframeClock/Clock.cs @@ -4,19 +4,13 @@ namespace WarframeClock { public static class Clock { - public static long CetusExpiry { get; set; } = -1; + public static long? CetusExpiry { get; set; } public static string CetusExpiryString() { double currentTime = GetCurrentTime(); - double cetusLen = 8998.8748; - double cetusDayLen = 8248.9686 - 2249.7187; - double cetusBegin = 1509371722 + 2249.7187; - - if (CetusExpiry >= 0) - { - cetusBegin = CetusExpiry / 1000 - cetusLen; - } + double cetusLen = 8998.8748, cetusDayLen = cetusLen * 2 / 3; + double cetusBegin = (CetusExpiry ?? 1548159123053) / 1000.0 - cetusLen; cetusBegin += Math.Floor((currentTime - cetusBegin) / cetusLen) * cetusLen; if (currentTime < cetusBegin + cetusDayLen) @@ -28,15 +22,15 @@ namespace WarframeClock public static string VallisExpiryString() { double currentTime = GetCurrentTime(); - double dayStart = 1542131224; + double dayStart = 1548148830; // 2019-01-22 09:20:30 +0000 dayStart += Math.Floor((currentTime - dayStart) / 1600) * 1600; - if (currentTime - dayStart < 400) - return $"Vallis: ❄️[→☁] {GetReadableTimeSpan(dayStart + 400 - currentTime)}"; + if (currentTime - dayStart < 467) + return $"Vallis: ❄️[→☁] {GetReadableTimeSpan(dayStart + 467 - currentTime)}"; else if (currentTime - dayStart < 800) - return $"Vallis: ☁[→🌣] {GetReadableTimeSpan(dayStart + 800 - currentTime)}"; + return $"Vallis: ☁[→☀️] {GetReadableTimeSpan(dayStart + 800 - currentTime)}"; else if (currentTime - dayStart < 1200) - return $"Vallis: 🌣[→☁] {GetReadableTimeSpan(dayStart + 1200 - currentTime)}"; + return $"Vallis: ☀️[→☁] {GetReadableTimeSpan(dayStart + 1200 - currentTime)}"; else return $"Vallis: ☁[→❄️] {GetReadableTimeSpan(dayStart + 1600 - currentTime)}"; } -- cgit v1.2.3