using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security; using System.Security.Permissions; using System.Text; using Alexandria; using Alexandria.Assetbundle; using Alexandria.CharacterAPI; using Alexandria.EnemyAPI; using Alexandria.ItemAPI; using Alexandria.Misc; using Alexandria.PrefabAPI; using Alexandria.SoundAPI; using Alexandria.VisualAPI; using BepInEx; using BepInEx.Configuration; using Dungeonator; using Gungeon; using HarmonyLib; using JuneLib; using MikuMikuMod.Code; using MonoMod.RuntimeDetour; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Mod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Mod")] [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace MikuMikuMod { internal class AssetBundleLoader { public static AssetBundle LoadAssetBundleFromLiterallyAnywhere(string name, bool logs = false) { AssetBundle result = null; string text = name + GetPlatformBundleExtension(); if (File.Exists(MikuMikuModule.FilePathFolder + "/" + text)) { try { result = AssetBundle.LoadFromFile(Path.Combine(MikuMikuModule.FilePathFolder, text)); if (logs) { ETGModConsole.Log((object)"Successfully loaded assetbundle!", false); } } catch (Exception ex) { ETGModConsole.Log((object)"Failed loading asset bundle from file.", false); ETGModConsole.Log((object)ex.ToString(), false); } } else { ETGModConsole.Log((object)"AssetBundle NOT FOUND!", false); } return result; } private static string GetPlatformBundleExtension() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 if ((int)Application.platform == 13) { return "-linux"; } if ((int)Application.platform == 1) { return "-macos"; } return "-windows"; } } public class AudioResourceLoader { public static void loadFromFolder(string modName) { ResourceLoaderSoundbanks resourceLoaderSoundbanks = new ResourceLoaderSoundbanks(); resourceLoaderSoundbanks.AutoloadFromPath(MikuMikuModule.FilePathFolder, modName); } public static void loadFromAssembly(string bankName, string modName) { ResourceLoaderSoundbanks resourceLoaderSoundbanks = new ResourceLoaderSoundbanks(); resourceLoaderSoundbanks.AutoloadFromAssembly(Assembly.GetExecutingAssembly(), bankName, modName); } } public class ResourceLoaderSoundbanks { public void AutoloadFromAssembly(Assembly assembly, string bankName, string prefix) { if ((object)assembly == null) { throw new ArgumentNullException("assembly", "Assembly cannot be null."); } if (prefix == null) { throw new ArgumentNullException("prefix", "Prefix name cannot be null."); } prefix = prefix.Trim(); if (prefix == "") { throw new ArgumentException("Prefix name cannot be an empty (or whitespace only) string.", "prefix"); } List list = new List(assembly.GetManifestResourceNames()); for (int i = 0; i < list.Count; i++) { string text = list[i]; string text2 = text; text2 = text2.Replace('/', Path.DirectorySeparatorChar); text2 = text2.Replace('\\', Path.DirectorySeparatorChar); if (!text2.Contains(bankName)) { continue; } text2 = text2.Substring(text2.IndexOf(bankName)); if (text2.LastIndexOf(".bnk") == text2.Length - ".bnk".Length) { text2 = text2.Substring(0, text2.Length - ".bnk".Length); if (text2.IndexOf(Path.DirectorySeparatorChar) == 0) { text2 = text2.Substring(1); } text2 = prefix + ":" + text2; Debug.Log((object)$"{typeof(ResourceLoaderSoundbanks)}: Soundbank found, attempting to autoload: name='{text2}' resource='{text}'"); using Stream stream = assembly.GetManifestResourceStream(text); LoadSoundbankFromStream(stream, text2); } } } public void AutoloadFromPath(string path, string prefix) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException("path", "Path cannot be null."); } if (string.IsNullOrEmpty(prefix)) { throw new ArgumentNullException("prefix", "Prefix name cannot be null."); } prefix = prefix.Trim(); if (string.IsNullOrEmpty(prefix)) { throw new ArgumentException("Prefix name cannot be an empty (or whitespace only) string.", "prefix"); } path = path.Replace('/', Path.DirectorySeparatorChar); path = path.Replace('\\', Path.DirectorySeparatorChar); if (!Directory.Exists(path)) { Debug.LogError((object)$"{typeof(ResourceLoaderSoundbanks)}: No autoload directory in path, not autoloading anything. Path='{path}'."); return; } List list = new List(Directory.GetFiles(path, "*.bnk", SearchOption.AllDirectories)); for (int i = 0; i < list.Count; i++) { string text = list[i]; string text2 = text; text2 = text2.Replace('/', Path.DirectorySeparatorChar); text2 = text2.Replace('\\', Path.DirectorySeparatorChar); text2 = text2.Substring(text2.IndexOf(path) + path.Length); text2 = text2.Substring(0, text2.Length - ".bnk".Length); if (text2.IndexOf(Path.DirectorySeparatorChar) == 0) { text2 = text2.Substring(1); } text2 = prefix + ":" + text2; Debug.Log((object)$"{typeof(ResourceLoaderSoundbanks)}: Soundbank found, attempting to autoload: name='{text2}' file='{text}'"); using FileStream stream = File.OpenRead(text); LoadSoundbankFromStream(stream, text2); } } private void LoadSoundbankFromStream(Stream stream, string name) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) byte[] array = StreamToByteArray(stream); IntPtr intPtr = Marshal.AllocHGlobal(array.Length); try { Marshal.Copy(array, 0, intPtr, array.Length); uint num = default(uint); AKRESULT val = AkSoundEngine.LoadAndDecodeBankFromMemory(intPtr, (uint)array.Length, false, name, false, ref num); Debug.Log((object)$"Result of soundbank load: {val}."); } finally { Marshal.FreeHGlobal(intPtr); } } public static byte[] StreamToByteArray(Stream input) { byte[] array = new byte[16384]; using MemoryStream memoryStream = new MemoryStream(); int count; while ((count = input.Read(array, 0, array.Length)) > 0) { memoryStream.Write(array, 0, count); } return memoryStream.ToArray(); } } public static class Easing { public enum Ease { IN, OUT, IN_OUT, NONE, EASE_IN_AND_BACK } public static float DoLerpT(float t, Ease ease = Ease.IN_OUT) { return ease switch { Ease.IN => EaseIn(t), Ease.OUT => EaseOut(t), Ease.IN_OUT => EaseInOut(t), Ease.NONE => t, Ease.EASE_IN_AND_BACK => EaseInAndBack(t), _ => t, }; } public static float EaseIn(float t) { return t * t; } public static float EaseInInverse(float t) { return 1f - t * t; } public static float Flip(float t) { return 1f - t; } public static float EaseOut(float t) { return Flip(EaseIn(Flip(t))); } public static float EaseInOut(float t) { return Mathf.Lerp(EaseIn(t), EaseOut(t), t); } public static float EaseInAndBack(float t) { return Mathf.Lerp(EaseIn(t), EaseInInverse(t), t); } } public class Leek : PlayerItem { public static int ID; public static VFXPool Impact; public static string ImpactSFX; public static GameObject LeekObject; private MikuHarmony mikuHarmony; public static void Init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) string text = "Leek"; GameObject val = new GameObject(text); Leek leek = val.AddComponent(); tk2dSpriteCollectionData mikuItemAndGunCollection = StaticSpriteCollections.MikuItemAndGunCollection; ItemBuilder.AddSpriteToObjectAssetbundle(text, mikuItemAndGunCollection.GetSpriteIdByName("leek"), mikuItemAndGunCollection, val); string text2 = "Spin To Win! (Not Guaranteed)"; string text3 = "Spins items into other items. Gets more effective spins with higher Harmony.\n\nA leek..? How does a leek of all things work like that?"; ItemBuilder.SetupItem((PickupObject)(object)leek, text2, text3, "miku"); ItemBuilder.SetCooldownType((PlayerItem)(object)leek, (CooldownType)2, 5f); ((PlayerItem)leek).consumable = false; ((PickupObject)leek).quality = (ItemQuality)(-50); ItemBuilder.AddPassiveStatModifier((PickupObject)(object)leek, (StatType)8, 1f, (ModifyMethod)0); ((PickupObject)leek).CanBeDropped = false; ((PickupObject)leek).PreventStartingOwnerFromDropping = true; GameObject val2 = PrefabBuilder.BuildObject("leek"); tk2dSprite val3 = val2.gameObject.AddComponent(); ((tk2dBaseSprite)val3).SetSprite(StaticSpriteCollections.MikuItemAndGunCollection, "takingaleek"); ((BraveBehaviour)val3).renderer.material = new Material(ShaderCache.Acquire("Sprites/Default")); ((tk2dBaseSprite)val3).SortingOrder = 4; GameObjectExtensions.SetLayerRecursively(((Component)val3).gameObject, LayerMask.NameToLayer("FG_Critical")); ((BraveBehaviour)val3).renderer.sortingLayerName = "Foreground"; DepthLookupManager.AssignRendererToSortingLayer(((BraveBehaviour)val3).renderer, (GungeonSortingLayer)2); ImprovedAfterImage val4 = val2.AddComponent(); ((BraveBehaviour)val4).sprite = (tk2dBaseSprite)(object)val3; val4.shadowLifetime = 0.333f; val4.shadowTimeDelay = 0.0333f; val4.dashColor = Color.white; val4.targetHeight = 1f; LeekObject = val2; HarmonyPatches.OnActiveItemDropped = (Action)Delegate.Combine(HarmonyPatches.OnActiveItemDropped, new Action(OnThisActiveDropped)); ID = ((PickupObject)leek).PickupObjectId; } public static void OnThisActiveDropped(PlayerItem active, PlayerController player) { if (((PickupObject)active).PickupObjectId == ID) { ((PickupObject)active).Pickup(player); } } public static IEnumerator DoLeekToss(tk2dSpriteAnimator tk2DSpriteAnimator, tk2dSpriteAnimationFrame tk2DSpriteAnimationFrame) { AttachPoint[] attachPoints = tk2DSpriteAnimationFrame.spriteCollection.spriteDefinitions[tk2DSpriteAnimationFrame.spriteId].GetAttachPoints(tk2DSpriteAnimationFrame.spriteCollection, tk2DSpriteAnimationFrame.spriteId); Vector3 attachPoint_start = ((BraveBehaviour)tk2DSpriteAnimator).transform.position + Array.Find(attachPoints, (AttachPoint a) => a.name == "throwpoint_leek").position; Vector3 attachPoint_end = ((BraveBehaviour)tk2DSpriteAnimator).transform.position + Array.Find(attachPoints, (AttachPoint a) => a.name == "headlandspot").position; GameObject onject = Object.Instantiate(LeekObject, attachPoint_start, Quaternion.identity); float uiyferw = Random.Range(540, 1080); float e = 0f; AkSoundEngine.PostEvent("Play_OBJ_item_throw_01", onject.gameObject); while (e < 1f) { e += Time.deltaTime * 0.666f; onject.transform.position = Vector2.op_Implicit(Vector2.Lerp(Vector2.op_Implicit(attachPoint_start), Vector2.op_Implicit(attachPoint_end), e) + new Vector2(0f, Mathf.Lerp(0f, 5f, Easing.DoLerpT(e, Easing.Ease.EASE_IN_AND_BACK)))); onject.transform.Rotate(new Vector3(0f, 0f, uiyferw * Time.deltaTime)); yield return null; } if (((Component)tk2DSpriteAnimator).gameObject.activeSelf) { Impact.SpawnAtPosition(attachPoint_end, 0f, (Transform)null, (Vector2?)null, (Vector2?)null, (float?)null, false, (SpawnMethod)null, (tk2dBaseSprite)null, false); AkSoundEngine.PostEvent("Play_WPN_" + ImpactSFX + "_impact_01", onject.gameObject); } ((Behaviour)onject.GetComponent()).enabled = false; DebrisObject orAddComponent = GameObjectExtensions.GetOrAddComponent(onject); orAddComponent.angularVelocity = Random.Range(90, 120); orAddComponent.angularVelocityVariance = Random.Range(10, 60); orAddComponent.decayOnBounce = 0.5f; orAddComponent.bounceCount = 1; orAddComponent.canRotate = true; orAddComponent.shouldUseSRBMotion = true; orAddComponent.AssignFinalWorldDepth(-0.5f); ((BraveBehaviour)orAddComponent).sprite = onject.GetComponent(); orAddComponent.animatePitFall = true; orAddComponent.Trigger(Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Random.Range(0.5f, 2f))), 3.5f, 1f); orAddComponent.audioEventName = "Play_PET_junk_splat_01"; } public override void Pickup(PlayerController player) { ((PlayerItem)this).Pickup(player); SetHarmonyInst(); } private void SetHarmonyInst() { if ((Object)(object)base.LastOwner == (Object)null || (Object)(object)mikuHarmony != (Object)null) { return; } foreach (PassiveItem passiveItem in base.LastOwner.passiveItems) { if (passiveItem is MikuHarmony) { mikuHarmony = (MikuHarmony)(object)passiveItem; break; } } } public override bool CanBeUsed(PlayerController user) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between Unknown and I4 //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 if ((Object)(object)user == (Object)null) { return false; } IPlayerInteractable lastInteractable = user.GetLastInteractable(); if (lastInteractable != null) { PickupObject val = (PickupObject)(object)((lastInteractable is PickupObject) ? lastInteractable : null); if (val != null && (int)val.quality != -100 && (int)val.quality != -50 && (int)val.quality > 0) { return true; } } return false; } public override void DoEffect(PlayerController user) { SetHarmonyInst(); ((MonoBehaviour)user).StartCoroutine(LeekAllOverThePlace(user)); } private IEnumerator LeekAllOverThePlace(PlayerController user) { PickupObject pickupObject = null; IPlayerInteractable lastInteractable = user.GetLastInteractable(); int num; if (lastInteractable != null) { PickupObject interactablePickup = (PickupObject)(object)((lastInteractable is PickupObject) ? lastInteractable : null); num = ((interactablePickup != null) ? 1 : 0); } else { num = 0; } if (num != 0) { pickupObject = (PickupObject)lastInteractable; } if ((Object)(object)pickupObject == (Object)null) { yield break; } ((PickupObject)this).CanBeDropped = false; ((PlayerItem)this).IsCurrentlyActive = true; base.m_activeElapsed = 0f; base.m_activeDuration = 5f; user.CurrentRoom.DeregisterInteractable(lastInteractable); user.ToggleGunRenderers(false, "Leeking"); user.ToggleHandRenderers(false, "Leeking"); user.SetInputOverride("Leeking"); user.ZeroVelocityThisFrame = true; user.m_handlingQueuedAnimation = true; ((BraveBehaviour)user).spriteAnimator.PlayForDuration("select_leek_start", 0.5f, "select_leek_loop", false); PassiveItem passive = (PassiveItem)(object)((pickupObject is PassiveItem) ? pickupObject : null); if (passive != null) { passive.OnExitRange(user); } Gun gun = (Gun)(object)((pickupObject is Gun) ? pickupObject : null); if (gun != null) { gun.OnExitRange(user); } PlayerItem active = (PlayerItem)(object)((pickupObject is PlayerItem) ? pickupObject : null); if (active != null) { active.OnExitRange(user); } Vector2 v = ((BraveBehaviour)pickupObject).sprite.WorldCenter; _ = ((BraveBehaviour)pickupObject).transform.position; SquishyBounceWiggler p = ((Component)pickupObject).GetComponent(); if (Object.op_Implicit((Object)(object)p)) { ((Behaviour)p).enabled = false; } float particle = 40f; float delay = 1f / particle; float a = 0f; float e = 0f; float offsetAngleApplied = 0f; AkSoundEngine.PostEvent("Play_OBJ_item_throw_01", ((Component)base.LastOwner).gameObject); AkSoundEngine.PostEvent("Play_OBJ_rope_escape_01", ((Component)base.LastOwner).gameObject); SpriteOutlineManager.RemoveOutlineFromSprite(((BraveBehaviour)pickupObject).sprite, false); while (e < 1f) { e += Time.deltaTime * 0.66f; a += Time.deltaTime; float angleApplied = Mathf.Lerp(0f, 7223f, e * e) * Time.deltaTime; ((BraveBehaviour)pickupObject).transform.position = Vector2.op_Implicit(v); ((BraveBehaviour)pickupObject).transform.Rotate(new Vector3(0f, 0f, angleApplied)); Vector3 v_ = Vector2Extensions.ToVector3ZUp(((BraveBehaviour)pickupObject).sprite.WorldCenter, 120f) - ((BraveBehaviour)pickupObject).transform.position; offsetAngleApplied += angleApplied; Transform transform = ((BraveBehaviour)pickupObject).transform; transform.position -= v_; ((BraveBehaviour)pickupObject).transform.position = Vector3Extensions.WithZ(((BraveBehaviour)pickupObject).transform.position, 120f); if (a > delay) { a = 0f; particle += 1f; delay = 1f / particle; GlobalSparksDoer.DoSingleParticle(Vector2.op_Implicit(((BraveBehaviour)pickupObject).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Mathf.Min(12f, particle * 0.075f))), (float?)0.125f, (float?)0.5f, (Color?)Color.white, (SparksType)2); GlobalSparksDoer.DoSingleParticle(Vector2.op_Implicit(((BraveBehaviour)pickupObject).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Mathf.Min(8f, particle * 0.05f))), (float?)0.125f, (float?)1f, (Color?)Color.white, (SparksType)2); } yield return null; } AkSoundEngine.PostEvent("Play_BOSS_dragun_spin_01", ((Component)base.LastOwner).gameObject); e = 0f; while (e < 1f) { e += Time.deltaTime * 1f; a += Time.deltaTime; ((BraveBehaviour)pickupObject).transform.position = Vector2.op_Implicit(v); ((BraveBehaviour)pickupObject).transform.Rotate(new Vector3(0f, 0f, 7223f * Time.deltaTime)); Vector3 v_2 = Vector2Extensions.ToVector3ZUp(((BraveBehaviour)pickupObject).sprite.WorldCenter, 120f) - ((BraveBehaviour)pickupObject).transform.position; offsetAngleApplied += 7200f * Time.deltaTime; Transform transform2 = ((BraveBehaviour)pickupObject).transform; transform2.position -= v_2; ((BraveBehaviour)pickupObject).transform.position = Vector3Extensions.WithZ(((BraveBehaviour)pickupObject).transform.position, 120f); if (a > delay) { a = 0f; delay = 1f / particle; GlobalSparksDoer.DoSingleParticle(Vector2.op_Implicit(((BraveBehaviour)pickupObject).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Mathf.Min(12f, particle * 0.075f))), (float?)0.125f, (float?)0.5f, (Color?)Color.white, (SparksType)2); GlobalSparksDoer.DoSingleParticle(Vector2.op_Implicit(((BraveBehaviour)pickupObject).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Mathf.Min(8f, particle * 0.05f))), (float?)0.125f, (float?)1f, (Color?)Color.white, (SparksType)2); } yield return null; } int oldPickup = pickupObject.PickupObjectId; int SuccessfulRoll = 0; int newID = ((!(pickupObject is Gun)) ? ((PickupObject)PickupObjectDatabase.GetRandomGunOfQualities(new Random(), new List { oldPickup }, (ItemQuality[])(object)new ItemQuality[1] { (ItemQuality)(int)DetermineNewQuality(pickupObject, ref SuccessfulRoll) })).PickupObjectId : ((!(Random.value > 0.15f)) ? ((PickupObject)Toolbox.GetRandomActiveOfQualities(new Random(), new List { oldPickup }, (ItemQuality)(int)DetermineNewQuality(pickupObject, ref SuccessfulRoll))).PickupObjectId : ((PickupObject)PickupObjectDatabase.GetRandomPassiveOfQualities(new Random(), new List { 303, 243, 244, 245, 246, 247, 248, 72, 219, 222, oldPickup }, (ItemQuality[])(object)new ItemQuality[1] { (ItemQuality)(int)DetermineNewQuality(pickupObject, ref SuccessfulRoll) })).PickupObjectId)); GameObject silencerVFX = (GameObject)ResourceCache.Acquire("Global VFX/BlankVFX_Ghost"); GameObject blankObj = Object.Instantiate(silencerVFX.gameObject, Vector2.op_Implicit(v), Quaternion.identity); blankObj.transform.localScale = Vector3.one * 0.5f; Object.Destroy((Object)(object)blankObj, 2f); AkSoundEngine.PostEvent("Play_NPC_faerie_heal_01", ((Component)base.LastOwner).gameObject); switch (SuccessfulRoll) { case 0: { AkSoundEngine.PostEvent("Play_OBJ_prize_won_01", ((Component)base.LastOwner).gameObject); for (int j = 0; j < 18; j++) { ParticleBase.EmitNoiselessParticle(v, 2, 9f * Random.Range(0.8f, 1.2f), 20 * j, 1f); } break; } case 1: { AkSoundEngine.PostEvent("Play_NPC_magic_blessing_01", ((Component)base.LastOwner).gameObject); for (int k = 0; k < 36; k++) { ParticleBase.EmitNoiselessParticle(v, 4, 11.5f * Random.Range(0.8f, 1.2f), 10 * k, 1f); } break; } case -1: { AkSoundEngine.PostEvent("Play_NPC_Blessing_Slow_Tonic_01", ((Component)base.LastOwner).gameObject); for (int i = 0; i < 24; i++) { GlobalSparksDoer.DoSingleParticle(Vector2.op_Implicit(((BraveBehaviour)pickupObject).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(15 * i, 5.5f * Random.Range(0.8f, 1.2f))), (float?)0.2f, (float?)3f, (Color?)Color.red, (SparksType)6); } break; } } if ((Object)(object)((Component)pickupObject).GetComponent() != (Object)null) { Object.Destroy((Object)(object)((Component)pickupObject).GetComponent()); } if ((Object)(object)((Component)pickupObject).GetComponentInParent() != (Object)null) { Object.Destroy((Object)(object)((Component)pickupObject).GetComponentInParent()); } offsetAngleApplied = Mathf.Min(1463f, offsetAngleApplied); DebrisObject newPickup = LootEngine.SpawnItem(((Component)PickupObjectDatabase.GetById(newID)).gameObject, Vector2.op_Implicit(v), Vector2.zero, 0f, false, false, false); Exploder.DoDistortionWave(v, 0.5f, 0.1f, 50f, 0.333f); Object.Destroy((Object)(object)((Component)pickupObject).gameObject); yield return null; p = ((Component)newPickup).GetComponent(); if (Object.op_Implicit((Object)(object)p)) { ((Behaviour)p).enabled = false; } bool b = false; e = 0f; while (e < 1f) { if (e > 0.375f && !b) { b = true; ((BraveBehaviour)user).spriteAnimator.Play("select_leek_start_reverse"); } e += Time.deltaTime * 0.5f; ((BraveBehaviour)newPickup).transform.position = Vector2.op_Implicit(v); ((BraveBehaviour)newPickup).transform.localRotation = Quaternion.Euler(0f, 0f, Mathf.Lerp(offsetAngleApplied, 0f, Easing.DoLerpT(e, Easing.Ease.OUT))); Transform transform3 = ((BraveBehaviour)newPickup).transform; transform3.position -= Vector2Extensions.ToVector3ZUp(((BraveBehaviour)newPickup).sprite.WorldCenter, 120f) - ((BraveBehaviour)newPickup).transform.position; ((BraveBehaviour)newPickup).transform.position = Vector3Extensions.WithZ(((BraveBehaviour)newPickup).transform.position, 120f); SpeculativeRigidbody specRigidbody = ((BraveBehaviour)newPickup).specRigidbody; if (specRigidbody != null) { specRigidbody.Reinitialize(); } yield return null; } if (Object.op_Implicit((Object)(object)p)) { ((Behaviour)p).enabled = true; } ((BraveBehaviour)newPickup).transform.position = Vector2.op_Implicit(v); ((PickupObject)this).CanBeDropped = true; user.ToggleGunRenderers(true, "Leeking"); user.ToggleHandRenderers(true, "Leeking"); user.ClearInputOverride("Leeking"); ((PlayerItem)this).IsCurrentlyActive = false; } private ItemQuality DetermineNewQuality(PickupObject pickupObject, ref int RollType) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) RollType = 0; if ((int)pickupObject.quality > 1 && Random.value < DetermineHarmonyChance(positive: false)) { RollType = -1; return (ItemQuality)(pickupObject.quality - 1); } if ((int)pickupObject.quality < 5 && Random.value < DetermineHarmonyChance(positive: true)) { RollType = 1; return (ItemQuality)(pickupObject.quality + 1); } return pickupObject.quality; } public float DetermineHarmonyChance(bool positive) { SetHarmonyInst(); if ((Object)(object)mikuHarmony == (Object)null) { return 0f; } return mikuHarmony.CurrentHarmonyLevel switch { 0 => positive ? 0f : 0.15f, 1 => positive ? 0.0125f : 0.075f, 2 => positive ? 0.075f : 0.025f, 3 => positive ? 0.125f : 0.0125f, 4 => positive ? 0.15f : 0f, _ => 0f, }; } static Leek() { PickupObject byId = PickupObjectDatabase.GetById(539); Impact = ((Gun)((byId is Gun) ? byId : null)).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.enemy; PickupObject byId2 = PickupObjectDatabase.GetById(539); ImpactSFX = ((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.chargeProjectiles[0].Projectile.enemyImpactEventName; } } public class MikuMikuBeam : GunBehaviour { public class FancyTipParticles : MonoBehaviour { public float TimeBetweenParticles = 0.1f; private float elapsed; private Vector2 StoredBonePosition; public bool ignoreQueues; public float tickDelay; private Projectile projectile; private BasicBeamController basicBeamController; public Vector2 Velocity; public bool isEmber = false; public EmitParams emitParams; public FancyTipParticles() { tickDelay = 0.05f; ignoreQueues = true; } private void Start() { projectile = ((Component)this).GetComponent(); basicBeamController = ((Component)this).GetComponent(); } private void Update() { //IL_0042: 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_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_00d2: 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) DoTick(); elapsed += BraveTime.DeltaTime; if (elapsed > TimeBetweenParticles) { elapsed = 0f; ((EmitParams)(ref emitParams)).position = Vector2.op_Implicit(StoredBonePosition); if (((Vector2)(ref Velocity)).magnitude > 0f) { ((EmitParams)(ref emitParams)).velocity = Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Random.Range(Velocity.x, Velocity.y))); } elapsed = 0f; if (isEmber) { ParticleBase.MikuBeam_2.Emit(emitParams, 1); } else { ParticleBase.Chaff_BG.Emit(emitParams, 1); } } } private void DoTick() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) LinkedList bones = basicBeamController.m_bones; LinkedListNode last = bones.Last; Vector2 bonePosition = basicBeamController.GetBonePosition(last.Value); StoredBonePosition = bonePosition; } public void OnDestroy() { } } public static Projectile[] BeamProjectiles; public static void Add() { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_12a0: Unknown result type (might be due to invalid IL or missing references) //IL_12a7: Expected O, but got Unknown //IL_12c2: Unknown result type (might be due to invalid IL or missing references) //IL_12c7: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_07c9: Unknown result type (might be due to invalid IL or missing references) //IL_082e: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Unknown result type (might be due to invalid IL or missing references) //IL_08f6: Unknown result type (might be due to invalid IL or missing references) //IL_08fb: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Unknown result type (might be due to invalid IL or missing references) //IL_0928: Unknown result type (might be due to invalid IL or missing references) //IL_092d: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_094b: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Unknown result type (might be due to invalid IL or missing references) //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_0a1e: Unknown result type (might be due to invalid IL or missing references) //IL_0a3f: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b40: Unknown result type (might be due to invalid IL or missing references) //IL_0b58: Unknown result type (might be due to invalid IL or missing references) //IL_0b5a: Unknown result type (might be due to invalid IL or missing references) //IL_0b6b: Unknown result type (might be due to invalid IL or missing references) //IL_0b70: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c22: Unknown result type (might be due to invalid IL or missing references) //IL_0c27: Unknown result type (might be due to invalid IL or missing references) //IL_0c3b: Unknown result type (might be due to invalid IL or missing references) //IL_0c40: Unknown result type (might be due to invalid IL or missing references) //IL_0c54: Unknown result type (might be due to invalid IL or missing references) //IL_0c59: Unknown result type (might be due to invalid IL or missing references) //IL_0c72: Unknown result type (might be due to invalid IL or missing references) //IL_0c77: Unknown result type (might be due to invalid IL or missing references) //IL_0c8b: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Unknown result type (might be due to invalid IL or missing references) //IL_0ca9: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_0cc2: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Unknown result type (might be due to invalid IL or missing references) //IL_0d57: Unknown result type (might be due to invalid IL or missing references) //IL_0e01: Unknown result type (might be due to invalid IL or missing references) //IL_0e15: Unknown result type (might be due to invalid IL or missing references) //IL_0e1d: Unknown result type (might be due to invalid IL or missing references) //IL_0e56: Unknown result type (might be due to invalid IL or missing references) //IL_0e7f: Unknown result type (might be due to invalid IL or missing references) //IL_0e84: Unknown result type (might be due to invalid IL or missing references) //IL_0e9c: Unknown result type (might be due to invalid IL or missing references) //IL_0e9e: Unknown result type (might be due to invalid IL or missing references) //IL_0eaf: Unknown result type (might be due to invalid IL or missing references) //IL_0eb4: Unknown result type (might be due to invalid IL or missing references) //IL_0fb9: Unknown result type (might be due to invalid IL or missing references) //IL_0fc8: Unknown result type (might be due to invalid IL or missing references) //IL_0fdc: Unknown result type (might be due to invalid IL or missing references) //IL_0ff0: Unknown result type (might be due to invalid IL or missing references) //IL_1009: Unknown result type (might be due to invalid IL or missing references) //IL_101d: Unknown result type (might be due to invalid IL or missing references) //IL_1036: Unknown result type (might be due to invalid IL or missing references) //IL_104a: Unknown result type (might be due to invalid IL or missing references) //IL_10da: Unknown result type (might be due to invalid IL or missing references) //IL_1136: Unknown result type (might be due to invalid IL or missing references) //IL_113e: Unknown result type (might be due to invalid IL or missing references) //IL_1169: Unknown result type (might be due to invalid IL or missing references) //IL_1192: Unknown result type (might be due to invalid IL or missing references) //IL_1197: Unknown result type (might be due to invalid IL or missing references) //IL_11af: Unknown result type (might be due to invalid IL or missing references) //IL_11b1: Unknown result type (might be due to invalid IL or missing references) //IL_11c2: Unknown result type (might be due to invalid IL or missing references) //IL_11c7: Unknown result type (might be due to invalid IL or missing references) //IL_122a: Unknown result type (might be due to invalid IL or missing references) //IL_1377: Unknown result type (might be due to invalid IL or missing references) //IL_137e: Expected O, but got Unknown //IL_13cf: Unknown result type (might be due to invalid IL or missing references) //IL_13ee: Unknown result type (might be due to invalid IL or missing references) //IL_141a: Unknown result type (might be due to invalid IL or missing references) //IL_1439: Unknown result type (might be due to invalid IL or missing references) //IL_143e: Unknown result type (might be due to invalid IL or missing references) //IL_1458: Unknown result type (might be due to invalid IL or missing references) Gun val = Databases.Items.NewGun("Miku (Miku) Beam!!!", "MikuMikuBeam"); Game.Items.Rename("outdated_gun_mods:miku_(miku)_beam!!!", "miku:miku_(miku)_beam!!!"); MikuMikuBeam mikuMikuBeam = ((Component)val).gameObject.AddComponent(); GunExt.SetShortDescription((PickupObject)(object)val, "M@gical Cure, Love Shot!"); GunExt.SetLongDescription((PickupObject)(object)val, "Sing to your hearts content!\n\nGreatly empowered with Harmony."); BeamProjectiles = (Projectile[])(object)new Projectile[5]; ((Component)val).GetComponent().GetClipByName(val.reloadAnimation).frames[0].eventAudio = "Play_WPN_blackhole_impact_01"; ((Component)val).GetComponent().GetClipByName(val.reloadAnimation).frames[0].triggerEvent = true; GunInt.SetupSprite(val, StaticSpriteCollections.MikuItemAndGunCollection, "microphone_ammonomicon", 0, (string)null); val.m_sprite.Collection = StaticSpriteCollections.MikuItemAndGunCollection; ((BraveBehaviour)val).spriteAnimator.Library = StaticSpriteCollections.ItemAndWeaponAnimation; ((BraveBehaviour)val).sprite.SortingOrder = 1; val.idleAnimation = "mic_idle"; val.shootAnimation = "mic_fire"; val.reloadAnimation = "mic_reload"; val.emptyAnimation = "mic_empty"; ((PickupObject)val).CanBeDropped = false; ((PickupObject)val).PreventStartingOwnerFromDropping = true; val.gunHandedness = (GunHandedness)2; val.m_defaultSpriteID = StaticSpriteCollections.MikuItemAndGunCollection.GetSpriteIdByName("microphone_idle_001"); int num = (val.DefaultSpriteID = StaticSpriteCollections.MikuItemAndGunCollection.GetSpriteIdByName("microphone_idle_001")); int num2 = num; ((BraveBehaviour)val).sprite.SetSprite(StaticSpriteCollections.MikuItemAndGunCollection, num2); Shader val2 = ShaderCache.Acquire("Brave/LitTk2dCustomFalloffTiltedCutoutEmissive"); Material val3 = new Material(val2); val3.mainTexture = StaticSpriteCollections.ProjectileAndBeamCollection.material.mainTexture; val3.EnableKeyword("BRIGHTNESS_CLAMP_ON"); val3.SetFloat("_EmissivePower", 20f); val3.SetFloat("_EmissiveColorPower", 5f); tk2dSpriteDefinition[] spriteDefinitions = StaticSpriteCollections.ProjectileAndBeamCollection.spriteDefinitions; foreach (tk2dSpriteDefinition val4 in spriteDefinitions) { val4.material = val3; } val.Volley.ModulesAreTiers = true; val.isAudioLoop = true; val.gunSwitchGroup = string.Empty; for (int j = 0; j < 5; j++) { PickupObject byId = PickupObjectDatabase.GetById(86); GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, false); } for (int k = 0; k < val.Volley.projectiles.Count; k++) { ProjectileModule val5 = val.Volley.projectiles[k]; val5.ammoCost = 10; val5.shootStyle = (ShootStyle)2; val5.sequenceStyle = (ProjectileSequenceStyle)0; val5.cooldownTime = 1f; val5.numberOfShotsInClip = 50; val5.angleVariance = 0f; val5.ammoType = (AmmoType)2; EmitParams emitParams; switch (k) { case 0: { PickupObject byId10 = PickupObjectDatabase.GetById(86); Projectile val15 = Object.Instantiate(((Gun)((byId10 is Gun) ? byId10 : null)).DefaultModule.projectiles[0]); ((Component)val15).gameObject.SetActive(false); val15.shouldRotate = true; ((Object)val15).name = "MikuBeam_1"; FakePrefab.MarkAsFakePrefab(((Component)val15).gameObject); Object.DontDestroyOnLoad((Object)(object)val15); BasicBeamController val16 = BeamBuilders.GenerateBeamPrefabBundle(val15, "mikubeam_tier1_impact_001", StaticSpriteCollections.ProjectileAndBeamCollection, StaticSpriteCollections.ProjectileAndBeamAnimation, "mikubeam_1_main_idle", new Vector2(4f, 4f), new Vector2(0f, 0f), "mikubeam_1_impact", (Vector2?)new Vector2(4f, 4f), (Vector2?)new Vector2(0f, 0f), "mikubeam_1_main_idle", (Vector2?)new Vector2(4f, 4f), (Vector2?)new Vector2(0f, 0f), "mikubeam_1_start_idle", (Vector2?)new Vector2(4f, 4f), (Vector2?)new Vector2(0f, 0f), false, true, "mikubeam_1_main_start", "mikubeam_1_start_start", "mikubeam_1_main_start", 0.25f, true, "mikubeam_1_main_dissipate", "mikubeam_1_start_dissipate", "mikubeam_1_main_dissipate", 0.1f); val15.baseData.damage = 16.66f; val15.baseData.force = 18f; val15.baseData.range = 1000f; val15.baseData.speed = 25f; ((BraveBehaviour)val15).specRigidbody.CollideWithOthers = false; val16.boneType = (BeamBoneType)2; ref string startAudioEvent3 = ref val16.startAudioEvent; PickupObject byId11 = PickupObjectDatabase.GetById(87); startAudioEvent3 = ((Component)((Gun)((byId11 is Gun) ? byId11 : null)).DefaultModule.projectiles[0]).GetComponent().startAudioEvent; ref string endAudioEvent3 = ref val16.endAudioEvent; PickupObject byId12 = PickupObjectDatabase.GetById(87); endAudioEvent3 = ((Component)((Gun)((byId12 is Gun) ? byId12 : null)).DefaultModule.projectiles[0]).GetComponent().endAudioEvent; ((BraveBehaviour)val16).projectile.baseData.damage = 16.66f; val16.reflections = 0; ((BeamController)val16).IsReflectedBeam = false; val16.DispersalParticleSystemPrefab = ((Component)ParticleBase.MikuBeam_1).gameObject; val16.UsesDispersalParticles = true; val16.DispersalMinCoherency = 0.1f; val16.DispersalMaxCoherency = 0.2f; val16.DispersalDensity = 0.0001f; val16.DispersalExtraImpactFactor = 3f; val16.usesTelegraph = false; val16.collisionType = (BeamCollisionType)0; val16.collisionRadius = 0.25f; val16.TileType = (BeamTileType)0; val16.interpolateStretchedBones = false; val16.endType = (BeamEndType)0; ((BeamController)val16).usesChargeDelay = false; val16.ContinueBeamArtToWall = true; ((BraveBehaviour)val16).sprite.usesOverrideMaterial = true; val5.projectiles[0] = val15; BeamProjectiles[0] = val15; break; } case 1: { PickupObject byId7 = PickupObjectDatabase.GetById(86); Projectile val13 = Object.Instantiate(((Gun)((byId7 is Gun) ? byId7 : null)).DefaultModule.projectiles[0]); val13.shouldRotate = true; ((Object)val13).name = "MikuBeam_2"; ((Component)val13).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val13).gameObject); Object.DontDestroyOnLoad((Object)(object)val13); BasicBeamController val14 = BeamBuilders.GenerateBeamPrefabBundle(val13, "mikubeam_tier2_impact_001", StaticSpriteCollections.ProjectileAndBeamCollection, StaticSpriteCollections.ProjectileAndBeamAnimation, "mikubeam_2_main_idle", new Vector2(8f, 8f), new Vector2(0f, 0f), "mikubeam_2_impact", (Vector2?)new Vector2(8f, 8f), (Vector2?)new Vector2(0f, 0f), "mikubeam_2_main_idle", (Vector2?)new Vector2(8f, 8f), (Vector2?)new Vector2(0f, 0f), "mikubeam_2_start_idle", (Vector2?)new Vector2(8f, 8f), (Vector2?)new Vector2(0f, 0f), false, true, "mikubeam_2_main_start", "mikubeam_2_start_start", "mikubeam_2_main_start", 0.25f, true, "mikubeam_2_main_dissipate", "mikubeam_2_start_dissipate", "mikubeam_2_main_dissipate", 0.125f); val13.baseData.damage = 20f; val13.baseData.force = 22.5f; val13.baseData.range = 1000f; val13.baseData.speed = 37.5f; ((BraveBehaviour)val13).specRigidbody.CollideWithOthers = false; val14.boneType = (BeamBoneType)2; ref string startAudioEvent2 = ref val14.startAudioEvent; PickupObject byId8 = PickupObjectDatabase.GetById(40); startAudioEvent2 = ((Component)((Gun)((byId8 is Gun) ? byId8 : null)).DefaultModule.projectiles[0]).GetComponent().startAudioEvent; ref string endAudioEvent2 = ref val14.endAudioEvent; PickupObject byId9 = PickupObjectDatabase.GetById(40); endAudioEvent2 = ((Component)((Gun)((byId9 is Gun) ? byId9 : null)).DefaultModule.projectiles[0]).GetComponent().endAudioEvent; ((BraveBehaviour)val14).projectile.baseData.damage = 20f; val14.reflections = 0; ((BeamController)val14).IsReflectedBeam = false; val14.ContinueBeamArtToWall = true; val14.collisionType = (BeamCollisionType)0; val14.collisionRadius = 0.5f; val14.usesTelegraph = false; val14.DispersalParticleSystemPrefab = ((Component)ParticleBase.MikuBeam_2).gameObject; val14.UsesDispersalParticles = true; val14.DispersalMinCoherency = 0.04f; val14.DispersalMaxCoherency = 0.1f; val14.DispersalDensity = 1E-05f; val14.DispersalExtraImpactFactor = 3f; val14.TileType = (BeamTileType)0; val14.endType = (BeamEndType)0; ((BraveBehaviour)val14).sprite.usesOverrideMaterial = true; val5.projectiles[0] = val13; BeamProjectiles[1] = val13; break; } case 2: { PickupObject byId13 = PickupObjectDatabase.GetById(86); Projectile val17 = Object.Instantiate(((Gun)((byId13 is Gun) ? byId13 : null)).DefaultModule.projectiles[0]); ((Object)val17).name = "MikuBeam_3"; val17.shouldRotate = true; ((Component)val17).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val17).gameObject); Object.DontDestroyOnLoad((Object)(object)val17); BasicBeamController val18 = BeamBuilders.GenerateBeamPrefabBundle(val17, "mikubeam_tier3_impact_001", StaticSpriteCollections.ProjectileAndBeamCollection, StaticSpriteCollections.ProjectileAndBeamAnimation, "mikubeam_3_main_idle", Vector2.op_Implicit(new Vector3(10f, 10f)), Vector2.op_Implicit(new Vector3(0f, 0f)), "mikubeam_3_impact", (Vector2?)Vector2.op_Implicit(new Vector3(10f, 10f)), (Vector2?)Vector2.op_Implicit(new Vector3(0f, 0f)), "mikubeam_3_main_idle", (Vector2?)Vector2.op_Implicit(new Vector3(10f, 10f)), (Vector2?)Vector2.op_Implicit(new Vector3(0f, 0f)), "mikubeam_3_start_idle", (Vector2?)Vector2.op_Implicit(new Vector3(10f, 10f)), (Vector2?)Vector2.op_Implicit(new Vector3(0f, 0f)), false, true, "mikubeam_3_main_start", "mikubeam_3_start_start", "mikubeam_3_main_start", 0.4f, true, "mikubeam_3_main_dissipate", "mikubeam_3_start_dissipate", "mikubeam_3_main_dissipate", 0.15f); val17.baseData.damage = 24f; val17.baseData.force = 35f; val17.baseData.range = 1000f; val17.baseData.speed = 40f; val18.collisionType = (BeamCollisionType)0; val18.collisionRadius = 1f; ((BraveBehaviour)val17).specRigidbody.CollideWithOthers = false; val18.boneType = (BeamBoneType)0; ref string startAudioEvent4 = ref val18.startAudioEvent; PickupObject byId14 = PickupObjectDatabase.GetById(40); startAudioEvent4 = ((Component)((Gun)((byId14 is Gun) ? byId14 : null)).DefaultModule.projectiles[0]).GetComponent().startAudioEvent; ref string endAudioEvent4 = ref val18.endAudioEvent; PickupObject byId15 = PickupObjectDatabase.GetById(40); endAudioEvent4 = ((Component)((Gun)((byId15 is Gun) ? byId15 : null)).DefaultModule.projectiles[0]).GetComponent().endAudioEvent; ((BraveBehaviour)val18).projectile.baseData.damage = 24f; val18.reflections = 0; ((BeamController)val18).IsReflectedBeam = false; val18.ContinueBeamArtToWall = true; ((BraveBehaviour)val18).sprite.usesOverrideMaterial = true; val18.TileType = (BeamTileType)0; val18.endType = (BeamEndType)0; FancyTipParticles fancyTipParticles3 = ((Component)val18).gameObject.AddComponent(); fancyTipParticles3.isEmber = false; fancyTipParticles3.TimeBetweenParticles = 0.02f; emitParams = default(EmitParams); ((EmitParams)(ref emitParams)).startLifetime = 1f; ((EmitParams)(ref emitParams)).startColor = Color32.op_Implicit(new Color(0f, 0.9f, 0.9f, 1f)); ((EmitParams)(ref emitParams)).startSize = 0.1f; fancyTipParticles3.emitParams = emitParams; fancyTipParticles3.Velocity = new Vector2(0.75f, 1.25f); val5.projectiles[0] = val17; BeamProjectiles[2] = val17; break; } case 3: { PickupObject byId4 = PickupObjectDatabase.GetById(86); Projectile val9 = Object.Instantiate(((Gun)((byId4 is Gun) ? byId4 : null)).DefaultModule.projectiles[0]); ((Object)val9).name = "MikuBeam_4"; val9.shouldRotate = true; ((Component)val9).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val9).gameObject); Object.DontDestroyOnLoad((Object)(object)val9); BasicBeamController val10 = BeamBuilders.GenerateBeamPrefabBundle(val9, "mikubeam_tier4_impact_001", StaticSpriteCollections.ProjectileAndBeamCollection, StaticSpriteCollections.ProjectileAndBeamAnimation, "mikubeam_4_main_idle", Vector4.op_Implicit(new Vector4(18f, 12f)), Vector4.op_Implicit(new Vector4(0f, 3f)), "mikubeam_4_impact", (Vector2?)Vector4.op_Implicit(new Vector4(18f, 12f)), (Vector2?)Vector4.op_Implicit(new Vector4(0f, 3f)), "mikubeam_4_main_idle", (Vector2?)Vector4.op_Implicit(new Vector4(18f, 12f)), (Vector2?)Vector4.op_Implicit(new Vector4(0f, 3f)), "mikubeam_4_start_idle", (Vector2?)Vector4.op_Implicit(new Vector4(18f, 12f)), (Vector2?)Vector4.op_Implicit(new Vector4(0f, 3f)), false, true, "mikubeam_4_main_start", "mikubeam_4_start_start", "mikubeam_4_main_start", 0.55f, true, "mikubeam_4_main_dissipate", "mikubeam_4_start_dissipate", "mikubeam_4_main_dissipate", 0.2f); val9.baseData.damage = 30f; val9.baseData.force = 55f; val9.baseData.range = 1000f; val9.baseData.speed = 40f; ((BraveBehaviour)val9).specRigidbody.CollideWithOthers = false; val10.boneType = (BeamBoneType)0; ref string startAudioEvent = ref val10.startAudioEvent; PickupObject byId5 = PickupObjectDatabase.GetById(40); startAudioEvent = ((Component)((Gun)((byId5 is Gun) ? byId5 : null)).DefaultModule.projectiles[0]).GetComponent().startAudioEvent; ref string endAudioEvent = ref val10.endAudioEvent; PickupObject byId6 = PickupObjectDatabase.GetById(40); endAudioEvent = ((Component)((Gun)((byId6 is Gun) ? byId6 : null)).DefaultModule.projectiles[0]).GetComponent().endAudioEvent; ((BraveBehaviour)val10).projectile.baseData.damage = 30f; val10.reflections = 0; ((BeamController)val10).IsReflectedBeam = false; val10.ContinueBeamArtToWall = true; val10.startAudioEvent = "Play_ENM_deathray_shot_01"; val10.endAudioEvent = "Stop_ENM_deathray_loop_01"; val10.collisionType = (BeamCollisionType)0; val10.collisionRadius = 1.25f; val10.TileType = (BeamTileType)0; val10.endType = (BeamEndType)0; ((BraveBehaviour)val10).sprite.usesOverrideMaterial = true; FancyTipParticles fancyTipParticles2 = ((Component)val10).gameObject.AddComponent(); fancyTipParticles2.isEmber = false; fancyTipParticles2.TimeBetweenParticles = 0.02f; emitParams = default(EmitParams); ((EmitParams)(ref emitParams)).startLifetime = 0.75f; ((EmitParams)(ref emitParams)).startColor = Color32.op_Implicit(new Color(0f, 0.6f, 0.9f, 1f)); ((EmitParams)(ref emitParams)).startSize = 0.2f; fancyTipParticles2.emitParams = emitParams; fancyTipParticles2.Velocity = new Vector2(2.5f, 3.25f); AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid("b98b10fca77d469e80fb45f3c5badec5"); Component[] componentsInChildren = ((Component)orLoadByGuid).GetComponentsInChildren(typeof(Component)); foreach (Component val11 in componentsInChildren) { BossFinalRogueLaserGun val12 = (BossFinalRogueLaserGun)(object)((val11 is BossFinalRogueLaserGun) ? val11 : null); if (val12 != null && Object.op_Implicit((Object)(object)val12.beamProjectile)) { break; } } val5.projectiles[0] = val9; BeamProjectiles[3] = val9; break; } case 4: { PickupObject byId2 = PickupObjectDatabase.GetById(86); Projectile val6 = Object.Instantiate(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]); ((Component)val6).gameObject.SetActive(false); val6.shouldRotate = true; ((Object)val6).name = "MikuBeam_5"; FakePrefab.MarkAsFakePrefab(((Component)val6).gameObject); Object.DontDestroyOnLoad((Object)(object)val6); BasicBeamController val7 = BeamBuilders.GenerateBeamPrefabBundle(val6, "mikubeam_tier5_impact_001", StaticSpriteCollections.ProjectileAndBeamCollection, StaticSpriteCollections.ProjectileAndBeamAnimation, "mikubeam_5_main_idle", new Vector2(28f, 20f), new Vector2(0f, 4f), "mikubeam_5_impact", (Vector2?)new Vector2(28f, 20f), (Vector2?)new Vector2(0f, 4f), "mikubeam_5_main_idle", (Vector2?)new Vector2(28f, 20f), (Vector2?)new Vector2(0f, 4f), "mikubeam_5_start_idle", (Vector2?)new Vector2(28f, 20f), (Vector2?)new Vector2(0f, 4f), false, true, "mikubeam_5_main_start", "mikubeam_5_start_start", "mikubeam_5_main_start", 1.33f, true, "mikubeam_5_main_dissipate", "mikubeam_5_start_dissipate", "mikubeam_5_main_dissipate", 0.2f); val6.baseData.damage = 45f; val6.baseData.force = 90f; val6.baseData.range = 1000f; val6.baseData.speed = 40f; ((BraveBehaviour)val6).specRigidbody.CollideWithOthers = false; val7.boneType = (BeamBoneType)0; ((BraveBehaviour)val7).projectile.baseData.damage = 45f; ((BraveBehaviour)val7).projectile.baseData.force = 90f; val7.reflections = 0; ((BeamController)val7).IsReflectedBeam = false; val7.ContinueBeamArtToWall = true; ((BraveBehaviour)val7).sprite.usesOverrideMaterial = true; val7.TileType = (BeamTileType)0; val7.endType = (BeamEndType)0; FancyTipParticles fancyTipParticles = ((Component)val7).gameObject.AddComponent(); fancyTipParticles.isEmber = false; fancyTipParticles.TimeBetweenParticles = 0.01666f; emitParams = default(EmitParams); ((EmitParams)(ref emitParams)).startLifetime = 0.625f; ((EmitParams)(ref emitParams)).startColor = Color32.op_Implicit(new Color(0f, 1f, 1f, 1f)); ((EmitParams)(ref emitParams)).startSize = 0.5f; fancyTipParticles.emitParams = emitParams; fancyTipParticles.Velocity = new Vector2(4.5f, 6.75f); PickupObject byId3 = PickupObjectDatabase.GetById(519); CombineEvaporateEffect component = ((Component)((Gun)((byId3 is Gun) ? byId3 : null)).alternateVolley.projectiles[0].projectiles[0]).GetComponent(); CombineEvaporateEffect val8 = ((Component)val7).gameObject.AddComponent(); val8.ParticleSystemToSpawn = component.ParticleSystemToSpawn; val8.FallbackShader = component.FallbackShader; val7.collisionType = (BeamCollisionType)0; val7.collisionRadius = 1.66f; BeamProjectiles[4] = val6; val5.projectiles[0] = val6; break; } } } ((BraveBehaviour)val).sprite.usesOverrideMaterial = true; Material val19 = new Material(((BraveBehaviour)((BraveBehaviour)EnemyDatabase.GetOrLoadByName("GunNut")).sprite).renderer.material); val19.SetColor("_EmissiveColor", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)225, byte.MaxValue, byte.MaxValue))); val19.SetFloat("_EmissiveColorPower", 1.55f); val19.SetFloat("_EmissivePower", 100f); val19.SetFloat("_EmissiveThresholdSensitivity", 0.2f); MeshRenderer component2 = ((Component)val).GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { return; } Material[] array = ((Renderer)component2).sharedMaterials; for (int m = 0; m < array.Length; m++) { if ((Object)(object)array[m].shader == (Object)(object)val19) { return; } } Array.Resize(ref array, array.Length + 1); Material val20 = new Material(val19); val20.SetTexture("_MainTex", array[0].GetTexture("_MainTex")); array[^1] = val20; ((Renderer)component2).sharedMaterials = array; val.doesScreenShake = false; val.InfiniteAmmo = true; val.reloadTime = 1.3f; val.muzzleFlashEffects.type = (VFXPoolType)0; ((Component)val.barrelOffset).transform.localPosition = new Vector3(1.125f, 0.5f, 0f); val.SetBaseMaxAmmo(360); val.ammo = 360; val.PreventNormalFireAudio = true; val.gunClass = (GunClass)20; ref string gunSwitchGroup = ref val.gunSwitchGroup; PickupObject byId16 = PickupObjectDatabase.GetById(87); gunSwitchGroup = ((Gun)((byId16 is Gun) ? byId16 : null)).gunSwitchGroup; val.carryPixelOffset = new IntVector2(3, 0); Databases.Items.Add((PickupObject)(object)val, false, "ANY"); ((PickupObject)val).quality = (ItemQuality)(-50); } public void ToggleInfinityClip(bool value) { if (value) { base.gun.ForceImmediateReload(true); } for (int i = 0; i < base.gun.Volley.projectiles.Count; i++) { int num = (base.gun.Volley.projectiles[i].ammoCost = ((!value) ? 10 : 0)); } } public void OnTierSwitched(int Tier) { if (base.gun.IsFiring) { base.gun.CeaseAttack(false, (ProjectileData)null); } base.gun.ForceImmediateReload(true); switch (Tier) { case 0: { base.gun.CurrentStrengthTier = 0; ref string gunSwitchGroup5 = ref base.gun.gunSwitchGroup; PickupObject byId5 = PickupObjectDatabase.GetById(87); gunSwitchGroup5 = ((Gun)((byId5 is Gun) ? byId5 : null)).gunSwitchGroup; base.gun.m_hasReinitializedAudioSwitch = false; break; } case 1: { base.gun.CurrentStrengthTier = 1; ref string gunSwitchGroup4 = ref base.gun.gunSwitchGroup; PickupObject byId4 = PickupObjectDatabase.GetById(40); gunSwitchGroup4 = ((Gun)((byId4 is Gun) ? byId4 : null)).gunSwitchGroup; base.gun.m_hasReinitializedAudioSwitch = false; break; } case 2: { base.gun.CurrentStrengthTier = 2; ref string gunSwitchGroup3 = ref base.gun.gunSwitchGroup; PickupObject byId3 = PickupObjectDatabase.GetById(179); gunSwitchGroup3 = ((Gun)((byId3 is Gun) ? byId3 : null)).gunSwitchGroup; base.gun.m_hasReinitializedAudioSwitch = false; break; } case 3: { base.gun.CurrentStrengthTier = 3; ref string gunSwitchGroup2 = ref base.gun.gunSwitchGroup; PickupObject byId2 = PickupObjectDatabase.GetById(328); gunSwitchGroup2 = ((Gun)((byId2 is Gun) ? byId2 : null)).gunSwitchGroup; base.gun.m_hasReinitializedAudioSwitch = false; break; } case 4: { base.gun.CurrentStrengthTier = 4; ref string gunSwitchGroup = ref base.gun.gunSwitchGroup; PickupObject byId = PickupObjectDatabase.GetById(518); gunSwitchGroup = ((Gun)((byId is Gun) ? byId : null)).gunSwitchGroup; base.gun.m_hasReinitializedAudioSwitch = false; break; } } } public override void OnReloadPressed(PlayerController player, Gun gun, bool bSOMETHING) { if (gun.IsFiring) { gun.CeaseAttack(false, (ProjectileData)null); } if (gun.IsReloading) { gun.CeaseAttack(false, (ProjectileData)null); AkSoundEngine.PostEvent("Stop_WPN_All", ((Component)this).gameObject); ((GunBehaviour)this).OnReloadPressed(player, gun, bSOMETHING); } } public override void Update() { ((GunBehaviour)this).Update(); base.gun.ammo = 360; if (base.gun.ClipShotsRemaining <= 0 && base.gun.IsFiring) { base.gun.CeaseAttack(false, (ProjectileData)null); } } } public class ParticleBase : MonoBehaviour { public static ParticleSystem ParticleSystem_Note_1; public static ParticleSystem ParticleSystem_Note_2; public static ParticleSystem ParticleSystem_Note_3; public static ParticleSystem ParticleSystem_Note_4; public static ParticleSystem ParticleSystem_Note_1_Noiseless; public static ParticleSystem ParticleSystem_Note_2_Noiseless; public static ParticleSystem ParticleSystem_Note_3_Noiseless; public static ParticleSystem ParticleSystem_Note_4_Noiseless; public static ParticleSystem MikuBeam_1; public static ParticleSystem MikuBeam_2; public static ParticleSystem MikuBeam_3; public static ParticleSystem MikuBeam_4; public static ParticleSystem MikuBeam_5; public static ParticleSystem Ember_BG; public static ParticleSystem Chaff_BG; public static void Init() { //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) ParticleSystem_Note_1 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem1")).GetComponent(); ParticleSystem_Note_2 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem2")).GetComponent(); ParticleSystem_Note_3 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem3")).GetComponent(); ParticleSystem_Note_4 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem4")).GetComponent(); ParticleSystem_Note_1_Noiseless = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem1_Noiseless")).GetComponent(); ParticleSystem_Note_2_Noiseless = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem2_Noiseless")).GetComponent(); ParticleSystem_Note_3_Noiseless = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem3_Noiseless")).GetComponent(); ParticleSystem_Note_4_Noiseless = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MusicNoteSystem4_Noiseless")).GetComponent(); MikuBeam_1 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MikuBeamParticle_1")).GetComponent(); MikuBeam_2 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MikuBeamParticle_2")).GetComponent(); MikuBeam_3 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MikuBeamParticle_3")).GetComponent(); MikuBeam_4 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MikuBeamParticle_4")).GetComponent(); MikuBeam_5 = Object.Instantiate(StaticSpriteCollections.MikuBundle.LoadAsset("MikuBeamParticle_5")).GetComponent(); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_1); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_2); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_3); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_4); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_1_Noiseless); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_2_Noiseless); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_3_Noiseless); Object.DontDestroyOnLoad((Object)(object)ParticleSystem_Note_4_Noiseless); Object.DontDestroyOnLoad((Object)(object)MikuBeam_1); Object.DontDestroyOnLoad((Object)(object)MikuBeam_2); Object.DontDestroyOnLoad((Object)(object)MikuBeam_3); Object.DontDestroyOnLoad((Object)(object)MikuBeam_4); Object.DontDestroyOnLoad((Object)(object)MikuBeam_5); Object obj = Object.Instantiate(ResourceCache.Acquire("Global VFX/EmberSystem"), Vector3.zero, Quaternion.identity); Ember_BG = ((GameObject)((obj is GameObject) ? obj : null)).GetComponent(); Object obj2 = Object.Instantiate(ResourceCache.Acquire("Global VFX/ChaffSystem"), Vector3.zero, Quaternion.identity); Chaff_BG = ((GameObject)((obj2 is GameObject) ? obj2 : null)).GetComponent(); Object.DontDestroyOnLoad((Object)(object)Ember_BG); Object.DontDestroyOnLoad((Object)(object)Chaff_BG); } public static void EmitParticle(Vector2 Position, int Level) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_005c: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = ParticleSystem_Note_1; switch (Level) { case 1: val = ParticleSystem_Note_1; break; case 2: val = ParticleSystem_Note_2; break; case 3: val = ParticleSystem_Note_3; break; case 4: val = ParticleSystem_Note_4; break; } ParticleSystem obj = val; EmitParams val2 = default(EmitParams); ((EmitParams)(ref val2)).position = Vector2.op_Implicit(Position); obj.Emit(val2, 1); } public static void EmitNoiselessParticle(Vector2 Position, int Level, float Speed, float Angle, float Lifetime) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = ParticleSystem_Note_1; switch (Level) { case 1: val = ParticleSystem_Note_1_Noiseless; break; case 2: val = ParticleSystem_Note_2_Noiseless; break; case 3: val = ParticleSystem_Note_3_Noiseless; break; case 4: val = ParticleSystem_Note_4_Noiseless; break; } ParticleSystem obj = val; EmitParams val2 = default(EmitParams); ((EmitParams)(ref val2)).position = Vector2.op_Implicit(Position); ((EmitParams)(ref val2)).velocity = Vector2.op_Implicit(Toolbox.GetUnitOnCircle(Angle, Speed)); ((EmitParams)(ref val2)).startLifetime = Lifetime; obj.Emit(val2, 1); } } public class MikuHarmony : PassiveItem { public static ProjectileModule[] MikuPolarisModules; private static int itemID; public static tk2dSpriteAnimator TextDisplay; public int CurrentHarmonyLevel = 0; public int Kills; public List currentEffectsActive = new List(); private StatModifier CoolnessMod; private StatModifier AccuracyMod; private StatModifier ReloadSpeedMod; private StatModifier ChargeSpeedMod; public static string[] BlackList = new string[3] { EnemyGUIDs.Blobulin_GUID, EnemyGUIDs.Poisbulin_GUID, EnemyGUIDs.Large_Spent_GUID }; public Action OnlevelUp; public float durationBetweenNotes = -1f; private float E_Note; public static void Init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_02e3: Unknown result type (might be due to invalid IL or missing references) string text = "Musical Harmony"; GameObject val = new GameObject(text); MikuHarmony mikuHarmony = val.AddComponent(); tk2dSpriteCollectionData mikuItemAndGunCollection = StaticSpriteCollections.MikuItemAndGunCollection; ItemBuilder.AddSpriteToObjectAssetbundle(text, mikuItemAndGunCollection.GetSpriteIdByName("mikupassive"), mikuItemAndGunCollection, val); string text2 = "The Power Of Music"; string text3 = "Empowers your abilities with Harmony!\n\nHarmony is increased through enough kills, granting stat boosts and other benefits to your starting gear, and is decreased when hurt.\n\nKeep it up!"; ItemBuilder.SetupItem((PickupObject)(object)mikuHarmony, text2, text3, "miku"); ((PickupObject)mikuHarmony).quality = (ItemQuality)(-50); ((PickupObject)mikuHarmony).CanBeDropped = false; ((PickupObject)mikuHarmony).PreventStartingOwnerFromDropping = true; GameObject val2 = PrefabBuilder.BuildObject("TextDisplay"); tk2dSprite val3 = val2.gameObject.AddComponent(); ((tk2dBaseSprite)val3).SetSprite(StaticSpriteCollections.MikuItemAndGunCollection, "TIER_001"); tk2dSpriteAnimator val4 = val2.gameObject.AddComponent(); ((BraveBehaviour)val3).renderer.material = new Material(ShaderCache.Acquire("Sprites/Default")); TextDisplay = val4; val4.library = StaticSpriteCollections.ItemAndWeaponAnimation; CustomSynergies.Add("Auditory Attenuation", new List { "miku:musical_harmony" }, new List { "metronome" }, false); CustomSynergies.Add("Stunning Performance", new List { "miku:musical_harmony" }, new List { "aged_bell" }, false); CustomSynergies.Add("War Horn", new List { "miku:musical_harmony" }, new List { "charm_horn" }, false); CustomSynergies.Add("Stars Alike, Shine Bright", new List { "miku:musical_harmony" }, new List { "stuffed_star" }, false); CustomSynergies.Add("You're Gonna Need A Bigger Lute", new List { "miku:musical_harmony" }, new List { "really_special_lute" }, false); CustomSynergies.Add("Bringing Back The Classics", new List { "miku:musical_harmony" }, new List { "gunzheng" }, false); CustomSynergies.Add("Mechanical Love", new List { "miku:musical_harmony" }, new List { "face_melter" }, false); CustomSynergies.Add("Star Example", new List { "miku:musical_harmony" }, new List { "polaris" }, false); CustomSynergies.Add("Rise To Stardom", new List { "miku:musical_harmony" }, new List { "master_round_1", "master_round_2", "master_round_3", "master_round_4", "master_round_5" }, false); ItemsCore.AddChangeSpawnItem((Func)ReturnObj); itemID = ((PickupObject)mikuHarmony).PickupObjectId; new Hook((MethodBase)typeof(TemporaryInvulnerabilityPlayerItem).GetMethod("HandleDuration", BindingFlags.Instance | BindingFlags.NonPublic), typeof(MikuHarmony).GetMethod("HandleDuration", BindingFlags.Static | BindingFlags.Public)); PickupObject byId = PickupObjectDatabase.GetById(506); LuteUpTheNight luteUpTheNight = ((Component)((byId is Gun) ? byId : null)).gameObject.AddComponent(); luteUpTheNight.AuraRadius = 3.5f; luteUpTheNight.CharmEffect = ((Component)PickupObjectDatabase.GetById(527)).GetComponent().CharmModifierEffect; PickupObject byId2 = PickupObjectDatabase.GetById(482); ((Component)((byId2 is Gun) ? byId2 : null)).gameObject.AddComponent(); PickupObject byId3 = PickupObjectDatabase.GetById(149); ((Component)((byId3 is Gun) ? byId3 : null)).gameObject.AddComponent(); MikuPolarisModules = (ProjectileModule[])(object)new ProjectileModule[4]; InitNewPolarisModule1(); InitNewPolarisModule2(); InitNewPolarisModule3(); InitNewPolarisModule4(); PickupObject byId4 = PickupObjectDatabase.GetById(97); GunExt.AddProjectileModule((Gun)(object)((byId4 is Gun) ? byId4 : null), MikuPolarisModules[0]); PickupObject byId5 = PickupObjectDatabase.GetById(97); GunExt.AddProjectileModule((Gun)(object)((byId5 is Gun) ? byId5 : null), MikuPolarisModules[1]); PickupObject byId6 = PickupObjectDatabase.GetById(718); GunExt.AddProjectileModule((Gun)(object)((byId6 is Gun) ? byId6 : null), MikuPolarisModules[2]); PickupObject byId7 = PickupObjectDatabase.GetById(718); GunExt.AddProjectileModule((Gun)(object)((byId7 is Gun) ? byId7 : null), MikuPolarisModules[3]); } public static void InitNewPolarisModule1() { //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Expected O, but got Unknown //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) PickupObject byId = PickupObjectDatabase.GetById(97); ProjectileModule defaultModule = ((Gun)((byId is Gun) ? byId : null)).DefaultModule; ProjectileModule val = ProjectileModule.CreateClone(defaultModule, false, -1); val.chargeProjectiles = new List(defaultModule.chargeProjectiles); val.projectiles = new List(defaultModule.projectiles); PickupObject byId2 = PickupObjectDatabase.GetById(97); Projectile val2 = Object.Instantiate(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]); ((Component)val2).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject); Object.DontDestroyOnLoad((Object)(object)val2); val2.baseData.damage = 27f; val2.baseData.speed = 55f; val2.baseData.force = 60f; val2.shouldRotate = true; val2.pierceMinorBreakables = true; ProjectileBuilders.SetProjectileCollisionRight(val2, "mikuStar_001", StaticSpriteCollections.ProjectileAndBeamCollection, 22, 15, false, (Anchor)4, (int?)22, (int?)15, true, false, (int?)1, (int?)3, (Projectile)null); GameObject val3 = ETGMod.AddChild(((Component)val2).gameObject, "trail object", new Type[0]); val3.transform.position = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldTopLeft + new Vector2(0.25f, -0.25f)); val3.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldTopLeft + new Vector2(0.25f, -0.25f)); TrailRenderer val4 = val3.AddComponent(); ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).receiveShadows = false; Material val5 = (((Renderer)val4).material = new Material(Shader.Find("Sprites/Default"))); val4.minVertexDistance = 0.01f; val4.numCapVertices = 640; Color val7 = default(Color); ((Color)(ref val7))..ctor(0f, 2f, 2f, 2f); val5.SetColor("_Color", val7); val4.startColor = val7; val4.endColor = new Color(0f, 1f, 1f, 0.5f); val4.time = 0.25f; val4.startWidth = 0.1875f; val4.endWidth = 0f; val4.autodestruct = false; ProjectileTrailRendererController val8 = ((Component)val2).gameObject.AddComponent(); val8.trailRenderer = val4; val8.desiredLength = 6f; GameObject val9 = ETGMod.AddChild(((Component)val2).gameObject, "trail object", new Type[0]); val9.transform.position = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); val9.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); TrailRenderer val10 = val9.AddComponent(); ((Renderer)val10).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val10).receiveShadows = false; Material val11 = (((Renderer)val10).material = new Material(Shader.Find("Sprites/Default"))); val10.minVertexDistance = 0.01f; val10.numCapVertices = 640; val11.SetColor("_Color", val7); val10.startColor = val7; val10.endColor = new Color(0.8f, 1f, 1f, 0f); val10.time = 0.25f; val10.startWidth = 0.1875f; val10.endWidth = 0f; val10.autodestruct = false; ProjectileTrailRendererController val13 = ((Component)val2).gameObject.AddComponent(); val13.trailRenderer = val10; val13.desiredLength = 6f; val.projectiles[0] = val2; MikuPolarisModules[0] = val; } public static void InitNewPolarisModule2() { //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Expected O, but got Unknown //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Expected O, but got Unknown //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Expected O, but got Unknown //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) PickupObject byId = PickupObjectDatabase.GetById(97); ProjectileModule defaultModule = ((Gun)((byId is Gun) ? byId : null)).DefaultModule; ProjectileModule val = ProjectileModule.CreateClone(defaultModule, false, -1); val.chargeProjectiles = new List(defaultModule.chargeProjectiles); val.projectiles = new List(defaultModule.projectiles); PickupObject byId2 = PickupObjectDatabase.GetById(97); Projectile val2 = Object.Instantiate(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]); ((Component)val2).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val2).gameObject); Object.DontDestroyOnLoad((Object)(object)val2); val2.baseData.damage = 32f; val2.baseData.speed = 65f; val2.baseData.force = 100f; val2.shouldRotate = true; val2.pierceMinorBreakables = true; ProjectileBuilders.SetProjectileCollisionRight(val2, "mikuStar_002", StaticSpriteCollections.ProjectileAndBeamCollection, 28, 19, false, (Anchor)4, (int?)28, (int?)19, true, false, (int?)null, (int?)null, (Projectile)null); GameObject val3 = ETGMod.AddChild(((Component)val2).gameObject, "trail object", new Type[0]); val3.transform.position = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldTopLeft - new Vector2(0.25f, 0.25f)); val3.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldTopLeft - new Vector2(0.25f, 0.25f)); TrailRenderer val4 = val3.AddComponent(); ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).receiveShadows = false; Material val5 = (((Renderer)val4).material = new Material(Shader.Find("Sprites/Default"))); val4.minVertexDistance = 0.01f; val4.numCapVertices = 640; Color val7 = default(Color); ((Color)(ref val7))..ctor(0f, 2f, 2f, 2f); val5.SetColor("_Color", val7); val4.startColor = val7; val4.endColor = new Color(0f, 1f, 1f, 0.5f); val4.time = 0.25f; val4.startWidth = 0.1875f; val4.endWidth = 0f; val4.autodestruct = false; ProjectileTrailRendererController val8 = ((Component)val2).gameObject.AddComponent(); val8.trailRenderer = val4; val8.desiredLength = 6f; GameObject val9 = ETGMod.AddChild(((Component)val2).gameObject, "trail object", new Type[0]); val9.transform.position = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); val9.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); TrailRenderer val10 = val9.AddComponent(); ((Renderer)val10).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val10).receiveShadows = false; Material val11 = (((Renderer)val10).material = new Material(Shader.Find("Sprites/Default"))); val10.minVertexDistance = 0.01f; val10.numCapVertices = 640; val11.SetColor("_Color", val7); val10.startColor = val7; val10.endColor = new Color(0.8f, 1f, 1f, 0f); val10.time = 0.25f; val10.startWidth = 0.1875f; val10.endWidth = 0f; val10.autodestruct = false; ProjectileTrailRendererController val13 = ((Component)val2).gameObject.AddComponent(); val13.trailRenderer = val10; val13.desiredLength = 6f; GameObject val14 = ETGMod.AddChild(((Component)val2).gameObject, "trail object", new Type[0]); val14.transform.position = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldCenter - new Vector2(0.5f, 0f)); val14.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldCenter - new Vector2(0.5f, 0f)); TrailRenderer val15 = val14.AddComponent(); ((Renderer)val15).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val15).receiveShadows = false; Material val16 = (((Renderer)val15).material = new Material(Shader.Find("Sprites/Default"))); val15.minVertexDistance = 0.01f; val15.numCapVertices = 640; val16.SetColor("_Color", val7); val15.startColor = val7; val15.endColor = new Color(0.8f, 1f, 1f, 0f); val15.time = 0.3125f; val15.startWidth = 0.25f; val15.endWidth = 0f; val15.autodestruct = false; ProjectileTrailRendererController val18 = ((Component)val2).gameObject.AddComponent(); val18.trailRenderer = val15; val18.desiredLength = 8f; PierceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent(((Component)val2).gameObject); orAddComponent.penetration = 1; orAddComponent.penetratesBreakables = true; val.projectiles[0] = val2; MikuPolarisModules[1] = val; } public static void InitNewPolarisModule3() { //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Expected O, but got Unknown //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Expected O, but got Unknown //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) PickupObject byId = PickupObjectDatabase.GetById(718); ProjectileModule val = ((Gun)((byId is Gun) ? byId : null)).Volley.projectiles[2]; ProjectileModule val2 = ProjectileModule.CreateClone(val, false, -1); val2.chargeProjectiles = new List(val.chargeProjectiles); val2.projectiles = new List(val.projectiles); PickupObject byId2 = PickupObjectDatabase.GetById(97); Projectile val3 = Object.Instantiate(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]); ((Component)val3).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val3).gameObject); Object.DontDestroyOnLoad((Object)(object)val3); val3.baseData.damage = 35f; val3.baseData.speed = 55f; val3.baseData.force = 60f; val3.shouldRotate = true; val3.pierceMinorBreakables = true; ProjectileBuilders.SetProjectileCollisionRight(val3, "mikuStar_001", StaticSpriteCollections.ProjectileAndBeamCollection, 22, 15, false, (Anchor)4, (int?)22, (int?)15, true, false, (int?)1, (int?)3, (Projectile)null); GameObject val4 = ETGMod.AddChild(((Component)val3).gameObject, "trail object", new Type[0]); val4.transform.position = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldTopLeft + new Vector2(0.25f, -0.25f)); val4.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldTopLeft + new Vector2(0.25f, -0.25f)); TrailRenderer val5 = val4.AddComponent(); ((Renderer)val5).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val5).receiveShadows = false; Material val6 = (((Renderer)val5).material = new Material(Shader.Find("Sprites/Default"))); val5.minVertexDistance = 0.01f; val5.numCapVertices = 640; Color val8 = default(Color); ((Color)(ref val8))..ctor(0f, 2f, 2f, 2f); val6.SetColor("_Color", val8); val5.startColor = val8; val5.endColor = new Color(0f, 1f, 1f, 0.5f); val5.time = 0.25f; val5.startWidth = 0.1875f; val5.endWidth = 0f; val5.autodestruct = false; ProjectileTrailRendererController val9 = ((Component)val3).gameObject.AddComponent(); val9.trailRenderer = val5; val9.desiredLength = 6f; GameObject val10 = ETGMod.AddChild(((Component)val3).gameObject, "trail object", new Type[0]); val10.transform.position = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); val10.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); TrailRenderer val11 = val10.AddComponent(); ((Renderer)val11).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val11).receiveShadows = false; Material val12 = (((Renderer)val11).material = new Material(Shader.Find("Sprites/Default"))); val11.minVertexDistance = 0.01f; val11.numCapVertices = 640; val12.SetColor("_Color", val8); val11.startColor = val8; val11.endColor = new Color(0.8f, 1f, 1f, 0f); val11.time = 0.25f; val11.startWidth = 0.1875f; val11.endWidth = 0f; val11.autodestruct = false; ProjectileTrailRendererController val14 = ((Component)val3).gameObject.AddComponent(); val14.trailRenderer = val11; val14.desiredLength = 6f; val2.projectiles[0] = val3; MikuPolarisModules[2] = val2; } public static void InitNewPolarisModule4() { //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Expected O, but got Unknown //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Expected O, but got Unknown //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) PickupObject byId = PickupObjectDatabase.GetById(718); ProjectileModule val = ((Gun)((byId is Gun) ? byId : null)).Volley.projectiles[2]; ProjectileModule val2 = ProjectileModule.CreateClone(val, false, -1); val2.chargeProjectiles = new List(val.chargeProjectiles); val2.projectiles = new List(val.projectiles); PickupObject byId2 = PickupObjectDatabase.GetById(97); Projectile val3 = Object.Instantiate(((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0]); ((Component)val3).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)val3).gameObject); Object.DontDestroyOnLoad((Object)(object)val3); val3.baseData.damage = 40f; val3.baseData.speed = 70f; val3.baseData.force = 100f; val3.shouldRotate = true; val3.pierceMinorBreakables = true; ProjectileBuilders.SetProjectileCollisionRight(val3, "mikuStar_002", StaticSpriteCollections.ProjectileAndBeamCollection, 28, 19, false, (Anchor)4, (int?)28, (int?)19, true, false, (int?)null, (int?)null, (Projectile)null); GameObject val4 = ETGMod.AddChild(((Component)val3).gameObject, "trail object", new Type[0]); val4.transform.position = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldTopLeft - new Vector2(0.25f, 0.25f)); val4.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldTopLeft - new Vector2(0.25f, 0.25f)); TrailRenderer val5 = val4.AddComponent(); ((Renderer)val5).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val5).receiveShadows = false; Material val6 = (((Renderer)val5).material = new Material(Shader.Find("Sprites/Default"))); val5.minVertexDistance = 0.01f; val5.numCapVertices = 640; Color val8 = default(Color); ((Color)(ref val8))..ctor(0f, 2f, 2f, 2f); val6.SetColor("_Color", val8); val5.startColor = val8; val5.endColor = new Color(0f, 1f, 1f, 0.5f); val5.time = 0.25f; val5.startWidth = 0.1875f; val5.endWidth = 0f; val5.autodestruct = false; ProjectileTrailRendererController val9 = ((Component)val3).gameObject.AddComponent(); val9.trailRenderer = val5; val9.desiredLength = 6f; GameObject val10 = ETGMod.AddChild(((Component)val3).gameObject, "trail object", new Type[0]); val10.transform.position = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); val10.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldBottomLeft + new Vector2(0.25f, 0.25f)); TrailRenderer val11 = val10.AddComponent(); ((Renderer)val11).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val11).receiveShadows = false; Material val12 = (((Renderer)val11).material = new Material(Shader.Find("Sprites/Default"))); val11.minVertexDistance = 0.01f; val11.numCapVertices = 640; val12.SetColor("_Color", val8); val11.startColor = val8; val11.endColor = new Color(0.8f, 1f, 1f, 0f); val11.time = 0.25f; val11.startWidth = 0.1875f; val11.endWidth = 0f; val11.autodestruct = false; ProjectileTrailRendererController val14 = ((Component)val3).gameObject.AddComponent(); val14.trailRenderer = val11; val14.desiredLength = 6f; GameObject val15 = ETGMod.AddChild(((Component)val3).gameObject, "trail object", new Type[0]); val15.transform.position = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldCenter - new Vector2(0.5f, 0f)); val15.transform.localPosition = Vector2.op_Implicit(((BraveBehaviour)val3).sprite.WorldCenter - new Vector2(0.5f, 0f)); TrailRenderer val16 = val15.AddComponent(); ((Renderer)val16).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val16).receiveShadows = false; Material val17 = (((Renderer)val16).material = new Material(Shader.Find("Sprites/Default"))); val16.minVertexDistance = 0.01f; val16.numCapVertices = 640; val17.SetColor("_Color", val8); val16.startColor = val8; val16.endColor = new Color(0.8f, 1f, 1f, 0f); val16.time = 0.3125f; val16.startWidth = 0.25f; val16.endWidth = 0f; val16.autodestruct = false; ProjectileTrailRendererController val19 = ((Component)val3).gameObject.AddComponent(); val19.trailRenderer = val16; val19.desiredLength = 8f; PierceProjModifier orAddComponent = GameObjectExtensions.GetOrAddComponent(((Component)val3).gameObject); orAddComponent.penetration = 1; orAddComponent.penetratesBreakables = true; val2.projectiles[0] = val3; MikuPolarisModules[3] = val2; } public static IEnumerator HandleDuration(Func orig, TemporaryInvulnerabilityPlayerItem self, PlayerController user, Material userMaterial) { ((PlayerItem)self).IsCurrentlyActive = true; float ela = 0f; ((PlayerItem)self).m_activeDuration = self.Duration; ((PlayerItem)self).m_activeElapsed = ela; MikuMikuBeam beam = null; if (ItemHelpers.PlayerHasActiveSynergy(user, "Stars Alike, Shine Bright") && ((PickupObject)self).PickupObjectId == 433) { beam = ((Component)user.inventory.AllGuns.Where((Gun __) => (Object)(object)((Component)__).GetComponent() != (Object)null).FirstOrDefault()).GetComponent(); beam.ToggleInfinityClip(value: true); } while (ela < self.Duration) { ela = (((PlayerItem)self).m_activeElapsed = ela + BraveTime.DeltaTime); ((BraveBehaviour)user).healthHaver.IsVulnerable = false; yield return null; } if ((Object)(object)beam != (Object)null) { beam.ToggleInfinityClip(value: false); } user.ClearOverrideShader(); ((BraveBehaviour)user).healthHaver.IsVulnerable = true; ((PlayerItem)self).IsCurrentlyActive = false; AkSoundEngine.PostEvent("Stop_SND_OBJ", ((Component)user).gameObject); } public static GameObject ReturnObj(PickupObject pickup) { PlayerController[] allPlayers = GameManager.Instance.AllPlayers; foreach (PlayerController val in allPlayers) { if (!val.HasPassiveItem(itemID)) { continue; } HealthPickup component = ((Component)pickup).GetComponent(); if ((Object)(object)component != (Object)null) { if (component.healAmount == 0.5f) { pickup = ((Random.value < 0.2f) ? PickupObjectDatabase.GetById(78) : PickupObjectDatabase.GetById(600)); } if (component.healAmount == 1f) { pickup = ((Random.value < 0.5f) ? PickupObjectDatabase.GetById(78) : PickupObjectDatabase.GetById(600)); } } } return ((Component)pickup).gameObject; } private StatModifier AddStat(StatType statType, float amount, ModifyMethod method = (ModifyMethod)0) { //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_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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown StatModifier val = new StatModifier { amount = amount, statToBoost = statType, modifyType = method }; if (base.passiveStatModifiers == null) { base.passiveStatModifiers = (StatModifier[])(object)new StatModifier[1] { val }; } else { base.passiveStatModifiers = base.passiveStatModifiers.Concat((IEnumerable)(object)new StatModifier[1] { val }).ToArray(); } return val; } private void RemoveStat(StatModifier statType) { if (statType == null) { return; } List list = new List(); for (int i = 0; i < base.passiveStatModifiers.Length; i++) { if (base.passiveStatModifiers[i] != statType) { list.Add(base.passiveStatModifiers[i]); } } base.passiveStatModifiers = list.ToArray(); } public override void Pickup(PlayerController player) { ((PassiveItem)this).Pickup(player); player.OnAnyEnemyReceivedDamage = (Action)Delegate.Combine(player.OnAnyEnemyReceivedDamage, new Action(OnHurtEnemy)); player.OnReceivedDamage += Player_OnReceivedDamage; if (MikuMikuModule.CopyrightedAudio.Value) { ((BraveBehaviour)player).spriteAnimator.GetClipByName("doorway").frames[2].eventAudio = ((Random.value < 0.001f) ? "Play_Once_Upon_a_Time" : ""); ((BraveBehaviour)player).spriteAnimator.GetClipByName("doorway").frames[2].triggerEvent = true; } } private void Player_OnReceivedDamage(PlayerController obj) { if (CurrentHarmonyLevel > 0) { Kills = 0; ProcessHarmonyChange(CurrentHarmonyLevel - 2, isPositive: false); } } public void OnHurtEnemy(float a, bool fatal, HealthHaver healthHaver) { GameActor gameActor = ((BraveBehaviour)healthHaver).gameActor; AIActor val = (AIActor)(object)((gameActor is AIActor) ? gameActor : null); if (val != null && fatal && (Object)(object)val != (Object)null && !BlackList.Contains(val.EnemyGuid) && CurrentHarmonyLevel < 4) { Kills++; if (Kills >= GetKillThreshold()) { Kills = 0; ProcessHarmonyChange(CurrentHarmonyLevel + 1); } } } public int GetKillThreshold() { int num = 10 + CurrentHarmonyLevel * 5; foreach (PassiveItem passiveItem in ((PassiveItem)this).Owner.passiveItems) { BasicStatPickup val = (BasicStatPickup)(object)((passiveItem is BasicStatPickup) ? passiveItem : null); if (val != null && val.IsMasteryToken) { num--; } } return num; } public string TextType(bool isStart = true) { return CurrentHarmonyLevel switch { 0 => "Zero" + (isStart ? "_Start" : "_End"), 1 => "One" + (isStart ? "_Start" : "_End"), 2 => "Two" + (isStart ? "_Start" : "_End"), 3 => "Three" + (isStart ? "_Start" : "_End"), 4 => "Four" + (isStart ? "_Start" : "_End"), _ => "Zero" + (isStart ? "_Start" : "_End"), }; } public IEnumerator KillSadness(tk2dSpriteAnimator tk2DSpriteAnimator) { yield return (object)new WaitForSeconds(2.25f); if (!Object.op_Implicit((Object)(object)tk2DSpriteAnimator)) { yield break; } tk2DSpriteAnimator.PlayAndDestroyObject("Sad_End", (Action)delegate { if (currentEffectsActive.Contains(tk2DSpriteAnimator)) { currentEffectsActive.Remove(tk2DSpriteAnimator); } }); } public IEnumerator MetronomeUppies() { for (int i = 0; i < 3; i++) { if (Object.op_Implicit((Object)(object)((PassiveItem)this).Owner)) { AkSoundEngine.SetRTPCValue("Pitch_Metronome", (float)CurrentHarmonyLevel * 15f + (float)(i * 5)); AkSoundEngine.PostEvent("Play_OBJ_metronome_jingle_01", ((Component)((PassiveItem)this).Owner).gameObject); } yield return (object)new WaitForSeconds(0.15f); } } public void ProcessHarmonyChange(int currentLevel, bool isPositive = true, bool hideVFX = false) { //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_028b: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) int num = currentLevel; num = Mathf.Max(0, num); if (num == CurrentHarmonyLevel) { return; } CurrentHarmonyLevel = num; foreach (Gun allGun in ((PassiveItem)this).Owner.inventory.AllGuns) { if ((Object)(object)((Component)allGun).GetComponent() != (Object)null) { ((Component)allGun).GetComponent().OnTierSwitched(CurrentHarmonyLevel); break; } } OnlevelUp?.Invoke(this); if (!hideVFX) { foreach (tk2dSpriteAnimator item in currentEffectsActive) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)((Component)item).gameObject); } } currentEffectsActive.Clear(); tk2dSpriteAnimator animator_1 = ((GameActor)(object)((PassiveItem)this).Owner).SmartPlayEffectOnActor(((Component)TextDisplay).gameObject, new Vector3(-1f, 1f)).GetComponent(); animator_1.PlayAndDestroyObject("Tier_Start", (Action)delegate { if (currentEffectsActive.Contains(animator_1)) { currentEffectsActive.Remove(animator_1); } }); currentEffectsActive.Add(animator_1); tk2dSpriteAnimator animator_2 = ((GameActor)(object)((PassiveItem)this).Owner).SmartPlayEffectOnActor(((Component)TextDisplay).gameObject, new Vector3(1f, 1f)).GetComponent(); animator_2.PlayAndDestroyObject(TextType(), (Action)delegate { if (currentEffectsActive.Contains(animator_2)) { currentEffectsActive.Remove(animator_2); } }); currentEffectsActive.Add(animator_2); } Exploder.DoRadialPush(Vector2.op_Implicit(TransformExtensions.PositionVector2(((Component)this).gameObject.transform)), 160f, 6.5f); Exploder.DoRadialKnockback(Vector2.op_Implicit(TransformExtensions.PositionVector2(((Component)this).gameObject.transform)), 160f, 6.5f); Exploder.DoRadialMinorBreakableBreak(Vector2.op_Implicit(TransformExtensions.PositionVector2(((Component)this).gameObject.transform)), 6.5f); ((GameActor)((PassiveItem)this).Owner).CurrentGun.ForceImmediateReload(false); if (isPositive) { ((MonoBehaviour)this).StartCoroutine(MetronomeUppies()); for (int num2 = 0; num2 < 36; num2++) { ParticleBase.EmitNoiselessParticle(Vector2.op_Implicit(((BraveBehaviour)((PassiveItem)this).Owner).transform.position), CurrentHarmonyLevel, 7f + (float)CurrentHarmonyLevel * 2.25f * Random.Range(0.85f, 1.15f), 10 * num2, 0.5f + 0.25f * (float)CurrentHarmonyLevel); } float num3 = Random.Range(0, 360); if (CurrentHarmonyLevel > 2) { for (int num4 = 0; num4 < 24; num4++) { ParticleBase.EmitNoiselessParticle(Vector2.op_Implicit(((BraveBehaviour)((PassiveItem)this).Owner).transform.position), 1, 14f * Random.Range(0.9f, 1.1f), (float)(15 * num4) + num3, 1.5f); } } if (CurrentHarmonyLevel > 3) { num3 = Random.Range(0, 360); for (int num5 = 0; num5 < 24; num5++) { ParticleBase.EmitNoiselessParticle(Vector2.op_Implicit(((BraveBehaviour)((PassiveItem)this).Owner).transform.position), 2, 18f * Random.Range(0.9f, 1.1f), (float)(15 * num5) + num3, 2f); } } } else { Kills = 0; AkSoundEngine.PostEvent("Play_OBJ_metronome_fail_01", ((Component)((PassiveItem)this).Owner).gameObject); tk2dSpriteAnimator component = ((GameActor)(object)((PassiveItem)this).Owner).SmartPlayEffectOnActor(((Component)TextDisplay).gameObject, new Vector3(1.875f, 1f)).GetComponent(); component.Play("Sad_Start"); currentEffectsActive.Add(component); ((MonoBehaviour)((PassiveItem)this).Owner).StartCoroutine(KillSadness(component)); } RemoveStat(CoolnessMod); RemoveStat(AccuracyMod); RemoveStat(ReloadSpeedMod); RemoveStat(ChargeSpeedMod); switch (currentLevel) { case 0: durationBetweenNotes = -1f; break; case 1: durationBetweenNotes = 3f; ReloadSpeedMod = AddStat((StatType)10, -0.16f, (ModifyMethod)0); AccuracyMod = AddStat((StatType)2, -0.075f, (ModifyMethod)0); ChargeSpeedMod = AddStat((StatType)25, 0.1f, (ModifyMethod)0); break; case 2: durationBetweenNotes = 2f; CoolnessMod = AddStat((StatType)4, 1f, (ModifyMethod)0); ReloadSpeedMod = AddStat((StatType)10, -0.33f, (ModifyMethod)0); AccuracyMod = AddStat((StatType)2, -0.15f, (ModifyMethod)0); ChargeSpeedMod = AddStat((StatType)25, 0.2f, (ModifyMethod)0); break; case 3: durationBetweenNotes = 1.25f; CoolnessMod = AddStat((StatType)4, 2f, (ModifyMethod)0); ReloadSpeedMod = AddStat((StatType)10, -0.5f, (ModifyMethod)0); AccuracyMod = AddStat((StatType)2, -0.3f, (ModifyMethod)0); ChargeSpeedMod = AddStat((StatType)25, 0.3f, (ModifyMethod)0); break; case 4: durationBetweenNotes = 0.5f; CoolnessMod = AddStat((StatType)4, 3f, (ModifyMethod)0); ReloadSpeedMod = AddStat((StatType)10, -0.666f, (ModifyMethod)0); AccuracyMod = AddStat((StatType)2, -0.45f, (ModifyMethod)0); ChargeSpeedMod = AddStat((StatType)25, 0.4f, (ModifyMethod)0); break; } ((PassiveItem)this).Owner.stats.RecalculateStats(((PassiveItem)this).Owner, false, false); } public override void DisableEffect(PlayerController player) { player.OnAnyEnemyReceivedDamage = (Action)Delegate.Remove(player.OnAnyEnemyReceivedDamage, new Action(OnHurtEnemy)); player.OnReceivedDamage -= Player_OnReceivedDamage; } public override void Update() { //IL_006b: 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) ((PassiveItem)this).Update(); if (!Object.op_Implicit((Object)(object)((PassiveItem)this).Owner)) { return; } ((PassiveItem)this).Owner.UnderstandsGleepGlorp = true; if (durationBetweenNotes != -1f) { E_Note -= Time.deltaTime; if (E_Note <= 0f) { ParticleBase.EmitParticle(Vector2.op_Implicit(((BraveBehaviour)((PassiveItem)this).Owner).transform.position), CurrentHarmonyLevel); E_Note = durationBetweenNotes; } } } public override void OnDestroy() { ((PassiveItem)this).OnDestroy(); if (Object.op_Implicit((Object)(object)((PassiveItem)this).Owner)) { PlayerController owner = ((PassiveItem)this).Owner; owner.OnAnyEnemyReceivedDamage = (Action)Delegate.Remove(owner.OnAnyEnemyReceivedDamage, new Action(OnHurtEnemy)); ((PassiveItem)this).Owner.OnReceivedDamage -= Player_OnReceivedDamage; } } public override DebrisObject Drop(PlayerController player) { player.OnAnyEnemyReceivedDamage = (Action)Delegate.Remove(player.OnAnyEnemyReceivedDamage, new Action(OnHurtEnemy)); player.OnReceivedDamage -= Player_OnReceivedDamage; return ((PassiveItem)this).Drop(player); } public override void MidGameSerialize(List data) { ((PickupObject)this).MidGameSerialize(data); data.Add(CurrentHarmonyLevel); data.Add(Kills); } public override void MidGameDeserialize(List data) { ((PassiveItem)this).MidGameDeserialize(data); int num = 0; int currentLevel = (int)data[num++]; Kills = (int)data[num++]; ProcessHarmonyChange(currentLevel, isPositive: false, hideVFX: true); } } public static class Toolbox { private static readonly HashSet adjustedDefs = new HashSet(); public static string RainbowizeString(string orig) { //IL_0033: 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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < orig.Length; i++) { char c = orig[i]; float num = Mathf.InverseLerp(0f, (float)orig.Length, (float)i); Color val = Color.HSVToRGB(num, 1f, 1f); string arg = ColorUtility.ToHtmlStringRGB(val); string value = $"{c}"; stringBuilder.Append(value); } return stringBuilder.ToString(); } public static MikuHarmony PlayerIsMiku(this PlayerController player) { for (int i = 0; i < player.passiveItems.Count; i++) { PassiveItem val = player.passiveItems[i]; if (val is MikuHarmony result) { return result; } } return null; } internal static BasicBeamController GenerateBeamPrefabBundleInternal(this Projectile projectile, string defaultSpriteName, tk2dSpriteCollectionData data, tk2dSpriteAnimation animation, string IdleAnimationName, Vector2 colliderDimensions, Vector2 colliderOffsets, string impactVFXAnimationName = null, Vector2? impactVFXColliderDimensions = null, Vector2? impactVFXColliderOffsets = null, string endAnimation = null, Vector2? endColliderDimensions = null, Vector2? endColliderOffsets = null, string muzzleAnimationName = null, Vector2? muzzleColliderDimensions = null, Vector2? muzzleColliderOffsets = null, bool glows = false, bool canTelegraph = false, string beamTelegraphIdleAnimationName = null, string beamStartTelegraphAnimationName = null, string beamEndTelegraphAnimationName = null, float telegraphTime = 1f, bool canDissipate = false, string beamDissipateAnimationName = null, string beamStartDissipateAnimationName = null, string beamEndDissipateAnimationName = null, float dissipateTime = 1f, bool constructOffsets = true) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Expected O, but got Unknown //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Expected O, but got Unknown //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) try { if (Object.op_Implicit((Object)(object)((BraveBehaviour)projectile).specRigidbody)) { ((BraveBehaviour)projectile).specRigidbody.CollideWithOthers = false; } tk2dTiledSprite orAddComponent = GameObjectExtensions.GetOrAddComponent(((Component)projectile).gameObject); ((tk2dBaseSprite)orAddComponent).Collection = data; ((tk2dBaseSprite)orAddComponent).SetSprite(data, data.GetSpriteIdByName(defaultSpriteName)); tk2dSpriteDefinition currentSpriteDef = ((tk2dBaseSprite)orAddComponent).GetCurrentSpriteDef(); currentSpriteDef.colliderVertices = (Vector3[])(object)new Vector3[2] { Vector2.op_Implicit(0.0625f * colliderOffsets), Vector2.op_Implicit(0.0625f * colliderDimensions) }; if (constructOffsets) { currentSpriteDef.ConstructOffsetsFromAnchor((Anchor)3); } tk2dSpriteAnimator orAddComponent2 = GameObjectExtensions.GetOrAddComponent(((Component)projectile).gameObject); orAddComponent2._startingSpriteCollection = data; orAddComponent2.Library = animation; orAddComponent2.playAutomatically = true; orAddComponent2.defaultClipId = animation.GetClipIdByName(IdleAnimationName); Object.Destroy((Object)(object)((Component)projectile).GetComponentInChildren()); ((BraveBehaviour)projectile).sprite = (tk2dBaseSprite)(object)orAddComponent; ((BraveBehaviour)projectile).sprite.Collection = data; BasicBeamController orAddComponent3 = GameObjectExtensions.GetOrAddComponent(((Component)projectile).gameObject); ((BraveBehaviour)orAddComponent3).sprite = (tk2dBaseSprite)(object)orAddComponent; ((BraveBehaviour)orAddComponent3).spriteAnimator = orAddComponent2; orAddComponent3.m_beamSprite = orAddComponent; orAddComponent3.beamAnimation = IdleAnimationName; if (endAnimation != null && endColliderDimensions.HasValue && endColliderOffsets.HasValue) { SetupBeamPart(animation, data, endAnimation, endColliderDimensions.Value, endColliderOffsets.Value, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.beamEndAnimation = endAnimation; } else { SetupBeamPart(animation, data, IdleAnimationName, null, null, currentSpriteDef.colliderVertices, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.beamEndAnimation = IdleAnimationName; } if (impactVFXAnimationName != null && impactVFXColliderDimensions.HasValue && impactVFXColliderOffsets.HasValue) { SetupBeamPart(animation, data, impactVFXAnimationName, impactVFXColliderDimensions.Value, impactVFXColliderOffsets.Value, null, (WrapMode)2, (Anchor)4, constructOffsets); orAddComponent3.impactAnimation = impactVFXAnimationName; } if (muzzleAnimationName != null && muzzleColliderDimensions.HasValue && muzzleColliderOffsets.HasValue) { SetupBeamPart(animation, data, muzzleAnimationName, muzzleColliderDimensions.Value, muzzleColliderOffsets.Value, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.beamStartAnimation = muzzleAnimationName; } else { SetupBeamPart(animation, data, IdleAnimationName, null, null, currentSpriteDef.colliderVertices, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.beamStartAnimation = IdleAnimationName; } if (canTelegraph) { orAddComponent3.usesTelegraph = true; orAddComponent3.telegraphAnimations = new TelegraphAnims(); if (beamStartTelegraphAnimationName != null) { SetupBeamPart(animation, data, beamStartTelegraphAnimationName, Vector2.zero, Vector2.zero, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.telegraphAnimations.beamStartAnimation = beamStartTelegraphAnimationName; } if (beamTelegraphIdleAnimationName != null) { SetupBeamPart(animation, data, beamTelegraphIdleAnimationName, Vector2.zero, Vector2.zero, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.telegraphAnimations.beamAnimation = beamTelegraphIdleAnimationName; } if (beamEndTelegraphAnimationName != null) { SetupBeamPart(animation, data, beamEndTelegraphAnimationName, Vector2.zero, Vector2.zero, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.telegraphAnimations.beamEndAnimation = beamEndTelegraphAnimationName; } orAddComponent3.telegraphTime = telegraphTime; } if (canDissipate) { orAddComponent3.endType = (BeamEndType)2; orAddComponent3.dissipateAnimations = new TelegraphAnims(); if (beamStartDissipateAnimationName != null) { SetupBeamPart(animation, data, beamStartDissipateAnimationName, Vector2.zero, Vector2.zero, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.dissipateAnimations.beamStartAnimation = beamStartDissipateAnimationName; } if (beamDissipateAnimationName != null) { SetupBeamPart(animation, data, beamDissipateAnimationName, Vector2.zero, Vector2.zero, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.dissipateAnimations.beamAnimation = beamDissipateAnimationName; } if (beamEndDissipateAnimationName != null) { SetupBeamPart(animation, data, beamEndDissipateAnimationName, Vector2.zero, Vector2.zero, null, (WrapMode)2, (Anchor)3, constructOffsets); orAddComponent3.dissipateAnimations.beamEndAnimation = beamEndDissipateAnimationName; } orAddComponent3.dissipateTime = dissipateTime; } return orAddComponent3; } catch (Exception ex) { ETGModConsole.Log((object)ex.ToString(), false); return null; } } internal static void SetupBeamPart(tk2dSpriteAnimation beamAnimation, tk2dSpriteCollectionData data, string animationName, Vector2? colliderDimensions = null, Vector2? colliderOffsets = null, Vector3[] overrideVertices = null, WrapMode wrapMode = (WrapMode)2, Anchor anchor = (Anchor)3, bool constructOffsets = true) { //IL_0032: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) tk2dSpriteAnimationFrame[] frames = beamAnimation.GetClipByName(animationName).frames; foreach (tk2dSpriteAnimationFrame val in frames) { tk2dSpriteDefinition val2 = data.spriteDefinitions[val.spriteId]; if (constructOffsets) { val2.ConstructOffsetsFromAnchor(anchor); } if (overrideVertices != null) { val2.colliderVertices = overrideVertices; } else if (colliderDimensions.HasValue && colliderOffsets.HasValue) { val2.colliderVertices = (Vector3[])(object)new Vector3[2] { Vector2.op_Implicit(0.0625f * colliderOffsets.Value), Vector2.op_Implicit(0.0625f * colliderDimensions.Value) }; } else { ETGModConsole.Log((object)"BEAM ERROR: colliderDimensions or colliderOffsets was null with no override vertices!", false); } } } internal static void ConstructOffsetsFromAnchor(this tk2dSpriteDefinition def, Anchor anchor, Vector2? scale = null, bool fixesScale = false, bool changesCollider = true) { //IL_0033: 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) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 //IL_004d: 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_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) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Invalid comparison between Unknown and I4 //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_008c: 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_00a7: Invalid comparison between Unknown and I4 //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Invalid comparison between Unknown and I4 //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Invalid comparison between Unknown and I4 //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Invalid comparison between Unknown and I4 //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Invalid comparison between Unknown and I4 //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Invalid comparison between Unknown and I4 //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Invalid comparison between Unknown and I4 //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Invalid comparison between Unknown and I4 //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Invalid comparison between Unknown and I4 //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Invalid comparison between Unknown and I4 //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Invalid comparison between Unknown and I4 //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Invalid comparison between Unknown and I4 //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Invalid comparison between Unknown and I4 //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Invalid comparison between Unknown and I4 //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Invalid comparison between Unknown and I4 //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Invalid comparison between Unknown and I4 //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Invalid comparison between Unknown and I4 //IL_01ff: Unknown result type (might be due to invalid IL or missing references) if (adjustedDefs.Contains(def)) { return; } adjustedDefs.Add(def); if (!scale.HasValue) { scale = Vector2.op_Implicit(def.position3); } if (fixesScale) { Vector2 value = scale.Value - Vector3Extensions.XY(def.position0); scale = value; } float num = 0f; if ((int)anchor == 1 || (int)anchor == 4 || (int)anchor == 7) { num = 0f - scale.Value.x / 2f; } else if ((int)anchor == 2 || (int)anchor == 5 || (int)anchor == 8) { num = 0f - scale.Value.x; } float num2 = 0f; if ((int)anchor == 3 || (int)anchor == 4 || (int)anchor == 3) { num2 = 0f - scale.Value.y / 2f; } else if ((int)anchor == 6 || (int)anchor == 7 || (int)anchor == 8) { num2 = 0f - scale.Value.y; } def.MakeOffset(Vector2.op_Implicit(new Vector2(num, num2))); if (changesCollider && def.colliderVertices != null && def.colliderVertices.Length != 0) { float num3 = 0f; if ((int)anchor == 0 || (int)anchor == 3 || (int)anchor == 6) { num3 = scale.Value.x / 2f; } else if ((int)anchor == 2 || (int)anchor == 5 || (int)anchor == 8) { num3 = 0f - scale.Value.x / 2f; } float num4 = 0f; if ((int)anchor == 0 || (int)anchor == 1 || (int)anchor == 2) { num4 = scale.Value.y / 2f; } else if ((int)anchor == 6 || (int)anchor == 7 || (int)anchor == 8) { num4 = 0f - scale.Value.y / 2f; } ref Vector3 reference = ref def.colliderVertices[0]; reference += new Vector3(num3, num4, 0f); } } internal static void MakeOffset(this tk2dSpriteDefinition def, Vector3 offset, bool changesCollider = false) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0056: 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) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) def.position0 += offset; def.position1 += offset; def.position2 += offset; def.position3 += offset; def.boundsDataCenter += offset; def.untrimmedBoundsDataCenter += offset; if (changesCollider && def.colliderVertices != null && def.colliderVertices.Length != 0) { ref Vector3 reference = ref def.colliderVertices[0]; reference += offset; } } public static void ApplyOffsetToAnimation(this tk2dSpriteAnimationClip tk2DSpriteAnimationClip, Vector2 Offset, List IdsModified = null) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (IdsModified == null) { IdsModified = new List(); } if (tk2DSpriteAnimationClip == null) { return; } float x = Offset.x; float y = Offset.y; for (int i = 0; i < tk2DSpriteAnimationClip.frames.Length; i++) { int spriteId = tk2DSpriteAnimationClip.frames[i].spriteId; if (!IdsModified.Contains(spriteId)) { IdsModified.Add(spriteId); tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position0.x += x; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position0.y += y; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position1.x += x; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position1.y += y; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position2.x += x; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position2.y += y; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position3.x += x; tk2DSpriteAnimationClip.frames[i].spriteCollection.spriteDefinitions[spriteId].position3.y += y; } } } public static PlayerItem GetRandomActiveOfQualities(Random usedRandom, List excludedIDs, params ItemQuality[] qualities) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < ((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects.Count; i++) { if ((Object)(object)((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i] != (Object)null && ((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i] is PlayerItem && (int)((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i].quality != -100 && (int)((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i].quality != -50 && !(((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i] is ContentTeaserItem) && Array.IndexOf(qualities, ((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i].quality) != -1 && !excludedIDs.Contains(((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i].PickupObjectId)) { EncounterTrackable component = ((Component)((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i]).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.PrerequisitesMet()) { PickupObject obj = ((ObjectDatabase)(object)PickupObjectDatabase.Instance).Objects[i]; list.Add((PlayerItem)(object)((obj is PlayerItem) ? obj : null)); } } } int num = usedRandom.Next(list.Count); if (num < 0 || num >= list.Count) { return null; } return list[num]; } public static Vector2 GetUnitOnCircle(float angleDegrees, float radius) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = 0f; float num3 = 0f; num3 = angleDegrees * (float)Math.PI / 180f; num = radius * Mathf.Cos(num3); num2 = radius * Mathf.Sin(num3); Vector2 result = default(Vector2); ((Vector2)(ref result))..ctor(num, num2); return result; } public static Vector3 GetUnitOnCircleVec3(float angleDegrees, float radius) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = 0f; float num3 = 0f; num3 = angleDegrees * (float)Math.PI / 180f; num = radius * Mathf.Cos(num3); num2 = radius * Mathf.Sin(num3); Vector3 result = default(Vector3); ((Vector3)(ref result))..ctor(num, num2); return result; } public static GameObject SmartPlayEffectOnActor(this GameActor effector, GameObject effect, Vector3 offset, bool attached = true, bool IgnorePools = true, bool alreadyMiddleCenter = false, bool useHitbox = false) { //IL_0051: 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) //IL_0060: 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_0085: 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) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) GameObject val = SpawnManager.SpawnVFX(effect, IgnorePools); tk2dBaseSprite component = val.GetComponent(); Vector3 val2 = ((!useHitbox || !Object.op_Implicit((Object)(object)((BraveBehaviour)effector).specRigidbody) || ((BraveBehaviour)effector).specRigidbody.HitboxPixelCollider == null) ? Vector2Extensions.ToVector3ZUp(((BraveBehaviour)effector).sprite.WorldCenter, 0f) : Vector2Extensions.ToVector3ZUp(((BraveBehaviour)effector).specRigidbody.HitboxPixelCollider.UnitCenter, 0f)); if (!alreadyMiddleCenter) { component.PlaceAtPositionByAnchor(val2 + offset, (Anchor)4); } else { ((BraveBehaviour)component).transform.position = val2 + offset; } if (attached) { val.transform.parent = ((BraveBehaviour)effector).transform; component.HeightOffGround = 0.2f; ((BraveBehaviour)effector).sprite.AttachRenderer(component); if (effector is PlayerController) { SmartOverheadVFXController component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.Initialize((PlayerController)(object)((effector is PlayerController) ? effector : null), offset); } } } if (!alreadyMiddleCenter) { val.transform.localPosition = dfVectorExtensions.QuantizeFloor(val.transform.localPosition, 0.0625f); } return val; } } public class StaticSpriteCollections { public static AssetBundle MikuBundle; public static tk2dSpriteCollectionData MikuCharacterCollection; public static tk2dSpriteCollectionData MikuItemAndGunCollection; public static tk2dSpriteCollectionData ProjectileAndBeamCollection; public static tk2dSpriteAnimation MikuCharacterAnimation; public static tk2dSpriteAnimation ItemAndWeaponAnimation; public static tk2dSpriteAnimation ProjectileAndBeamAnimation; public static void Init() { MikuBundle = AssetBundleLoader.LoadAssetBundleFromLiterallyAnywhere("mikumod"); MikuCharacterCollection = MikuBundle.LoadAsset("MikuCharacterCollection").GetComponent(); MikuCharacterAnimation = MikuBundle.LoadAsset("MikuCharacterAnimation").GetComponent(); MikuItemAndGunCollection = MikuBundle.LoadAsset("ItemAndWeaponCollection").GetComponent(); ItemAndWeaponAnimation = MikuBundle.LoadAsset("ItemAndWeaponAnimation").GetComponent(); ProjectileAndBeamCollection = MikuBundle.LoadAsset("ProjectileAndBeamCollection").GetComponent(); ProjectileAndBeamAnimation = MikuBundle.LoadAsset("ProjectileAndBeamAnimation").GetComponent(); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("somebunny.etg.mikumikumod", "~~ Miku Miku Mod ~~", "1.0.4")] public class MikuMikuModule : BaseUnityPlugin { public const string GUID = "somebunny.etg.mikumikumod"; public const string NAME = "~~ Miku Miku Mod ~~"; public const string VERSION = "1.0.4"; public const string TEXT_COLOR = "#00FFFF"; public static string FilePathFolder; public static PlayableCharacters Miku; public static ConfigEntry CopyrightedAudio; public void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) FilePathFolder = ETGMod.FolderPath((BaseUnityPlugin)(object)this); new Harmony("somebunny.etg.mikumikumod").PatchAll(); StaticSpriteCollections.Init(); ParticleBase.Init(); ETGModMainBehaviour.WaitForGameManagerStart((Action)GMStart); } public void GMStart(GameManager g) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_00f6: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06bf: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06eb: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Expected O, but got Unknown //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0714: Unknown result type (might be due to invalid IL or missing references) //IL_071f: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Expected O, but got Unknown CopyrightedAudio = ((BaseUnityPlugin)this).Config.Bind("Miku Miku Mod", "Copyrighted Audio", true, "Should (likely) copyrighted audio be enabled?"); MikuMikuBeam.Add(); MikuHarmony.Init(); Leek.Init(); AudioResourceLoader.loadFromAssembly("MikuMikuSounds.bnk", "HatsuneMikuMod"); Miku = ETGModCompatibility.ExtendEnum("somebunny.etg.mikumikumod", "Miku"); CustomCharacterData val = Loader.BuildCharacterBundle("MikuMikuMod/MikuData", StaticSpriteCollections.MikuCharacterCollection, StaticSpriteCollections.MikuCharacterAnimation, StaticSpriteCollections.MikuCharacterCollection, StaticSpriteCollections.MikuCharacterAnimation, "somebunny.etg.hatsunemiku", new Vector3(37.5f, 27.5f), false, new Vector3(34.625f, 27.5f), true, false, true, true, false, new GlowMatDoer(Color32.op_Implicit(new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue)), 0f, 0f), new GlowMatDoer(Color32.op_Implicit(new Color32((byte)0, (byte)0, (byte)0, byte.MaxValue)), 0f, 0f), 0, false, "", StaticSpriteCollections.MikuBundle.LoadAsset("mikubosscard_001")); val.identity = Miku; val.bossCard = new List { StaticSpriteCollections.MikuBundle.LoadAsset("modular_bosscard_001"), StaticSpriteCollections.MikuBundle.LoadAsset("modular_bosscard_002"), StaticSpriteCollections.MikuBundle.LoadAsset("modular_bosscard_003"), StaticSpriteCollections.MikuBundle.LoadAsset("modular_bosscard_004") }; val.animator.GetClipByName("death_shot").ApplyOffsetToAnimation(new Vector2(0.5f, -1.75f)); val.animator.GetClipByName("slide_up").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f)); val.animator.GetClipByName("slide_down").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f)); val.animator.GetClipByName("slide_right").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f)); val.animator.GetClipByName("item_get").ApplyOffsetToAnimation(new Vector2(-0.5f, 0f)); val.animator.GetClipByName("death").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f)); val.animator.GetClipByName("chest_recover").ApplyOffsetToAnimation(new Vector2(-0.375f, 0f)); val.animator.GetClipByName("pet").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f)); List idsModified = new List(); val.animator.GetClipByName("select_leek_end").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("select_leek_loop").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("select_leek_start").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("select_microphone_end").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("select_microphone_singloop").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("select_microphone_start").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("select_choose").ApplyOffsetToAnimation(new Vector2(-0.625f, 0f), idsModified); tk2dSpriteAnimationClip clipByName = val.animator.GetClipByName("doorway"); tk2dSpriteAnimationFrame[] frames = clipByName.frames; foreach (tk2dSpriteAnimationFrame val2 in frames) { val2.eventAudio = ""; val2.triggerEvent = false; } clipByName.frames[0].eventAudio = "Play_OBJ_item_throw_01"; clipByName.frames[0].triggerEvent = true; clipByName.frames[1].eventAudio = "Play_Fall"; clipByName.frames[1].triggerEvent = true; tk2dSpriteAnimationClip clipByName2 = val.animator.GetClipByName("death_shot"); clipByName2.frames[0].eventAudio = "Play_DeltaruneExplosion"; clipByName2.frames[0].triggerEvent = true; if (CopyrightedAudio.Value) { tk2dSpriteAnimationClip clipByName3 = val.animator.GetClipByName("item_get"); clipByName3.frames[2].eventAudio = "Play_OOEEOO"; clipByName3.frames[2].triggerEvent = true; } SoundManager.AddCustomSwitchData("FS_Surfaces", "Stone", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Stone") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "Carpet", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Carpet") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "Water", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Water") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "Ice", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Stone") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "Grass", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Carpet") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "Bone", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Stone") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "Flesh", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Water") }); SoundManager.AddCustomSwitchData("FS_Surfaces", "ThickGoop", "Play_FS_Miku", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_Miku_Step_Water") }); tk2dSpriteAnimationClip[] clips = val.animator.Library.clips; foreach (tk2dSpriteAnimationClip val3 in clips) { for (int k = 0; k <= val3.frames.Length; k++) { if (val3.name.Contains("run_") && (k == 2 || k == 5)) { val3.frames[k].eventAudio = "Play_FS_Miku"; val3.frames[k].triggerEvent = true; } } } CharacterSelectIdleDoer idleDoer = val.idleDoer; idleDoer.idleMax = 1f; idleDoer.idleMin = 1f; idleDoer.phases = (CharacterSelectIdlePhase[])(object)new CharacterSelectIdlePhase[2] { new CharacterSelectIdlePhase { inAnimation = "select_microphone_start", holdAnimation = "select_microphone_singloop", outAnimation = "select_microphone_end", holdMin = 4f, holdMax = 9f }, new CharacterSelectIdlePhase { inAnimation = "select_leek_start", holdAnimation = "select_leek_loop", outAnimation = "select_leek_end", holdMin = 3f, holdMax = 6f } }; Log("~~ Miku Miku Mod ~~ v1.0.4 started successfully.", "#00FFFF"); } public static void Log(string text, string color = "#FFFFFF") { ETGModConsole.Log((object)("" + text + ""), false); } } } namespace MikuMikuMod.Code { public class FaceMelterLaser : BraveBehaviour { public Gun LuteRef; public MikuHarmony MikuHarmony; private int Lastharmony; public float TriggerHoldTime = 0.1f; private Dictionary currentBeams = new Dictionary(); public void Start() { LuteRef = ((Component)this).GetComponent(); } public void ClearOutBeams() { foreach (KeyValuePair currentBeam in currentBeams) { currentBeam.Key.CeaseAttack(); } currentBeams.Clear(); } public void Update() { //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)LuteRef) || !Object.op_Implicit((Object)(object)LuteRef.CurrentOwner)) { return; } GameActor currentOwner = LuteRef.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val == null) { return; } if ((Object)(object)MikuHarmony == (Object)null) { MikuHarmony = val.passiveItems.Where(delegate(PassiveItem self) { MikuHarmony mikuHarmony = self as MikuHarmony; return mikuHarmony != null; }).FirstOrDefault() as MikuHarmony; } if (!ItemHelpers.PlayerHasActiveSynergy(val, "Mechanical Love")) { return; } if (LuteRef.m_extantAmp != null) { if (!LuteRef.m_isCurrentlyFiring && TriggerHoldTime > 0f) { TriggerHoldTime -= Time.deltaTime; if (TriggerHoldTime <= 0f) { ClearOutBeams(); } } else if (LuteRef.m_isCurrentlyFiring) { TriggerHoldTime = 0.5f; if (currentBeams.Count == 0) { foreach (ProjectileModule projectile in LuteRef.Volley.projectiles) { Dictionary dictionary = currentBeams; Projectile obj = MikuMikuBeam.BeamProjectiles[Lastharmony]; SingleSpawnableGunPlacedObject extantAmp = LuteRef.m_extantAmp; dictionary.Add(BeamAPI.FreeFireBeamFromAnywhere(obj, val, (GameObject)null, ((BraveBehaviour)((extantAmp is ShootProjectileOnGunfireDoer) ? extantAmp : null)).sprite.WorldCenter, LuteRef.CurrentAngle + projectile.angleFromAim, 1000f, false, false, 0f), projectile.angleFromAim); } } } foreach (KeyValuePair currentBeam in currentBeams) { val.DoPostProcessBeamChanceTick(currentBeam.Key); currentBeam.Key.Direction = Toolbox.GetUnitOnCircle(LuteRef.CurrentAngle + currentBeam.Value, 1f); } } if (Lastharmony != MikuHarmony.CurrentHarmonyLevel) { Lastharmony = MikuHarmony.CurrentHarmonyLevel; ClearOutBeams(); } } } public class GunzhengTuah : BraveBehaviour { public Gun LuteRef; private bool LastSynergyState = false; public MikuHarmony MikuHarmony; private int Lastharmony; public StatModifier StatModifier; public void Start() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown LuteRef = ((Component)this).GetComponent(); StatModifier = new StatModifier { amount = 1f, isMeatBunBuff = false, modifyType = (ModifyMethod)1, statToBoost = (StatType)1 }; LuteRef.currentGunStatModifiers = (StatModifier[])(object)new StatModifier[1] { StatModifier }; } public void Update() { if (!Object.op_Implicit((Object)(object)LuteRef) || !Object.op_Implicit((Object)(object)LuteRef.CurrentOwner)) { return; } GameActor currentOwner = LuteRef.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val == null) { return; } if ((Object)(object)MikuHarmony == (Object)null) { MikuHarmony = val.passiveItems.Where(delegate(PassiveItem self) { MikuHarmony mikuHarmony = self as MikuHarmony; return mikuHarmony != null; }).FirstOrDefault() as MikuHarmony; } bool flag = ItemHelpers.PlayerHasActiveSynergy(val, "Bringing Back The Classics"); if (LastSynergyState != flag) { LastSynergyState = flag; ToggleSynergy(LastSynergyState); } if (flag && Lastharmony != MikuHarmony.CurrentHarmonyLevel) { Lastharmony = MikuHarmony.CurrentHarmonyLevel; switch (Lastharmony) { case 0: StatModifier.amount = 1f; break; case 1: StatModifier.amount = 1.25f; break; case 2: StatModifier.amount = 1.5f; break; case 3: StatModifier.amount = 2f; break; case 4: StatModifier.amount = 2.5f; break; } val.stats.RecalculateStats(val, false, false); } } public void ToggleSynergy(bool Value) { if (Value) { Gun luteRef = LuteRef; luteRef.PostProcessProjectile = (Action)Delegate.Combine(luteRef.PostProcessProjectile, new Action(PostProcess)); } else { Gun luteRef2 = LuteRef; luteRef2.PostProcessProjectile = (Action)Delegate.Remove(luteRef2.PostProcessProjectile, new Action(PostProcess)); } } public void PostProcess(Projectile projectile) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)MikuHarmony == (Object)null) && MikuHarmony.CurrentHarmonyLevel > 0) { switch (MikuHarmony.CurrentHarmonyLevel) { case 1: { ProjectileData baseData4 = projectile.baseData; baseData4.speed *= 1.1f; projectile.UpdateSpeed(); projectile.AdjustPlayerProjectileTint(new Color(0f, 1f, 1f, 0.1f), 10, 0f); break; } case 2: { ProjectileData baseData3 = projectile.baseData; baseData3.speed *= 1.2f; projectile.UpdateSpeed(); projectile.AdjustPlayerProjectileTint(new Color(0f, 1f, 1f, 0.3f), 10, 0f); break; } case 3: { ProjectileData baseData2 = projectile.baseData; baseData2.speed *= 1.33f; projectile.UpdateSpeed(); projectile.AdjustPlayerProjectileTint(new Color(0f, 1f, 1f, 0.7f), 10, 0f); break; } case 4: { ProjectileData baseData = projectile.baseData; baseData.speed *= 1.5f; projectile.UpdateSpeed(); projectile.AdjustPlayerProjectileTint(Color.cyan, 10, 0f); break; } } } } } [HarmonyPatch(typeof(GameUIRoot), "UpdateGunDataInternal")] public class NopeOutVisibility { public static float e; private static void Postfix(GameUIRoot __instance, PlayerController targetPlayer, GunInventory inventory, int inventoryShift, GameUIAmmoController targetAmmoController, int labelTarget) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_00fc: Unknown result type (might be due to invalid IL or missing references) MikuHarmony mikuHarmony = targetPlayer.PlayerIsMiku(); if (!((Object)(object)mikuHarmony == (Object)null)) { string text = "[color #ffffff]~~ Harmony: 0 ~~[/color]"; switch (mikuHarmony.CurrentHarmonyLevel) { case 1: text = "[color #b5ffff]~~ Harmony: 1 ~~[/color]"; break; case 2: text = "[color #4ae7ff]~~: Harmony: 2 :~~[/color]"; break; case 3: e += Time.deltaTime; text = "[color #" + ColorUtility.ToHtmlStringRGBA(Color.Lerp(Color.cyan, Color.blue, Mathf.PingPong(e, 1f))) + "]~~:: Harmony: 3 ::~~[/color]"; break; case 4: { e += Time.deltaTime; float num = e; float num2 = Mathf.Abs(num * -0.5f) % 1f; int num3 = 8; int num4 = 2; int num5 = 3; float num6 = Mathf.Sin(num * (float)num5 * (float)num3) * (float)num4; text = "[color #" + ColorUtility.ToHtmlStringRGBA(Color.HSVToRGB(num2, 1f, 1f)) + "]{{{ Harmony: MAX }}}[/color]"; break; } } __instance.m_gunNameVisibilityTimers[labelTarget] -= ((TimeInvariantMonoBehaviour)__instance).m_deltaTime; if (__instance.m_gunNameVisibilityTimers[labelTarget] > 1f) { __instance.gunNameLabels[labelTarget].processMarkup = true; ((dfControl)__instance.gunNameLabels[labelTarget]).IsVisible = true; ((dfControl)__instance.gunNameLabels[labelTarget]).Opacity = 1f; __instance.gunNameLabels[labelTarget].Text = text + "\n" + __instance.gunNameLabels[labelTarget].Text; } else if (__instance.m_gunNameVisibilityTimers[labelTarget] > 0f) { __instance.gunNameLabels[labelTarget].processMarkup = true; ((dfControl)__instance.gunNameLabels[labelTarget]).IsVisible = true; ((dfControl)__instance.gunNameLabels[labelTarget]).Opacity = __instance.m_gunNameVisibilityTimers[labelTarget]; __instance.gunNameLabels[labelTarget].Text = text + "\n" + __instance.gunNameLabels[labelTarget].Text; } else { __instance.gunNameLabels[labelTarget].processMarkup = true; ((dfControl)__instance.gunNameLabels[labelTarget]).IsVisible = true; ((dfControl)__instance.gunNameLabels[labelTarget]).Opacity = 1f; __instance.gunNameLabels[labelTarget].Text = text ?? ""; } } } } public class Charmable : MonoBehaviour, IPlayerInteractable { private RoomHandler roomHandler; public AIActor enemy; private Color oldColor; public void Start() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) oldColor = SpriteOutlineManager.GetOutlineMaterial(((BraveBehaviour)enemy).sprite).GetColor("_OverrideColor"); SpriteOutlineManager.AddOutlineToSprite(((BraveBehaviour)enemy).sprite, new Color(1f, 0.4f, 0.8f, 1f)); roomHandler = Vector3Extensions.GetAbsoluteRoom(((Component)this).transform.position); if (roomHandler != null) { roomHandler.RegisterInteractable((IPlayerInteractable)(object)this); } } public string GetAnimationState(PlayerController interactor, out bool shouldBeFlipped) { shouldBeFlipped = false; return string.Empty; } public float GetDistanceToPoint(Vector2 point) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((BraveBehaviour)enemy).sprite)) { return 1000f; } Bounds bounds = ((BraveBehaviour)enemy).sprite.GetBounds(); ((Bounds)(ref bounds)).SetMinMax(((Bounds)(ref bounds)).min + ((Component)this).transform.position, ((Bounds)(ref bounds)).max + ((Component)this).transform.position); float num = Mathf.Max(Mathf.Min(point.x, ((Bounds)(ref bounds)).max.x), ((Bounds)(ref bounds)).min.x); float num2 = Mathf.Max(Mathf.Min(point.y, ((Bounds)(ref bounds)).max.y), ((Bounds)(ref bounds)).min.y); return Mathf.Sqrt((point.x - num) * (point.x - num) + (point.y - num2) * (point.y - num2)) / 1.5f; } public float GetOverrideMaxDistance() { return 3f; } public void Interact(PlayerController interactor) { MikuHarmony mikuHarmony = interactor.PlayerIsMiku(); if (Object.op_Implicit((Object)(object)mikuHarmony)) { for (int i = 0; i < mikuHarmony.CurrentHarmonyLevel + 1; i++) { float timeMult = 1.5f - (float)i * 0.125f; float height = 3f + (float)i * 0.25f; float damage = ((i == 0) ? 40 : 15); ((MonoBehaviour)GameManager.Instance).StartCoroutine(DoLeekToss(enemy, interactor, height, timeMult, damage)); } } else { ((MonoBehaviour)GameManager.Instance).StartCoroutine(DoLeekToss(enemy, interactor)); Object.Destroy((Object)(object)this); } } public IEnumerator DoLeekToss(AIActor enemy, PlayerController player, float Height = 3f, float TimeMult = 1.5f, float Damage = 40f) { Vector2 v = ((BraveBehaviour)player).sprite.WorldCenter; GameObject onject = Object.Instantiate(Leek.LeekObject, Vector2.op_Implicit(v), Quaternion.identity); float uiyferw = Random.Range(240, 600); float e = 0f; AkSoundEngine.PostEvent("Play_OBJ_item_throw_01", onject.gameObject); Vector2 v_2 = ((BraveBehaviour)enemy).sprite.WorldTopCenter; while (e < 1f) { v_2 = (Object.op_Implicit((Object)(object)enemy) ? ((BraveBehaviour)enemy).sprite.WorldTopCenter : v_2); e += Time.deltaTime * TimeMult; onject.transform.position = Vector2.op_Implicit(Vector2.Lerp(v, v_2, e) + new Vector2(0f, Mathf.Lerp(0f, Height, Easing.DoLerpT(e, Easing.Ease.EASE_IN_AND_BACK)))); onject.transform.Rotate(new Vector3(0f, 0f, uiyferw * Time.deltaTime)); yield return null; } onject.GetComponent().spawnShadows = false; DebrisObject orAddComponent = GameObjectExtensions.GetOrAddComponent(onject); orAddComponent.angularVelocity = Random.Range(90, 120); orAddComponent.angularVelocityVariance = Random.Range(10, 60); orAddComponent.decayOnBounce = 0.5f; orAddComponent.bounceCount = 1; orAddComponent.canRotate = true; orAddComponent.shouldUseSRBMotion = true; orAddComponent.AssignFinalWorldDepth(-0.5f); ((BraveBehaviour)orAddComponent).sprite = onject.GetComponent(); orAddComponent.animatePitFall = true; orAddComponent.Trigger(Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), Random.Range(0.5f, 2f))), 3.5f, 1f); orAddComponent.audioEventName = "Play_PET_junk_splat_01"; if (Object.op_Implicit((Object)(object)enemy)) { Leek.Impact.SpawnAtPosition(Vector2.op_Implicit(v_2), 0f, (Transform)null, (Vector2?)null, (Vector2?)null, (float?)null, false, (SpawnMethod)null, (tk2dBaseSprite)null, false); AkSoundEngine.PostEvent("Play_WPN_" + Leek.ImpactSFX + "_impact_01", onject.gameObject); ((BraveBehaviour)enemy).healthHaver.ApplyDamage(Damage * player.stats.GetStatValue((StatType)5), Vector2.zero, "", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); ((BraveBehaviour)enemy).behaviorSpeculator.Stun(7.5f, true); AIActorUtility.ApplyGlitter(enemy); } } public void OnEnteredRange(PlayerController interactor) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) SpriteOutlineManager.AddOutlineToSprite(((BraveBehaviour)enemy).sprite, Color.white); } public void OnExitRange(PlayerController interactor) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) SpriteOutlineManager.AddOutlineToSprite(((BraveBehaviour)enemy).sprite, new Color(1f, 0.4f, 0.8f, 1f)); } public void OnDestroy() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) roomHandler.DeregisterInteractable((IPlayerInteractable)(object)this); SpriteOutlineManager.AddOutlineToSprite(((BraveBehaviour)enemy).sprite, oldColor); } } public class HarmonyPatches { [HarmonyPatch(typeof(PlayerItem), "Drop")] public class PlayerItem_Drop_Post { [HarmonyPostfix] public static void Postfix(PlayerItem __instance, PlayerController player, float overrideForce = 4f) { if (Object.op_Implicit((Object)(object)__instance)) { OnActiveItemDropped?.Invoke(__instance, player); } } } [HarmonyPatch(typeof(GunTierController), "OnGunInitialized")] public class AffectEnemy_GunTierController_Awake_Post { [HarmonyPostfix] public static void Postfix(GunTierController __instance, GameActor obj) { if ((Object)(object)__instance.m_gun != (Object)null) { GameActor currentOwner = __instance.m_gun.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val != null && (((PickupObject)__instance.m_gun).PickupObjectId == 97 || ((PickupObject)__instance.m_gun).PickupObjectId == 718)) { PolarStar orAddComponent = GameObjectExtensions.GetOrAddComponent(((Component)__instance.m_gun).gameObject); orAddComponent.Gun = __instance.m_gun; orAddComponent.GunTierController = __instance; orAddComponent.PlayerController = val; orAddComponent.StartUp(); } } } } [HarmonyPatch(typeof(GunTierController), "OnEnemyKilled")] public class AffectEnemy_GunTierController_OnEnemyKilled_Post { [HarmonyPrefix] public static bool Postfix(GunTierController __instance, PlayerController obj) { foreach (PassiveItem passiveItem in obj.passiveItems) { if (passiveItem is MikuHarmony) { return false; } } return true; } } [HarmonyPatch(typeof(GunTierController), "OnPlayerDamaged")] public class AffectEnemy_GunTierController_OnPlayerDamaged_Post { [HarmonyPrefix] public static bool Postfix(GunTierController __instance) { GameActor currentOwner = __instance.m_gun.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val != null) { foreach (PassiveItem passiveItem in val.passiveItems) { if (passiveItem is MikuHarmony) { return false; } } } return true; } } [HarmonyPatch(typeof(GunTierController), "OnGunDroppedOrDestroyed")] public class AffectEnemy_GunTierController_OnGunDroppedOrDestroyed_Post { [HarmonyPrefix] public static bool Postfix(GunTierController __instance) { if ((Object)(object)((Component)__instance.m_gun).GetComponent() != (Object)null) { ((Component)__instance.m_gun).GetComponent().OnDropped(); } return true; } } [HarmonyPatch(typeof(RadialSlowItem), "AffectEnemy")] public class AffectEnemy_RadialSlowItem_StartPatch { [HarmonyPostfix] public static void Postfix(RadialSlowItem __instance, AIActor target) { if (ItemHelpers.PlayerHasActiveSynergy(((PlayerItem)__instance).LastOwner, "Stunning Performance")) { ((MonoBehaviour)target).StartCoroutine(DoInteractableBuff(target, __instance.HoldTime + __instance.InTime)); } } private static IEnumerator DoInteractableBuff(AIActor target, float duration) { Charmable s = ((Component)target).gameObject.AddComponent(); s.enemy = target; for (int i = 0; i < 24; i++) { ParticleBase.EmitNoiselessParticle(((BraveBehaviour)target).sprite.WorldCenter, 1, 3f * Random.Range(0.9f, 1.1f), 15 * i, 0.75f); } yield return (object)new WaitForSeconds(duration); if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)s)) { Object.Destroy((Object)(object)s); } } } [HarmonyPatch(typeof(RadialCharmItem), "AffectEnemy")] public class AffectEnemy_StartPatch { [HarmonyPostfix] public static void Postfix(RadialCharmItem __instance, AIActor target) { if (ItemHelpers.PlayerHasActiveSynergy(((PlayerItem)__instance).LastOwner, "War Horn")) { ((MonoBehaviour)target).StartCoroutine(DoBuffDuration(((PlayerItem)__instance).LastOwner, target, ((GameActorEffect)__instance.CharmEffect).duration)); } } } [HarmonyPatch(typeof(MetronomeItem))] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Postfix_MetronomeItem_1 { [HarmonyPostfix] public static float Postfix(float __result, MetronomeItem __instance) { if (ItemHelpers.PlayerHasActiveSynergy(((PassiveItem)__instance).Owner, "Auditory Attenuation")) { __result *= 0.5f; } return __result; } } [HarmonyPatch(typeof(MetronomeItem))] [HarmonyPatch(/*Could not decode attribute arguments.*/)] public class Postfix_MetronomeItem_2 { [HarmonyPostfix] public static float Postfix(float __result, MetronomeItem __instance) { if (ItemHelpers.PlayerHasActiveSynergy(((PassiveItem)__instance).Owner, "Auditory Attenuation")) { __result *= 0.5f; } return __result; } } [HarmonyPatch(typeof(FoyerCharacterSelectFlag), "Start")] public class FoyerCharacterSelectFlag_StartPatch { [HarmonyPrefix] public static void Prefix(FoyerCharacterSelectFlag __instance) { if (!((Object)__instance).name.Contains("Miku")) { return; } tk2dSpriteAnimator obj = ((Component)__instance).GetComponent() ?? ((Component)__instance).GetComponentInChildren(); obj.GetClipByName("select_leek_end").frames[5].eventInfo = "TossLeek"; obj.GetClipByName("select_leek_end").frames[5].triggerEvent = true; obj.GetClipByName("select_microphone_singloop").frames[1].eventInfo = "SingHerHeartAway"; obj.GetClipByName("select_microphone_singloop").frames[1].triggerEvent = true; obj.GetClipByName("select_microphone_singloop").frames[3].eventInfo = "SingHerHeartAway"; obj.GetClipByName("select_microphone_singloop").frames[3].triggerEvent = true; tk2dSpriteAnimator obj2 = obj; obj2.AnimationEventTriggered = (Action)Delegate.Combine(obj2.AnimationEventTriggered, (Action)delegate(tk2dSpriteAnimator o1, tk2dSpriteAnimationClip o2, int o3) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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 (o2.GetFrame(o3).eventInfo == "TossLeek") { ((MonoBehaviour)GameManager.Instance).StartCoroutine(Leek.DoLeekToss(obj, o2.GetFrame(o3))); } if (o2.GetFrame(o3).eventInfo == "SingHerHeartAway") { ParticleBase.EmitParticle(((BraveBehaviour)obj).sprite.WorldCenter + new Vector2(0.25f, 0.25f), 2); } if (o2.GetFrame(o3).eventInfo == "Undertale") { AkSoundEngine.PostEvent("Play_Once_Upon_a_Time", ((Component)obj).gameObject); } }); } } [HarmonyPatch(typeof(MetronomeItem), "OnGunChanged")] public class OnGunChanged_StartPatch { [HarmonyPatch] public static bool Prefix(MetronomeItem __instance, Gun current) { if ((Object)(object)((PassiveItem)__instance).Owner == (Object)null) { return false; } if (ItemHelpers.PlayerHasActiveSynergy(((PassiveItem)__instance).Owner, "Auditory Attenuation")) { __instance.m_cachedGunReference = current; return false; } return true; } } [HarmonyPatch(typeof(ShootProjectileOnGunfireDoer), "HandleProjectileFired")] public class HandleProjectileFired_StartPatch { private class BeamContainer : MonoBehaviour { public List BasicBeamController = new List(); public void ClearBeams() { foreach (BeamController item in BasicBeamController) { item.CeaseAttack(); } BasicBeamController.Clear(); } } [HarmonyPrefix] public static bool Postfix(ShootProjectileOnGunfireDoer __instance, Projectile obj) { if (!Object.op_Implicit((Object)(object)__instance) || !Object.op_Implicit((Object)(object)((BraveBehaviour)__instance).sprite)) { __instance.Deactivate(); return false; } if (__instance.m_isActive) { GameActor owner = obj.Owner; PlayerController val = (PlayerController)(object)((owner is PlayerController) ? owner : null); if (val != null && ItemHelpers.PlayerHasActiveSynergy(val, "Mechanical Love")) { return false; } } return true; } } public static Action OnActiveItemDropped; public static IEnumerator DoBuffDuration(PlayerController player, AIActor target, float duration) { GameObject effect = (GameObject)ResourceCache.Acquire("Global VFX/VFX_Buff_Status"); GameObject effect_ = ((GameActor)target).PlayEffectOnActor(effect, new Vector3(0f, 1f, 0f), true, true, false); float e = 0f; target.MovementSpeed *= 1.5f; BehaviorSpeculator behaviorSpeculator = ((BraveBehaviour)target).behaviorSpeculator; behaviorSpeculator.CooldownScale *= 1.33f; Action var = delegate(Projectile p) { ProjectileUtility.RemoveFromPool(p); player.DoPostProcessProjectile(p); }; if (Object.op_Implicit((Object)(object)((BraveBehaviour)target).bulletBank)) { AIBulletBank bulletBank = ((BraveBehaviour)target).bulletBank; bulletBank.OnProjectileCreated = (Action)Delegate.Combine(bulletBank.OnProjectileCreated, var); } if (Object.op_Implicit((Object)(object)((BraveBehaviour)target).aiShooter)) { AIShooter aiShooter = ((BraveBehaviour)target).aiShooter; aiShooter.PostProcessProjectile = (Action)Delegate.Combine(aiShooter.PostProcessProjectile, var); } while (e < duration) { e += Time.deltaTime; yield return null; } if (Object.op_Implicit((Object)(object)target)) { target.MovementSpeed /= 1.5f; BehaviorSpeculator behaviorSpeculator2 = ((BraveBehaviour)target).behaviorSpeculator; behaviorSpeculator2.CooldownScale /= 1.33f; if (Object.op_Implicit((Object)(object)((BraveBehaviour)target).bulletBank)) { AIBulletBank bulletBank2 = ((BraveBehaviour)target).bulletBank; bulletBank2.OnProjectileCreated = (Action)Delegate.Remove(bulletBank2.OnProjectileCreated, var); } if (Object.op_Implicit((Object)(object)((BraveBehaviour)target).aiShooter)) { AIShooter aiShooter2 = ((BraveBehaviour)target).aiShooter; aiShooter2.PostProcessProjectile = (Action)Delegate.Remove(aiShooter2.PostProcessProjectile, var); } Object.Destroy((Object)(object)effect_); } } } public class LuteUpTheNight : BraveBehaviour { public Gun LuteRef; private bool LastSynergyState = false; public MikuHarmony MikuHarmony; private HeatIndicatorController m_radialIndicator; private bool m_radialIndicatorActive; public float AuraRadius = 5f; public bool DoCharm; public GameActorCharmEffect CharmEffect; public void Start() { LuteRef = ((Component)this).GetComponent(); LuteRef.OnReloadPressed = (Action)Delegate.Combine(LuteRef.OnReloadPressed, new Action(HandleReload)); } private void HandleReload(PlayerController sourcePlayer, Gun arg2, bool arg3) { if (Object.op_Implicit((Object)(object)sourcePlayer) && ItemHelpers.PlayerHasActiveSynergy(sourcePlayer, "You're Gonna Need A Bigger Lute")) { ((MonoBehaviour)this).StartCoroutine(HandleReloadTrigger()); } } private IEnumerator HandleReloadTrigger() { float elapsed = 0f; HandleRadialIndicator(); while (Object.op_Implicit((Object)(object)LuteRef) && LuteRef.IsReloading) { if (!((Behaviour)LuteRef).enabled || !Object.op_Implicit((Object)(object)LuteRef.CurrentOwner) || Dungeon.IsGenerating) { yield break; } elapsed += BraveTime.DeltaTime; GameActor currentOwner = LuteRef.CurrentOwner; PlayerController playerOwner = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (!Object.op_Implicit((Object)(object)playerOwner) || playerOwner.CurrentRoom == null) { yield break; } playerOwner.CurrentRoom.ApplyActionToNearbyEnemies(((GameActor)playerOwner).CenterPosition, AuraRadius, (Action)ProcessEnemy); yield return null; } UnhandleRadialIndicator(); } private void ProcessEnemy(AIActor enemy, float distance) { ((GameActor)enemy).ApplyEffect((GameActorEffect)(object)CharmEffect, 1f, (Projectile)null); } private void HandleRadialIndicator() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (!m_radialIndicatorActive) { m_radialIndicatorActive = true; m_radialIndicator = ((GameObject)Object.Instantiate(ResourceCache.Acquire("Global VFX/HeatIndicator"), Vector2Extensions.ToVector3ZisY(LuteRef.CurrentOwner.CenterPosition, 0f), Quaternion.identity, ((BraveBehaviour)LuteRef.CurrentOwner).transform)).GetComponent(); m_radialIndicator.CurrentColor = new Color(1f, 0.4f, 0.8f); m_radialIndicator.IsFire = false; m_radialIndicator.CurrentRadius = Mathf.Max((float)MikuHarmony.CurrentHarmonyLevel + 0.5f, 2.5f); } } private void UnhandleRadialIndicator() { if (m_radialIndicatorActive) { m_radialIndicatorActive = false; if (Object.op_Implicit((Object)(object)m_radialIndicator)) { m_radialIndicator.EndEffect(); } m_radialIndicator = null; } } public void Update() { if (!Object.op_Implicit((Object)(object)LuteRef) || !Object.op_Implicit((Object)(object)LuteRef.CurrentOwner)) { return; } GameActor currentOwner = LuteRef.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val == null) { return; } if ((Object)(object)MikuHarmony == (Object)null) { MikuHarmony = val.passiveItems.Where(delegate(PassiveItem self) { MikuHarmony mikuHarmony = self as MikuHarmony; return mikuHarmony != null; }).FirstOrDefault() as MikuHarmony; } if (LastSynergyState != ItemHelpers.PlayerHasActiveSynergy(val, "You're Gonna Need A Bigger Lute")) { LastSynergyState = ItemHelpers.PlayerHasActiveSynergy(val, "You're Gonna Need A Bigger Lute"); ToggleSynergy(LastSynergyState); } } public void ToggleSynergy(bool Value) { if (Value) { Gun luteRef = LuteRef; luteRef.PostProcessProjectile = (Action)Delegate.Combine(luteRef.PostProcessProjectile, new Action(PostProcess)); } else { Gun luteRef2 = LuteRef; luteRef2.PostProcessProjectile = (Action)Delegate.Remove(luteRef2.PostProcessProjectile, new Action(PostProcess)); } } public void PostProcess(Projectile projectile) { if (!((Object)(object)MikuHarmony == (Object)null) && MikuHarmony.CurrentHarmonyLevel > 0) { HomingModifier orAddComponent = GameObjectExtensions.GetOrAddComponent(((Component)projectile).gameObject); switch (MikuHarmony.CurrentHarmonyLevel) { case 1: orAddComponent.AngularVelocity += 10f; orAddComponent.HomingRadius += 2f; break; case 2: orAddComponent.AngularVelocity += 20f; orAddComponent.HomingRadius += 6f; break; case 3: orAddComponent.AngularVelocity += 40f; orAddComponent.HomingRadius += 9f; break; case 4: orAddComponent.AngularVelocity += 60f; orAddComponent.HomingRadius += 11f; break; } } } } public class PolarStar : MonoBehaviour { public Gun Gun; public GunTierController GunTierController; public PlayerController PlayerController; public bool Active = false; public void StartUp() { foreach (PassiveItem passiveItem in PlayerController.passiveItems) { if (passiveItem is MikuHarmony mikuHarmony) { mikuHarmony.OnlevelUp = (Action)Delegate.Combine(mikuHarmony.OnlevelUp, new Action(UpdateTiers)); } } if (!Active) { Active = true; } } public void UpdateTiers(MikuHarmony harmony) { Gun.CurrentStrengthTier = harmony.CurrentHarmonyLevel; Gun.m_hasReinitializedAudioSwitch = false; } public void OnDropped() { foreach (PassiveItem passiveItem in PlayerController.passiveItems) { if (passiveItem is MikuHarmony mikuHarmony) { mikuHarmony.OnlevelUp = (Action)Delegate.Remove(mikuHarmony.OnlevelUp, new Action(UpdateTiers)); } } Gun.CurrentStrengthTier = Mathf.Min(Gun.CurrentStrengthTier, 2); } } }