using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using AutoInterrogation.Configuration; using AutoInterrogation.Localization; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using HarmonyLib; using IceBoxModLib.Config; using IceBoxModLib.Localization; using IceBoxModLib.UI; using Player.Minigame; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("AutoInterrogation")] [assembly: AssemblyDescription("Auto Interrogation mod for Roadside Research by Ice Box Studio")] [assembly: AssemblyCompany("Ice Box Studio")] [assembly: AssemblyProduct("AutoInterrogation")] [assembly: AssemblyCopyright("Copyright © 2026 Ice Box Studio All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("5a446a12-55a9-4082-af60-41099b6da873")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyVersion("1.0.0.0")] namespace AutoInterrogation { [BepInPlugin("IceBoxStudio.RoadsideResearch.AutoInterrogation", "AutoInterrogation", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class AutoInterrogation : BasePlugin { public static AutoInterrogation _Instance; private Harmony _harmony; private bool patchesApplied; public static AutoInterrogation Instance => _Instance; internal static ManualLogSource Log { get; private set; } public override void Load() { //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown _Instance = this; Log = ((BasePlugin)this).Log; bool flag = default(bool); try { Log.LogInfo((object)"============================================="); ManualLogSource log = Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(1, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("AutoInterrogation"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(LocalizationManager.Instance.GetLocalizedText("plugin.initializing")); } log.LogInfo(val); ManualLogSource log2 = Log; val = new BepInExInfoLogInterpolatedStringHandler(54, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(LocalizationManager.Instance.GetLocalizedText("plugin.author_prefix")); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Ice Box Studio(https://steamcommunity.com/id/ibox666/)"); } log2.LogInfo(val); ConfigManager.Initialize(((BasePlugin)this).Config); ApplyPatches(); ManualLogSource log3 = Log; val = new BepInExInfoLogInterpolatedStringHandler(1, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("AutoInterrogation"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(LocalizationManager.Instance.GetLocalizedText("plugin.initialized")); } log3.LogInfo(val); Log.LogInfo((object)"============================================="); } catch (Exception ex) { ManualLogSource log4 = Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(9, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted("AutoInterrogation"); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" 初始化错误: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("\n"); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.StackTrace); } log4.LogError(val2); } } private void ApplyPatches() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (!patchesApplied) { try { _harmony = new Harmony("IceBoxStudio.RoadsideResearch.AutoInterrogation"); _harmony.PatchAll(); patchesApplied = true; return; } catch (Exception ex) { ManualLogSource log = Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(10, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("AutoInterrogation"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" 应用补丁错误: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\n"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.StackTrace); } log.LogError(val); return; } } Log.LogInfo((object)LocalizationManager.Instance.GetLocalizedText("plugin.patches_skipped")); } } public static class PluginInfo { public const string PLUGIN_GUID = "IceBoxStudio.RoadsideResearch.AutoInterrogation"; public const string PLUGIN_NAME = "AutoInterrogation"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace AutoInterrogation.Patches { [HarmonyPatch(typeof(MinigameController), "RpcStartMinigame")] internal static class InterrogationMinigamePatch { private static void Postfix(MinigameController __instance, MiniGameType minigame) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) ConfigManager instance = ConfigManager.Instance; if (instance == null || !instance.ShouldSkipInterrogationMinigame(minigame)) { return; } ManualLogSource log = AutoInterrogation.Log; if (log != null) { bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(15, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("AutoInterrogation"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] 已自动跳过盘问小游戏: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(minigame); } log.LogInfo(val); } __instance.EndMinigame(true, true); ModNotification.Show(GetSkippedNotificationMessage(minigame), 4f, (Color?)null); } private static string GetSkippedNotificationMessage(MiniGameType minigame) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown string text = (int)minigame switch { 0 => "minigame.breathing", 3 => "minigame.farting", 4 => "minigame.blinking", _ => ((object)(MiniGameType)(ref minigame)).ToString(), }; string text2 = ((text == ((object)(MiniGameType)(ref minigame)).ToString()) ? ((object)(MiniGameType)(ref minigame)).ToString() : LocalizationManager.Instance.GetLocalizedText(text)); return LocalizationManager.Instance.GetLocalizedText("notification.interrogation_minigame_skipped", text2); } } } namespace AutoInterrogation.Localization { public static class LocalizationHelper { public static Dictionary GetDefaultTranslations(string language) { Dictionary dictionary = new Dictionary(); switch (language) { case "简体中文": dictionary.Add("plugin.initializing", "开始初始化..."); dictionary.Add("plugin.author_prefix", "作者:"); dictionary.Add("plugin.initialized", "初始化成功!"); dictionary.Add("plugin.patches_skipped", "补丁已应用,跳过..."); dictionary.Add("config.enable_auto_skip_interrogation_minigames.desc", "启用自动跳过盘问小游戏功能"); dictionary.Add("config.skip_breathing_minigame.desc", "是否自动跳过呼吸盘问小游戏"); dictionary.Add("config.skip_farting_minigame.desc", "是否自动跳过放屁盘问小游戏"); dictionary.Add("config.skip_blinking_minigame.desc", "是否自动跳过眨眼盘问小游戏"); dictionary.Add("notification.interrogation_minigame_skipped", "已自动跳过盘问小游戏:{0}"); dictionary.Add("minigame.breathing", "呼吸"); dictionary.Add("minigame.farting", "放屁"); dictionary.Add("minigame.blinking", "眨眼"); break; case "繁體中文": dictionary.Add("plugin.initializing", "開始初始化..."); dictionary.Add("plugin.author_prefix", "作者:"); dictionary.Add("plugin.initialized", "初始化成功!"); dictionary.Add("plugin.patches_skipped", "補丁已應用,跳過..."); dictionary.Add("config.enable_auto_skip_interrogation_minigames.desc", "啟用自動跳過盤問小遊戲功能"); dictionary.Add("config.skip_breathing_minigame.desc", "是否自動跳過呼吸盤問小遊戲"); dictionary.Add("config.skip_farting_minigame.desc", "是否自動跳過放屁盤問小遊戲"); dictionary.Add("config.skip_blinking_minigame.desc", "是否自動跳過眨眼盤問小遊戲"); dictionary.Add("notification.interrogation_minigame_skipped", "已自動跳過盤問小遊戲:{0}"); dictionary.Add("minigame.breathing", "呼吸"); dictionary.Add("minigame.farting", "放屁"); dictionary.Add("minigame.blinking", "眨眼"); break; case "English": dictionary.Add("plugin.initializing", "Starting initialization..."); dictionary.Add("plugin.author_prefix", "Author: "); dictionary.Add("plugin.initialized", "Initialization successful!"); dictionary.Add("plugin.patches_skipped", "Patches already applied, skipping..."); dictionary.Add("config.enable_auto_skip_interrogation_minigames.desc", "Enable automatic skip interrogation minigames feature"); dictionary.Add("config.skip_breathing_minigame.desc", "Whether to automatically skip the breathing interrogation minigame"); dictionary.Add("config.skip_farting_minigame.desc", "Whether to automatically skip the farting interrogation minigame"); dictionary.Add("config.skip_blinking_minigame.desc", "Whether to automatically skip the blinking interrogation minigame"); dictionary.Add("notification.interrogation_minigame_skipped", "Automatically skipped interrogation minigame: {0}"); dictionary.Add("minigame.breathing", "Breathing"); dictionary.Add("minigame.farting", "Farting"); dictionary.Add("minigame.blinking", "Blinking"); break; case "日本語": dictionary.Add("plugin.initializing", "初期化中..."); dictionary.Add("plugin.author_prefix", "作者:"); dictionary.Add("plugin.initialized", "初期化に成功しました!"); dictionary.Add("plugin.patches_skipped", "パッチは既に適用されています。スキップします..."); dictionary.Add("config.enable_auto_skip_interrogation_minigames.desc", "尋問ミニゲームの自動スキップ機能を有効にする"); dictionary.Add("config.skip_breathing_minigame.desc", "呼吸の尋問ミニゲームを自動でスキップするかどうか"); dictionary.Add("config.skip_farting_minigame.desc", "オナラの尋問ミニゲームを自動でスキップするかどうか"); dictionary.Add("config.skip_blinking_minigame.desc", "瞬きの尋問ミニゲームを自動でスキップするかどうか"); dictionary.Add("notification.interrogation_minigame_skipped", "尋問ミニゲームを自動でスキップしました:{0}"); dictionary.Add("minigame.breathing", "呼吸"); dictionary.Add("minigame.farting", "オナラ"); dictionary.Add("minigame.blinking", "瞬き"); break; } return dictionary; } } public class LocalizationManager { private static LocalizationManager _instance; private readonly ModLocalizationService _service; public static readonly string[] SupportedLanguages = new string[4] { "简体中文", "繁體中文", "English", "日本語" }; public static LocalizationManager Instance => _instance ?? (_instance = new LocalizationManager()); private LocalizationManager() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown _service = new ModLocalizationService((IEnumerable)SupportedLanguages, "English"); Initialize(); } public void Initialize() { string[] supportedLanguages = SupportedLanguages; foreach (string text in supportedLanguages) { Dictionary defaultTranslations = LocalizationHelper.GetDefaultTranslations(text); if (defaultTranslations != null && defaultTranslations.Count > 0) { _service.AddTranslations(text, defaultTranslations); } } } public string GetLocalizedText(string key, params object[] args) { return _service.GetText(key, args); } } } namespace AutoInterrogation.Configuration { public class ConfigManager : ModConfigBase { private static ConfigManager _instance; public ConfigEntry EnableAutoSkipInterrogationMinigames { get; private set; } public ConfigEntry SkipBreathingMinigame { get; private set; } public ConfigEntry SkipFartingMinigame { get; private set; } public ConfigEntry SkipBlinkingMinigame { get; private set; } public static ConfigManager Instance => _instance; private ConfigManager(ConfigFile configFile) : base(configFile) { InitializeDefaultConfigs(); } public static void Initialize(ConfigFile configFile) { if (_instance == null) { _instance = new ConfigManager(configFile); } } private void InitializeDefaultConfigs() { EnableAutoSkipInterrogationMinigames = ((ModConfigBase)this).RegisterBool("General", "EnableAutoSkipInterrogationMinigames", GetLocalizedDescription("config.enable_auto_skip_interrogation_minigames.desc"), true); SkipBreathingMinigame = ((ModConfigBase)this).RegisterBool("Minigames", "SkipBreathingMinigame", GetLocalizedDescription("config.skip_breathing_minigame.desc"), true); SkipFartingMinigame = ((ModConfigBase)this).RegisterBool("Minigames", "SkipFartingMinigame", GetLocalizedDescription("config.skip_farting_minigame.desc"), true); SkipBlinkingMinigame = ((ModConfigBase)this).RegisterBool("Minigames", "SkipBlinkingMinigame", GetLocalizedDescription("config.skip_blinking_minigame.desc"), true); } public bool ShouldSkipInterrogationMinigame(MiniGameType minigame) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected I4, but got Unknown if (EnableAutoSkipInterrogationMinigames == null || !EnableAutoSkipInterrogationMinigames.Value) { return false; } return (int)minigame switch { 0 => SkipBreathingMinigame != null && SkipBreathingMinigame.Value, 3 => SkipFartingMinigame != null && SkipFartingMinigame.Value, 4 => SkipBlinkingMinigame != null && SkipBlinkingMinigame.Value, _ => false, }; } private string GetLocalizedDescription(string key) { return LocalizationManager.Instance?.GetLocalizedText(key); } } }