133 lines
4.1 KiB
C#
133 lines
4.1 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace IdleSpectator;
|
|
|
|
/// <summary>
|
|
/// WorldLog asset ids → EventStrength seeds (score-native; no InterestTier).
|
|
/// </summary>
|
|
public static class WorldLogInterestTable
|
|
{
|
|
private static readonly Dictionary<string, float> EventSeeds = new Dictionary<string, float>
|
|
{
|
|
// World-shaping
|
|
["diplomacy_war_started"] = 100f,
|
|
["total_war_started"] = 100f,
|
|
["kingdom_destroyed"] = 100f,
|
|
["kingdom_shattered"] = 98f,
|
|
["kingdom_fractured"] = 95f,
|
|
["city_destroyed"] = 92f,
|
|
["log_city_revolted"] = 90f,
|
|
|
|
// Leadership / politics / favorites / founding
|
|
["kingdom_new"] = 75f,
|
|
["city_new"] = 72f,
|
|
["king_new"] = 78f,
|
|
["king_dead"] = 80f,
|
|
["king_killed"] = 85f,
|
|
["king_fled_capital"] = 70f,
|
|
["king_fled_city"] = 68f,
|
|
["king_left"] = 65f,
|
|
["alliance_new"] = 70f,
|
|
["alliance_dissolved"] = 68f,
|
|
["diplomacy_war_ended"] = 72f,
|
|
["favorite_dead"] = 82f,
|
|
["favorite_killed"] = 85f,
|
|
["kingdom_royal_clan_new"] = 74f,
|
|
["kingdom_royal_clan_changed"] = 72f,
|
|
["kingdom_royal_clan_dead"] = 76f,
|
|
|
|
// Biosphere footnotes
|
|
["race_dead"] = 40f
|
|
};
|
|
|
|
public static bool TryGetEventStrength(string assetId, out float eventStrength)
|
|
{
|
|
if (string.IsNullOrEmpty(assetId))
|
|
{
|
|
eventStrength = 0f;
|
|
return false;
|
|
}
|
|
|
|
if (EventSeeds.TryGetValue(assetId, out eventStrength))
|
|
{
|
|
return true;
|
|
}
|
|
|
|
if (assetId.Contains("disaster") || assetId.StartsWith("worldlog_disaster"))
|
|
{
|
|
eventStrength = 95f;
|
|
return true;
|
|
}
|
|
|
|
eventStrength = 0f;
|
|
return false;
|
|
}
|
|
|
|
public static string MakeLabel(WorldLogMessage message)
|
|
{
|
|
string id = message.asset_id ?? "event";
|
|
string a = message.special1;
|
|
string b = message.special2;
|
|
|
|
switch (id)
|
|
{
|
|
case "diplomacy_war_started":
|
|
return $"War: {a} vs {b}";
|
|
case "total_war_started":
|
|
return $"Total war: {a}";
|
|
case "kingdom_destroyed":
|
|
return $"Kingdom fell: {a}";
|
|
case "kingdom_shattered":
|
|
return $"Kingdom shattered: {a}";
|
|
case "kingdom_fractured":
|
|
return $"Kingdom fractured: {a}";
|
|
case "city_destroyed":
|
|
return $"City destroyed: {a}";
|
|
case "log_city_revolted":
|
|
return $"Revolt: {a}";
|
|
case "kingdom_new":
|
|
return $"New kingdom: {a}";
|
|
case "city_new":
|
|
return $"New city: {a}";
|
|
case "king_new":
|
|
return $"New king: {b} ({a})";
|
|
case "king_dead":
|
|
return $"King died: {b} ({a})";
|
|
case "king_killed":
|
|
return $"King killed: {b} ({a})";
|
|
case "king_fled_capital":
|
|
return $"King fled capital: {b}";
|
|
case "king_fled_city":
|
|
return $"King fled city: {b}";
|
|
case "alliance_new":
|
|
return $"Alliance: {a}";
|
|
case "alliance_dissolved":
|
|
return $"Alliance dissolved: {a}";
|
|
case "diplomacy_war_ended":
|
|
return $"War ended: {a}";
|
|
case "kingdom_royal_clan_new":
|
|
case "kingdom_royal_clan_changed":
|
|
return $"Royal clan: {a}";
|
|
case "kingdom_royal_clan_dead":
|
|
return $"Royal clan ended: {a}";
|
|
case "race_dead":
|
|
return $"Species extinct: {a}";
|
|
case "favorite_dead":
|
|
case "favorite_killed":
|
|
return $"Favorite fell: {a}";
|
|
default:
|
|
if (!string.IsNullOrEmpty(a) && !string.IsNullOrEmpty(b))
|
|
{
|
|
return $"{id}: {a} / {b}";
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(a))
|
|
{
|
|
return $"{id}: {a}";
|
|
}
|
|
|
|
return id;
|
|
}
|
|
}
|
|
}
|