Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of FarewellSteelSoul v1.1.0
FarewellSteelSoul.dll
Decompiled 5 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TeamCherry.Localization; using UnityEngine; using UnityEngine.SceneManagement; [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("FarewellSteelSoul")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+470db5cb2cc21ddd7bccb1e3737aef4fecd19f94")] [assembly: AssemblyProduct("FarewellSteelSoul")] [assembly: AssemblyTitle("FarewellSteelSoul")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/EchoLinger/Farewell-Steel-Soul")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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 BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace FarewellSteelSoul { [HarmonyPatch] [BepInPlugin("io.github.EchoLinger.FarewellSteelSoul", "FarewellSteelSoul", "1.1.0")] public class FarewellSteelSoul : BaseUnityPlugin { [Serializable] public class I18n { public string QuestName = "钢魂碎档"; public string CrestName = "碎档者"; public string CrestDesc = "在尝试完成这项壮举的过程中,你证明了自己的勇气"; public string CrestEquip = "愿你的灵魂最终得以安息"; public static string ModName => "Farewell Steel Soul"; public static string Author => "HuangYunOCN\nEchoLinger"; } public static class I18nKeys { public const string QuestName = "QuestName"; public const string CrestName = "CrestName"; public const string CrestDesc = "CrestDesc"; public const string CrestEquip = "CrestEquip"; public const string ModName = "ModName"; public const string Author = "Author"; } [HarmonyPatch(typeof(GameManager), "PlayerDead")] public static class PatchPlayerDead { [CompilerGenerated] private sealed class <Postfix>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator __result; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Postfix>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = __result; <>1__state = 1; return true; case 1: <>1__state = -1; if (IsPermaDeath) { ((MonoBehaviour)Instance).StartCoroutine(Chain()); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPrefix] public static void Prefix(GameManager __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 IsPermaDeath = (int)__instance.playerData.permadeathMode == 2; if (IsPermaDeath && ShowJournal.Value) { ShowJournalMsg(); } } [IteratorStateMachine(typeof(<Postfix>d__1))] [HarmonyPostfix] public static IEnumerator Postfix(IEnumerator __result) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Postfix>d__1(0) { __result = __result }; } } [CompilerGenerated] private sealed class <>c__DisplayClass25_0 { public bool completed; internal void <ShowCrestMsg>b__1() { completed = true; } internal bool <ShowCrestMsg>b__2() { return completed; } } [CompilerGenerated] private sealed class <>c__DisplayClass43_0 { public PlayMakerFSM fsm; internal bool <Chain>b__0() { bool flag = (Object)(object)fsm == (Object)null; bool flag2; if (!flag) { if (fsm != null) { string activeStateName = fsm.ActiveStateName; if (activeStateName == "End" || activeStateName == "Ended") { flag2 = true; goto IL_0044; } } flag2 = false; goto IL_0044; } goto IL_0046; IL_0046: return flag; IL_0044: flag = flag2; goto IL_0046; } } [CompilerGenerated] private sealed class <>c__DisplayClass47_0 { public bool completed; internal void <ShowQuestMsg>b__0() { completed = true; } internal bool <ShowQuestMsg>b__1() { return completed; } } [CompilerGenerated] private sealed class <Chain>d__43 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <Chain>d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (ShowJournal.Value) { <>c__DisplayClass43_0 CS$<>8__locals0 = new <>c__DisplayClass43_0(); GameObject journalUpdateMessage = EnemyJournalManager._instance.journalUpdateMessage; CS$<>8__locals0.fsm = PlayMakerFSM.FindFsmOnGameObject(journalUpdateMessage, "Journal Msg"); <>2__current = (object)new WaitUntil((Func<bool>)delegate { bool flag = (Object)(object)CS$<>8__locals0.fsm == (Object)null; bool flag2; if (!flag) { if (CS$<>8__locals0.fsm != null) { string activeStateName = CS$<>8__locals0.fsm.ActiveStateName; if (activeStateName == "End" || activeStateName == "Ended") { flag2 = true; goto IL_0044; } } flag2 = false; goto IL_0044; } goto IL_0046; IL_0046: return flag; IL_0044: flag = flag2; goto IL_0046; }); <>1__state = 1; return true; } goto IL_0087; case 1: <>1__state = -1; goto IL_0087; case 2: <>1__state = -1; <>2__current = ShowQuestMsg(); <>1__state = 3; return true; case 3: <>1__state = -1; goto IL_00c9; case 4: <>1__state = -1; <>2__current = ShowCrestMsg(); <>1__state = 5; return true; case 5: <>1__state = -1; goto IL_010b; case 6: { <>1__state = -1; Scene activeScene = SceneManager.GetActiveScene(); GameManager.ReportUnload(((Scene)(ref activeScene)).name); GameManager.instance.LoadScene("End_Credits"); break; } IL_0087: if (ShowQuest.Value) { <>2__current = _waitForSeconds1; <>1__state = 2; return true; } goto IL_00c9; IL_010b: if (ShowCredits.Value) { <>2__current = _waitForSeconds2; <>1__state = 6; return true; } IsPermaDeath = false; GameManager.instance.LoadScene("PermaDeath"); break; IL_00c9: if (ShowCrest.Value) { <>2__current = _waitForSeconds2; <>1__state = 4; return true; } goto IL_010b; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ModSequence>d__23 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CreditsHelper creditsHelper; private int <i>5__2; private CreditsSectionBase <creditsSection>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ModSequence>d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <creditsSection>5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; creditsHelper.screenFader.AlphaSelf = 1f; if ((Object)(object)creditsHelper.silentSnapshot != (Object)null) { creditsHelper.silentSnapshot.TransitionTo(0f); } creditsHelper.musicSource.Play(); InsertSection(creditsHelper); <i>5__2 = 0; goto IL_0238; case 1: <>1__state = -1; <>2__current = <creditsSection>5__3.Show(); <>1__state = 2; return true; case 2: <>1__state = -1; if (<i>5__2 >= creditsHelper.creditsSections.Count - 1 && (Object)(object)creditsHelper.silentSnapshot != (Object)null) { creditsHelper.silentSnapshot.TransitionTo(<creditsSection>5__3.FadeDownDuration + creditsHelper.timeBetweenScreens); } <>2__current = (object)new WaitForSeconds(creditsHelper.screenFader.FadeTo(1f, <creditsSection>5__3.FadeDownDuration, (AnimationCurve)null, false, (Action<bool>)null)); <>1__state = 3; return true; case 3: <>1__state = -1; ((Component)<creditsSection>5__3).gameObject.SetActive(false); <>2__current = (object)new WaitForSeconds(creditsHelper.timeBetweenScreens); <>1__state = 4; return true; case 4: { <>1__state = -1; <creditsSection>5__3 = null; int num = <i>5__2 + 1; <i>5__2 = num; goto IL_0238; } case 5: <>1__state = -1; creditsHelper.cutSceneHelper.nextSceneType = (NextScene)0; creditsHelper.cutSceneHelper.nextScene = "PermaDeath"; <>2__current = creditsHelper.cutSceneHelper.Skip(); <>1__state = 6; return true; case 6: { <>1__state = -1; GameCameras.instance.cameraController.IsBloomForced = false; return false; } IL_0238: if (<i>5__2 < creditsHelper.creditsSections.Count) { <creditsSection>5__3 = creditsHelper.creditsSections[<i>5__2]; ((Component)<creditsSection>5__3).gameObject.SetActive(true); if (<i>5__2 == 0 && (Object)(object)creditsHelper.musicSnapshot != (Object)null) { creditsHelper.musicSnapshot.TransitionTo(<creditsSection>5__3.FadeUpDuration); } <>2__current = (object)new WaitForSeconds(creditsHelper.screenFader.FadeTo(0f, <creditsSection>5__3.FadeUpDuration, (AnimationCurve)null, false, (Action<bool>)null)); <>1__state = 1; return true; } <>2__current = _waitForSeconds1; <>1__state = 5; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ShowCrestMsg>d__25 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShowCrestMsg>d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass25_0 CS$<>8__locals0 = new <>c__DisplayClass25_0 { completed = false }; GameObject val = AssetBundle.GetAllLoadedAssetBundles().First((AssetBundle b) => b.GetAllAssetNames().Contains("Assets/Prefabs/UI/Messages/Tool Crest UI Msg.prefab")).LoadAsset<GameObject>("Assets/Prefabs/UI/Messages/Tool Crest UI Msg.prefab"); ToolCrestUIMsg.Spawn(Crest, val, (Action)delegate { CS$<>8__locals0.completed = true; }); <>2__current = (object)new WaitUntil((Func<bool>)(() => CS$<>8__locals0.completed)); <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <ShowQuestMsg>d__47 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ShowQuestMsg>d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>c__DisplayClass47_0 CS$<>8__locals0 = new <>c__DisplayClass47_0 { completed = false }; QuestManager.ShowQuestCompleted((FullQuestBase)(object)Quest, (Action)delegate { CS$<>8__locals0.completed = true; }); <>2__current = (object)new WaitUntil((Func<bool>)(() => CS$<>8__locals0.completed)); <>1__state = 1; return true; } case 1: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static readonly WaitForSeconds StageGap = new WaitForSeconds(2f); private static ToolCrest? _crest; private static Quest? _quest; private static Texture[]? _animations; private static Sprite? _credits; private static ConfigEntry<bool> ShowJournal; private static ConfigEntry<bool> ShowQuest; private static ConfigEntry<bool> ShowCrest; private static ConfigEntry<bool> ShowCredits; private static ManualLogSource Log; private static FarewellSteelSoul Instance; private static LanguageCode _currentLanguage = (LanguageCode)199; private static I18n _i18n = new I18n(); private static readonly (int oldId, int newId)?[] DefIds = new(int, int)?[24]; private static readonly WaitForSeconds _waitForSeconds1 = new WaitForSeconds(1f); private static readonly WaitForSeconds _waitForSeconds2 = new WaitForSeconds(2f); private static bool IsPermaDeath; public const string Id = "io.github.EchoLinger.FarewellSteelSoul"; private static ToolCrest Crest { get { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_crest != (Object)null) { return _crest; } ToolCrest obj = Object.Instantiate<ToolCrest>(ToolItemManager.GetCrestByName("Warrior")); obj.crestSprite = LoadSprite("crest.png"); obj.displayName = I18nString("CrestName"); obj.getPromptDesc = I18nString("CrestDesc"); obj.equipText = I18nString("CrestEquip"); _crest = obj; return _crest; } } private static Quest Quest { get { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_quest != (Object)null) { return _quest; } Quest obj = ScriptableObject.CreateInstance<Quest>(); obj.questType = ScriptableObject.CreateInstance<QuestType>(); ((BasicQuestBase)obj).displayName = I18nString("QuestName"); Sprite largeIcon = LoadSprite("quest.png"); obj.questType.largeIcon = largeIcon; _quest = obj; return _quest; } } private static Texture[] Animations { get { if (_animations != null) { return _animations; } _animations = (Texture[]?)(object)new Texture[24]; for (int i = 1; i <= 17; i++) { Texture2D val = LoadTexture($"animation/journal_{i:D2}.png"); _animations[i - 1] = (Texture)(object)val; } for (int j = 1; j <= 7; j++) { Texture2D val2 = LoadTexture($"animation/journal_down_{j:D2}.png"); _animations[j + 16] = (Texture)(object)val2; } return _animations; } } private static Sprite Credits { get { if ((Object)(object)_credits != (Object)null) { return _credits; } _credits = LoadSprite("credits.png"); return _credits; } } private static string Location => Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location); public static string Name => "FarewellSteelSoul"; public static string Version => "1.1.0"; private static Texture2D LoadTexture(string spritePath) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown byte[] array = File.ReadAllBytes(Path.Combine(Location, "media", spritePath)); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; return val; } private static Sprite LoadSprite(string spritePath, Vector2? pivot = null, float? ppu = null) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Texture2D val = LoadTexture(spritePath); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), (Vector2)(((??)pivot) ?? new Vector2(0.5f, 0.5f)), ppu.GetValueOrDefault(100f)); } private void Register() { ShowJournal = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "ShowJournal", true, "Show journal updated message"); ShowQuest = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "ShowQuest", true, "Show wish granted message"); ShowCrest = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "ShowCrest", true, "Show crest bound message"); ShowCredits = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "ShowCredits", true, "Show ending credits"); } private static GameObject? FindDeepChildRecursive(GameObject parent, string name) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown foreach (Transform item in parent.transform) { Transform val = item; if (((Object)val).name == name) { return ((Component)val).gameObject; } GameObject val2 = FindDeepChildRecursive(((Component)val).gameObject, name); if ((Object)(object)val2 != (Object)null) { return val2; } } return null; } private static GameObject FindDeepChild(GameObject parent, string name) { GameObject val = FindDeepChildRecursive(parent, name); if (!((Object)(object)val != (Object)null)) { throw new Exception($"GameObject {name} not found among {parent}"); } return val; } private static void InsertSection(CreditsHelper creditsHelper) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) List<CreditsSectionBase> creditsSections = creditsHelper.creditsSections; GameObject val = Object.Instantiate<GameObject>(((Component)creditsSections[10]).gameObject, ((Component)creditsHelper).gameObject.transform); ((Object)val).name = "SaveFileBreak"; Object.Destroy((Object)(object)FindDeepChild(val, "Unity Technical Support")); Object.Destroy((Object)(object)FindDeepChild(val, "Knights of U")); Object.Destroy((Object)(object)FindDeepChild(val, "credits_plates__0002_THANKS")); Object.Destroy((Object)(object)FindDeepChild(val, "Thanks")); GameObject val2 = Object.Instantiate<GameObject>(FindDeepChild(((Component)creditsSections[5]).gameObject, "Dressing"), val.transform); ((Object)val2).name = "Author"; val2.transform.localPosition = new Vector3(0f - val2.transform.localPosition.x + 1f, val2.transform.localPosition.y - 1f, val2.transform.localPosition.z); val2.GetComponent<SetTextMeshProGameText>().Text = I18nString("ModName"); GameObject obj = FindDeepChild(val2, "NathAndJames"); ((Object)obj).name = "Authors"; obj.GetComponent<SetTextMeshProGameText>().Text = I18nString("Author"); GameObject obj2 = Object.Instantiate<GameObject>(FindDeepChild(((Component)creditsSections[2]).gameObject, "credits_plates_LACE"), FindDeepChild(val, "bg").transform); ((Object)obj2).name = "Icon"; obj2.GetComponent<SpriteRenderer>().sprite = Credits; creditsSections.Insert(0, val.GetComponent<CreditsSectionBase>()); } [IteratorStateMachine(typeof(<ModSequence>d__23))] private static IEnumerator ModSequence(CreditsHelper creditsHelper) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ModSequence>d__23(0) { creditsHelper = creditsHelper }; } [HarmonyPatch(typeof(CreditsHelper), "Sequence")] [HarmonyPostfix] public static IEnumerator ShowModCredits(IEnumerator __result, CreditsHelper __instance) { if (!IsPermaDeath) { return __result; } IsPermaDeath = false; return ModSequence(__instance); } [IteratorStateMachine(typeof(<ShowCrestMsg>d__25))] private static IEnumerator ShowCrestMsg() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShowCrestMsg>d__25(0); } private void Awake() { Log = ((BaseUnityPlugin)this).Logger; Instance = this; Register(); Harmony.CreateAndPatchAll(typeof(FarewellSteelSoul).Assembly, (string)null); Log.LogInfo((object)("Plugin " + Name + " (io.github.EchoLinger.FarewellSteelSoul) has loaded!")); } [HarmonyPatch(typeof(LocalizationProjectSettings), "OnSwitchedLanguage")] [HarmonyPostfix] public static void LoadI18n(LanguageCode newLang) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (newLang == _currentLanguage) { return; } try { _i18n = JsonUtility.FromJson<I18n>(File.ReadAllText(Path.Combine(Location, "i18n", $"{newLang}.json"), Encoding.UTF8)); _currentLanguage = newLang; } catch (Exception ex) { Log.LogError((object)ex); } } [HarmonyPatch(typeof(LocalisedString), "ToString", new Type[] { typeof(bool) })] [HarmonyPostfix] public static void PatchLocalisedString(ref LocalisedString __instance, ref string __result) { if (__instance.Sheet == "io.github.EchoLinger.FarewellSteelSoul") { __result = __instance.Key switch { "QuestName" => _i18n.QuestName, "CrestName" => _i18n.CrestName, "CrestDesc" => _i18n.CrestDesc, "CrestEquip" => _i18n.CrestEquip, "ModName" => I18n.ModName, "Author" => I18n.Author, _ => __result, }; } } private static LocalisedString I18nString(string key) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return new LocalisedString("io.github.EchoLinger.FarewellSteelSoul", key); } private static void ShowJournalMsg() { GameObject journalUpdateMessage = EnemyJournalManager._instance.journalUpdateMessage; journalUpdateMessage.SetActive(true); PlayMakerFSM obj = PlayMakerFSM.FindFsmOnGameObject(journalUpdateMessage, "Journal Msg"); FSMUtility.SetBool(obj, "Full", true); FSMUtility.SetBool(obj, "Should Recycle", true); } [HarmonyPatch(typeof(tk2dSpriteAnimator), "Play", new Type[] { typeof(tk2dSpriteAnimationClip) })] [HarmonyPrefix] public static void ReplaceAnimation(tk2dSpriteAnimationClip clip) { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Expected O, but got Unknown bool flag; if (clip != null) { string name = clip.name; if (name == "Journal Full" || name == "Journal Full Down") { flag = true; goto IL_002c; } } flag = false; goto IL_002c; IL_002c: if (!flag) { return; } bool flag2 = clip.name == "Journal Full Down"; tk2dSpriteAnimationFrame val = (flag2 ? clip.frames.First() : clip.frames.Last()); Vector3[] positions = val.spriteCollection.spriteDefinitions[val.spriteId].positions; for (int i = 0; i < clip.frames.Length; i++) { tk2dSpriteAnimationFrame val2 = clip.frames[i]; tk2dSpriteDefinition val3 = val2.spriteCollection.spriteDefinitions[val2.spriteId]; int num = (flag2 ? (i + 17) : i); if (IsPermaDeath) { if (!DefIds[num].HasValue) { tk2dSpriteDefinition val4 = JsonUtility.FromJson<tk2dSpriteDefinition>(JsonUtility.ToJson((object)val3)); val4.positions = positions; val4.uvs = (Vector2[])(object)new Vector2[4] { new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0f, 1f), new Vector2(1f, 1f) }; val4.materialInst = new Material(val3.materialInst) { mainTexture = Animations[num] }; val2.spriteCollection.spriteDefinitions = CollectionExtensions.AddToArray<tk2dSpriteDefinition>(val2.spriteCollection.spriteDefinitions, val4); int spriteId = val2.spriteId; int item = val2.spriteCollection.spriteDefinitions.Length - 1; DefIds[num] = (spriteId, item); } val2.spriteId = DefIds[num].Value.newId; } else if (DefIds[num].HasValue) { val2.spriteId = DefIds[num].Value.oldId; } } } [IteratorStateMachine(typeof(<Chain>d__43))] private static IEnumerator Chain() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <Chain>d__43(0); } [HarmonyPatch(typeof(GameManager), "LoadScene")] [HarmonyPrefix] public static bool PatchLoadScene(GameManager __instance, ref string destScene) { if (destScene == "PermaDeath") { return !IsPermaDeath; } return true; } [IteratorStateMachine(typeof(<ShowQuestMsg>d__47))] private static IEnumerator ShowQuestMsg() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ShowQuestMsg>d__47(0); } } }