91 lines
3 KiB
C#
91 lines
3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace IdleSpectator;
|
|
|
|
public sealed class DisasterInterestEntry
|
|
{
|
|
public string Id = "";
|
|
public float EventStrength = 90f;
|
|
public string Category = "Disaster";
|
|
public string WorldLogId = "";
|
|
public bool CreatesInterest = true;
|
|
public bool IsFallback;
|
|
}
|
|
|
|
/// <summary>Authored interest overlay for every live disasters library asset.</summary>
|
|
public static class DisasterInterestCatalog
|
|
{
|
|
private static readonly Dictionary<string, DisasterInterestEntry> Entries =
|
|
new Dictionary<string, DisasterInterestEntry>(StringComparer.OrdinalIgnoreCase);
|
|
|
|
static DisasterInterestCatalog()
|
|
{
|
|
Add("tornado", 95f, "disaster_tornado");
|
|
Add("heatwave", 88f, "disaster_heatwave");
|
|
Add("small_meteorite", 95f, "disaster_meteorite");
|
|
Add("small_earthquake", 95f, "disaster_earthquake");
|
|
Add("hellspawn", 96f, "disaster_hellspawn");
|
|
Add("ice_ones_awoken", 95f, "disaster_ice_ones");
|
|
Add("sudden_snowman", 90f, "disaster_sudden_snowman");
|
|
Add("garden_surprise", 90f, "disaster_garden_surprise");
|
|
Add("dragon_from_farlands", 98f, "disaster_dragon_from_farlands");
|
|
Add("ash_bandits", 92f, "disaster_bandits");
|
|
Add("alien_invasion", 97f, "disaster_alien_invasion");
|
|
Add("biomass", 96f, "disaster_biomass");
|
|
Add("tumor", 96f, "disaster_tumor");
|
|
Add("wild_mage", 94f, "disaster_evil_mage");
|
|
Add("underground_necromancer", 95f, "disaster_underground_necromancer");
|
|
Add("mad_thoughts", 90f, "disaster_mad_thoughts");
|
|
Add("greg_abominations", 96f, "disaster_greg_abominations");
|
|
}
|
|
|
|
private static void Add(string id, float strength, string worldLogId)
|
|
{
|
|
Entries[id] = new DisasterInterestEntry
|
|
{
|
|
Id = id,
|
|
EventStrength = strength,
|
|
WorldLogId = worldLogId,
|
|
CreatesInterest = true,
|
|
Category = "Disaster"
|
|
};
|
|
}
|
|
|
|
public static IEnumerable<string> AuthoredIds => Entries.Keys;
|
|
|
|
public static bool HasAuthored(string disasterId)
|
|
{
|
|
return !string.IsNullOrEmpty(disasterId) && Entries.ContainsKey(disasterId.Trim());
|
|
}
|
|
|
|
public static bool TryGet(string disasterId, out DisasterInterestEntry entry)
|
|
{
|
|
entry = null;
|
|
if (string.IsNullOrEmpty(disasterId))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return Entries.TryGetValue(disasterId.Trim(), out entry);
|
|
}
|
|
|
|
public static DisasterInterestEntry GetOrFallback(string disasterId)
|
|
{
|
|
if (TryGet(disasterId, out DisasterInterestEntry entry))
|
|
{
|
|
return entry;
|
|
}
|
|
|
|
string id = string.IsNullOrEmpty(disasterId) ? "unknown" : disasterId.Trim();
|
|
return new DisasterInterestEntry
|
|
{
|
|
Id = id,
|
|
EventStrength = 90f,
|
|
Category = "Disaster",
|
|
WorldLogId = "",
|
|
CreatesInterest = true,
|
|
IsFallback = true
|
|
};
|
|
}
|
|
}
|