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 NewGenRaces v1.1.0
NewGenRaces.dll
Decompiled a day agousing System; 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 BepInEx; using BepInEx.Configuration; using EntityStates; using HG.Reflection; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.RoR2; using R2API; using ReviveAPI; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using ShaderSwapper; using UnityEngine; using UnityEngine.AddressableAssets; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("NewGenRaces")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+040d4e6ebae57843f8c9a778bd0a85ce04e480cd")] [assembly: AssemblyProduct("NewGenRaces")] [assembly: AssemblyTitle("NewGenRaces")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace NewGenRaces { public class Artifact { public static string ArtifactName = "Artifact of Time"; public static string ArtifactDescription = "Upon dying, revive and add a penalty to the timer."; public static ArtifactDef ArtifactDef; public static bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef); public static Sprite ArtifactEnabledIcon => NewGenRaces.Assets.LoadAsset<Sprite>("ArtifactOfTime.png"); public static Sprite ArtifactDisabledIcon => NewGenRaces.Assets.LoadAsset<Sprite>("ArtifactOfTimeDisabled.png"); public static void Init() { CreateLang(); CreateArtifact(); } protected static void CreateArtifact() { ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>(); ArtifactDef.cachedName = "ARTIFACT_TIME"; ArtifactDef.nameToken = "ARTIFACT_TIME_NAME"; ArtifactDef.descriptionToken = "ARTIFACT_TIME_DESCRIPTION"; ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon; ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon; ContentAddition.AddArtifactDef(ArtifactDef); } protected static void CreateLang() { LanguageAPI.Add("ARTIFACT_TIME_NAME", ArtifactName); LanguageAPI.Add("ARTIFACT_TIME_DESCRIPTION", ArtifactDescription); } } public class Item { [CompilerGenerated] private static class <>O { public static hook_Init <0>__LunarItemOrEquipmentCostTypeHelper_RemoveTimelessCrown; } public static string ItemName = "Timeless Crown"; public static string ItemDescription = "Saved you from death, at the cost of time."; public static string ItemPickup = "You've met with a terrible fate, haven't you?"; public static string ItemLore = "Each time the newt left the slipstream, he saw the same planet in different points of it's life. For a creature who can travel to any point in time, getting an exact lock was difficult. The first time the newt had visited the planet, it was quiet. The next, it was covered in ruins. The third time the newt came to this planet, it seemed alive. A tall, red-robed figure was standing before him. The newt stared. The robed figure stared back. The newt gave a slight wave with it's only good hand. The robed figure shared the gesture, sensing no hostility.\n\nA tension formed in the newt's mind. A newt's connection to time allows it to see the past, present, and future all at the same time. And every path for this robed figure lead to ruin. He had seen many creatures who's future led to ruin, and he wondered if maybe this time, it could prevent it. Maybe by intervening, the newt could save this robed figure. He only had so much time before the sickness of being out of the slipstream would set in.\n\nThe newt shared visions of what the robed figure's brother would do. Images of war, spearheaded by constructs of their making. As the robed figure's face changed, the newt could feel fate shift. He saw into the future again, and this time... saw a story of a brother who cast the other away instead, a brother who died, and a planet taken by the ever consuming void...\n\nThe newt was filled with anguish. He wanted to fix this, but his head writhed in pain. The sickness had kicked in, leaving him just out of time to fix what he had wronged. \n\nThere was never enough time.\n\nFrom that point on, the newt left markers of places he had been, stone idols of himself that allow him to pinpoint an exact moment in time. But he was never able to make it back to that robed figure."; public static ItemDef ItemDef; public static GameObject itemDisplayPrefab = PrefabAPI.CreateEmptyPrefab("timelesscrown_empty"); public static Sprite ItemIcon => NewGenRaces.Assets.LoadAsset<Sprite>("TimelessCrown.png"); public static GameObject ItemPrefab => NewGenRaces.Assets.LoadAsset<GameObject>("TimelessCrown.prefab"); public static void Init() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown CreateLang(); CreateItem(); object obj = <>O.<0>__LunarItemOrEquipmentCostTypeHelper_RemoveTimelessCrown; if (obj == null) { hook_Init val = LunarItemOrEquipmentCostTypeHelper_RemoveTimelessCrown; <>O.<0>__LunarItemOrEquipmentCostTypeHelper_RemoveTimelessCrown = val; obj = (object)val; } LunarItemOrEquipmentCostTypeHelper.Init += (hook_Init)obj; } private static void LunarItemOrEquipmentCostTypeHelper_RemoveTimelessCrown(orig_Init orig) { orig.Invoke(); LunarItemOrEquipmentCostTypeHelper.lunarItemIndices = LunarItemOrEquipmentCostTypeHelper.lunarItemIndices.Where((ItemIndex x) => x != ItemDef.itemIndex).ToArray(); } protected static void CreateItem() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown ItemDef = ScriptableObject.CreateInstance<ItemDef>(); ((Object)ItemDef).name = "NEWGENRACES_TIMELESSCROWN_NAME"; ItemDef.nameToken = "NEWGENRACES_TIMELESSCROWN_NAME"; ItemDef.descriptionToken = "NEWGENRACES_TIMELESSCROWN_DESCRIPTION"; ItemDef.pickupToken = "NEWGENRACES_TIMELESSCROWN_PICKUP"; ItemDef.loreToken = "NEWGENRACES_TIMELESSCROWN_LORE"; ItemDef.canRemove = false; ItemDef itemDef = ItemDef; ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); itemDef.tags = (ItemTag[])(object)array; ItemDef._itemTierDef = Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/LunarTierDef.asset").WaitForCompletion(); ItemDef.tier = (ItemTier)3; ItemDef.deprecatedTier = (ItemTier)3; ItemDef.pickupIconSprite = ItemIcon; ItemDef.pickupModelPrefab = ItemPrefab; ModelPanelParameters val = ItemDef.pickupModelPrefab.AddComponent<ModelPanelParameters>(); val.focusPointTransform = new GameObject("FocusPoint").transform; val.focusPointTransform.SetParent(ItemDef.pickupModelPrefab.transform); val.cameraPositionTransform = new GameObject("CameraPosition").transform; val.cameraPositionTransform.SetParent(ItemDef.pickupModelPrefab.transform); ItemFollower val2 = itemDisplayPrefab.AddComponent<ItemFollower>(); val2.followerPrefab = ItemPrefab; val2.distanceDampTime = 0.02f; val2.distanceMaxSpeed = 35f; val2.targetObject = itemDisplayPrefab; ItemAPI.Add(new CustomItem(ItemDef, ItemDisplayTransformations())); } public static ItemDisplayRuleDict ItemDisplayTransformations() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0018: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_0798: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0806: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null); val.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Chest", localPos = new Vector3(0.00021f, 0.94454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlSeeker", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlDroneTech", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); val.Add("mdlDrifter", (ItemDisplayRule[])(object)new ItemDisplayRule[1] { new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, followerPrefab = itemDisplayPrefab, childName = "Head", localPos = new Vector3(0.00021f, 0.44454f, 0.04126f), localAngles = new Vector3(0f, 0f, 0f), localScale = new Vector3(2f, 2f, 2f) } }); return val; } protected static void CreateLang() { LanguageAPI.Add("NEWGENRACES_TIMELESSCROWN_NAME", ItemName); LanguageAPI.Add("NEWGENRACES_TIMELESSCROWN_DESCRIPTION", ItemDescription); LanguageAPI.Add("NEWGENRACES_TIMELESSCROWN_PICKUP", ItemPickup); LanguageAPI.Add("NEWGENRACES_TIMELESSCROWN_LORE", ItemLore); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("acanthi.NewGenRaces", "NewGenRaces", "1.0.0")] public class NewGenRaces : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static OnReviveDelegate <0>__SimpleRespawn; public static OnReviveDelegate <1>__SimpleRespawnSound; public static OnReviveDelegate <2>__OnRaceRevive; public static CanReviveDelegate <3>__RaceReviveCondition; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__14_2; public static Func<Instruction, bool> <>9__14_3; public static Func<float, float> <>9__14_1; public static Manipulator <>9__14_0; public static Func<PortalStatueBehavior, bool> <>9__15_0; internal void <Awake>b__14_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "GetRunStopwatch") })) { val.EmitDelegate<Func<float, float>>((Func<float, float>)((float time) => addToDifficulty.Value ? time : (time - (float)(deaths * baseSecondsToAdd.Value + additiveSecondsToAdd.Value * deaths)))); } else { Debug.Log((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } } internal bool <Awake>b__14_2(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <Awake>b__14_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "GetRunStopwatch"); } internal float <Awake>b__14_1(float time) { return addToDifficulty.Value ? time : (time - (float)(deaths * baseSecondsToAdd.Value + additiveSecondsToAdd.Value * deaths)); } internal bool <Stage_EraseNewt>b__15_0(PortalStatueBehavior newt) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 return (int)newt.portalType == 0; } } public const string PluginGUID = "acanthi.NewGenRaces"; public const string PluginAuthor = "acanthi"; public const string PluginName = "NewGenRaces"; public const string PluginVersion = "1.0.0"; public static ConfigEntry<bool> reviveEnabled; public static ConfigEntry<bool> addItem; public static ConfigEntry<bool> addToDifficulty; public static ConfigEntry<int> baseSecondsToAdd; public static ConfigEntry<int> additiveSecondsToAdd; public static ConfigEntry<bool> disableNewts; public static AssetBundle Assets; public static int deaths; public static PendingOnRevive[] customPendingOnRevives { get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown PendingOnRevive val = new PendingOnRevive(); val.timer = 2f; PendingOnRevive obj = val; object obj2 = <>O.<0>__SimpleRespawn; if (obj2 == null) { OnReviveDelegate val2 = ReviveAPI.SimpleRespawn; <>O.<0>__SimpleRespawn = val2; obj2 = (object)val2; } obj.onReviveDelegate = (OnReviveDelegate)obj2; PendingOnRevive val3 = val; val = new PendingOnRevive(); val.timer = 2f; PendingOnRevive obj3 = val; object obj4 = <>O.<1>__SimpleRespawnSound; if (obj4 == null) { OnReviveDelegate val4 = ReviveAPI.SimpleRespawnSound; <>O.<1>__SimpleRespawnSound = val4; obj4 = (object)val4; } obj3.onReviveDelegate = (OnReviveDelegate)obj4; PendingOnRevive val5 = val; val = new PendingOnRevive(); val.timer = 2f; PendingOnRevive obj5 = val; object obj6 = <>O.<2>__OnRaceRevive; if (obj6 == null) { OnReviveDelegate val6 = OnRaceRevive; <>O.<2>__OnRaceRevive = val6; obj6 = (object)val6; } obj5.onReviveDelegate = (OnReviveDelegate)obj6; PendingOnRevive val7 = val; return (PendingOnRevive[])(object)new PendingOnRevive[3] { val3, val5, val7 }; } } private void Awake() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown InitConfig(); if (reviveEnabled.Value || addItem.Value) { using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("NewGenRaces.artifactoftime_assets")) { Assets = AssetBundle.LoadFromStream(stream); } ((MonoBehaviour)this).StartCoroutine(ShaderSwapper.UpgradeStubbedShadersAsync(Assets)); } if (reviveEnabled.Value) { Artifact.Init(); } if (addItem.Value) { Item.Init(); } object obj = <>O.<3>__RaceReviveCondition; if (obj == null) { CanReviveDelegate val = RaceReviveCondition; <>O.<3>__RaceReviveCondition = val; obj = (object)val; } ReviveAPI.AddCustomRevive((CanReviveDelegate)obj, customPendingOnRevives, -99); Run.onRunStartGlobal += RunStart_ResetDeathCounter; GenericCharacterDeath.OnEnter += new hook_OnEnter(GenericCharacterDeath_GlassDeath); Stage.onStageStartGlobal += Stage_EraseNewt; object obj2 = <>c.<>9__14_0; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Run>(x, "GetRunStopwatch") })) { val3.EmitDelegate<Func<float, float>>((Func<float, float>)((float time) => addToDifficulty.Value ? time : (time - (float)(deaths * baseSecondsToAdd.Value + additiveSecondsToAdd.Value * deaths)))); } else { Debug.Log((object)(((MemberReference)il.Method).Name + " IL Hook failed!")); } }; <>c.<>9__14_0 = val2; obj2 = (object)val2; } Run.RecalculateDifficultyCoefficentInternal += (Manipulator)obj2; } private void Stage_EraseNewt(Stage obj) { if (disableNewts.Value && (!reviveEnabled.Value || Artifact.ArtifactEnabled)) { PortalStatueBehavior[] array = (from newt in Object.FindObjectsOfType<PortalStatueBehavior>(true) where (int)newt.portalType == 0 select newt).ToArray(); PortalStatueBehavior[] array2 = array; foreach (PortalStatueBehavior val in array2) { ((Component)val).GetComponent<PurchaseInteraction>().available = false; } } } private void GenericCharacterDeath_GlassDeath(orig_OnEnter orig, GenericCharacterDeath self) { CharacterMaster master = ((EntityState)self).characterBody.master; if ((Object)(object)master != (Object)null && RaceReviveCondition(master)) { ((EntityState)self).characterBody.isGlass = true; } orig.Invoke(self); } private void RunStart_ResetDeathCounter(Run obj) { deaths = 0; } private static bool RaceReviveCondition(CharacterMaster characterMaster) { if (!Object.op_Implicit((Object)(object)characterMaster.playerCharacterMasterController)) { return false; } if (reviveEnabled.Value) { return Artifact.ArtifactEnabled; } return true; } private static void OnRaceRevive(CharacterMaster characterMaster) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) AddTime(); if (addItem.Value) { characterMaster.inventory.GiveItemPermanent(Item.ItemDef, 1); CharacterMasterNotificationQueue.PushPickupNotification(characterMaster, PickupCatalog.FindPickupIndex(Item.ItemDef.itemIndex)); } deaths++; } private static void AddTime() { float runStopwatch = Run.instance.GetRunStopwatch(); float num = baseSecondsToAdd.Value + additiveSecondsToAdd.Value * deaths; Run.instance.SetRunStopwatch(runStopwatch + num); } private void InitConfig() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown reviveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Main Settings", "Artifact", true, "Allows you to disable/enable the mod as an artifact. Otherwise always enabled. Reload Required!"); addItem = ((BaseUnityPlugin)this).Config.Bind<bool>("Main Settings", "Add Item", true, "ItemDisplay to mock you for dying :3. Reload Required!"); addToDifficulty = ((BaseUnityPlugin)this).Config.Bind<bool>("Main Settings", "Add To Difficulty", false, "Each death adds to the enemy difficulty! WARNING: This compounds quickly."); baseSecondsToAdd = ((BaseUnityPlugin)this).Config.Bind<int>("Main Settings", "Base Seconds To Add", 120, "Base seconds to add to the timer."); additiveSecondsToAdd = ((BaseUnityPlugin)this).Config.Bind<int>("Main Settings", "Additive Seconds To Add", 60, "Seconds to add accumulatively after each death."); disableNewts = ((BaseUnityPlugin)this).Config.Bind<bool>("Run Settings", "Disable Newt Altars", false, "Disables Newt Altars. Only works if reviving is enabled!"); ModSettingsManager.SetModDescription("A simple races mod that revives you at the cost of time."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(reviveEnabled, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(addItem, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(addToDifficulty)); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(baseSecondsToAdd)); ModSettingsManager.AddOption((BaseOption)new IntFieldOption(additiveSecondsToAdd)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(disableNewts)); } } }