using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SiegeUpgradesEnglish")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f506d0af91fd2a1fdcce8b7885d61186a31a0412")]
[assembly: AssemblyProduct("SiegeUpgradesEnglish")]
[assembly: AssemblyTitle("SiegeUpgradesEnglish")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace SiegeUpgradesEnglish
{
public enum TranslationMode
{
Auto,
AlwaysEnglish,
Off
}
[BepInPlugin("celeste.stonewards.siegeupgrades.english", "SiegeUpgradesEnglish", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private static class GameLanguage
{
private const BindingFlags Static = BindingFlags.Static | BindingFlags.Public;
private const BindingFlags Instance = BindingFlags.Instance | BindingFlags.Public;
private static bool _bound;
private static PropertyInfo _hasSettings;
private static PropertyInfo _initializationOperation;
private static PropertyInfo _isDone;
private static PropertyInfo _selectedLocale;
private static PropertyInfo _identifier;
private static PropertyInfo _code;
private static EventInfo _selectedLocaleChanged;
public static bool Bind()
{
if (_bound)
{
return true;
}
Type? type = Type.GetType("UnityEngine.Localization.Settings.LocalizationSettings, Unity.Localization");
Type type2 = Type.GetType("UnityEngine.Localization.Locale, Unity.Localization");
_hasSettings = type?.GetProperty("HasSettings", BindingFlags.Static | BindingFlags.Public);
_initializationOperation = type?.GetProperty("InitializationOperation", BindingFlags.Static | BindingFlags.Public);
_isDone = _initializationOperation?.PropertyType.GetProperty("IsDone", BindingFlags.Instance | BindingFlags.Public);
_selectedLocale = type?.GetProperty("SelectedLocale", BindingFlags.Static | BindingFlags.Public);
_selectedLocaleChanged = type?.GetEvent("SelectedLocaleChanged", BindingFlags.Static | BindingFlags.Public);
_identifier = type2?.GetProperty("Identifier", BindingFlags.Instance | BindingFlags.Public);
_code = _identifier?.PropertyType.GetProperty("Code", BindingFlags.Instance | BindingFlags.Public);
_bound = _hasSettings != null && _isDone != null && _selectedLocale != null && _code != null;
return _bound;
}
public static bool IsReady()
{
if ((bool)_hasSettings.GetValue(null))
{
return (bool)_isDone.GetValue(_initializationOperation.GetValue(null));
}
return false;
}
public static string Code()
{
object value = _selectedLocale.GetValue(null);
if (value == null)
{
return null;
}
return _code.GetValue(_identifier.GetValue(value)) as string;
}
public static Delegate Subscribe(object target, string method)
{
if (_selectedLocaleChanged == null)
{
return null;
}
MethodInfo method2 = target.GetType().GetMethod(method, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
Delegate obj = Delegate.CreateDelegate(_selectedLocaleChanged.EventHandlerType, target, method2);
_selectedLocaleChanged.AddEventHandler(null, obj);
return obj;
}
public static void Unsubscribe(Delegate handler)
{
_selectedLocaleChanged?.RemoveEventHandler(null, handler);
}
}
public const string Guid = "celeste.stonewards.siegeupgrades.english";
public const string TargetGuid = "catedralemchamas.stonewards.siegeupgrades";
internal static ManualLogSource Log;
private static ConfigEntry<TranslationMode> _mode;
internal static bool English;
private Harmony _harmony;
private Assembly _target;
private ConfigFile _targetConfig;
private readonly Dictionary<ConfigDefinition, ConfigDescription> _originalDescriptions = new Dictionary<ConfigDefinition, ConfigDescription>();
private bool? _configLanguageApplied;
private bool _localeResolved;
private Delegate _localeChangedHandler;
private float _nextPoll;
private static readonly FieldInfo DescriptionField = AccessTools.Field(typeof(ConfigEntryBase), "<Description>k__BackingField");
private void Awake()
{
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
_mode = ((BaseUnityPlugin)this).Config.Bind<TranslationMode>("General", "Mode", TranslationMode.Auto, "Auto = English only when the game language is English. AlwaysEnglish = always translate. Off = leave SiegeUpgrades untranslated.");
_mode.SettingChanged += delegate
{
Refresh(force: true);
};
if (!Chainloader.PluginInfos.TryGetValue("catedralemchamas.stonewards.siegeupgrades", out var value) || (Object)(object)value.Instance == (Object)null)
{
Log.LogError((object)"SiegeUpgrades not found; nothing to translate.");
return;
}
_target = ((object)value.Instance).GetType().Assembly;
_targetConfig = value.Instance.Config;
if (value.Metadata.Version.ToString() != "1.1.0")
{
Log.LogWarning((object)$"Translations were written for SiegeUpgrades 1.1.0, found {value.Metadata.Version}. New or changed text will stay in Portuguese.");
}
_harmony = new Harmony("celeste.stonewards.siegeupgrades.english");
PatchLiterals();
PatchDecimalFormat();
English = _mode.Value == TranslationMode.AlwaysEnglish;
ApplyConfigLanguage();
}
private void Update()
{
if (_target == null || _localeResolved || Time.unscaledTime < _nextPoll)
{
return;
}
_nextPoll = Time.unscaledTime + 0.5f;
try
{
if (!GameLanguage.Bind())
{
_localeResolved = true;
Log.LogWarning((object)"Couldn't find the game's language settings; falling back to Mode setting only.");
}
else if (GameLanguage.IsReady())
{
_localeResolved = true;
if ((object)_localeChangedHandler == null)
{
_localeChangedHandler = GameLanguage.Subscribe(this, "OnLocaleChanged");
}
Refresh(force: false);
}
}
catch (Exception ex)
{
_localeResolved = true;
Log.LogWarning((object)("Couldn't read the game language; falling back to Mode setting only. " + (ex.InnerException ?? ex).Message));
}
}
private void OnLocaleChanged(object _)
{
Refresh(force: false);
}
private static bool GameIsEnglish()
{
try
{
return GameLanguage.Code()?.StartsWith("en", StringComparison.OrdinalIgnoreCase) ?? false;
}
catch
{
return false;
}
}
private void Refresh(bool force)
{
bool flag = _mode.Value switch
{
TranslationMode.AlwaysEnglish => true,
TranslationMode.Off => false,
_ => _localeResolved && GameIsEnglish(),
};
if (flag != English || force)
{
English = flag;
Log.LogInfo((object)("SiegeUpgrades text: " + (flag ? "English" : "original (Portuguese)") + "."));
ResetCachedTexts();
ApplyConfigLanguage();
}
}
public static string T(string s)
{
if (!English)
{
return s;
}
if (!Translations.Literals.TryGetValue(s, out var value))
{
return s;
}
return value;
}
private void PatchLiterals()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(Plugin), "Transpiler", (Type[])null, (Type[])null));
Type[] array;
try
{
array = _target.GetTypes();
}
catch (ReflectionTypeLoadException ex)
{
array = ex.Types.Where((Type t) => t != null).ToArray();
}
int num = 0;
int num2 = 0;
Type[] array2 = array;
foreach (Type type in array2)
{
if (type.ContainsGenericParameters || type.Name == "SiegeConfig" || type.Name == "SiegeArt")
{
continue;
}
MethodInfo[] methods = type.GetMethods(BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
foreach (MethodInfo methodInfo in methods)
{
if (!methodInfo.IsAbstract && !methodInfo.ContainsGenericParameters && HasTranslatableLiteral(methodInfo))
{
try
{
_harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null);
num++;
}
catch (Exception ex2)
{
num2++;
Log.LogWarning((object)("Couldn't patch " + type.FullName + "." + methodInfo.Name + ": " + ex2.Message));
}
}
}
}
Log.LogInfo((object)($"Patched {num} SiegeUpgrades methods" + ((num2 > 0) ? $" ({num2} failed)." : ".")));
}
private static bool HasTranslatableLiteral(MethodInfo method)
{
try
{
return PatchProcessor.ReadMethodBody((MethodBase)method).Any((KeyValuePair<OpCode, object> kv) => kv.Key == OpCodes.Ldstr && kv.Value is string key && Translations.Literals.ContainsKey(key));
}
catch
{
return false;
}
}
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
MethodInfo t = AccessTools.Method(typeof(Plugin), "T", (Type[])null, (Type[])null);
foreach (CodeInstruction ins in instructions)
{
yield return ins;
if (ins.opcode == OpCodes.Ldstr && ins.operand is string key && Translations.Literals.ContainsKey(key))
{
yield return new CodeInstruction(OpCodes.Call, (object)t);
}
}
}
private void PatchDecimalFormat()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
MethodInfo methodInfo = AccessTools.Method(_target.GetType("SiegeUpgrades.UI.Txt"), "Dec", (Type[])null, (Type[])null);
if (methodInfo == null)
{
Log.LogWarning((object)"Txt.Dec not found; decimals keep the comma.");
}
else
{
_harmony.Patch((MethodBase)methodInfo, new HarmonyMethod(AccessTools.Method(typeof(Plugin), "DecPrefix", (Type[])null, (Type[])null)), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
}
}
private static bool DecPrefix(float value, string format, ref string __result)
{
if (!English)
{
return true;
}
__result = value.ToString(format, CultureInfo.InvariantCulture);
return false;
}
private void ResetCachedTexts()
{
try
{
Type type = _target.GetType("SiegeUpgrades.UI.SiegeWindow");
Type type2 = _target.GetType("SiegeUpgrades.UI.CachedText");
if (type == null || type2 == null)
{
return;
}
Object[] array = Object.FindObjectsByType(type, (FindObjectsSortMode)0);
foreach (Object obj in array)
{
FieldInfo[] fields = type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
foreach (FieldInfo fieldInfo in fields)
{
if (fieldInfo.FieldType == type2)
{
fieldInfo.SetValue(obj, Activator.CreateInstance(type2));
}
else if (fieldInfo.FieldType.IsArray && fieldInfo.FieldType.GetElementType() == type2 && fieldInfo.GetValue(obj) is Array array2)
{
Array.Clear(array2, 0, array2.Length);
}
}
}
}
catch (Exception ex)
{
Log.LogWarning((object)("Couldn't reset cached window text: " + ex.Message));
}
}
private void ApplyConfigLanguage()
{
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Expected O, but got Unknown
if (_targetConfig == null || DescriptionField == null || _configLanguageApplied == English)
{
return;
}
try
{
foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in ((IEnumerable<KeyValuePair<ConfigDefinition, ConfigEntryBase>>)_targetConfig).ToList())
{
ConfigEntryBase value = item.Value;
ConfigDefinition key = item.Key;
if (!_originalDescriptions.TryGetValue(key, out var value2))
{
value2 = value.Description;
_originalDescriptions[key] = value2;
}
ConfigDescription value3 = value2;
if (English && Translations.Config.TryGetValue(key.Section + "." + key.Key, out var value4))
{
value3 = new ConfigDescription(value4, value2.AcceptableValues, value2.Tags);
}
DescriptionField.SetValue(value, value3);
}
_targetConfig.Save();
_configLanguageApplied = English;
}
catch (Exception ex)
{
Log.LogWarning((object)("Couldn't translate the SiegeUpgrades config descriptions: " + ex.Message));
}
}
private void OnDestroy()
{
if ((object)_localeChangedHandler != null)
{
try
{
GameLanguage.Unsubscribe(_localeChangedHandler);
}
catch
{
}
}
Harmony harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}
internal static class Translations
{
public static readonly Dictionary<string, string> Literals = new Dictionary<string, string>
{
["Balista"] = "Ballista",
["Catapulta"] = "Catapult",
["da "] = "on ",
["Adicionar balista"] = "Add ballista",
["Adicionar trabuco"] = "Add trebuchet",
["Dano"] = "Damage",
["Velocidade de ataque"] = "Attack speed",
["Velocidade do projétil"] = "Projectile speed",
["Projéteis extras"] = "Extra projectiles",
["Área da explosão"] = "Explosion area",
["Alcance"] = "Range",
["Ricochete"] = "Ricochet",
["Congelamento"] = "Freeze",
["Fogo"] = "Fire",
["Veneno"] = "Poison",
["Lentidão"] = "Slow",
["Estilhaços"] = "Shrapnel",
["Virote explosivo"] = "Explosive bolt",
["Gelo"] = "Freeze",
["Explosão"] = "Explosion",
["Melhorias da Balista"] = "Ballista Upgrades",
["Melhorias da Catapulta"] = "Catapult Upgrades",
["Defesas do Muro"] = "Wall Defenses",
["Fechar (E / Esc)"] = "Close (E / Esc)",
["Aguardando o servidor..."] = "Waiting for the server...",
["E / Esc: fechar"] = "E / Esc: close",
["Cada nível da Forja dá 1 ponto · cada wave sobrevivida dá 1 escolha de efeito"] = "Each Forge level gives 1 point · each wave survived gives 1 effect choice",
["Pontos da Forja: {0} para gastar ({1} ganhos, {2} gastos). "] = "Forge Points: {0} to spend ({1} earned, {2} spent). ",
["Cada nível novo da Forja dá pontos (agora a Forja está no nível {0}). Valem para as melhorias das duas defesas."] = "Each new Forge level gives points (the Forge is now level {0}). They are shared by the upgrades of both defenses.",
["Escolhas de efeito: {0} para usar ({1} ganhas, {2} usadas). "] = "Effect Choices: {0} to spend ({1} earned, {2} used). ",
["Cada wave sobrevivida dá uma escolha ({0} waves até agora)."] = "Each wave survived gives one choice ({0} waves so far).",
["Nv "] = "Lv ",
["Nível = melhorias e efeitos comprados para esta defesa. Valem para as duas posições do muro, e também para uma defesa construída depois."] = "Level = upgrades and effects bought for this defense. They apply to both wall slots, including a defense built later.",
["Defesa automática"] = "Automated defense",
["Dano "] = "Damage ",
["Dano de cada disparo (com as cartas do jogo e a melhoria de Dano)"] = "Damage per shot (with the game's cards and the Damage upgrade)",
["Vel. ataque ×"] = "Atk speed ×",
["Velocidade de ataque comparada com a defesa normal"] = "Attack speed compared with the normal defense",
["Vel. projétil "] = "Proj. speed ",
["Velocidade do virote"] = "Bolt speed",
["Velocidade da pedra (cai no mesmo ponto, só chega antes)"] = "Rock speed (lands on the same spot, just arrives sooner)",
["Projéteis +"] = "Projectiles +",
["Projéteis extras em cada disparo"] = "Extra projectiles per shot",
["Área "] = "Area ",
["Raio da explosão da pedra"] = "Blast radius of the rock",
["Recarga "] = "Reload ",
["Tempo mínimo entre disparos (a animação de disparo também acelera quando precisa)"] = "Minimum time between shots (the firing animation also speeds up when needed)",
["Alcance "] = "Range ",
["Distância em que a defesa acha monstros"] = "Distance at which the defense finds enemies",
["Efeitos ativos"] = "Active effects",
["Nenhum ainda — use as escolhas de wave"] = "None yet — use your wave choices",
["Posições no muro"] = "Wall slots",
["Esquerda"] = "Left",
["Direita"] = "Right",
["Vazia"] = "Empty",
["Posição "] = "",
["esquerda"] = "Left",
["direita"] = "Right",
[" do muro: "] = " wall slot: ",
[" construída"] = " built",
["Posição livre: as cartas 'Adicionar balista' e 'Adicionar trabuco' do fim da wave constroem aqui"] = "Free slot: the end-of-wave cards 'Add ballista' and 'Add trebuchet' build here",
["Ativa (esquerda e direita)"] = "Active (left and right)",
["Ativa (direita)"] = "Active (right)",
["Ativa (esquerda)"] = "Active (left)",
["Não construída — as duas posições do muro já estão ocupadas."] = "Not built — both wall slots are already taken.",
["Não construída — escolha a carta '"] = "Not built — pick the '",
["' no fim de uma wave."] = "' card at the end of a wave.",
["Melhorias com pontos da Forja"] = "Upgrades (Forge Points)",
["Efeitos (1 escolha por wave)"] = "Effects (1 choice per wave)",
["Na Balista cada acerto sorteia os efeitos, inclusive o ricochete do virote."] = "On the Ballista, effects roll on every hit, including the bolt's ricochet.",
["Na Catapulta os efeitos valem para todos os monstros da explosão; os estilhaços saem uma vez por pedra."] = "On the Catapult, effects roll for every enemy caught in the blast; shrapnel rolls once per rock.",
["ponto"] = "point",
["pontos"] = "points",
["escolha"] = "choice",
["escolhas"] = "choices",
[" para usar"] = " available",
["{0} {1} para usar"] = "{0} {1} available",
["Nv {0}/{1}"] = "Lv {0}/{1}",
["pontos da Forja"] = "Forge Points",
["escolhas de efeito"] = "Effect Choices",
["Chance {0}% » {1}%"] = "Chance {0}% » {1}%",
["Chance {0}%"] = "Chance {0}%",
["MÁX"] = "MAX",
["Faltam {0} {1}"] = "Need {0} more {1}",
["Comprando..."] = "Buying...",
["Comprar o próximo nível"] = "Buy the next level",
["Nível máximo."] = "Max level.",
["Próximo nível: 1 ponto da Forja."] = "Next level: 1 Forge Point.",
["Próximo nível: {0} pontos da Forja."] = "Next level: {0} Forge Points.",
["% de dano por nível, por cima das cartas do jogo (ex.: Balista Melhorada)."] = "% damage per level, on top of the game's cards (e.g. Improved Ballista).",
["% de velocidade de ataque por nível: recarga e mira mais curtas e animação de disparo mais rápida."] = "% attack speed per level: shorter reload and aim time, and a faster firing animation.",
["% por nível: o virote chega antes no alvo."] = "% per level: the bolt reaches the target sooner.",
["% por nível: a pedra chega antes e cai no mesmo ponto (erra menos monstros andando)."] = "% per level: the rock arrives sooner and lands on the same spot (misses fewer moving enemies).",
["+1 virote por disparo por nível, num leque na horizontal, com "] = "+1 bolt per shot per level, in a horizontal fan, dealing ",
["+1 pedra por disparo por nível, em outros monstros no alcance (ou em volta do alvo), com "] = "+1 rock per shot per level, at other enemies in range (or around the target), dealing ",
["% do dano."] = "% damage.",
["% no raio da explosão por nível."] = "% blast radius per level.",
["% de alcance por nível: a defesa acha e atira em monstros mais longe."] = "% range per level: the defense finds and shoots enemies further away.",
["O virote pula para o monstro mais perto até "] = "The bolt jumps to the nearest enemy within ",
[" m com "] = " m, dealing ",
["A pedra pula para o monstro mais perto até "] = "The rock bounces to the nearest enemy within ",
[" m e explode de novo com "] = " m and explodes again, dealing ",
["Congela o monstro por "] = "Freezes the enemy for ",
[" s (efeito de gelo do jogo; metade em elites e chefes)."] = " s (the game's freeze effect; half on elites and bosses).",
["Queima por "] = "Burns for ",
[" s: "] = " s: ",
["% do dano do acerto a cada segundo (fogo do jogo)."] = "% of the hit damage every second (the game's fire).",
["Envenena por "] = "Poisons for ",
["% do dano do acerto a cada segundo (veneno do jogo)."] = "% of the hit damage every second (the game's poison).",
["Deixa o monstro "] = "Makes the enemy ",
["% mais lento por "] = "% slower for ",
[" s (metade do tempo em elites e chefes)."] = " s (half as long on elites and bosses).",
["O acerto explode (bola de fogo do jogo) com "] = "The hit explodes (the game's fireball), dealing ",
["% do dano num raio de "] = "% damage in a radius of ",
["{0} estilhaços caem em volta da explosão, cada um explodindo com {1}% do dano (raio {2} m)."] = "{0} shrapnel rocks land around the blast, each exploding for {1}% damage (radius {2} m).",
["{0} Chance: +{1}% por nível (agora {2}%)."] = "{0} Chance: +{1}% per level (now {2}%).",
["Forja nível {0}: +{1} {2} da Forja para as Defesas do Muro "] = "Forge level {0}: +{1} Forge {2} for the Wall Defenses ",
["({0} para gastar)"] = "({0} to spend)",
["Wave {0} sobrevivida: +{1} {2} de efeito para as Defesas do Muro "] = "Wave {0} survived: +{1} effect {2} for the Wall Defenses ",
["({0} para usar)"] = "({0} to spend)",
["As Defesas do Muro só podem ser melhoradas durante a partida."] = "The Wall Defenses can only be upgraded during a run.",
[" já está no máximo."] = " is already maxed.",
["Faltam {0} pontos da Forja."] = "Need {0} more Forge Points.",
["{0}: {1} {2} Nv {3}"] = "{0}: {1} {2} Lv {3}",
[" não existe "] = " isn't available ",
["Faltam {0} escolhas de efeito (ganhe sobrevivendo às waves)."] = "Need {0} more Effect Choices (earn them by surviving waves).",
["Jogador"] = "Player",
["O host usa outra versão do SiegeUpgrades (a sua: v1.1.0). A janela das defesas fica desligada."] = "The host uses a different version of SiegeUpgrades (yours: v1.1.0). The defense window is disabled.",
["Um jogador tem outra versão do SiegeUpgrades (v"] = "A player has a different version of SiegeUpgrades (v",
["). Atualizem o mod."] = "). Please update the mod.",
["SiegeUpgrades: {0} v{1} carregado (protocolo {2})."] = "SiegeUpgrades: {0} v{1} loaded (protocol {2}).",
["{0}: caixa de interação {1} (centro {2}), {3} modelos."] = "{0}: interaction box {1} (center {2}), {3} models.",
[": modelos sem leitura; destaque por cor em vez do contorno."] = ": models not readable; using a color highlight instead of the outline.",
["SiegeUpgrades: contorno da defesa indisponível: "] = "SiegeUpgrades: defense outline unavailable: ",
["SiegeUpgrades: erro ao preparar as defesas: "] = "SiegeUpgrades: error preparing the defenses: ",
["interação preparada em "] = "interaction set up on ",
["SiegeUpgrades: erro na mira alternativa: "] = "SiegeUpgrades: error in the fallback aim: ",
["SiegeUpgrades: não deu para escalar a explosão: "] = "SiegeUpgrades: couldn't scale the explosion: ",
["SiegeUpgrades: input preso em GeneralMenu depois de um menu do jogo; voltando para o jogo."] = "SiegeUpgrades: input stuck in GeneralMenu after a game menu; returning to gameplay.",
["SiegeUpgrades: não consegui ajustar o menu do jogo: "] = "SiegeUpgrades: couldn't adjust the game menu: ",
["janela das defesas"] = "defense window",
["fonte do jogo"] = "game font",
["SiegeUpgrades: erro na interface ("] = "SiegeUpgrades: UI error (",
["SiegeUpgrades: não deu para tocar o som da interface: "] = "SiegeUpgrades: couldn't play the UI sound: ",
["SiegeUpgrades: erro no disparo melhorado: "] = "SiegeUpgrades: error in the upgraded shot: ",
["{0} disparou: dano {1:0.#}, velocidade {2:0.#} m/s, extras {3}."] = "{0} fired: damage {1:0.#}, speed {2:0.#} m/s, extras {3}.",
["SiegeUpgrades: partida nova ({0} balistas, {1} catapultas). "] = "SiegeUpgrades: new run ({0} ballistas, {1} catapults). ",
["Pontos da Forja {0}, escolhas de efeito {1}."] = "Forge Points {0}, Effect Choices {1}.",
["SiegeUpgrades: Forja nível {0} (+{1} pontos, {2} disponíveis)."] = "SiegeUpgrades: Forge level {0} (+{1} points, {2} available).",
["SiegeUpgrades: wave {0} sobrevivida (+{1} escolhas, {2} disponíveis)."] = "SiegeUpgrades: wave {0} survived (+{1} choices, {2} available).",
["SiegeUpgrades: {0} comprou {1} Nv {2} para a {3} ({4} pontos; {5} sobrando)."] = "SiegeUpgrades: {0} bought {1} Lv {2} for the {3} ({4} points; {5} left).",
["SiegeUpgrades: {0} comprou o efeito {1} Nv {2} para a {3} ({4} escolhas; {5} sobrando)."] = "SiegeUpgrades: {0} bought effect {1} Lv {2} for the {3} ({4} choices; {5} left).",
["SiegeUpgrades: o host não confirmou o protocolo (outra versão do mod). A janela das defesas fica desligada."] = "SiegeUpgrades: the host didn't confirm the protocol (different mod version). The defense window is disabled.",
["SiegeUpgrades: erro nos efeitos no acerto: "] = "SiegeUpgrades: error in on-hit effects: ",
["{0}: {1} em {2} ({3:0.#} s, valor {4:0.##})."] = "{0}: {1} on {2} ({3:0.#} s, value {4:0.##}).",
["{0}: ricochete para {1} ({2:0.#} de dano)."] = "{0}: ricochet to {1} ({2:0.#} damage).",
["Balista: virote explosivo ({0:0.#} de dano, raio {1:0.#} m)."] = "Ballista: explosive bolt ({0:0.#} damage, radius {1:0.#} m).",
["Catapulta: {0} estilhaços ({1:0.#} de dano cada, raio {2:0.#} m)."] = "Catapult: {0} shrapnel ({1:0.#} damage each, radius {2:0.#} m).",
["{0}: recarga {1:0.##} s, mira {2:0.##} s, projétil {3:0.#} m/s, "] = "{0}: reload {1:0.##} s, aim {2:0.##} s, projectile {3:0.#} m/s, ",
["alcance {0:0.#} m, "] = "range {0:0.#} m, ",
["explosão {0:0.#} m, animador {1}."] = "explosion {0:0.#} m, animator {1}.",
["nenhum"] = "none",
["{0}: ciclo das animações {1:0.###} s (recarga original {2:0.##} s)."] = "{0}: animation cycle {1:0.###} s (original reload {2:0.##} s).",
["SiegeUpgrades: mensagem "] = "SiegeUpgrades: message ",
[" com formato diferente (outra versão do mod?), ignorada: "] = " has a different format (different mod version?), ignored: ",
["SiegeUpgrades: conexão {0} usa outra versão do mod (v{1}, protocolo {2}; "] = "SiegeUpgrades: connection {0} uses a different mod version (v{1}, protocol {2}; ",
["este host: v{0}, protocolo {1}). A janela das defesas fica desligada para esse jogador."] = "this host: v{0}, protocol {1}). The defense window is disabled for that player.",
["SiegeUpgrades: conexão {0} tem o mod (v{1}, protocolo {2})."] = "SiegeUpgrades: connection {0} has the mod (v{1}, protocol {2}).",
["SiegeUpgrades: erro no hello de um jogador: "] = "SiegeUpgrades: error in a player's hello: ",
["SiegeUpgrades: erro ao mostrar aviso: "] = "SiegeUpgrades: error showing a notice: ",
["SiegeUpgrades: o host confirmou o protocolo {0}."] = "SiegeUpgrades: the host confirmed protocol {0}.",
["SiegeUpgrades: o id {0} da mensagem {1} já tinha handler em {2} (colisão com outro mod?)."] = "SiegeUpgrades: id {0} of message {1} already had a handler on {2} (collision with another mod?).",
["SiegeUpgrades: erro ao ler o estado: "] = "SiegeUpgrades: error reading the state: ",
["SiegeUpgrades: erro na compra: "] = "SiegeUpgrades: error in purchase: ",
["SiegeUpgrades: falha ao registrar handlers do cliente: "] = "SiegeUpgrades: failed to register client handlers: ",
["SiegeUpgrades: falha ao registrar handlers do servidor: "] = "SiegeUpgrades: failed to register server handlers: "
};
private static readonly Dictionary<string, string> StatLabels = new Dictionary<string, string>
{
["Damage"] = "Damage",
["AttackSpeed"] = "Attack speed",
["ProjectileSpeed"] = "Projectile speed",
["ExtraProjectiles"] = "Extra projectiles",
["ExplosionArea"] = "Explosion area",
["Range"] = "Range"
};
private static readonly Dictionary<string, string> EffectLabels = new Dictionary<string, string>
{
["Ricochet"] = "Ricochet",
["Freeze"] = "Freeze",
["Burn"] = "Fire",
["Poison"] = "Poison",
["Slow"] = "Slow",
["Explosion"] = "Explosive bolt / Shrapnel"
};
public static readonly Dictionary<string, string> Config = BuildConfig();
private static Dictionary<string, string> BuildConfig()
{
Dictionary<string, string> dictionary = new Dictionary<string, string>
{
["General.Enabled"] = "Turns the mod on/off. On the host it disables the upgrades (defenses go back to normal); on a client it disables the window.",
["General.ShowNotices"] = "Shows on-screen notices (Forge Point earned, Effect Choice earned, purchases). Visual only; each player chooses.",
["Currencies.ForgePointsPerLevel"] = "Forge Points earned for each new Forge level in the run (the Forge starts at level 1 = 0 points).",
["Currencies.EffectChoicesPerWave"] = "Effect Choices earned for each wave survived (completed).",
["Interaction.InteractDistance"] = "Maximum distance (m) to aim at a built defense and press E. The game uses 5 m for normal objects; the defenses sit high on the wall, so the default is larger.",
["Interaction.LookAtFallback"] = "If the game's crosshair doesn't pick up the defense (another object in front), pressing E while looking at it also opens the window when the crosshair is on nothing.",
["Interaction.Outline"] = "Green outline (same as the game's) on the defense when the crosshair is on it.",
["Damage.PercentPerLevel"] = "Damage: Extra damage per level (%). Multiplies the defense's damage on top of the game's cards (e.g. Improved Ballista).",
["AttackSpeed.PercentPerLevel"] = "Attack speed: Extra attack speed per level (%): divides reload and aim time and speeds up the firing animation when needed.",
["AttackSpeed.MaxAnimatorSpeed"] = "Cap on how much the attack animation can speed up (1 = never speeds up).",
["ProjectileSpeed.PercentPerLevel"] = "Projectile speed: Extra projectile speed per level (%). The Catapult rock still lands on the same spot, it just arrives sooner.",
["ExtraProjectiles.MaxLevel"] = "Extra projectiles: max level (0 = off). Each level gives +1 projectile per shot (Ballista: horizontal fan; Catapult: rocks on other enemies or around the target).",
["ExtraProjectiles.Costs"] = "Forge Points for each level, comma-separated (if values are missing, the last one repeats).",
["ExtraProjectiles.DamagePercent"] = "Damage of each extra projectile (% of the shot's damage).",
["ExtraProjectiles.BallistaSpreadDegrees"] = "Spread (degrees) between the bolts in the Ballista's fan.",
["ExtraProjectiles.CatapultScatterRadius"] = "With no other enemies in range, the extra rocks land around the target up to this distance (m).",
["ExplosionArea.PercentPerLevel"] = "Explosion area: Extra Catapult blast radius per level (%).",
["ExplosionArea.ScaleExplosionVfx"] = "Scales up the explosion visual along with the area (only for players with the mod; others see the normal size).",
["Range.PercentPerLevel"] = "Range: Extra range per level (%): the defense finds and shoots enemies further away (by default the Ballista has 50 m and the Catapult 100 m).",
["Ricochet.DamagePercent"] = "Ricochet: Ricochet damage (% of the shot's damage).",
["Ricochet.Range"] = "Ricochet: Range (m) to find the next enemy.",
["Freeze.Seconds"] = "Freeze: Seconds frozen (the player's freeze uses 5 s; shorter here so it doesn't stall the whole wave).",
["Burn.DamagePercentPerSecond"] = "Fire: Damage per second (% of the hit damage; the game uses 10%).",
["Burn.Seconds"] = "Fire: Seconds burning (the game uses 10 s).",
["Poison.DamagePercentPerSecond"] = "Poison: Damage per second (% of the hit damage; the game uses 10%).",
["Poison.Seconds"] = "Poison: Seconds poisoned (the game uses 10 s).",
["Slow.SlowPercent"] = "Slow: How much slower (%; the game uses 50%).",
["Slow.Seconds"] = "Slow: Seconds slowed (the game uses 10 s).",
["Explosion.DamagePercent"] = "Explosive bolt / Shrapnel: Explosion damage (% of the hit damage).",
["Explosion.Radius"] = "Explosive bolt / Shrapnel: Radius (m) of the explosion (Ballista) and of each shrapnel rock (Catapult).",
["Explosion.ShrapnelCount"] = "Catapult: how many shrapnel rocks come out of the explosion (each explodes with the damage and radius above).",
["Effects.EliteBossDurationMultiplier"] = "Freeze and slow on elites and bosses last this fraction as long (0.5 = half).",
["Debug.StartForgePoints"] = "Testing: extra Forge Points at the start of each run.",
["Debug.StartEffectChoices"] = "Testing: extra Effect Choices at the start of each run.",
["Debug.VerboseLog"] = "Logs every upgraded shot, applied effect and purchase."
};
foreach (KeyValuePair<string, string> statLabel in StatLabels)
{
if (statLabel.Key != "ExtraProjectiles")
{
dictionary[statLabel.Key + ".MaxLevel"] = statLabel.Value + ": max level (0 = off).";
dictionary[statLabel.Key + ".Cost"] = statLabel.Value + ": Forge Points per level.";
}
}
foreach (KeyValuePair<string, string> effectLabel in EffectLabels)
{
dictionary[effectLabel.Key + ".ChancePerLevel"] = effectLabel.Value + ": chance per level (%) on each hit.";
dictionary[effectLabel.Key + ".MaxLevel"] = effectLabel.Value + ": max level (0 = off).";
dictionary[effectLabel.Key + ".Cost"] = effectLabel.Value + ": Effect Choices per level.";
}
return dictionary;
}
}
internal static class PluginInfo
{
public const string Version = "1.0.0";
}
}