quantum-space-buddies/QSB/DeathSync/Necronomicon.cs

18 lines
554 B
C#
Raw Normal View History

using QSB.Localization;
2022-06-04 15:19:55 +00:00
using System;
using System.Collections.Generic;
2022-03-03 03:46:33 +00:00
namespace QSB.DeathSync;
public static class Necronomicon
{
2022-03-03 03:46:33 +00:00
public static string GetPhrase(DeathType deathType, int index)
=> QSBLocalization.Current.DeathMessages.ContainsKey(deathType)
? QSBLocalization.Current.DeathMessages[deathType][index]
2022-03-03 03:46:33 +00:00
: null;
2022-03-03 03:46:33 +00:00
public static int GetRandomIndex(DeathType deathType)
=> QSBLocalization.Current.DeathMessages.ContainsKey(deathType)
? new Random().Next(0, QSBLocalization.Current.DeathMessages[deathType].Length)
2022-03-03 03:46:33 +00:00
: -1;
2020-12-03 08:28:05 +00:00
}