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 BloonModdedUnlocks v1.0.0
BloonModdedUnlocks.dll
Decompiled 3 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AmpMod.Modules; using ArsonistMod.Modules; using BansheeMod.Modules; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BloonModdedUnlocks.Main; using BloonModdedUnlocks.Modules; using CadetMod.Modules; using Deputy.Modules; using DiggerPlugin; using EnforcerPlugin; using EntityStates.HAND_Overclocked.BrokenJanitor; using EntityStates.Missions.MiniGeodeTracker; using EntityStates.VoidCamp; using HANDMod.Content.HANDSurvivor; using HANDMod.Modules; using HG; using HarmonyLib; using HouseMod.Modules; using IL.EntityStates.Missions.MiniGeodeTracker; using Meltdown; using Meltdown.Elites; using Microsoft.CodeAnalysis; using Modules; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using Morris.Modules; using On.EntityStates.VoidCamp; using On.RoR2; using On.RoR2.Achievements; using PaladinMod.Modules; using Pathfinder.Modules; using R2API; using RA2Mod.Modules; using RA2Mod.Modules.Characters; using RA2Mod.Survivors.Desolator; using RA2Mod.Survivors.Tesla; using RedGuyMod.Modules; using RoR2; using RoR2.Achievements; using RoR2.ContentManagement; using RoR2.Stats; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using SeamstressMod.Modules; using SniperClassic.Modules; using Ultron; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("AmpMod")] [assembly: IgnoresAccessChecksTo("ArsonistMod")] [assembly: IgnoresAccessChecksTo("BansheeMod")] [assembly: IgnoresAccessChecksTo("CadetMod")] [assembly: IgnoresAccessChecksTo("Deputy")] [assembly: IgnoresAccessChecksTo("DiggerUnearthed")] [assembly: IgnoresAccessChecksTo("Enforcer")] [assembly: IgnoresAccessChecksTo("HAND_Overclocked")] [assembly: IgnoresAccessChecksTo("HouseMod")] [assembly: IgnoresAccessChecksTo("Meltdown")] [assembly: IgnoresAccessChecksTo("Morris")] [assembly: IgnoresAccessChecksTo("PaladinMod")] [assembly: IgnoresAccessChecksTo("Pathfinder")] [assembly: IgnoresAccessChecksTo("RA2Mod")] [assembly: IgnoresAccessChecksTo("RedGuyMod")] [assembly: IgnoresAccessChecksTo("SeamstressMod")] [assembly: IgnoresAccessChecksTo("SniperClassic")] [assembly: IgnoresAccessChecksTo("Ultron")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("BloonModdedUnlocks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BloonModdedUnlocks")] [assembly: AssemblyTitle("BloonModdedUnlocks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [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 BloonModdedUnlocks { [BepInPlugin("Bloonjitsu7.BloonModdedUnlocks", "BloonModdedUnlocks", "1.0.0")] [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.*/)] [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.*/)] [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.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class BloonModdedUnlocksPlugin : BaseUnityPlugin { public const string PluginGUID = "Bloonjitsu7.BloonModdedUnlocks"; public const string PluginAuthor = "Bloonjitsu7"; public const string PluginName = "BloonModdedUnlocks"; public const string PluginVersion = "1.0.0"; public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); new ContentPacks().Initialize(); Config config = new Config(); config.SetupConfig(((BaseUnityPlugin)this).Config); RegisterUnlocks registerUnlocks = new RegisterUnlocks(); registerUnlocks.Initialize(); } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace BloonModdedUnlocks.Modules { public static class Unlockables { internal static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>(); internal static void AddUnlockableDef(UnlockableDef unlockableDef) { unlockableDefs.Add(unlockableDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef val = ScriptableObject.CreateInstance<UnlockableDef>(); val.cachedName = identifier; val.nameToken = nameToken; val.achievementIcon = achievementIcon; val.sortScore = 200; AddUnlockableDef(val); return val; } } public static class Buffs { internal static List<BuffDef> buffDefs = new List<BuffDef>(); internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff, bool isCooldown, bool isHidden) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; val.isCooldown = isCooldown; val.isHidden = isHidden; buffDefs.Add(val); return val; } } public static class Effects { private static GameObject finder = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_IgniteOnKill.IgniteExplosionVFX_prefab).WaitForCompletion(); public static List<EffectDef> effectDefs = new List<EffectDef>(); internal static void RegisterEffects() { } private static GameObject CreateTransmitterEffect() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) return CloneObject("RoR2/DLC3/Items/ShieldBooster/ShieldEMPPulseEffectVoid.prefab", "BloonUnstableTransmitterPulse", new Color(1f, 0.2f, 0f, 1f), new Color(1f, 0.3f, 0f, 1f), 1f, 50f, colorMesh: false); } private static GameObject CreateBurdenWaveEffect() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) return CloneObject("RoR2/Base/IgniteOnKill/IgniteExplosionVFX.prefab", "BloonBurdenWave", new Color(1f, 0f, 1f, 1f), new Color(1f, 0f, 1f, 1f), 1f, 0f, colorMesh: false); } private static GameObject CreateTracer() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) GameObject val = CloneTracer("RoR2/Base/Huntress/TracerHuntressSnipe.prefab", "TracerStormboundAurelioniteLaser", Color.red, new Color(1f, 0.04f, 0.04f, 1f), 2f); Object.Destroy((Object)(object)((Component)val.transform.Find("TracerHead")).gameObject); return val; } private static GameObject CloneObject(string originalObjectName, string newObjectName, Color color1, Color color2, float scaleMult = 1f, float colorTemp = 0f, bool colorMesh = true, string soundName = "", bool parentToTransform = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalObjectName).WaitForCompletion(); if ((Object)(object)val == (Object)null) { Log.Warning(originalObjectName + " is null!"); return null; } Component[] componentsInChildren = val.GetComponentsInChildren(typeof(Component)); foreach (Component data in componentsInChildren) { Log.Message(data); } GameObject val2 = PrefabAPI.InstantiateClone(val, newObjectName, false); if ((Object)(object)val2.GetComponent<EffectComponent>() == (Object)null) { val2.AddComponent<EffectComponent>(); } if ((Object)(object)val2.GetComponent<VFXAttributes>() == (Object)null) { val2.AddComponent<VFXAttributes>(); } val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; val2.GetComponent<VFXAttributes>().DoNotPool = true; val2.Recolor(color1, color2, scaleMult, colorTemp, colorMesh); CreateEffectFromObject(val2, soundName, parentToTransform); return val2; } private static GameObject CloneTracer(string originalTracerName, string newTracerName, Color color1, Color color2, float widthMult = 1f, float? speed = null, float? length = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync<GameObject>((object)originalTracerName).WaitForCompletion(); if ((Object)(object)val == (Object)null) { Log.Warning(originalTracerName + " is null!"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, newTracerName, false); if (!Object.op_Implicit((Object)(object)val2.GetComponent<EffectComponent>())) { val2.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)val2.GetComponent<VFXAttributes>())) { val2.AddComponent<VFXAttributes>(); } val2.GetComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; val2.GetComponent<VFXAttributes>().DoNotPool = true; if (!Object.op_Implicit((Object)(object)val2.GetComponent<NetworkIdentity>())) { val2.AddComponent<NetworkIdentity>(); } val2.GetComponent<Tracer>().speed = (speed.HasValue ? speed.Value : val2.GetComponent<Tracer>().speed); val2.GetComponent<Tracer>().length = (length.HasValue ? length.Value : val2.GetComponent<Tracer>().length); val2.Recolor(color1, color2, widthMult); CreateAndAddEffectDef(val2); return val2; } private static void Recolor(this GameObject thingToColor, Color color1, Color color2, float widthMult = 1f, float colorTemp = 0f, bool colorMesh = true) { //IL_001a: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: 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) bool flag = true; LineRenderer[] componentsInChildren = thingToColor.GetComponentsInChildren<LineRenderer>(); foreach (LineRenderer val in componentsInChildren) { bool flag2 = true; val.startColor = color1; val.endColor = color2; if (widthMult != 1f) { val.widthMultiplier *= widthMult; } } ParticleSystem[] componentsInChildren2 = thingToColor.GetComponentsInChildren<ParticleSystem>(); foreach (ParticleSystem val2 in componentsInChildren2) { MainModule main = val2.main; MinMaxCurve startSize = ((MainModule)(ref main)).startSize; ((MainModule)(ref main)).startSize = new MinMaxCurve(((MinMaxCurve)(ref startSize)).constant * widthMult); ((MainModule)(ref main)).startColor = new MinMaxGradient(color1); TrailModule trails = val2.trails; if (((TrailModule)(ref trails)).enabled) { Gradient val3 = new Gradient(); GradientColorKey[] array = (GradientColorKey[])(object)new GradientColorKey[2]; array[0].color = color1; array[0].time = 0f; array[1].color = color2; array[1].time = 1f; GradientAlphaKey[] array2 = (GradientAlphaKey[])(object)new GradientAlphaKey[2]; array2[0].alpha = color1.a; array2[0].time = 0f; array2[1].alpha = color2.a; array2[1].time = 1f; val3.SetKeys(array, array2); ((TrailModule)(ref trails)).colorOverLifetime = new MinMaxGradient(val3); } } Light[] componentsInChildren3 = thingToColor.GetComponentsInChildren<Light>(); foreach (Light val4 in componentsInChildren3) { if (colorTemp > 0f) { val4.colorTemperature = colorTemp; val4.useColorTemperature = true; } else { val4.useColorTemperature = false; } val4.color = color1; Transform transform = ((Component)val4).transform; transform.localScale *= widthMult; } ParticleSystemRenderer[] componentsInChildren4 = thingToColor.GetComponentsInChildren<ParticleSystemRenderer>(); foreach (ParticleSystemRenderer val5 in componentsInChildren4) { ((Renderer)val5).material.SetColor("_MainColor", color1); ((Renderer)val5).material.SetColor("_Color", color1); ((Renderer)val5).material.SetColor("_TintColor", color2); } if (colorMesh) { MeshRenderer[] componentsInChildren5 = thingToColor.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val6 in componentsInChildren5) { ((Renderer)val6).material.SetColor("_MainColor", color1); ((Renderer)val6).material.SetColor("_Color", color1); ((Renderer)val6).material.SetColor("_TintColor", color2); } } } internal static void AddEffectDef(EffectDef effectDef) { effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab, bool donotPool = false) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown if (donotPool) { VFXAttributes val = effectPrefab.GetComponent<VFXAttributes>(); if ((Object)(object)val == (Object)null) { val = effectPrefab.AddComponent<VFXAttributes>(); } val.DoNotPool = true; } EffectDef val2 = new EffectDef(effectPrefab); AddEffectDef(val2); return val2; } internal static void CreateEffectFromObject(GameObject newEffect, string soundName, bool parentToTransform) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) newEffect.AddComponent<DestroyOnTimer>().duration = 6f; newEffect.AddComponent<NetworkIdentity>(); if (!Object.op_Implicit((Object)(object)newEffect.GetComponent<VFXAttributes>())) { newEffect.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; } EffectComponent component = newEffect.GetComponent<EffectComponent>(); if (!Object.op_Implicit((Object)(object)component)) { component = newEffect.AddComponent<EffectComponent>(); component.applyScale = true; component.effectIndex = (EffectIndex)(-1); component.parentToReferencedTransform = parentToTransform; component.positionAtReferencedTransform = true; component.soundName = soundName; } CreateAndAddEffectDef(newEffect); } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public string identifier => "com.Bloonjitsu7.BloonModdedUnlocks"; public void Initialize() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Effects.RegisterEffects(); ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.effectDefs.Add(Effects.effectDefs.ToArray()); contentPack.buffDefs.Add(Buffs.buffDefs.ToArray()); contentPack.unlockableDefs.Add(Unlockables.unlockableDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } } namespace BloonModdedUnlocks.Main { public class Config { internal static bool HasSniper => Chainloader.PluginInfos.ContainsKey("com.Moffein.SniperClassic"); internal static bool HasDeputy => Chainloader.PluginInfos.ContainsKey("com.Bog.Deputy"); internal static bool HasEnforcer => Chainloader.PluginInfos.ContainsKey("com.EnforcerGang.Enforcer"); internal static bool HasHAND => Chainloader.PluginInfos.ContainsKey("com.EnforcerGang.HANDOverclocked"); internal static bool HasCadet => Chainloader.PluginInfos.ContainsKey("com.kenko.Cadet"); internal static bool HasMiner => Chainloader.PluginInfos.ContainsKey("com.rob.DiggerUnearthed"); internal static bool HasPaladin => Chainloader.PluginInfos.ContainsKey("com.rob.Paladin"); internal static bool HasRavager => Chainloader.PluginInfos.ContainsKey("com.rob.Ravager"); internal static bool HasPathfinder => Chainloader.PluginInfos.ContainsKey("com.Bog.Pathfinder"); internal static bool HasSeamstress => Chainloader.PluginInfos.ContainsKey("com.kenko.Seamstress"); internal static bool HasBanshee => Chainloader.PluginInfos.ContainsKey("com.kenko.Banshee"); internal static bool HasMortician => Chainloader.PluginInfos.ContainsKey("com.Bog.Morris"); internal static bool HasArsonist => Chainloader.PluginInfos.ContainsKey("com.PopcornFactory.Arsonist"); internal static bool HasRedAlert => Chainloader.PluginInfos.ContainsKey("com.TheTimesweeper.RedAlert"); internal static bool HasMeltdown => Chainloader.PluginInfos.ContainsKey("com.pittabread.Meltdown"); internal static bool HasHouse => Chainloader.PluginInfos.ContainsKey("com.JavAngle.HouseMod"); internal static bool HasAmp => Chainloader.PluginInfos.ContainsKey("com.NeonThink.Amp"); internal static bool HasHELP => Chainloader.PluginInfos.ContainsKey("com.rob.Ultron"); public static ConfigEntry<bool> railgunnerEnable { get; set; } public static ConfigEntry<bool> seekerEnable { get; set; } public static ConfigEntry<bool> operatorEnable { get; set; } public static ConfigEntry<bool> sniperEnable { get; set; } public static ConfigEntry<bool> deputyEnable { get; set; } public static ConfigEntry<bool> enforcerEnable { get; set; } public static ConfigEntry<bool> handEnable { get; set; } public static ConfigEntry<bool> cadetEnable { get; set; } public static ConfigEntry<bool> minerEnable { get; set; } public static ConfigEntry<bool> paladinEnable { get; set; } public static ConfigEntry<bool> ravagerEnable { get; set; } public static ConfigEntry<bool> pathfinderEnable { get; set; } public static ConfigEntry<bool> seamstressEnable { get; set; } public static ConfigEntry<bool> bansheeEnable { get; set; } public static ConfigEntry<bool> morticianEnable { get; set; } public static ConfigEntry<bool> arsonistEnable { get; set; } public static ConfigEntry<bool> teslaEnable { get; set; } public static ConfigEntry<bool> desolatorEnable { get; set; } public static ConfigEntry<bool> houseEnable { get; set; } public static ConfigEntry<bool> ampEnable { get; set; } public static ConfigEntry<bool> nemampEnable { get; set; } public static ConfigEntry<bool> helpEnable { get; set; } public void SetupConfig(ConfigFile cfg) { railgunnerEnable = cfg.Bind<bool>("Survivor Unlocks - Railgunner", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires SniperClassic and the Survivors of the Void DLC."); seekerEnable = cfg.Bind<bool>("Survivor Unlocks - Seeker", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires the Seekers of the Storm DLC."); operatorEnable = cfg.Bind<bool>("Survivor Unlocks - Operator", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires the Alloyed Collective DLC."); sniperEnable = cfg.Bind<bool>("Survivor Unlocks - Sniper", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires SniperClassic."); deputyEnable = cfg.Bind<bool>("Survivor Unlocks - Deputy", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Deputy."); enforcerEnable = cfg.Bind<bool>("Survivor Unlocks - Enforcer", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Enforcer."); handEnable = cfg.Bind<bool>("Survivor Unlocks - HAN-D", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires HAND_OVERCLOCKED."); cadetEnable = cfg.Bind<bool>("Survivor Unlocks - Cadet", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Cadet."); minerEnable = cfg.Bind<bool>("Survivor Unlocks - Miner", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires MinerUnearthed."); paladinEnable = cfg.Bind<bool>("Survivor Unlocks - Paladin", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires PaladinMod."); ravagerEnable = cfg.Bind<bool>("Survivor Unlocks - Ravager", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Ravager and the Survivors of the Void DLC."); pathfinderEnable = cfg.Bind<bool>("Survivor Unlocks - Pathfinder", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Pathfinder. BetterRadarTowers is recommended, but not required."); seamstressEnable = cfg.Bind<bool>("Survivor Unlocks - Seamstress", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Seamstress."); bansheeEnable = cfg.Bind<bool>("Survivor Unlocks - Banshee", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Banshee and the Alloyed Collective DLC."); morticianEnable = cfg.Bind<bool>("Survivor Unlocks - Mortician", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Mortician and RealerBulwarksHaunt."); arsonistEnable = cfg.Bind<bool>("Survivor Unlocks - Arsonist", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Arsonist_Mod."); teslaEnable = cfg.Bind<bool>("Survivor Unlocks - Tesla Trooper", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Red_Alert."); desolatorEnable = cfg.Bind<bool>("Survivor Unlocks - Desolator", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Red_Alert and Meltdown."); houseEnable = cfg.Bind<bool>("Survivor Unlocks - House", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires TheHouse."); ampEnable = cfg.Bind<bool>("Survivor Unlocks - Amp", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Amp."); nemampEnable = cfg.Bind<bool>("Survivor Unlocks - Nemesis Amp", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires Amp and the Survivors of the Void DLC. Nautilus is recommended, but not required."); helpEnable = cfg.Bind<bool>("Survivor Unlocks - HEL-P", "Enable Achievement", true, "While enabled, this survivor will need their associated achievment to be completed in order to unlock them. Requires HEL_P and the Alloyed Collective DLC. BetterSentryKeys is recommended, but not required."); } } public static class StatDefs { } public class RegisterUnlocks { public static Sprite lockedIcon = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_AlienHead.texAlienHeadIcon_png).WaitForCompletion(); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { if (Config.railgunnerEnable.Value && Config.HasSniper) { RailgunnerUnlock railgunnerUnlock = new RailgunnerUnlock(); railgunnerUnlock.Initialize(); } if (Config.seekerEnable.Value) { SeekerUnlock seekerUnlock = new SeekerUnlock(); seekerUnlock.Initialize(); } if (Config.operatorEnable.Value) { OperatorUnlock operatorUnlock = new OperatorUnlock(); operatorUnlock.Initialize(); } if (Config.sniperEnable.Value && Config.HasSniper) { SniperUnlock sniperUnlock = new SniperUnlock(); sniperUnlock.Initialize(); } if (Config.deputyEnable.Value && Config.HasDeputy) { DeputyUnlock deputyUnlock = new DeputyUnlock(); deputyUnlock.Initialize(); } if (Config.enforcerEnable.Value && Config.HasEnforcer) { EnforcerUnlock enforcerUnlock = new EnforcerUnlock(); enforcerUnlock.Initialize(); } if (Config.handEnable.Value && Config.HasHAND) { HANDUnlock hANDUnlock = new HANDUnlock(); hANDUnlock.Initialize(); } if (Config.cadetEnable.Value && Config.HasCadet) { CadetUnlock cadetUnlock = new CadetUnlock(); cadetUnlock.Initialize(); } if (Config.minerEnable.Value && Config.HasMiner) { MinerUnlock minerUnlock = new MinerUnlock(); minerUnlock.Initialize(); } if (Config.paladinEnable.Value && Config.HasPaladin) { PaladinUnlock paladinUnlock = new PaladinUnlock(); paladinUnlock.Initialize(); } if (Config.ravagerEnable.Value && Config.HasRavager) { RavagerUnlock ravagerUnlock = new RavagerUnlock(); ravagerUnlock.Initialize(); } if (Config.pathfinderEnable.Value && Config.HasPathfinder) { PathfinderUnlock pathfinderUnlock = new PathfinderUnlock(); pathfinderUnlock.Initialize(); } if (Config.seamstressEnable.Value && Config.HasSeamstress) { SeamstressUnlock seamstressUnlock = new SeamstressUnlock(); seamstressUnlock.Initialize(); } if (Config.bansheeEnable.Value && Config.HasBanshee) { BansheeUnlock bansheeUnlock = new BansheeUnlock(); bansheeUnlock.Initialize(); } if (Config.morticianEnable.Value && Config.HasMortician) { MorticianUnlock morticianUnlock = new MorticianUnlock(); morticianUnlock.Initialize(); } if (Config.arsonistEnable.Value && Config.HasArsonist) { ArsonistUnlock arsonistUnlock = new ArsonistUnlock(); arsonistUnlock.Initialize(); } if (Config.HasRedAlert) { RedAlertUnlocks redAlertUnlocks = new RedAlertUnlocks(); redAlertUnlocks.Initialize(); } if (Config.houseEnable.Value && Config.HasHouse) { HouseUnlock houseUnlock = new HouseUnlock(); houseUnlock.Initialize(); } if (Config.ampEnable.Value && Config.HasAmp) { AmpUnlock ampUnlock = new AmpUnlock(); ampUnlock.Initialize(); } if (Config.nemampEnable.Value && Config.HasAmp) { NemAmpUnlock nemAmpUnlock = new NemAmpUnlock(); nemAmpUnlock.Initialize(); } if (Config.helpEnable.Value && Config.HasHELP) { HELPUnlock hELPUnlock = new HELPUnlock(); hELPUnlock.Initialize(); } } } public class HELPUnlock { [RegisterAchievement("Bloon_HELP_Achievement", "Characters.BloonHELP", null, 3u, null)] public class HELPAchievement : BaseAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); Inventory.onInventoryChangedGlobal += OnInventoryChanged; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnInventoryChanged(Inventory inventory) { if ((Object)(object)Stage.instance != (Object)null && (Object)(object)Stage.instance.sceneDef != (Object)null && Stage.instance.sceneDef.baseSceneName == "conduitcanyon") { int itemCountEffective = inventory.GetItemCountEffective(Items.PowerPyramid); if (itemCountEffective >= 15) { ((BaseAchievement)this).Grant(); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { Inventory.onInventoryChangedGlobal -= OnInventoryChanged; ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) survivor = Plugin.ultronSurvivorDef; Texture obj = Plugin.mainAssetBundle.LoadAsset<Texture>("texHELPIcon"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonHELP", "BLOON_HELP_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_HELP_ACHIEVEMENT_NAME", "Sequence Break"); LanguageAPI.Add("ACHIEVEMENT_BLOON_HELP_ACHIEVEMENT_DESCRIPTION", "Hold 15 Sentry Keys at once in Conduit Canyon."); } } public class NemAmpUnlock { [RegisterAchievement("Bloon_NemAmp_Achievement", "Characters.BloonNemAmp", null, 5u, null)] public class NemAmpAchievement : BaseAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("AmpBody"); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnChampionDeath; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnChampionDeath(DamageReport report) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (report.victimIsChampion && report.victimIsElite && Object.op_Implicit((Object)(object)report.victimBody.inventory) && report.victimBody.inventory.HasEquipment(Equipment.EliteVoidEquipment.equipmentIndex) && ((BaseAchievement)this).meetsBodyRequirement) { ((BaseAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnChampionDeath; ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; public static string name; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown Rect val = default(Rect); foreach (SurvivorDef survivorDefinition in Prefabs.survivorDefinitions) { Log.Message(survivorDefinition.cachedName); if (survivorDefinition.cachedName.Contains("NEMAMP")) { survivor = survivorDefinition; name = survivorDefinition.cachedName; Texture obj = Asset.LoadCharacterIcon("Nem"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonNemAmp", "BLOON_NEMAMP_ACHIEVEMENT", icon); survivorDefinition.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_NEMAMP_ACHIEVEMENT_NAME", "Cold Fusion"); LanguageAPI.Add("ACHIEVEMENT_BLOON_NEMAMP_ACHIEVEMENT_DESCRIPTION", "As Amp, defeat a Voidtouched boss."); if (Config.ampEnable.Value) { CharacterSelectBarController.Awake += new hook_Awake(OnSelectBarAwake); } } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnSelectBarAwake(orig_Awake orig, CharacterSelectBarController self) { bool flag = LocalUserManager.readOnlyLocalUsersList.Any((LocalUser localUser) => localUser.userProfile.HasUnlockable(AmpUnlock.unlock)); SurvivorDef val = SurvivorCatalog.FindSurvivorDef(name); if ((Object)(object)val != (Object)null) { val.hidden = !flag; } orig.Invoke(self); } } public class AmpUnlock { [RegisterAchievement("Bloon_Amp_Achievement", "Characters.BloonAmp", null, 5u, typeof(AmpServerAchievement))] public class AmpAchievement : BaseAchievement { public class AmpServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnWormDeath; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnWormDeath(DamageReport report) { if (!(Run.instance.difficultyCoefficient < 3f) && report.victimBody.baseNameToken.Contains("ELECTRICWORM")) { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnWormDeath; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); foreach (SurvivorDef survivorDefinition in Prefabs.survivorDefinitions) { Log.Message(survivorDefinition.cachedName); if (!survivorDefinition.cachedName.Contains("NEMAMP")) { survivor = survivorDefinition; Texture obj = Asset.LoadCharacterIcon("Amp"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonAmp", "BLOON_AMP_ACHIEVEMENT", icon); survivorDefinition.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_AMP_ACHIEVEMENT_NAME", "The Reminder"); LanguageAPI.Add("ACHIEVEMENT_BLOON_AMP_ACHIEVEMENT_DESCRIPTION", "Defeat an Overloading Worm on Monsoon difficulty or higher."); } } } } public class HouseUnlock { [RegisterAchievement("Bloon_House_Achievement", "Characters.BloonHouse", null, 7u, null)] public class HouseAchievement : BaseAchievement { public int rerollCount = 0; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown ((BaseAchievement)this).OnInstall(); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(OnRerollLunars); Stage.onStageStartGlobal += OnStageStart; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnStageStart(Stage stage) { rerollCount = 0; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnRerollLunars(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { if (((Object)((Component)self).gameObject).name != "LunarRecycler") { orig.Invoke(self, activator); return; } rerollCount++; if (rerollCount >= 7) { ((BaseAchievement)this).Grant(); } orig.Invoke(self, activator); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnRerollLunarsOld(orig_UpdateHologramContent orig, BazaarUpgradeInteraction self, GameObject hologramContentObject, Transform viewer) { if (self.cost >= 128) { ((BaseAchievement)this).Grant(); } orig.Invoke(self, hologramContentObject, viewer); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Stage.onStageStartGlobal -= OnStageStart; PurchaseInteraction.OnInteractionBegin -= new hook_OnInteractionBegin(OnRerollLunars); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; public static GameObject rerollPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_bazaar.BazaarUpgrade_prefab).WaitForCompletion(); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) Component[] componentsInChildren = rerollPrefab.GetComponentsInChildren(typeof(Component)); foreach (Component data in componentsInChildren) { Log.Message(data); } Component[] componentsInChildren2 = rerollPrefab.GetComponentsInChildren(typeof(BazaarUpgradeInteraction)); for (int j = 0; j < componentsInChildren2.Length; j++) { BazaarUpgradeInteraction val = (BazaarUpgradeInteraction)componentsInChildren2[j]; Log.Message(val.unlockableProgression.Length); string[] unlockableProgression = val.unlockableProgression; foreach (string data2 in unlockableProgression) { Log.Message(data2); } } if (Prefabs.survivorDefinitions.Count > 0) { survivor = Prefabs.survivorDefinitions[0]; Texture obj = Assets.LoadCharacterIcon(); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val2, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonHouse", "BLOON_HOUSE_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_HOUSE_ACHIEVEMENT_NAME", "Unlucky 7"); LanguageAPI.Add("ACHIEVEMENT_BLOON_HOUSE_ACHIEVEMENT_DESCRIPTION", "Reroll the Lunar Shop 7 times in a single visit to the Bazaar Between Time."); } } } public class RedAlertUnlocks { public static SurvivorDef desolatorSurvivor; public static Texture2D desolatorTexture; public static Sprite desolatorIcon; public static UnlockableDef desolatorUnlock; public static SurvivorDef teslaSurvivor; public static Texture2D teslaTexture; public static Sprite teslaIcon; public static UnlockableDef teslaUnlock; private static Hook hook; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown if (Config.teslaEnable.Value) { RedAlertUnlocks.teslaUnlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonTesla", "BLOON_TESLA_ACHIEVEMENT", teslaIcon); TeslaUnlock teslaUnlock = new TeslaUnlock(); } if (Config.desolatorEnable.Value && Config.HasMeltdown) { RedAlertUnlocks.desolatorUnlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonDesolator", "BLOON_DESOLATOR_ACHIEVEMENT", desolatorIcon); DesolatorUnlock desolatorUnlock = new DesolatorUnlock(); } MethodInfo methodInfo = AccessTools.Method(typeof(Content), "AddSurvivorDef", (Type[])null, (Type[])null); hook = new Hook((MethodBase)methodInfo, (Delegate)new Action<Action<SurvivorDef>, SurvivorDef>(GetSurvivorDefs)); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void GetSurvivorDefs(Action<SurvivorDef> orig, SurvivorDef survivorDef) { //IL_00b4: 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_01ab: 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) if (survivorDef.cachedName == "Desolator" && ((Object)(object)survivorDef.unlockableDef == (Object)null || survivorDef.unlockableDef.nameToken != "ACHIEVEMENT_BLOON_DESOLATOR_ACHIEVEMENT_NAME") && Config.desolatorEnable.Value && Config.HasMeltdown) { Log.Message("Success 1!!!!!!!!!!"); desolatorSurvivor = survivorDef; Texture obj = ((CharacterBase<DesolatorSurvivor>)(object)CharacterBase<DesolatorSurvivor>.instance).assetBundle.LoadAsset<Texture>("texIconDesolator"); desolatorTexture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)desolatorTexture).width, (float)((Texture)desolatorTexture).height); desolatorUnlock.achievementIcon = Sprite.Create(desolatorTexture, val, new Vector2(0.5f, 0.5f), 1f); survivorDef.unlockableDef = desolatorUnlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_DESOLATOR_ACHIEVEMENT_NAME", "Contaminated"); LanguageAPI.Add("ACHIEVEMENT_BLOON_DESOLATOR_ACHIEVEMENT_DESCRIPTION", "Defeat a Nuclear elite boss."); } if (survivorDef.cachedName == "TeslaTrooper" && ((Object)(object)survivorDef.unlockableDef == (Object)null || survivorDef.unlockableDef.nameToken != "ACHIEVEMENT_BLOON_DESOLATOR_ACHIEVEMENT_NAME") && Config.teslaEnable.Value) { Log.Message("Success 2!!!!!!!!!!"); teslaSurvivor = survivorDef; Texture obj2 = ((CharacterBase<TeslaTrooperSurvivor>)(object)CharacterBase<TeslaTrooperSurvivor>.instance).assetBundle.LoadAsset<Texture>("texIconTesla"); teslaTexture = (Texture2D)(object)((obj2 is Texture2D) ? obj2 : null); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, 0f, (float)((Texture)teslaTexture).width, (float)((Texture)teslaTexture).height); teslaUnlock.achievementIcon = Sprite.Create(teslaTexture, val2, new Vector2(0.5f, 0.5f), 1f); survivorDef.unlockableDef = teslaUnlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_TESLA_ACHIEVEMENT_NAME", "Energized"); LanguageAPI.Add("ACHIEVEMENT_BLOON_TESLA_ACHIEVEMENT_DESCRIPTION", "Defeat an Overloading elite boss."); } orig(survivorDef); } } public class DesolatorUnlock { [RegisterAchievement("Bloon_Desolator_Achievement", "Characters.BloonDesolator", null, 3u, typeof(DesolatorServerAchievement))] public class DesolatorAchievement : BaseAchievement { public class DesolatorServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnChampionDeath; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnChampionDeath(DamageReport report) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (report.victimIsChampion && report.victimIsElite && Object.op_Implicit((Object)(object)report.victimBody.inventory) && report.victimBody.inventory.HasEquipment(((EliteBase)Meltdown.elites.nuclear).equipmentDef.equipmentIndex)) { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnChampionDeath; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } } public class TeslaUnlock { [RegisterAchievement("Bloon_Tesla_Achievement", "Characters.BloonTesla", null, 3u, typeof(TeslaServerAchievement))] public class TeslaAchievement : BaseAchievement { public class TeslaServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnChampionDeath; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnChampionDeath(DamageReport report) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (report.victimIsChampion && report.victimIsElite && Object.op_Implicit((Object)(object)report.victimBody.inventory) && report.victimBody.inventory.HasEquipment(Equipment.AffixBlue.equipmentIndex)) { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnChampionDeath; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } } public class ArsonistUnlock { [RegisterAchievement("Bloon_Arsonist_Achievement", "Characters.BloonArsonist", null, 3u, typeof(ArsonistServerAchievement))] public class ArsonistAchievement : BaseAchievement { public class ArsonistServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnChampionDeath; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnChampionDeath(DamageReport report) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (report.victimIsChampion && report.victimIsElite && Object.op_Implicit((Object)(object)report.victimBody.inventory) && report.victimBody.inventory.HasEquipment(Equipment.AffixRed.equipmentIndex)) { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnChampionDeath; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (ContentPacks.survivorDefs.Count > 0) { survivor = ContentPacks.survivorDefs[0]; Texture obj = AssetsArsonist.mainAssetBundle.LoadAsset<Texture>("ArsonistIcon"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonArsonist", "BLOON_ARSONIST_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_ARSONIST_ACHIEVEMENT_NAME", "Ignited"); LanguageAPI.Add("ACHIEVEMENT_BLOON_ARSONIST_ACHIEVEMENT_DESCRIPTION", "Defeat a Blazing elite boss."); } } } public class MorticianUnlock { [RegisterAchievement("Bloon_Mortician_Achievement", "Characters.BloonMortician", null, 5u, typeof(MorticianServerAchievement))] public class MorticianAchievement : BaseAchievement { public class MorticianServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); Stage.onStageStartGlobal += OnStageStart; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnStageStart(Stage stage) { string cachedName = stage.sceneDef.cachedName; if (cachedName == "BulwarksHaunt_GhostWave") { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { Stage.onStageStartGlobal -= OnStageStart; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (ContentPacks.survivorDefs.Count > 0) { survivor = ContentPacks.survivorDefs[0]; Texture obj = MorrisAssets.mainAssetBundle.LoadAsset<Texture>("texMorrisIcon"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonMortician", "BLOON_MORTICIAN_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_MORTICIAN_ACHIEVEMENT_NAME", "Last Respects"); LanguageAPI.Add("ACHIEVEMENT_BLOON_MORTICIAN_ACHIEVEMENT_DESCRIPTION", "Enter A Moment, Haunted."); } } } public class BansheeUnlock { [RegisterAchievement("Bloon_Banshee_Achievement", "Characters.BloonBanshee", null, 5u, typeof(BansheeServerAchievement))] public class BansheeAchievement : BaseAchievement { public class BansheeServerAchievement : BaseServerAchievement { public static int signalsActive; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); Stage.onStageStartGlobal += OnStageStart; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void RecieveTransmissionAchievement() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown signalsActive++; if (signalsActive == 1) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cIsUtility>[???] Attempting to receive transmission B-27; data upload link at <style=cIsHealing>20%</style></style>" }); } else if (signalsActive == 2) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cIsUtility>[???] Attempting to receive transmission B-27; data upload link at <style=cIsHealing>40%</style></style>" }); } else if (signalsActive == 3) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cIsUtility>[???] Attempting to receive transmission B-27; data upload link at <style=cIsHealing>60%</style></style>" }); } else if (signalsActive == 4) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cIsUtility>[???] Attempting to receive transmission B-27; data upload link at <style=cIsHealing>80%</style></style>" }); } else if (signalsActive == 5) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cIsUtility>[House Beyond] Transmission B-27 to the Herald on UES [REDACTED] received; delay time of [error: integer overflow] seconds. Time exceeds expected window; automatic reinforcement protocol engaged.</style>" }); ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnStageStart(Stage stage) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) signalsActive = 0; GameObject radioSignalPrefab = BansheeUnlock.radioSignalPrefab; string cachedName = stage.sceneDef.cachedName; if (cachedName == "repurposedcrater") { SpawnSignal(radioSignalPrefab, new Vector3(-234.62f, 60.99f, -135.68f), Vector3.zero); SpawnSignal(radioSignalPrefab, new Vector3(-184.07f, 93.8f, 142.58f), Vector3.zero); SpawnSignal(radioSignalPrefab, new Vector3(9.27f, 10.79f, -114.23f), Vector3.zero); SpawnSignal(radioSignalPrefab, new Vector3(-109.27f, 58.98f, -99.27f), Vector3.zero); SpawnSignal(radioSignalPrefab, new Vector3(-100.49f, -0.81f, 32.05f), Vector3.zero); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void SpawnSignal(GameObject prefab, Vector3 position, Vector3 rotation) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { GameObject val = Object.Instantiate<GameObject>(prefab, position, Quaternion.Euler(rotation)); val.transform.eulerAngles = rotation; HouseBeyondRadioSignalController houseBeyondRadioSignalController = default(HouseBeyondRadioSignalController); if (val.TryGetComponent<HouseBeyondRadioSignalController>(ref houseBeyondRadioSignalController)) { houseBeyondRadioSignalController.achievement = this; } SpecialObjectAttributes val2 = default(SpecialObjectAttributes); if (val.TryGetComponent<SpecialObjectAttributes>(ref val2)) { val2.bestName = "BLOON_RADIOSIGNAL_NAME"; val2.portraitIcon = (Texture)(object)Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common_MiscIcons.texMysteryIcon_png).WaitForCompletion().texture; } NetworkServer.Spawn(val); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { Stage.onStageStartGlobal -= OnStageStart; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public class HouseBeyondRadioSignalController : MonoBehaviour { public BansheeAchievement.BansheeServerAchievement achievement; public PurchaseInteraction purchaseInteraction; public GameObject pointLight; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void Start() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction = ((Component)this).gameObject.GetComponent<PurchaseInteraction>(); ((UnityEvent<Interactor>)(object)purchaseInteraction.onPurchase).AddListener((UnityAction<Interactor>)RecieveTransmission); Vector3 position = ((Component)this).gameObject.transform.position; position.y += 1.4f; pointLight = Object.Instantiate<GameObject>(radioSignalLight, position, Quaternion.identity); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void RecieveTransmission(Interactor interactor) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (achievement != null) { achievement.RecieveTransmissionAchievement(); Util.PlaySound("Play_GG_StageEvent_AccessCodes_WrongActivation", ((Component)this).gameObject); if ((Object)(object)pointLight != (Object)null) { Light component = pointLight.GetComponent<Light>(); component.color = Color.cyan; } } } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; public static GameObject radioSignalPrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_EquipmentBarrel.EquipmentBarrel_prefab).WaitForCompletion(), "bloonRadioSignalPrefab"); public static GameObject radioSignalLight = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_ArtifactCompounds.ArtifactCompoundDiamondDisplay_prefab).WaitForCompletion(), "bloonRadioSignalLight"); public static Material radioSignalMat = Addressables.LoadAssetAsync<Material>((object)RoR2_DLC3_repurposedcrater.matRCMetalTrim01_mat).WaitForCompletion(); public static Material radioSignalLightMat = Addressables.LoadAssetAsync<Material>((object)RoR2_Base_limbo.matLimboTotem_mat).WaitForCompletion(); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) SetupRadioPrefab(); LanguageAPI.Add("BLOON_RADIOSIGNAL_NAME", "Transmitter Pylon"); LanguageAPI.Add("BLOON_RADIOSIGNAL_CONTEXT", "Activate Transmitter Pylon"); LanguageAPI.Add("BLOON_RADIOSIGNAL_INSPECT", "A technologically advanced transmitter from an unknown source, scavenged by solus units and integrated into their domain. The transmission signal seems to be disrupted."); if (ContentPacks.survivorDefs.Count > 0) { survivor = ContentPacks.survivorDefs[0]; Texture obj = CharacterAssets.LoadAssetBundle("banshee").LoadAsset<Texture>("texBansheeIcon"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonBanshee", "BLOON_BANSHEE_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_BANSHEE_ACHIEVEMENT_NAME", "Above And Beyond"); LanguageAPI.Add("ACHIEVEMENT_BLOON_BANSHEE_ACHIEVEMENT_DESCRIPTION", "Activate pylons to receive the disrupted transmission in Repurposed Crater."); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void SetupRadioPrefab() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Expected O, but got Unknown //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Expected O, but got Unknown //IL_02d1: 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_0335: Expected O, but got Unknown Light val = radioSignalLight.AddComponent<Light>(); val.color = Color.yellow; val.bounceIntensity = 1f; val.intensity = 6f; val.range = 2f; Transform transform = radioSignalLight.transform; transform.localScale *= 0.3f; Component[] componentsInChildren = radioSignalLight.GetComponentsInChildren(typeof(MeshRenderer)); for (int i = 0; i < componentsInChildren.Length; i++) { MeshRenderer val2 = (MeshRenderer)componentsInChildren[i]; ((Renderer)val2).material = radioSignalLightMat; } radioSignalPrefab.AddComponent<HouseBeyondRadioSignalController>(); Component[] componentsInChildren2 = radioSignalPrefab.GetComponentsInChildren(typeof(SkinnedMeshRenderer)); for (int j = 0; j < componentsInChildren2.Length; j++) { SkinnedMeshRenderer val3 = (SkinnedMeshRenderer)componentsInChildren2[j]; ((Renderer)val3).material = radioSignalMat; } Component[] componentsInChildren3 = radioSignalPrefab.GetComponentsInChildren(typeof(DitherModel)); for (int k = 0; k < componentsInChildren3.Length; k++) { DitherModel val4 = (DitherModel)componentsInChildren3[k]; Renderer[] renderers = val4.renderers; foreach (Renderer val5 in renderers) { val5.material = radioSignalMat; } } Component[] componentsInChildren4 = radioSignalPrefab.GetComponentsInChildren(typeof(ChestBehavior)); for (int m = 0; m < componentsInChildren4.Length; m++) { ChestBehavior val6 = (ChestBehavior)componentsInChildren4[m]; Object.Destroy((Object)(object)val6); } InspectDef val7 = ScriptableObject.CreateInstance<InspectDef>(); InspectInfo val8 = new InspectInfo(); val8.DescriptionToken = "BLOON_RADIOSIGNAL_INSPECT"; val8.TitleToken = "BLOON_RADIOSIGNAL_NAME"; val8.Visual = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common_MiscIcons.texMysteryIcon_png).WaitForCompletion(); val7.Info = val8; Component[] componentsInChildren5 = radioSignalPrefab.GetComponentsInChildren(typeof(GenericInspectInfoProvider)); for (int n = 0; n < componentsInChildren5.Length; n++) { GenericInspectInfoProvider val9 = (GenericInspectInfoProvider)componentsInChildren5[n]; val9.InspectInfo = val7; } Component[] componentsInChildren6 = radioSignalPrefab.GetComponentsInChildren(typeof(SpecialObjectAttributes)); for (int num = 0; num < componentsInChildren6.Length; num++) { SpecialObjectAttributes val10 = (SpecialObjectAttributes)componentsInChildren6[num]; val10.behavioursToDisable = null; val10.breakoutStateMachineName = ""; val10.childObjectsToDisable = null; val10.grabbable = false; val10.objectsToDetach = null; val10.renderersToDisable = null; val10.bestName = "BLOON_RADIOSIGNAL_NAME"; val10.portraitIcon = (Texture)(object)val8.Visual.texture; } Component[] componentsInChildren7 = radioSignalPrefab.GetComponentsInChildren(typeof(PurchaseInteraction)); for (int num2 = 0; num2 < componentsInChildren7.Length; num2++) { PurchaseInteraction val11 = (PurchaseInteraction)componentsInChildren7[num2]; val11.costType = (CostTypeIndex)0; val11.cost = 0; val11.setUnavailableOnTeleporterActivated = false; val11.contextToken = "BLOON_RADIOSIGNAL_CONTEXT"; val11.displayNameToken = "BLOON_RADIOSIGNAL_NAME"; } Component[] componentsInChildren8 = radioSignalPrefab.GetComponentsInChildren(typeof(GenericDisplayNameProvider)); for (int num3 = 0; num3 < componentsInChildren8.Length; num3++) { GenericDisplayNameProvider val12 = (GenericDisplayNameProvider)componentsInChildren8[num3]; } } } public class SeamstressUnlock { [RegisterAchievement("Bloon_Seamstress_Achievement", "Characters.BloonSeamstress", null, 5u, typeof(SeamstressServerAchievement))] public class SeamstressAchievement : BaseAchievement { public class SeamstressServerAchievement : BaseServerAchievement { public int ritualProgress = 0; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown ((BaseServerAchievement)this).OnInstall(); Run.onRunStartGlobal += OnRunStart; ShrineBloodBehavior.AddShrineStack += new hook_AddShrineStack(OnAddBloodStack); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnRunStart(Run run) { ritualProgress = 0; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnAddBloodStack(orig_AddShrineStack orig, ShrineBloodBehavior self, Interactor interactor) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, interactor); if (self.purchaseCount < self.maxPurchaseCount) { return; } ritualProgress++; if (ritualProgress == 1) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>A dimensional rift begins to form.</style>" }); } else if (ritualProgress == 2) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>The rift grows larger.</style>" }); } else if (ritualProgress == 3) { Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>The rift tears itself open!</style>" }); Util.PlaySound("Play_imp_overlord_death", ((Component)self).gameObject); Util.PlaySound("elite_antiHeal_spawn", ((Component)self).gameObject); SeamstressImpBossEncounter seamstressImpBossEncounter = ((Component)Stage.instance).GetComponent<SeamstressImpBossEncounter>(); if (!Object.op_Implicit((Object)(object)seamstressImpBossEncounter)) { seamstressImpBossEncounter = ((Component)Stage.instance).gameObject.AddComponent<SeamstressImpBossEncounter>(); } seamstressImpBossEncounter.achievement = this; seamstressImpBossEncounter.ShrinePos = ((Component)self).gameObject.transform.position; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnImpKilled() { ((BaseServerAchievement)this).Grant(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Run.onRunStartGlobal -= OnRunStart; ShrineBloodBehavior.AddShrineStack -= new hook_AddShrineStack(OnAddBloodStack); ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public class SeamstressImpBossEncounter : MonoBehaviour { public bool hasSpawned = false; public float spawnTimer = 5f; public Vector3 ShrinePos = new Vector3(0f, 0f, 0f); public static SpawnCard impSpawnCard = Addressables.LoadAssetAsync<SpawnCard>((object)RoR2_Base_ImpBoss.cscImpBoss_asset).WaitForCompletion(); public SeamstressAchievement.SeamstressServerAchievement achievement; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void Awake() { hasSpawned = false; spawnTimer = 5f; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void FixedUpdate() { if (spawnTimer > 0f) { spawnTimer -= Time.fixedDeltaTime; } else if (!hasSpawned) { hasSpawned = true; SpawnImpBoss(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void BroadcastSpawn() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<style=cWorldEvent>Echoes of the fallen grow louder.</style>" }); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void SpawnImpBoss() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown if (achievement == null) { return; } CombatSquad combatSquad = Object.Instantiate<GameObject>(impEncounterObject).GetComponent<CombatSquad>(); if (!Object.op_Implicit((Object)(object)combatSquad)) { return; } DirectorPlacementRule val = new DirectorPlacementRule { placementMode = (PlacementMode)3, position = ShrinePos, minDistance = 15f, maxDistance = 45f }; DirectorSpawnRequest val2 = new DirectorSpawnRequest(impSpawnCard, val, Run.instance.runRNG); val2.ignoreTeamMemberLimit = true; val2.teamIndexOverride = (TeamIndex)2; val2.onSpawnedServer = (Action<SpawnResult>)Delegate.Combine(val2.onSpawnedServer, (Action<SpawnResult>)delegate(SpawnResult result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (result.success) { CharacterMaster component = result.spawnedInstance.GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component)) { Inventory inventory = component.inventory; if (Object.op_Implicit((Object)(object)inventory)) { CharacterBody body = component.GetBody(); body.AddTimedBuff(Buffs.LifeSteal, 9999f); inventory.ResetItemPermanent(Items.InvadingDoppelganger); inventory.GiveItemPermanent(Items.TeleportWhenOob, 1); inventory.GiveItemPermanent(Items.UseAmbientLevel, 1); inventory.GiveItemPermanent(Items.AdaptiveArmor, 1); inventory.GiveItemPermanent(Items.BoostHp, 5); } combatSquad.AddMember(component); } } }); DirectorCore.instance.TrySpawnObject(val2); combatSquad.onDefeatedServer += achievement.OnImpKilled; } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; internal static GameObject impEncounterObject = PrefabAPI.CreateEmptyPrefab("bloonImpEncounterObject"); [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0098: 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) impEncounterObject.AddComponent<CombatSquad>(); BossGroup val = impEncounterObject.AddComponent<BossGroup>(); val.shouldDisplayHealthBarOnHud = true; val.bossDropChance = 0f; if (ContentPacks.survivorDefs.Count > 0) { survivor = ContentPacks.survivorDefs[0]; Texture obj = CharacterAssets.LoadAssetBundle("seamstressassets").LoadAsset<Texture>("texSeamstressIcon"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val2, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonSeamstress", "BLOON_SEAMSTRESS_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_SEAMSTRESS_ACHIEVEMENT_NAME", "Blood Ritual"); LanguageAPI.Add("ACHIEVEMENT_BLOON_SEAMSTRESS_ACHIEVEMENT_DESCRIPTION", "Fully deplete 3 Blood Shrines in a single run and complete the ritual."); } } } public class PathfinderUnlock { [RegisterAchievement("Bloon_Pathfinder_Achievement", "Characters.BloonPathfinder", null, 3u, null)] public class PathfinderAchievement : BaseAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); UserProfile.onUnlockableGranted += OnUnlockableGranted; Check(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { UserProfile.onUnlockableGranted -= OnUnlockableGranted; ((BaseAchievement)this).OnUninstall(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnUnlockableGranted(UserProfile userProfile, UnlockableDef unlockableDef) { Check(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private int EnvironmentLogsFound() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) int num = 0; Enumerator<SceneDef> enumerator = SceneCatalog.allStageSceneDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { SceneDef current = enumerator.Current; UnlockableDef unlockableLogFromBaseSceneName = SceneCatalog.GetUnlockableLogFromBaseSceneName(current.baseSceneName); if (((BaseAchievement)this).userProfile.HasUnlockable(unlockableLogFromBaseSceneName)) { num++; } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } return num; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void Check() { if (EnvironmentLogsFound() >= 15) { ((BaseAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override float ProgressForAchievement() { return (float)EnvironmentLogsFound() / 15f; } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (ContentPacks.survivorDefs.Count > 0) { survivor = ContentPacks.survivorDefs[0]; Texture obj = PathfinderAssets.mainAssetBundle.LoadAsset<Texture>("texPathfinderIcon"); texture = (Texture2D)(object)((obj is Texture2D) ? obj : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonPathfinder", "BLOON_PATHFINDER_ACHIEVEMENT", icon); survivor.unlockableDef = unlock; LanguageAPI.Add("ACHIEVEMENT_BLOON_PATHFINDER_ACHIEVEMENT_NAME", "Planetside Survey"); LanguageAPI.Add("ACHIEVEMENT_BLOON_PATHFINDER_ACHIEVEMENT_DESCRIPTION", "Collect 15 different environment logs."); } } } public class RavagerUnlock { [RegisterAchievement("Bloon_Ravager_Achievement", "Characters.BloonRavager", null, 5u, typeof(RavagerServerAchievement))] public class RavagerAchievement : BaseAchievement { public class RavagerServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); InfiniteTowerRun.onAllEnemiesDefeatedServer += OnAllEnemiesDefeatedServer; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { InfiniteTowerRun.onAllEnemiesDefeatedServer -= OnAllEnemiesDefeatedServer; ((BaseServerAchievement)this).OnUninstall(); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnAllEnemiesDefeatedServer(InfiniteTowerWaveController waveController) { if ((Object)(object)unlock != (Object)null) { Run instance = Run.instance; InfiniteTowerRun val = (InfiniteTowerRun)(object)((instance is InfiniteTowerRun) ? instance : null); if (Object.op_Implicit((Object)(object)val) && val.waveIndex >= 50 && Run.instance.difficultyCoefficient >= 2f) { ((BaseServerAchievement)this).Grant(); } } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown if (Prefabs.survivorDefinitions.Count > 0) { survivor = Prefabs.survivorDefinitions[0]; icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texRavagerAchievement"); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonRavager", "BLOON_RAVAGER_ACHIEVEMENT", icon); LanguageAPI.Add("ACHIEVEMENT_BLOON_RAVAGER_ACHIEVEMENT_NAME", "No Longer Myself"); LanguageAPI.Add("ACHIEVEMENT_BLOON_RAVAGER_ACHIEVEMENT_DESCRIPTION", "Complete Wave 50 in the Simulacrum on Rainstorm difficulty or higher."); survivor.unlockableDef = unlock; Log.Message("Wahooooooooo!!!!!!!!! Ravager"); } CompleteWave50ServerAchievement.OnInstall += new hook_OnInstall(OnRemoveVoidFiendObjective1); CompleteWave50ServerAchievement.OnUninstall += new hook_OnUninstall(OnRemoveVoidFiendObjective2); LanguageAPI.AddOverlay("ACHIEVEMENT_COMPLETEVOIDENDING_DESCRIPTION", "Escape the Planetarium."); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnRemoveVoidFiendObjective1(orig_OnInstall orig, CompleteWave50ServerAchievement self) { } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void OnRemoveVoidFiendObjective2(orig_OnUninstall orig, CompleteWave50ServerAchievement self) { } } public class PaladinUnlock { [RegisterAchievement("Bloon_Paladin_Achievement", "Characters.BloonPaladin", null, 3u, typeof(PaladinServerAchievement))] public class PaladinAchievement : BaseAchievement { public class PaladinServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); ArtifactTrialMissionController.onShellDeathServer += OnTrialComplete; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnTrialComplete(ArtifactTrialMissionController self, DamageReport report) { if ((Object)(object)survivor != (Object)null) { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ArtifactTrialMissionController.onShellDeathServer -= OnTrialComplete; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; private static ILHook hook; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(Survivors), "RegisterSurvivors", (Type[])null, (Type[])null); hook = new ILHook((MethodBase)methodInfo, new Manipulator(IL_GetPaladinDef)); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void IL_GetPaladinDef(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MoveType val2 = (MoveType)2; ILLabel val3 = il.DefineLabel(); int loc1 = -1; int num = default(int); if (val.TryGotoNext(val2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref loc1), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(SurvivorDef), "unlockableDef") })) { val.Emit(OpCodes.Ldloc, loc1); val.EmitDelegate<Action<SurvivorDef>>((Action<SurvivorDef>)delegate(SurvivorDef survivorDef) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) survivor = survivorDef; Texture charPortrait = Asset.charPortrait; texture = (Texture2D)(object)((charPortrait is Texture2D) ? charPortrait : null); Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val4, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonPaladin", "BLOON_PALADIN_ACHIEVEMENT", icon); LanguageAPI.Add("ACHIEVEMENT_BLOON_PALADIN_ACHIEVEMENT_NAME", "Foundation"); LanguageAPI.Add("ACHIEVEMENT_BLOON_PALADIN_ACHIEVEMENT_DESCRIPTION", "Complete a trial in the Bulwark's Ambry."); survivorDef.unlockableDef = unlock; Log.Message("Wahooo!!!!!!!!!"); }); } else { Log.Error(((MemberReference)il.Method).Name + " Hook 1 failed!"); } } } public class MinerUnlock { [RegisterAchievement("Bloon_Miner_Achievement", "Characters.BloonMiner", null, 3u, typeof(MinerServerAchievement))] public class MinerAchievement : BaseAchievement { public class MinerServerAchievement : BaseServerAchievement { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseServerAchievement)this).OnInstall(); GlobalEventManager.onCharacterDeathGlobal += OnAuriDeath; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void OnAuriDeath(DamageReport report) { string baseSceneName = SceneCatalog.GetSceneDefForCurrentScene().baseSceneName; if (!(baseSceneName != "goldshores") && !((Object)(object)survivor == (Object)null) && ((Object)report.victimBody).name.Contains("Gold") && ((Object)report.victimBody).name.Contains("Titan")) { ((BaseServerAchievement)this).Grant(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { GlobalEventManager.onCharacterDeathGlobal -= OnAuriDeath; ((BaseServerAchievement)this).OnUninstall(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { ((BaseAchievement)this).OnInstall(); ((BaseAchievement)this).SetServerTracked(true); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnUninstall() { ((BaseAchievement)this).SetServerTracked(false); ((BaseAchievement)this).OnUninstall(); } } public static SurvivorDef survivor; public static Texture2D texture; public static Sprite icon; public static UnlockableDef unlock; private static Hook minerHook; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public void Initialize() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(Content), "AddSurvivorDef", (Type[])null, (Type[])null); minerHook = new Hook((MethodBase)methodInfo, (Delegate)new Action<Action<SurvivorDef>, SurvivorDef>(GetMinerDef)); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private void GetMinerDef(Action<SurvivorDef> orig, SurvivorDef survivorDef) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (survivorDef.displayNameToken == "MINER_NAME") { Log.Message("Wahoo!!!!"); survivor = survivorDef; Texture charPortrait = Assets.charPortrait; texture = (Texture2D)(object)((charPortrait is Texture2D) ? charPortrait : null); Rect val = default(Rect); ((Rect)(ref val))..ctor(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height); icon = Sprite.Create(texture, val, new Vector2(0.5f, 0.5f), 1f); unlock = Unlockables.CreateAndAddUnlockbleDef("Characters.BloonMiner", "BLOON_MINER_ACHIEVEMENT", icon); LanguageAPI.Add("ACHIEVEMENT_BLOON_MINER_ACHIEVEMENT_NAME", "All That Glitters"); LanguageAPI.Add("ACHIEVEMENT_BLOON_MINER_ACHIEVEMENT_DESCRIPTION", "Defeat the prisoner of the Gilded Coast."); survivorDef.unlockableDef = unlock; } orig(survivorDef); } } public class CadetUnlock { [RegisterAchievement("Bloon_Cadet_Achievement", "Characters.BloonCadet", null, 5u, null)] public class CadetAchievement : BaseAchievement { private bool achievementActive; private ulong droneCount; private PlayerCharacterMasterController currentMasterController; private Inventory currentInventory; [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public override void OnInstall() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but