RynthSuite as of 2026-10-04 (internal c94715f): RynthOracle (based on Oracle of Dereth by Advis Eveldan) and RynthInventory, RynthAi patrol doorways and rooms, healing priority, strict monster priority, finish the wounded target, slayer weapons, arcs when clear, blasts like rings, learn unknown spells, looting fixes, release 2026.10.4.6
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
c33e24a610
commit
12ca25f911
426 changed files with 108239 additions and 7521 deletions
36
Plugins/RynthCore.Plugin.RynthOracle/Data/TimeText.cs
Normal file
36
Plugins/RynthCore.Plugin.RynthOracle/Data/TimeText.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
// Ported from Oracle of Dereth by Advis Eveldan (advis61), MIT. See THIRD_PARTY_NOTICES.md.
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
namespace RynthCore.Plugin.RynthOracle.Data;
|
||||
|
||||
internal static class TimeText
|
||||
{
|
||||
/// <summary>
|
||||
/// "2d 5h 0m", "12m 4s". Seconds only inside the last hour; once a unit shows, every smaller
|
||||
/// one follows even at zero, so a column doesn't change shape as it counts down (upstream's rule).
|
||||
/// </summary>
|
||||
public static string Friendly(TimeSpan d)
|
||||
{
|
||||
if (d < TimeSpan.Zero) d = TimeSpan.Zero;
|
||||
bool showSeconds = d.TotalHours < 1;
|
||||
string o = "";
|
||||
if (d.Days > 0) o += d.Days + "d ";
|
||||
if (o.Length > 0 || d.Hours > 0) o += d.Hours + "h ";
|
||||
if (o.Length > 0 || d.Minutes > 0) o += d.Minutes + "m ";
|
||||
if (showSeconds && (o.Length > 0 || d.Seconds > 0)) o += d.Seconds + "s ";
|
||||
return o.Length == 0 ? "0s" : o.Trim();
|
||||
}
|
||||
|
||||
/// <summary>"1:02:03" (hours unbounded), for buff timers.</summary>
|
||||
public static string Clock(double seconds)
|
||||
{
|
||||
if (!double.IsFinite(seconds) || seconds < 0) seconds = 0;
|
||||
var t = TimeSpan.FromSeconds(seconds);
|
||||
return t.TotalHours >= 1
|
||||
? $"{(int)t.TotalHours}:{t.Minutes:D2}:{t.Seconds:D2}"
|
||||
: $"{t.Minutes}:{t.Seconds:D2}";
|
||||
}
|
||||
|
||||
public static string Number(long n) => n.ToString("N0", CultureInfo.InvariantCulture);
|
||||
}
|
||||
Loading…
Reference in a new issue