using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; 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.ItemAPI; using Alexandria.Misc; using Alexandria.PrefabAPI; using Alexandria.SoundAPI; using Alexandria.VisualAPI; using BepInEx; using Brave.BulletScript; using Dungeonator; using Gungeon; using HarmonyLib; using InControl; using Mono.Cecil.Cil; using MonoMod.Cil; using Pathfinding; using Ralsei; using Ralsei.Code; using Ralsei.Code.VFX; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.Serialization; [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 { public class WarmScarf : PassiveItem { private CustomScarfDoer scarfInstance; public static ScarfAttachmentDoer scarfRef; public float HealthDropChance = 0.0333f; 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) string text = "Warm Scarf"; GameObject val = new GameObject(text); WarmScarf warmScarf = val.AddComponent(); tk2dSpriteCollectionData itemAndGunCollection = StaticSpriteCollections.ItemAndGunCollection; ItemBuilder.AddSpriteToObjectAssetbundle(text, itemAndGunCollection.GetSpriteIdByName("warmscarf"), itemAndGunCollection, val); string text2 = "Handmade"; string text3 = "Provides additional health occasionally.\n\nA soft, handmade scarf made by you, with love."; ItemBuilder.SetupItem((PickupObject)(object)warmScarf, text2, text3, "rlsi"); ((PickupObject)warmScarf).quality = (ItemQuality)(-50); ((PickupObject)warmScarf).CanBeDropped = false; PickupObject byId = PickupObjectDatabase.GetById(436); scarfRef = ((BlinkPassiveItem)((byId is BlinkPassiveItem) ? byId : null)).ScarfPrefab; ((PickupObject)warmScarf).PreventStartingOwnerFromDropping = true; } public override void Pickup(PlayerController player) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) ((PassiveItem)this).Pickup(player); player.OnRoomClearEvent += Player_OnRoomClearEvent; scarfInstance = Object.Instantiate(((Component)scarfRef).gameObject).AddComponent(); scarfInstance.AttachTarget = (GameActor)(object)player; scarfInstance.ScarfMaterial = new Material(scarfRef.ScarfMaterial); scarfInstance.StartWidth = 0.075f; scarfInstance.EndWidth = 0.075f; scarfInstance.AnimationSpeed = 20f; scarfInstance.ScarfLength = 0.4f; scarfInstance.AngleLerpSpeed = 4f; scarfInstance.BackwardZOffset = -2f; scarfInstance.CatchUpScale = 0.99f; scarfInstance.SinSpeed = 9f; scarfInstance.AmplitudeMod = 0.135f; scarfInstance.WavelengthMod = 1.1f; scarfInstance.ScarfMaterial.SetColor("_OverrideColor", new Color(0.52f, 0.12f, 0.52f)); scarfInstance.Initialize((GameActor)(object)player); } public override DebrisObject Drop(PlayerController player) { if (Object.op_Implicit((Object)(object)scarfInstance)) { Object.Destroy((Object)(object)((Component)scarfInstance).gameObject); scarfInstance = null; } player.OnRoomClearEvent -= Player_OnRoomClearEvent; return ((PassiveItem)this).Drop(player); } public override void OnDestroy() { if (Object.op_Implicit((Object)(object)((PassiveItem)this).Owner)) { ((PassiveItem)this).Owner.OnRoomClearEvent -= Player_OnRoomClearEvent; } if (Object.op_Implicit((Object)(object)scarfInstance)) { Object.Destroy((Object)(object)((Component)scarfInstance).gameObject); scarfInstance = null; } ((PassiveItem)this).OnDestroy(); } private void Player_OnRoomClearEvent(PlayerController obj) { //IL_0029: 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_0035: 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_0049: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (Random.value < HealthDropChance) { HealthDropChance = 0.0166f; IntVector2 bestRewardLocation = obj.CurrentRoom.GetBestRewardLocation(new IntVector2(1, 1), (RewardLocationStyle)0, true); DebrisObject val = LootEngine.SpawnItem(((Component)PickupObjectDatabase.GetById(73)).gameObject, ((IntVector2)(ref bestRewardLocation)).ToVector3(), Vector2.up, 0f, true, false, false); AkSoundEngine.PostEvent("Play_OBJ_med_kit_01", ((Component)obj).gameObject); for (int i = 0; i < 32; i++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)val).sprite.WorldCenter + new Vector2(-0.125f, -0.125f)), Vector2.op_Implicit(((BraveBehaviour)val).sprite.WorldCenter + new Vector2(0.125f, 0.125f)), Vector2.op_Implicit(BraveUtility.RandomVector2(new Vector2(-1f, -1f), new Vector2(1f, 1f)) * Random.Range(1.5f, 2.5f)), 2f, 1f, (float?)0.1f, (float?)1f, (Color?)(Color.green * 3f), (SparksType)0); } } else { HealthDropChance += 0.0166f; } } public override void Update() { ((PassiveItem)this).Update(); } } } namespace Ralsei { public static class AIActorModifiers { public class FriendlySpawnEnemyOnDeath : OnDeathBehavior { public float chanceToSpawn = 1f; public string spawnVfx; [Header("Enemies to Spawn")] public EnemySelection enemySelection = (EnemySelection)10; [EnemyIdentifier] public string[] enemyGuidsToSpawn; [ShowInInspectorIf("ShowRandomPrams", true)] public int minSpawnCount = 1; [ShowInInspectorIf("ShowRandomPrams", true)] public int maxSpawnCount = 1; [FormerlySerializedAs("spawnType")] [Header("Placement")] public SpawnPosition spawnPosition; [ShowInInspectorIf("ShowInsideColliderParams", true)] public int extraPixelWidth; [ShowInInspectorIf("ShowInsideRadiusParams", true)] public float spawnRadius = 1f; [Header("Spawn Parameters")] public float guaranteedSpawnGenerations; public string spawnAnim = "awaken"; public bool spawnsCanDropLoot = true; public bool DoNormalReinforcement; private bool m_hasTriggered; private bool ShowRandomPrams() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 return (int)enemySelection == 20; } private bool ShowInsideColliderParams() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 return (int)spawnPosition == 0; } private bool ShowInsideRadiusParams() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Invalid comparison between Unknown and I4 return (int)spawnPosition == 20; } public override void OnDestroy() { ((OnDeathBehavior)this).OnDestroy(); } public override void OnTrigger(Vector2 damageDirection) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Invalid comparison between Unknown and I4 if (m_hasTriggered) { return; } m_hasTriggered = true; if (guaranteedSpawnGenerations <= 0f && chanceToSpawn < 1f && Random.value > chanceToSpawn) { return; } if (!string.IsNullOrEmpty(spawnVfx)) { ((BraveBehaviour)this).aiAnimator.PlayVfx(spawnVfx, (Vector2?)null, (Vector2?)null, (Vector2?)null); } string[] array = null; if ((int)enemySelection == 10) { array = enemyGuidsToSpawn; } else if ((int)enemySelection == 20) { array = new string[Random.Range(minSpawnCount, maxSpawnCount)]; for (int i = 0; i < array.Length; i++) { array[i] = BraveUtility.RandomElement(enemyGuidsToSpawn); } } SpawnEnemies(array); } public void ManuallyTrigger(Vector2 damageDirection) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ((OnDeathBehavior)this).OnTrigger(damageDirection); } private void SpawnEnemies(string[] selectedEnemyGuids) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Invalid comparison between Unknown and I4 //IL_0018: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Invalid comparison between Unknown and I4 //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_062e: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_064c: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Invalid comparison between Unknown and I4 //IL_041b: 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_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0455: 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_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0492: Expected O, but got Unknown //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0698: 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_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: 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_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Unknown result type (might be due to invalid IL or missing references) //IL_06de: 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_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: 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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0286: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: 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_026e: Unknown result type (might be due to invalid IL or missing references) if ((int)spawnPosition == 0) { IntVector2 val = Vector2Extensions.ToIntVector2(((BraveBehaviour)this).specRigidbody.UnitCenter, (VectorConversions)0); if (((GameActor)((BraveBehaviour)this).aiActor).IsFalling || GameManager.Instance.Dungeon.CellIsPit(Vector2Extensions.ToVector3ZUp(((BraveBehaviour)this).specRigidbody.UnitCenter, 0f))) { return; } RoomHandler roomFromPosition = GameManager.Instance.Dungeon.GetRoomFromPosition(val); List list = new List(); list.Add(((BraveBehaviour)this).specRigidbody); Vector2 unitBottomLeft = ((BraveBehaviour)this).specRigidbody.UnitBottomLeft; for (int i = 0; i < selectedEnemyGuids.Length; i++) { AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid(selectedEnemyGuids[i]); AIActor val2 = AIActor.Spawn(orLoadByGuid, Vector2Extensions.ToIntVector2(((BraveBehaviour)this).specRigidbody.UnitCenter, (VectorConversions)0), roomFromPosition, false, (AwakenAnimationType)0, true); if (((BraveBehaviour)this).aiActor.IsBlackPhantom) { val2.ForceBlackPhantom = true; } if (Object.op_Implicit((Object)(object)val2)) { ((BraveBehaviour)val2).specRigidbody.Initialize(); Vector2 val3 = unitBottomLeft - (((BraveBehaviour)val2).specRigidbody.UnitBottomLeft - Vector3Extensions.XY(((BraveBehaviour)val2).transform.position)); Vector2 val4 = val3 + new Vector2(Mathf.Max(0f, ((BraveBehaviour)this).specRigidbody.UnitDimensions.x - ((BraveBehaviour)val2).specRigidbody.UnitDimensions.x), 0f); ((BraveBehaviour)val2).transform.position = Vector2.op_Implicit(Vector2.Lerp(val3, val4, (selectedEnemyGuids.Length != 1) ? ((float)i / ((float)selectedEnemyGuids.Length - 1f)) : 0f)); ((BraveBehaviour)val2).specRigidbody.Reinitialize(); val3 -= new Vector2(PhysicsEngine.PixelToUnit(extraPixelWidth), 0f); val4 += new Vector2(PhysicsEngine.PixelToUnit(extraPixelWidth), 0f); Vector2 val5 = Vector2.Lerp(val3, val4, (selectedEnemyGuids.Length != 1) ? ((float)i / ((float)selectedEnemyGuids.Length - 1f)) : 0.5f); IntVector2 val6 = PhysicsEngine.UnitToPixel(val5 - Vector3Extensions.XY(((BraveBehaviour)val2).transform.position)); CollisionData val7 = null; if (PhysicsEngine.Instance.RigidbodyCastWithIgnores(((BraveBehaviour)val2).specRigidbody, val6, ref val7, true, true, (int?)null, false, list.ToArray())) { val6 = val7.NewPixelsToMove; } CollisionData.Pool.Free(ref val7); Transform transform = ((BraveBehaviour)val2).transform; transform.position += Vector2Extensions.ToVector3ZisY(PhysicsEngine.PixelToUnit(val6), 0f); ((BraveBehaviour)val2).specRigidbody.Reinitialize(); if (i == 0) { ((BraveBehaviour)val2).aiAnimator.FacingDirection = 180f; } else if (i == selectedEnemyGuids.Length - 1) { ((BraveBehaviour)val2).aiAnimator.FacingDirection = 0f; } HandleSpawn(val2); list.Add(((BraveBehaviour)val2).specRigidbody); } } for (int j = 0; j < list.Count; j++) { for (int k = 0; k < list.Count; k++) { if (j != k) { list[j].RegisterGhostCollisionException(list[k]); } } } } else if ((int)spawnPosition == 1) { for (int l = 0; l < selectedEnemyGuids.Length; l++) { AIActor orLoadByGuid2 = EnemyDatabase.GetOrLoadByGuid(selectedEnemyGuids[l]); AIActor spawnedActor = AIActor.Spawn(orLoadByGuid2, Vector2Extensions.ToIntVector2(((BraveBehaviour)this).specRigidbody.UnitCenter, (VectorConversions)0), ((BraveBehaviour)this).aiActor.ParentRoom, false, (AwakenAnimationType)0, true); if (!Object.op_Implicit((Object)(object)spawnedActor)) { continue; } Vector2 cameraBottomLeft = Vector2.op_Implicit(BraveUtility.ViewportToWorldpoint(new Vector2(0f, 0f), (ViewportType)1)); Vector2 cameraTopRight = Vector2.op_Implicit(BraveUtility.ViewportToWorldpoint(new Vector2(1f, 1f), (ViewportType)1)); IntVector2 bottomLeft = Vector2Extensions.ToIntVector2(cameraBottomLeft, (VectorConversions)1); IntVector2 topRight = Vector2Extensions.ToIntVector2(cameraTopRight, (VectorConversions)0) - IntVector2.One; CellValidator val8 = (CellValidator)delegate(IntVector2 c) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_001d: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) for (int m = 0; m < spawnedActor.Clearance.x; m++) { for (int n = 0; n < spawnedActor.Clearance.y; n++) { if (GameManager.Instance.Dungeon.data.isTopWall(c.x + m, c.y + n)) { return false; } if (GameManager.Instance.Dungeon.data[c.x + m, c.y + n].isExitCell) { return false; } } } return c.x >= bottomLeft.x && c.y >= bottomLeft.y && c.x + spawnedActor.Clearance.x - 1 <= topRight.x && c.y + spawnedActor.Clearance.y - 1 <= topRight.y; }; Func func = delegate(IntVector2 c) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) float num4 = float.MaxValue; num4 = Mathf.Min(num4, (float)c.x - cameraBottomLeft.x); num4 = Mathf.Min(num4, (float)c.y - cameraBottomLeft.y); num4 = Mathf.Min(num4, cameraTopRight.x - (float)c.x + (float)spawnedActor.Clearance.x); return Mathf.Min(num4, cameraTopRight.y - (float)c.y + (float)spawnedActor.Clearance.y); }; Vector2 val9 = ((BraveBehaviour)spawnedActor).specRigidbody.UnitCenter - Vector3Extensions.XY(((BraveBehaviour)spawnedActor).transform.position); IntVector2? randomWeightedAvailableCell = spawnedActor.ParentRoom.GetRandomWeightedAvailableCell((IntVector2?)spawnedActor.Clearance, (CellTypes?)spawnedActor.PathableTiles, false, val8, func, 0.25f); if (!randomWeightedAvailableCell.HasValue) { Debug.LogError((object)"Screen Edge Spawn FAILED!", (Object)(object)spawnedActor); Object.Destroy((Object)(object)spawnedActor); } else { ((BraveBehaviour)spawnedActor).transform.position = Vector2.op_Implicit(Pathfinder.GetClearanceOffset(randomWeightedAvailableCell.Value, spawnedActor.Clearance) - val9); ((BraveBehaviour)spawnedActor).specRigidbody.Reinitialize(); HandleSpawn(spawnedActor); } } } else if ((int)spawnPosition == 20) { Vector2 unitCenter = ((BraveBehaviour)this).specRigidbody.GetUnitCenter((ColliderType)2); List list2 = new List(); list2.Add(((BraveBehaviour)this).specRigidbody); for (int num = 0; num < selectedEnemyGuids.Length; num++) { Vector2 val10 = unitCenter + Random.insideUnitCircle * spawnRadius; if ((int)GameManager.Instance.CurrentLevelOverrideState == 5) { Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "fs_robot") { RoomHandler entrance = GameManager.Instance.Dungeon.data.Entrance; Vector2 val11 = ((IntVector2)(ref entrance.area.basePosition)).ToVector2() + new Vector2(7f, 7f); Vector2 val12 = ((IntVector2)(ref entrance.area.basePosition)).ToVector2() + new Vector2(38f, 36f); val10 = Vector2.Min(val12, Vector2.Max(val11, val10)); } } AIActor orLoadByGuid3 = EnemyDatabase.GetOrLoadByGuid(selectedEnemyGuids[num]); AIActor val13 = AIActor.Spawn(orLoadByGuid3, Vector2Extensions.ToIntVector2(unitCenter, (VectorConversions)0), ((BraveBehaviour)this).aiActor.ParentRoom, true, (AwakenAnimationType)0, true); if (Object.op_Implicit((Object)(object)val13)) { ((BraveBehaviour)val13).specRigidbody.Initialize(); Vector2 val14 = val10 - ((BraveBehaviour)val13).specRigidbody.GetUnitCenter((ColliderType)2); ((BraveBehaviour)val13).specRigidbody.ImpartedPixelsToMove = PhysicsEngine.UnitToPixel(val14); HandleSpawn(val13); list2.Add(((BraveBehaviour)val13).specRigidbody); } } for (int num2 = 0; num2 < list2.Count; num2++) { for (int num3 = 0; num3 < list2.Count; num3++) { if (num2 != num3) { list2[num2].RegisterGhostCollisionException(list2[num3]); } } } } else { Debug.LogError((object)("Unknown spawn type: " + ((object)Unsafe.As(ref spawnPosition)/*cast due to .constrained prefix*/).ToString())); } } private void HandleSpawn(AIActor spawnedActor) { if (!string.IsNullOrEmpty(spawnAnim)) { ((BraveBehaviour)spawnedActor).aiAnimator.PlayUntilFinished(spawnAnim, false, (string)null, -1f, false); } ((MonoBehaviour)spawnedActor).StartCoroutine(WaitTillSpawnedFully(spawnedActor)); SpawnEnemyOnDeath component = ((Component)spawnedActor).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.guaranteedSpawnGenerations = Mathf.Max(0f, guaranteedSpawnGenerations - 1f); } if (!spawnsCanDropLoot) { spawnedActor.CanDropCurrency = false; spawnedActor.CanDropItems = false; } if (DoNormalReinforcement) { spawnedActor.HandleReinforcementFallIntoRoom(0.1f); } } public IEnumerator WaitTillSpawnedFully(AIActor aIActor) { if (!string.IsNullOrEmpty(spawnAnim)) { while (((BraveBehaviour)aIActor).aiAnimator.IsPlaying(spawnAnim)) { yield return null; } } yield return null; bool ralseified = false; PlayerController[] allPlayers = GameManager.Instance.AllPlayers; foreach (PlayerController entry in allPlayers) { if (entry.activeItems != null) { foreach (PlayerItem _ in entry.activeItems) { if (_ is Cake cake) { ralseified = true; aIActor.RalseifyEnemy(cake, isClone: false); break; } } } if (ralseified) { break; } } } } public class RalseiCharmedEnemyController : BraveBehaviour { public static List allCharmedAIActors = new List(); public static List allCharmed = new List(); public Cake CakeRef; private CompanionFollowPlayerBehavior companionController; public Dictionary AttachedEffectsAdditional = new Dictionary(); private float CollisionDamageCooldown = 0f; private bool isCurrentlyStealthed = false; private float currentC; private bool isFloorLoad = false; private bool WhatArmyActive = false; private bool LuteActive = false; private float CollisionDamageMult = 1f; private float Tick; private bool inCombat; public void InitEnemy(Cake cake, CompanionFollowPlayerBehavior _companionController) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown allCharmed.Add(this); allCharmedAIActors.Add(((BraveBehaviour)this).aiActor); companionController = _companionController; CakeRef = cake; if (Object.op_Implicit((Object)(object)cake)) { ((PlayerItem)cake).LastOwner.OnRoomClearEvent += LastOwner_OnRoomClearEvent; PlayerController lastOwner = ((PlayerItem)cake).LastOwner; lastOwner.OnNewFloorLoaded = (Action)Delegate.Combine(lastOwner.OnNewFloorLoaded, new Action(PlayerNewFloor)); PlayerController lastOwner2 = ((PlayerItem)cake).LastOwner; lastOwner2.OnEnteredCombat = (Action)Delegate.Combine(lastOwner2.OnEnteredCombat, new Action(EnteredCombat)); } ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.OnPreDeath += HealthHaver_OnPreDeath; ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.OnDamaged += new OnDamagedEvent(HealthHaver_OnDamaged); if (!(((BraveBehaviour)this).aiActor.CollisionDamage > 0f)) { return; } SpeculativeRigidbody specRigidbody = ((BraveBehaviour)((BraveBehaviour)this).aiActor).specRigidbody; specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)specRigidbody.OnPreRigidbodyCollision, (Delegate?)(OnPreRigidbodyCollisionDelegate)delegate(SpeculativeRigidbody myBody, PixelCollider myPixelCollider, SpeculativeRigidbody otherBody, PixelCollider otherPixelCollider) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (!isCurrentlyStealthed) { if ((Object)(object)((BraveBehaviour)myBody).aiActor != (Object)null && (Object)(object)((Component)((BraveBehaviour)myBody).aiActor).GetComponent() == (Object)null && CollisionDamageCooldown <= 0f) { CollisionDamageCooldown = ReturnContactCooldown(); float num = ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.maximumHealth * 0.15f * ((BraveBehaviour)this).aiActor.CollisionDamage + 0.5f; if (((BraveBehaviour)myBody).aiActor.CollisionSetsPlayerOnFire) { num *= 0.5f; ((GameActor)((BraveBehaviour)myBody).aiActor).ApplyEffect((GameActorEffect)(object)Cake.hotLeadEffect, 1f, (Projectile)null); } num *= CollisionDamageMult; ((BraveBehaviour)((BraveBehaviour)myBody).aiActor).healthHaver.ApplyDamage(num, Vector2.zero, "Collision", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } } }); } private void LastOwner_OnDidUnstealthyAction(PlayerController obj) { ((GameActor)((BraveBehaviour)this).aiActor).SetIsStealthed(false, ";3"); HealthHaver healthHaver = ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver; healthHaver.AllDamageMultiplier /= 0.2f; ((BraveBehaviour)((BraveBehaviour)this).aiActor).behaviorSpeculator.CooldownScale = currentC; ((PlayerItem)CakeRef).LastOwner.OnDidUnstealthyAction -= LastOwner_OnDidUnstealthyAction; } private void StartedStealth(PlayerController obj) { currentC = ((BraveBehaviour)((BraveBehaviour)this).aiActor).behaviorSpeculator.CooldownScale; ((BraveBehaviour)((BraveBehaviour)this).aiActor).behaviorSpeculator.CooldownScale = 0f; ((GameActor)((BraveBehaviour)this).aiActor).SetIsStealthed(true, ";3"); HealthHaver healthHaver = ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver; healthHaver.AllDamageMultiplier *= 0.2f; ((PlayerItem)CakeRef).LastOwner.OnDidUnstealthyAction += LastOwner_OnDidUnstealthyAction; } private void HealthHaver_OnDamaged(float resultValue, float maxValue, CoreDamageTypes damageTypes, DamageCategory damageCategory, Vector2 damageDirection) { ((MonoBehaviour)this).StartCoroutine(DoInvulnerabilityTime(Mathf.Max(Mathf.Min(0.5f, resultValue / 100f), 0.125f))); } public IEnumerator DoInvulnerabilityTime(float Duration) { ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.IsVulnerable = false; yield return (object)new WaitForSeconds(Duration); ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.IsVulnerable = true; } public void EnteredCombat() { inCombat = true; } public void PlayerNewFloor(PlayerController playerController) { ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.SetHealthMaximum(((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.maximumHealth * 1.15f, (float?)null, false); ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.ApplyHealing(Mathf.Min(125f, ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.maximumHealth * 0.3f)); } private void HealthHaver_OnPreDeath(Vector2 obj) { PlayerController lastOwner = ((PlayerItem)CakeRef).LastOwner; lastOwner.OnNewFloorLoaded = (Action)Delegate.Remove(lastOwner.OnNewFloorLoaded, new Action(PlayerNewFloor)); ((PlayerItem)CakeRef).LastOwner.OnRoomClearEvent -= LastOwner_OnRoomClearEvent; ((PlayerItem)CakeRef).LastOwner.OnDidUnstealthyAction -= LastOwner_OnDidUnstealthyAction; PlayerController lastOwner2 = ((PlayerItem)CakeRef).LastOwner; lastOwner2.OnEnteredCombat = (Action)Delegate.Remove(lastOwner2.OnEnteredCombat, new Action(EnteredCombat)); ((PlayerItem)CakeRef).LastOwner.companions.Remove(((BraveBehaviour)this).aiActor); CakeRef.AllCharmedEnemies.Remove(this); } private void LastOwner_OnRoomClearEvent(PlayerController obj) { inCombat = false; ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.SetHealthMaximum(((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.maximumHealth * 0.98f, (float?)null, false); ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.ApplyHealing(Mathf.Min(50f, ((BraveBehaviour)((BraveBehaviour)this).aiActor).healthHaver.maximumHealth * 0.125f)); DoHealParticles(); } public void DoHealParticles() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0077: 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) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 12; i++) { EmitParams newParams = default(EmitParams); ((EmitParams)(ref newParams)).position = Vector2.op_Implicit(((BraveBehaviour)((BraveBehaviour)this).aiActor).sprite.WorldCenter + BraveUtility.RandomVector2(new Vector2(-0.5f, -0.5f), new Vector2(0.5f, 0.5f))); ((EmitParams)(ref newParams)).velocity = Vector2.op_Implicit(BraveUtility.RandomVector2(new Vector2(0f, 1f), new Vector2(0f, 3f))); ((EmitParams)(ref newParams)).startLifetime = 0.5f; ((EmitParams)(ref newParams)).startSize = 0.5f; ParticleBase.EmitParticles("HealParticle", 1, newParams); } } public float ReturnContactCooldown() { float num = 0.66f; if (WhatArmyActive) { num *= 0.75f; } if (LuteActive) { num *= 0.75f; } return num; } public void Update() { //IL_023a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ScarfWeapon.RalseiSlash.targetVFX != (Object)null && (Object)(object)ScarfWeapon.RalseiSlash.targetVFX.TargetInst == (Object)(object)((BraveBehaviour)this).aiActor) { Object.Destroy((Object)(object)ScarfWeapon.RalseiSlash.targetVFX); ScarfWeapon.RalseiSlash.targetVFX = null; } bool isLoadingLevel = GameManager.Instance.IsLoadingLevel; if (isFloorLoad != isLoadingLevel) { isFloorLoad = isLoadingLevel; if (isFloorLoad) { ((Behaviour)((BraveBehaviour)this).behaviorSpeculator).enabled = false; ((Behaviour)((BraveBehaviour)this).aiActor).enabled = false; ((Behaviour)((BraveBehaviour)this).aiAnimator).enabled = false; ((BraveBehaviour)this).behaviorSpeculator.Interrupt(); return; } ((Behaviour)((BraveBehaviour)this).behaviorSpeculator).enabled = true; ((Behaviour)((BraveBehaviour)this).aiActor).enabled = true; ((Behaviour)((BraveBehaviour)this).aiAnimator).enabled = true; } if (CollisionDamageCooldown > 0f) { CollisionDamageCooldown -= BraveTime.DeltaTime; } if (Object.op_Implicit((Object)(object)((PlayerItem)CakeRef).LastOwner)) { bool isStealthed = ((GameActor)((PlayerItem)CakeRef).LastOwner).IsStealthed; if (isStealthed != isCurrentlyStealthed) { isCurrentlyStealthed = isStealthed; if (isCurrentlyStealthed) { StartedStealth(((PlayerItem)CakeRef).LastOwner); } else { LastOwner_OnDidUnstealthyAction(((PlayerItem)CakeRef).LastOwner); } } if (((PlayerItem)CakeRef).LastOwner.CurrentRoom != null) { ((BraveBehaviour)this).aiActor.parentRoom = ((PlayerItem)CakeRef).LastOwner.CurrentRoom; } } if (inCombat) { if ((Object)(object)ScarfWeapon.RalseiSlash.targetVFX != (Object)null) { ((BraveBehaviour)this).aiActor.OverrideTarget = ((BraveBehaviour)ScarfWeapon.RalseiSlash.targetVFX.TargetInst).specRigidbody; } Tick += BraveTime.DeltaTime; if (Tick > 0.5f) { Tick = 0f; companionController.TemporarilyDisabled = ((PlayerItem)CakeRef).LastOwner.CurrentRoom == Vector3Extensions.GetAbsoluteRoom(((BraveBehaviour)((BraveBehaviour)this).aiActor).transform.position); } } else { companionController.TemporarilyDisabled = false; } if (!((Object)(object)((PlayerItem)CakeRef).LastOwner != (Object)null)) { return; } bool flag = CustomSynergies.PlayerHasActiveSynergy(((PlayerItem)CakeRef).LastOwner, "You And What Army"); if (Object.op_Implicit((Object)(object)((GameActor)((PlayerItem)CakeRef).LastOwner).CurrentGun)) { bool luteCompanionBuffActive = ((GameActor)((PlayerItem)CakeRef).LastOwner).CurrentGun.LuteCompanionBuffActive; if (LuteActive != luteCompanionBuffActive) { LuteActive = luteCompanionBuffActive; if (!LuteActive) { AIActor aiActor = ((BraveBehaviour)this).aiActor; aiActor.MovementSpeed /= 2f; CollisionDamageMult /= 2.5f; } else { AIActor aiActor2 = ((BraveBehaviour)this).aiActor; aiActor2.MovementSpeed *= 2f; CollisionDamageMult *= 2.5f; } } } if (WhatArmyActive != flag) { WhatArmyActive = flag; if (!WhatArmyActive) { AIActor aiActor3 = ((BraveBehaviour)this).aiActor; aiActor3.MovementSpeed /= 1.5f; BehaviorSpeculator behaviorSpeculator = ((BraveBehaviour)((BraveBehaviour)this).aiActor).behaviorSpeculator; behaviorSpeculator.CooldownScale /= 1.25f; CollisionDamageMult /= 2.5f; } else { AIActor aiActor4 = ((BraveBehaviour)this).aiActor; aiActor4.MovementSpeed *= 1.5f; BehaviorSpeculator behaviorSpeculator2 = ((BraveBehaviour)((BraveBehaviour)this).aiActor).behaviorSpeculator; behaviorSpeculator2.CooldownScale *= 1.25f; CollisionDamageMult *= 2.5f; } } } public override void OnDestroy() { allCharmedAIActors.Remove(((BraveBehaviour)this).aiActor); allCharmed.Remove(this); if (Object.op_Implicit((Object)(object)CakeRef)) { PlayerController lastOwner = ((PlayerItem)CakeRef).LastOwner; lastOwner.OnNewFloorLoaded = (Action)Delegate.Remove(lastOwner.OnNewFloorLoaded, new Action(PlayerNewFloor)); ((PlayerItem)CakeRef).LastOwner.OnRoomClearEvent -= LastOwner_OnRoomClearEvent; ((PlayerItem)CakeRef).LastOwner.OnDidUnstealthyAction -= LastOwner_OnDidUnstealthyAction; PlayerController lastOwner2 = ((PlayerItem)CakeRef).LastOwner; lastOwner2.OnEnteredCombat = (Action)Delegate.Remove(lastOwner2.OnEnteredCombat, new Action(EnteredCombat)); ((PlayerItem)CakeRef).LastOwner.companions.Remove(((BraveBehaviour)this).aiActor); CakeRef.AllCharmedEnemies.Remove(this); } ((BraveBehaviour)this).OnDestroy(); } } public class CompanionisedEnemyBulletModifiers : BraveBehaviour { private List aIBeamShooters = new List(); public PlayerController enemyOwner; public bool scaleDamage; public bool scaleSize; public bool scaleSpeed; public bool doPostProcess; public float baseBulletDamage; public float jammedDamageMultiplier; public bool TintBullets; public Color TintColor; public bool BulletsAreUnBlankable = false; public CompanionisedEnemyBulletModifiers() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) scaleDamage = false; scaleSize = false; scaleSpeed = false; doPostProcess = false; baseBulletDamage = 10f; TintBullets = false; TintColor = Color.grey; jammedDamageMultiplier = 2f; } public void Start() { aIBeamShooters = ((Component)((BraveBehaviour)this).aiActor).GetComponents().ToList(); AIBulletBank bulletBank = ((BraveBehaviour)((BraveBehaviour)this).aiActor).bulletBank; if (Object.op_Implicit((Object)(object)bulletBank)) { foreach (Entry bullet in bulletBank.Bullets) { SpawnManager.PoolManager.Remove(bullet.BulletObject.transform); Projectile component = bullet.BulletObject.GetComponent(); component.BulletScriptSettings.preventPooling = true; component.BulletScriptSettings.overrideMotion = false; } } if ((Object)(object)((BraveBehaviour)((BraveBehaviour)this).aiActor).aiShooter != (Object)null) { AIShooter aiShooter = ((BraveBehaviour)((BraveBehaviour)this).aiActor).aiShooter; aiShooter.PostProcessProjectile = (Action)Delegate.Combine(aiShooter.PostProcessProjectile, new Action(PostProcessSpawnedEnemyProjectiles)); } if ((Object)(object)((BraveBehaviour)((BraveBehaviour)this).aiActor).bulletBank != (Object)null) { AIBulletBank bulletBank2 = ((BraveBehaviour)((BraveBehaviour)this).aiActor).bulletBank; bulletBank2.OnProjectileCreated = (Action)Delegate.Combine(bulletBank2.OnProjectileCreated, new Action(PostProcessSpawnedEnemyProjectiles)); bulletBank2.OnProjectileCreatedWithSource = (Action)Delegate.Combine(bulletBank2.OnProjectileCreatedWithSource, new Action(PostProcessSpawnedEnemyProjectiles)); bulletBank2.OnBulletSpawned += PostProcessSpawnedEnemyProjectiles; } } public void Update() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) foreach (AIBeamShooter aIBeamShooter in aIBeamShooters) { if ((Object)(object)aIBeamShooter.LaserBeam != (Object)null && aIBeamShooter.LaserBeam.HitsPlayers) { aIBeamShooter.LaserBeam.HitsPlayers = false; aIBeamShooter.LaserBeam.AdjustPlayerBeamTint(TintColor, 10, 0f); } } } private void PostProcessSpawnedEnemyProjectiles(Bullet src, Projectile proj) { Debug.Log((object)"Bullet"); PostProcessSpawnedEnemyProjectiles(proj); } private void PostProcessSpawnedEnemyProjectiles(string src, Projectile proj) { Debug.Log((object)"string"); PostProcessSpawnedEnemyProjectiles(proj); } private void PostProcessSpawnedEnemyProjectiles(Projectile proj) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)":3"); if (TintBullets) { proj.AdjustPlayerProjectileTint(TintColor, 1, 0f); } if ((Object)(object)((BraveBehaviour)this).aiActor != (Object)null) { SpawnManager.PoolManager.Remove(((BraveBehaviour)proj).transform); proj.baseData.damage = baseBulletDamage; proj.ImmuneToBlanks = BulletsAreUnBlankable; proj.ImmuneToSustainedBlanks = BulletsAreUnBlankable; if ((Object)(object)enemyOwner != (Object)null) { if (scaleDamage) { ProjectileData baseData = proj.baseData; baseData.damage *= enemyOwner.stats.GetStatValue((StatType)5); } if (scaleSize) { proj.RuntimeUpdateScale(enemyOwner.stats.GetStatValue((StatType)15)); } if (scaleSpeed) { ProjectileData baseData2 = proj.baseData; baseData2.speed *= enemyOwner.stats.GetStatValue((StatType)6); proj.UpdateSpeed(); } if (doPostProcess) { enemyOwner.DoPostProcessProjectile(proj); } } if (((BraveBehaviour)this).aiActor.IsBlackPhantom) { proj.baseData.damage = baseBulletDamage * jammedDamageMultiplier; } } else { ETGModConsole.Log((object)"Shooter is NULL", false); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__0_2; public static OnPreRigidbodyCollisionDelegate <>9__0_3; public static Func <>9__0_0; public static Func <>9__0_1; internal void b__0_2(AIActor self) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) ((BraveBehaviour)((BraveBehaviour)self).aiActor).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } internal void b__0_3(SpeculativeRigidbody _, PixelCollider __, SpeculativeRigidbody ___, PixelCollider ____) { if ((Object)(object)___ != (Object)null && (Object)(object)((BraveBehaviour)___).projectile != (Object)null && (Object)(object)((BraveBehaviour)___).projectile.Owner != (Object)null && ((BraveBehaviour)___).projectile.Owner is PlayerController) { PhysicsEngine.SkipCollision = true; _.DeregisterSpecificCollisionException(___); } } internal bool b__0_0(PixelCollider self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 return (int)self.CollisionLayer == 2; } internal bool b__0_1(PixelCollider self) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 return (int)self.CollisionLayer == 3; } } public static void RalseifyEnemy(this AIActor CurrentEnemy, Cake cake, bool isClone) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Expected O, but got Unknown //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_068b: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Expected O, but got Unknown //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07b3: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Expected O, but got Unknown //IL_089e: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_09b1: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_09fc: Unknown result type (might be due to invalid IL or missing references) PlayerController lastOwner = ((PlayerItem)cake).LastOwner; ((GameActor)CurrentEnemy).RemoveEffect((GameActorEffect)(object)Cake.charmingRoundsEffect); ((BraveBehaviour)CurrentEnemy).sprite.color = (isClone ? Color.red : Color.green); ((Behaviour)((BraveBehaviour)CurrentEnemy).behaviorSpeculator).enabled = false; CurrentEnemy.IgnoreForRoomClear = true; CurrentEnemy.CanTargetEnemies = true; CurrentEnemy.CanTargetPlayers = false; CurrentEnemy.OverrideTarget = null; CurrentEnemy.PlayerTarget = null; if (Object.op_Implicit((Object)(object)((BraveBehaviour)CurrentEnemy).behaviorSpeculator)) { ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.m_playerTarget = null; } if ((Object)(object)ScarfWeapon.RalseiSlash.targetVFX != (Object)null && (Object)(object)ScarfWeapon.RalseiSlash.targetVFX.TargetInst == (Object)(object)CurrentEnemy) { Object.Destroy((Object)(object)((Component)ScarfWeapon.RalseiSlash.targetVFX).gameObject); ScarfWeapon.RalseiSlash.targetVFX = null; } CompanionController val = ((Component)CurrentEnemy).gameObject.AddComponent(); val.companionID = (CompanionIdentifier)0; val.CanCrossPits = true; val.CanInterceptBullets = true; val.Initialize(lastOwner); CurrentEnemy.CompanionOwner = lastOwner; lastOwner.CurrentRoom.DeregisterEnemy(CurrentEnemy, false); AIAnimator aiAnimator = ((BraveBehaviour)CurrentEnemy).aiAnimator; CompanionFollowPlayerBehavior val2 = new CompanionFollowPlayerBehavior(); val2.CanRollOverPits = false; val2.CatchUpOutAnimation = aiAnimator.MoveAnimation.Prefix; val2.DisableInCombat = false; val2.CatchUpRadius = 8f; val2.CatchUpAccelTime = 5f; val2.CatchUpSpeed = (CurrentEnemy.MovementSpeed *= 1.15f); val2.CatchUpMaxSpeed = Mathf.Max(CurrentEnemy.MovementSpeed * 1.3f, 6f); val2.CatchUpAnimation = aiAnimator.MoveAnimation.Prefix; val2.RollAnimation = aiAnimator.MoveAnimation.Prefix; val2.TemporarilyDisabled = false; for (int num = ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.MovementBehaviors.Count - 1; num > -1; num--) { MovementBehaviorBase val3 = ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.MovementBehaviors[num]; SeekTargetBehavior val4 = (SeekTargetBehavior)(object)((val3 is SeekTargetBehavior) ? val3 : null); if (val4 != null) { val4.ReturnToSpawn = false; val2.PathInterval = val4.PathInterval; val2.IdealRadius = val4.CustomRange; val2.DisableInCombat = true; } FleeTargetBehavior val5 = (FleeTargetBehavior)(object)((val3 is FleeTargetBehavior) ? val3 : null); if (val5 != null) { ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.MovementBehaviors.Remove((MovementBehaviorBase)(object)val5); } MoveErraticallyBehavior val6 = (MoveErraticallyBehavior)(object)((val3 is MoveErraticallyBehavior) ? val3 : null); if (val6 != null) { ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.MovementBehaviors.Remove((MovementBehaviorBase)(object)val6); } } for (int i = 0; i < ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.AttackBehaviors.Count; i++) { AttackBehaviorBase val7 = ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.AttackBehaviors[i]; ((MirrorImageBehavior)(((val7 is MirrorImageBehavior) ? val7 : null)?)).m_allImages.ForEach(delegate(AIActor self) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) ((BraveBehaviour)((BraveBehaviour)self).aiActor).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); }); DisplaceBehavior val8 = (DisplaceBehavior)(object)((val7 is DisplaceBehavior) ? val7 : null); if (val8 != null && Object.op_Implicit((Object)(object)val8.m_image)) { ((BraveBehaviour)val8.m_image).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } BuffEnemiesBehavior val9 = (BuffEnemiesBehavior)(object)((val7 is BuffEnemiesBehavior) ? val7 : null); if (val9 != null) { ((BehaviorBase)val9).EndContinuousUpdate(); } AttackBehaviorGroup val10 = (AttackBehaviorGroup)(object)((val7 is AttackBehaviorGroup) ? val7 : null); if (val10 == null) { continue; } foreach (AttackGroupItem attackBehavior in val10.AttackBehaviors) { AttackBehaviorBase behavior = attackBehavior.Behavior; MirrorImageBehavior val11 = (MirrorImageBehavior)(object)((behavior is MirrorImageBehavior) ? behavior : null); if (val11 != null) { for (int num2 = val11.m_allImages.Count - 1; num2 > -1; num2--) { if ((Object)(object)val11.m_allImages[num2] != (Object)null) { ((BraveBehaviour)((BraveBehaviour)val11.m_allImages[num2]).aiActor).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } } } AttackBehaviorBase behavior2 = attackBehavior.Behavior; BuffEnemiesBehavior val12 = (BuffEnemiesBehavior)(object)((behavior2 is BuffEnemiesBehavior) ? behavior2 : null); if (val12 != null) { ((BehaviorBase)val12).EndContinuousUpdate(); } AttackBehaviorBase behavior3 = attackBehavior.Behavior; DisplaceBehavior val13 = (DisplaceBehavior)(object)((behavior3 is DisplaceBehavior) ? behavior3 : null); if (val13 != null && Object.op_Implicit((Object)(object)val13.m_image)) { ((BraveBehaviour)val13.m_image).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } } } if (((BraveBehaviour)CurrentEnemy).behaviorSpeculator.AttackBehaviorGroup != null) { foreach (AttackGroupItem attackBehavior2 in ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.AttackBehaviorGroup.AttackBehaviors) { AttackBehaviorBase behavior4 = attackBehavior2.Behavior; MirrorImageBehavior val14 = (MirrorImageBehavior)(object)((behavior4 is MirrorImageBehavior) ? behavior4 : null); if (val14 != null) { for (int num3 = val14.m_allImages.Count - 1; num3 > -1; num3--) { if ((Object)(object)val14.m_allImages[num3] != (Object)null) { ((BraveBehaviour)((BraveBehaviour)val14.m_allImages[num3]).aiActor).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } } } AttackBehaviorBase behavior5 = attackBehavior2.Behavior; BuffEnemiesBehavior val15 = (BuffEnemiesBehavior)(object)((behavior5 is BuffEnemiesBehavior) ? behavior5 : null); if (val15 != null) { ((BehaviorBase)val15).EndContinuousUpdate(); } AttackBehaviorBase behavior6 = attackBehavior2.Behavior; DisplaceBehavior val16 = (DisplaceBehavior)(object)((behavior6 is DisplaceBehavior) ? behavior6 : null); if (val16 != null && Object.op_Implicit((Object)(object)val16.m_image)) { ((BraveBehaviour)val16.m_image).healthHaver.ApplyDamage(100000000f, Vector2.zero, "Fuck off", (CoreDamageTypes)0, (DamageCategory)0, false, (PixelCollider)null, false); } } } CurrentEnemy.CompanionSettings = new ActorCompanionSettings { WarpsToRandomPoint = false }; ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.MovementBehaviors.Add((MovementBehaviorBase)(object)val2); ((Behaviour)((BraveBehaviour)CurrentEnemy).behaviorSpeculator).enabled = true; ((BraveBehaviour)CurrentEnemy).behaviorSpeculator.RefreshBehaviors(); SpeculativeRigidbody specRigidbody = ((BraveBehaviour)CurrentEnemy).specRigidbody; OnPreRigidbodyCollisionDelegate onPreRigidbodyCollision = specRigidbody.OnPreRigidbodyCollision; object obj = <>c.<>9__0_3; if (obj == null) { OnPreRigidbodyCollisionDelegate val17 = delegate(SpeculativeRigidbody _, PixelCollider __, SpeculativeRigidbody ___, PixelCollider ____) { if ((Object)(object)___ != (Object)null && (Object)(object)((BraveBehaviour)___).projectile != (Object)null && (Object)(object)((BraveBehaviour)___).projectile.Owner != (Object)null && ((BraveBehaviour)___).projectile.Owner is PlayerController) { PhysicsEngine.SkipCollision = true; _.DeregisterSpecificCollisionException(___); } }; <>c.<>9__0_3 = val17; obj = (object)val17; } specRigidbody.OnPreRigidbodyCollision = (OnPreRigidbodyCollisionDelegate)Delegate.Combine((Delegate?)(object)onPreRigidbodyCollision, (Delegate?)obj); ((Component)CurrentEnemy).gameObject.transform.parent = null; Object.DontDestroyOnLoad((Object)(object)((Component)CurrentEnemy).gameObject); ((BehaviorBase)val2).Start(); for (int num4 = ((GameActor)CurrentEnemy).m_activeEffects.Count - 1; num4 > -1; num4--) { if (((GameActor)CurrentEnemy).m_activeEffects[num4] is RalseiCharmable ralseiCharmable) { ((GameActor)CurrentEnemy).RemoveEffect(((GameActorEffect)ralseiCharmable).effectIdentifier); } } SpawnEnemyOnDeath component = ((Component)CurrentEnemy).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.ConvertSpawnModifier(); } CrazedController component2 = ((Component)CurrentEnemy).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Object.Destroy((Object)(object)component2); } CompanionisedEnemyBulletModifiers companionisedEnemyBulletModifiers = ((Component)val).gameObject.AddComponent(); ((BraveBehaviour)companionisedEnemyBulletModifiers).aiActor = CurrentEnemy; companionisedEnemyBulletModifiers.jammedDamageMultiplier *= 2.5f; companionisedEnemyBulletModifiers.baseBulletDamage = 2.5f; companionisedEnemyBulletModifiers.TintBullets = true; companionisedEnemyBulletModifiers.TintColor = new Color(0.333f, 1f, 0.8f); companionisedEnemyBulletModifiers.BulletsAreUnBlankable = true; companionisedEnemyBulletModifiers.enemyOwner = ((PlayerItem)cake).LastOwner; CustomScarfDoer customScarfDoer = Object.Instantiate(((Component)ScarfWeapon.scarfRef).gameObject).AddComponent(); customScarfDoer.AttachTarget = (GameActor)(object)CurrentEnemy; customScarfDoer.ScarfMaterial = new Material(ScarfWeapon.scarfRef.ScarfMaterial); customScarfDoer.StartWidth = 0.1f; customScarfDoer.EndWidth = 0.125f; customScarfDoer.AnimationSpeed = 12f; customScarfDoer.ScarfLength = 0.5f; customScarfDoer.AngleLerpSpeed = 4f; customScarfDoer.BackwardZOffset = -0.75f; customScarfDoer.CatchUpScale = 0.9f; customScarfDoer.SinSpeed = 9f; customScarfDoer.AmplitudeMod = 0.135f; customScarfDoer.WavelengthMod = 1.1f; customScarfDoer.ScarfMaterial.SetColor("_OverrideColor", (Color)(isClone ? Color.red : new Color(0f, 0.8f, 0.125f))); customScarfDoer.Initialize((GameActor)(object)CurrentEnemy); customScarfDoer.AdditionalOffset = new Vector3(0f, 0.0625f); float num5 = (float)((BraveBehaviour)CurrentEnemy).specRigidbody.HitboxPixelCollider.Height / 32f; EnemyHealthBarRalsei component3 = ((GameActor)(object)CurrentEnemy).SmartPlayEffectOnActor(Cake.EffectPrefab.gameObject, new Vector3(-0.625f, 0f - num5 - 0.25f), attached: true, IgnorePools: true, alreadyMiddleCenter: true, useHitbox: true).GetComponent(); component3.InitEffect(CurrentEnemy); HealthHaver healthHaver = ((BraveBehaviour)CurrentEnemy).healthHaver; healthHaver.maximumHealth *= 3f; ((BraveBehaviour)CurrentEnemy).healthHaver.CursedMaximum = ((BraveBehaviour)CurrentEnemy).healthHaver.maximumHealth; ((BraveBehaviour)CurrentEnemy).healthHaver.FullHeal(); lastOwner.companions.Add(CurrentEnemy); ((MonoBehaviour)CurrentEnemy).StartCoroutine(DoWait(CurrentEnemy)); IEnumerable enumerable = ((BraveBehaviour)CurrentEnemy).specRigidbody.PixelColliders.Where((PixelCollider self) => (int)self.CollisionLayer == 2); if (enumerable != null) { enumerable.FirstOrDefault().CollisionLayer = (CollisionLayer)0; } enumerable = ((BraveBehaviour)CurrentEnemy).specRigidbody.PixelColliders.Where((PixelCollider self) => (int)self.CollisionLayer == 3); if (enumerable != null) { enumerable.FirstOrDefault().CollisionLayer = (CollisionLayer)1; } ((BraveBehaviour)CurrentEnemy).specRigidbody.Reinitialize(); RalseiCharmedEnemyController ralseiCharmedEnemyController = ((Component)CurrentEnemy).gameObject.AddComponent(); ralseiCharmedEnemyController.InitEnemy(cake, val2); cake.AllCharmedEnemies.Add(ralseiCharmedEnemyController); } public static IEnumerator DoWait(AIActor aIActor) { yield return null; BulletLimbController limbs = ((Component)aIActor).gameObject.GetComponent(); if ((Object)(object)limbs != (Object)null) { limbs.DestroyProjectiles(); } } public static FriendlySpawnEnemyOnDeath ConvertSpawnModifier(this SpawnEnemyOnDeath spawnEnemyOnDeath) { //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_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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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) FriendlySpawnEnemyOnDeath friendlySpawnEnemyOnDeath = ((Component)spawnEnemyOnDeath).gameObject.AddComponent(); friendlySpawnEnemyOnDeath.enemyGuidsToSpawn = spawnEnemyOnDeath.enemyGuidsToSpawn; friendlySpawnEnemyOnDeath.enemySelection = spawnEnemyOnDeath.enemySelection; friendlySpawnEnemyOnDeath.extraPixelWidth = spawnEnemyOnDeath.extraPixelWidth; friendlySpawnEnemyOnDeath.spawnAnim = spawnEnemyOnDeath.spawnAnim; friendlySpawnEnemyOnDeath.chanceToSpawn = spawnEnemyOnDeath.chanceToSpawn; ((OnDeathBehavior)friendlySpawnEnemyOnDeath).deathType = ((OnDeathBehavior)spawnEnemyOnDeath).deathType; friendlySpawnEnemyOnDeath.DoNormalReinforcement = spawnEnemyOnDeath.DoNormalReinforcement; friendlySpawnEnemyOnDeath.guaranteedSpawnGenerations = spawnEnemyOnDeath.guaranteedSpawnGenerations; friendlySpawnEnemyOnDeath.minSpawnCount = spawnEnemyOnDeath.minSpawnCount; friendlySpawnEnemyOnDeath.maxSpawnCount = spawnEnemyOnDeath.maxSpawnCount; ((OnDeathBehavior)friendlySpawnEnemyOnDeath).triggerName = ((OnDeathBehavior)spawnEnemyOnDeath).triggerName; friendlySpawnEnemyOnDeath.spawnVfx = spawnEnemyOnDeath.spawnVfx; friendlySpawnEnemyOnDeath.spawnsCanDropLoot = spawnEnemyOnDeath.spawnsCanDropLoot; friendlySpawnEnemyOnDeath.spawnRadius = spawnEnemyOnDeath.spawnRadius; friendlySpawnEnemyOnDeath.spawnPosition = spawnEnemyOnDeath.spawnPosition; ((OnDeathBehavior)friendlySpawnEnemyOnDeath).preDeathDelay = ((OnDeathBehavior)spawnEnemyOnDeath).preDeathDelay; ((OnDeathBehavior)friendlySpawnEnemyOnDeath).m_deathDir = ((OnDeathBehavior)spawnEnemyOnDeath).m_deathDir; ((BraveBehaviour)friendlySpawnEnemyOnDeath).m_cachedCache = ((BraveBehaviour)spawnEnemyOnDeath).m_cachedCache; Object.Destroy((Object)(object)spawnEnemyOnDeath); return friendlySpawnEnemyOnDeath; } } public class AudioResourceLoader { public static void loadFromFolder(string modName, string FilePathFolder) { ResourceLoaderSoundbanks resourceLoaderSoundbanks = new ResourceLoaderSoundbanks(); resourceLoaderSoundbanks.AutoloadFromPath(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 class BehaviorPatches { [HarmonyPatch(typeof(SummonEnemyBehavior), "ContinuousUpdate")] public class ChangeUpSummonEnemiesBehavior { [HarmonyPatch] public static bool Prefix(SummonEnemyBehavior __instance, ref ContinuousBehaviorResult __result) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Invalid comparison between Unknown and I4 //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Invalid comparison between Unknown and I4 //IL_004f: 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_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Invalid comparison between Unknown and I4 //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) if (AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(((BehaviorBase)__instance).m_aiActor)) { if ((int)__instance.m_state == 1) { if (__instance.m_timer <= 0f) { __instance.m_spawnedActor = AIActor.Spawn(__instance.m_enemyPrefab, __instance.m_spawnCell.Value, ((BehaviorBase)__instance).m_aiActor.ParentRoom, false, (AwakenAnimationType)2, true); ((MonoBehaviour)__instance.m_spawnedActor).StartCoroutine(WaitUntilActive(__instance.m_spawnedActor)); ((BraveBehaviour)__instance.m_spawnedActor).healthHaver.SetHealthMaximum(((BraveBehaviour)__instance.m_spawnedActor).healthHaver.GetMaxHealth() * 0.3f, (float?)null, false); ((BraveBehaviour)__instance.m_spawnedActor).aiAnimator.PlayDefaultSpawnState(); __instance.m_allSpawnedActors.Add(__instance.m_spawnedActor); __instance.m_spawnedActor.CanDropCurrency = false; if ((Object)(object)__instance.OverrideCorpse != (Object)null) { __instance.m_spawnedActor.CorpseObject = __instance.OverrideCorpse; } if (__instance.BlackPhantomChance > 0f && (__instance.BlackPhantomChance >= 1f || Random.value < __instance.BlackPhantomChance)) { __instance.m_spawnedActor.ForceBlackPhantom = true; } __instance.m_spawnCount++; __instance.m_lifetimeSpawnCount++; if (__instance.m_spawnCount < __instance.m_numToSpawn) { __instance.PrepareSpawn(); IntVector2? spawnCell = __instance.m_spawnCell; if (spawnCell.HasValue) { if (!string.IsNullOrEmpty(__instance.TargetVfx)) { if (__instance.TargetVfxLoops) { ((BehaviorBase)__instance).m_aiAnimator.StopVfx(__instance.TargetVfx); } AIAnimator aiAnimator = ((BehaviorBase)__instance).m_aiAnimator; string targetVfx = __instance.TargetVfx; Vector2? val = Pathfinder.GetClearanceOffset(__instance.m_spawnCell.Value, __instance.m_enemyClearance); aiAnimator.PlayVfx(targetVfx, (Vector2?)null, (Vector2?)null, val); } __instance.m_timer = __instance.SummonTime; __result = (ContinuousBehaviorResult)0; return false; } } __instance.m_spawnClip = ((BraveBehaviour)__instance.m_spawnedActor).spriteAnimator.CurrentClip; if (__instance.m_spawnClip != null && (int)__instance.m_spawnClip.wrapMode > 0) { __instance.m_state = (State)2; __result = (ContinuousBehaviorResult)0; return false; } if (!string.IsNullOrEmpty(__instance.PostSummonAnim)) { __instance.m_state = (State)3; ((BehaviorBase)__instance).m_aiAnimator.PlayUntilFinished(__instance.PostSummonAnim, false, (string)null, -1f, false); __result = (ContinuousBehaviorResult)0; return false; } __result = (ContinuousBehaviorResult)1; return false; } } else if ((int)__instance.m_state == 2) { if (!Object.op_Implicit((Object)(object)__instance.m_spawnedActor) || !Object.op_Implicit((Object)(object)((BraveBehaviour)__instance.m_spawnedActor).healthHaver) || ((BraveBehaviour)__instance.m_spawnedActor).healthHaver.IsDead || !((BraveBehaviour)__instance.m_spawnedActor).spriteAnimator.IsPlaying(__instance.m_spawnClip)) { if (!string.IsNullOrEmpty(__instance.PostSummonAnim)) { __instance.m_state = (State)3; ((BehaviorBase)__instance).m_aiAnimator.PlayUntilFinished(__instance.PostSummonAnim, false, (string)null, -1f, false); __result = (ContinuousBehaviorResult)0; return false; } __result = (ContinuousBehaviorResult)1; return false; } } else if ((int)__instance.m_state == 3 && !((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).spriteAnimator.IsPlaying(__instance.PostSummonAnim)) { __result = (ContinuousBehaviorResult)1; return false; } __result = (ContinuousBehaviorResult)0; return false; } return true; } } [HarmonyPatch(typeof(MirrorImageController), "SetHost")] public class ChangeUpMirrorImageController { [HarmonyPostfix] public static void Prefix(MirrorImageController __instance, AIActor host) { if (AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(host)) { Cake cake = Toolbox.isCakedUp(); if ((Object)(object)cake != (Object)null && (Object)(object)((BraveBehaviour)__instance).aiActor != (Object)null) { ((MonoBehaviour)GameManager.Instance).StartCoroutine(KillMirror(((BraveBehaviour)__instance).aiActor, cake)); } } } public static IEnumerator KillMirror(AIActor aIActor, Cake c) { yield return null; aIActor.RalseifyEnemy(c, isClone: true); while ((Object)(object)aIActor != (Object)null) { yield return (object)new WaitForSeconds(1f); if ((Object)(object)aIActor != (Object)null && ((Component)aIActor).gameObject.activeSelf) { ((BraveBehaviour)aIActor).healthHaver.ApplyDamage(((BraveBehaviour)aIActor).healthHaver.GetMaxHealth() * 0.05f, Vector2.zero, "Mirror Host Death", (CoreDamageTypes)0, (DamageCategory)5, false, (PixelCollider)null, false); } } } } [HarmonyPatch(typeof(BuffEnemiesBehavior), "Update")] public class ChangeUpBuffEnemiesBehavior { [HarmonyPrefix] public static bool Prefix(BuffEnemiesBehavior __instance, ref BehaviorResult __result) { //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_001d: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I4, but got Unknown if (AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(((BehaviorBase)__instance).m_aiActor)) { BehaviorResult val = (BehaviorResult)0; if ((int)val > 0) { __result = (BehaviorResult)(int)val; return false; } if (!((AttackBehaviorBase)__instance).IsReady()) { __result = (BehaviorResult)0; return false; } if (__instance.m_searchTimer > 0f) { __result = (BehaviorResult)0; return false; } List list = new List(); list.AddRange(AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors); BuffEnemiesBehavior.s_activeEnemies = list; BuffEnemiesBehavior.s_activeEnemies.Remove(((BehaviorBase)__instance).m_aiActor); for (int num = BuffEnemiesBehavior.s_activeEnemies.Count - 1; num >= 0; num--) { if (!__instance.IsGoodBuffTarget(BuffEnemiesBehavior.s_activeEnemies[num])) { BuffEnemiesBehavior.s_activeEnemies.RemoveAt(num); } } if (BuffEnemiesBehavior.s_activeEnemies.Count == 0) { __result = (BehaviorResult)0; return false; } while ((float)__instance.m_buffedEnemies.Count < __instance.EnemiesToBuff && BuffEnemiesBehavior.s_activeEnemies.Count > 0) { int index = Random.Range(0, BuffEnemiesBehavior.s_activeEnemies.Count); __instance.m_buffedEnemies.Add(BuffEnemiesBehavior.s_activeEnemies[index]); BuffEnemiesBehavior.s_activeEnemies.RemoveAt(index); } for (int i = 0; i < __instance.m_buffedEnemies.Count; i++) { __instance.BuffEnemy(__instance.m_buffedEnemies[i]); } __instance.m_searchTimer = __instance.SearchInterval; if (!string.IsNullOrEmpty(__instance.BuffAnimation)) { ((BehaviorBase)__instance).m_aiAnimator.PlayUntilCancelled(__instance.BuffAnimation, true, (string)null, -1f, false); } if (!string.IsNullOrEmpty(__instance.BuffVfx)) { ((BehaviorBase)__instance).m_aiAnimator.PlayVfx(__instance.BuffVfx, (Vector2?)null, (Vector2?)null, (Vector2?)null); } if (Object.op_Implicit((Object)(object)((BehaviorBase)__instance).m_aiActor) && Object.op_Implicit((Object)(object)((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).knockbackDoer)) { ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).knockbackDoer.SetImmobile(true, "BuffEnemiesBehavior"); } __result = (BehaviorResult)4; return false; } return true; } } [HarmonyPatch(typeof(DestroyBulletsBehavior), "Upkeep")] public class ChangeUpDestroyBulletsBehavior { [HarmonyPrefix] public static bool Prefix(DestroyBulletsBehavior __instance) { //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //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) //IL_01e1: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) if (AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(((BehaviorBase)__instance).m_aiActor)) { ((BehaviorBase)__instance).DecrementTimer(ref ((BasicAttackBehavior)__instance).m_cooldownTimer, true); ((BehaviorBase)__instance).DecrementTimer(ref ((BasicAttackBehavior)__instance).m_resetCooldownOnDamageCooldown, true); if (((BasicAttackBehavior)__instance).HealthThresholds.Length != 0) { float currentHealthPercentage = ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).healthHaver.GetCurrentHealthPercentage(); if (currentHealthPercentage < ((BasicAttackBehavior)__instance).m_lowestRecordedHealthPercentage) { for (int i = 0; i < ((BasicAttackBehavior)__instance).HealthThresholds.Length; i++) { if (((BasicAttackBehavior)__instance).HealthThresholds[i] >= currentHealthPercentage && ((BasicAttackBehavior)__instance).HealthThresholds[i] < ((BasicAttackBehavior)__instance).m_lowestRecordedHealthPercentage) { ((BasicAttackBehavior)__instance).m_healthThresholdCredits = ((BasicAttackBehavior)__instance).m_healthThresholdCredits + 1; } } ((BasicAttackBehavior)__instance).m_lowestRecordedHealthPercentage = currentHealthPercentage; } } if (BasicAttackBehavior.DrawDebugFiringArea) { if (Time.frameCount != BasicAttackBehavior.m_lastFrame) { BasicAttackBehavior.m_arcCount = 0; BasicAttackBehavior.m_lastFrame = Time.frameCount; } if (Object.op_Implicit((Object)(object)((BehaviorBase)__instance).m_aiActor.TargetRigidbody) && ((BasicAttackBehavior)__instance).targetAreaStyle != null) { ((BasicAttackBehavior)__instance).targetAreaStyle.DrawDebugLines(((BasicAttackBehavior)__instance).GetOrigin(((BasicAttackBehavior)__instance).targetAreaStyle.targetAreaOrigin), ((BehaviorBase)__instance).m_aiActor.TargetRigidbody.GetUnitCenter((ColliderType)2), ((BehaviorBase)__instance).m_aiActor); } } ((BehaviorBase)__instance).DecrementTimer(ref __instance.m_timer, false); if (((BasicAttackBehavior)__instance).m_behaviorSpeculator.AttackCooldown <= 0f && ((BasicAttackBehavior)__instance).m_behaviorSpeculator.GlobalCooldown <= 0f && ((BasicAttackBehavior)__instance).m_cooldownTimer < __instance.SkippableCooldown) { bool flag = false; GameObject val = new GameObject("silencer_bombshee"); SilencerInstance val2 = val.AddComponent(); val2.ForceNoDamage = true; Cake cake = Toolbox.isCakedUp(); if (Object.op_Implicit((Object)(object)cake)) { val2.TriggerSilencer(((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).specRigidbody.UnitCenter, 50f, __instance.Radius * 10f, (GameObject)null, 0f, 0f, 0f, 0f, 0f, 0f, 0.25f, ((Object)(object)cake != (Object)null) ? ((PlayerItem)cake).LastOwner : null, false, true); } Vector2 unitCenter = ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).specRigidbody.HitboxPixelCollider.UnitCenter; ReadOnlyCollection allProjectiles = StaticReferenceManager.AllProjectiles; for (int j = 0; j < allProjectiles.Count; j++) { Projectile val3 = allProjectiles[j]; GameActor owner = val3.Owner; AIActor val4 = (AIActor)(object)((owner is AIActor) ? owner : null); if (val4 != null && !AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(val4) && Object.op_Implicit((Object)(object)((BraveBehaviour)val3).specRigidbody) && Vector2.Distance(unitCenter, ((BraveBehaviour)val3).specRigidbody.UnitCenter) <= __instance.SkippableRadius) { flag = true; break; } } if (flag) { ((BasicAttackBehavior)__instance).m_cooldownTimer = 0f; } } return false; } return true; } } [HarmonyPatch(typeof(DisplaceBehavior), "SpawnImage")] public class ChangeUpDisplaceBehavior { [HarmonyPrefix] public static bool Prefix(DisplaceBehavior __instance) { //IL_007d: 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) if (AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(((BehaviorBase)__instance).m_aiActor)) { Cake cake = Toolbox.isCakedUp(); if (Object.op_Implicit((Object)(object)cake)) { if (Object.op_Implicit((Object)(object)((BasicAttackBehavior)__instance).m_behaviorSpeculator) && ((BasicAttackBehavior)__instance).m_behaviorSpeculator.MovementBehaviors.Count == 0) { return false; } AIActor orLoadByGuid = EnemyDatabase.GetOrLoadByGuid(((BehaviorBase)__instance).m_aiActor.EnemyGuid); __instance.m_image = AIActor.Spawn(orLoadByGuid, ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).specRigidbody.UnitBottomLeft, ((BehaviorBase)__instance).m_aiActor.ParentRoom, false, (AwakenAnimationType)2, true); ((BraveBehaviour)__instance.m_image).transform.position = ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).transform.position; ((BraveBehaviour)__instance.m_image).specRigidbody.Reinitialize(); ((BraveBehaviour)((BraveBehaviour)__instance.m_image).aiAnimator).healthHaver.SetHealthMaximum(__instance.ImageHealthMultiplier * ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).healthHaver.GetMaxHealth() * 0.0625f, (float?)null, false); ((MonoBehaviour)__instance.m_image).StartCoroutine(WaitUntilActive(__instance.m_image)); DisplacedImageController val = ((Component)__instance.m_image).gameObject.AddComponent(); val.Init(); val.SetHost(((BehaviorBase)__instance).m_aiActor); if (Object.op_Implicit((Object)(object)((BasicAttackBehavior)__instance).m_behaviorSpeculator) && ((BasicAttackBehavior)__instance).m_behaviorSpeculator.MovementBehaviors != null && ((BasicAttackBehavior)__instance).m_behaviorSpeculator.MovementBehaviors.Count > 0) { MovementBehaviorBase obj = ((BasicAttackBehavior)__instance).m_behaviorSpeculator.MovementBehaviors[0]; FleeTargetBehavior val2 = (FleeTargetBehavior)(object)((obj is FleeTargetBehavior) ? obj : null); if (val2 != null) { val2.ForceRun = true; } } if (!__instance.m_hasInstantSpawned) { ((BraveBehaviour)__instance.m_image).behaviorSpeculator.GlobalCooldown = __instance.InitialImageAttackDelay; } return false; } } return true; } } [HarmonyPatch(typeof(TargetEnemiesBehavior), "Update")] public class ChangeUpTargetEnemiesBehavior { [HarmonyPrefix] public static bool Prefix(TargetEnemiesBehavior __instance, ref BehaviorResult __result) { //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_001d: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected I4, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01df: 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_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) if (AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(((BehaviorBase)__instance).m_aiActor)) { BehaviorResult val = (BehaviorResult)0; if ((int)val > 0) { __result = (BehaviorResult)(int)val; return false; } if (__instance.m_losTimer > 0f) { __result = (BehaviorResult)0; return false; } __instance.m_losTimer = __instance.SearchInterval; if (Object.op_Implicit((Object)(object)((BehaviorBase)__instance).m_aiActor.PlayerTarget)) { if (((BehaviorBase)__instance).m_aiActor.PlayerTarget.IsFalling) { ((BehaviorBase)__instance).m_aiActor.PlayerTarget = null; ((BehaviorBase)__instance).m_aiActor.ClearPath(); __result = (BehaviorResult)1; return false; } if (Object.op_Implicit((Object)(object)((BraveBehaviour)((BehaviorBase)__instance).m_aiActor.PlayerTarget).healthHaver) && ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor.PlayerTarget).healthHaver.IsDead) { ((BehaviorBase)__instance).m_aiActor.PlayerTarget = null; ((BehaviorBase)__instance).m_aiActor.ClearPath(); __result = (BehaviorResult)1; return false; } } else { ((BehaviorBase)__instance).m_aiActor.PlayerTarget = null; } if (!__instance.ObjectPermanence) { ((BehaviorBase)__instance).m_aiActor.PlayerTarget = null; } if ((Object)(object)((BehaviorBase)__instance).m_aiActor.PlayerTarget != (Object)null) { __result = (BehaviorResult)0; return false; } if (!((BehaviorBase)__instance).m_aiActor.CanTargetEnemies) { __result = (BehaviorResult)0; return false; } List allCharmedAIActors = AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors; if (allCharmedAIActors != null && allCharmedAIActors.Count > 0) { AIActor playerTarget = null; float num = float.MaxValue; RaycastResult val3 = default(RaycastResult); for (int i = 0; i < allCharmedAIActors.Count; i++) { AIActor val2 = allCharmedAIActors[i]; if ((Object)(object)val2 == (Object)(object)((BehaviorBase)__instance).m_aiActor) { continue; } float num2 = Vector2.Distance(((GameActor)((BehaviorBase)__instance).m_aiActor).CenterPosition, ((GameActor)val2).CenterPosition); if (!(num2 < num)) { continue; } if (__instance.LineOfSight) { int standardPlayerVisibilityMask = CollisionMask.StandardPlayerVisibilityMask; if (!PhysicsEngine.Instance.Raycast(((GameActor)((BehaviorBase)__instance).m_aiActor).CenterPosition, ((GameActor)val2).CenterPosition - ((GameActor)((BehaviorBase)__instance).m_aiActor).CenterPosition, num2, ref val3, true, true, standardPlayerVisibilityMask, (CollisionLayer?)null, false, (Func)null, ((BraveBehaviour)((BehaviorBase)__instance).m_aiActor).specRigidbody)) { RaycastResult.Pool.Free(ref val3); continue; } if ((Object)(object)val3.SpeculativeRigidbody == (Object)null || (Object)(object)((Component)val3.SpeculativeRigidbody).GetComponent() == (Object)null) { RaycastResult.Pool.Free(ref val3); continue; } RaycastResult.Pool.Free(ref val3); } playerTarget = val2; num = num2; } ((BehaviorBase)__instance).m_aiActor.PlayerTarget = (GameActor)(object)playerTarget; } if ((Object)(object)((BehaviorBase)__instance).m_aiShooter != (Object)null && (Object)(object)((BehaviorBase)__instance).m_aiActor.PlayerTarget != (Object)null) { ((BehaviorBase)__instance).m_aiShooter.AimAtPoint(((BehaviorBase)__instance).m_aiActor.PlayerTarget.CenterPosition); } if (!((BehaviorBase)__instance).m_aiActor.HasBeenEngaged) { ((BehaviorBase)__instance).m_aiActor.HasBeenEngaged = true; __result = (BehaviorResult)2; return false; } __result = (BehaviorResult)1; return false; } return true; } } [HarmonyPatch(typeof(BulletLimbController), "PostBodyMovement")] public class ChangeUpBulletLimbController { [HarmonyPostfix] public static void Postfix(BulletLimbController __instance, SpeculativeRigidbody specRigidbody, Vector2 unitDelta, IntVector2 pixelDelta) { if (!AIActorModifiers.RalseiCharmedEnemyController.allCharmedAIActors.Contains(__instance.m_body)) { return; } int count = __instance.m_projectiles.Count; for (int i = 0; i < count; i++) { Projectile val = __instance.m_projectiles[i]; if (val.collidesWithPlayer) { val.DieInAir(!((Component)val).gameObject.activeSelf, true, true, false); } } } } public static IEnumerator WaitUntilActive(AIActor aIActor) { while ((int)aIActor.State != 2) { yield return null; } yield return null; if (Object.op_Implicit((Object)(object)aIActor)) { Cake c = Toolbox.isCakedUp(); if (Object.op_Implicit((Object)(object)c)) { aIActor.RalseifyEnemy(c, isClone: false); } } } } public class EnemyHealthBarRalsei : MonoBehaviour { private AIActor MyEnemy; public tk2dSprite HealthbarSprite; public tk2dSprite Heart; public void InitEffect(AIActor aIActor) { MyEnemy = aIActor; } public void Update() { //IL_0034: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) float num = ((BraveBehaviour)MyEnemy).healthHaver.currentHealth / ((BraveBehaviour)MyEnemy).healthHaver.GetMaxHealth(); ((tk2dBaseSprite)HealthbarSprite).scale = new Vector3(num, 1f, 1f); ((tk2dBaseSprite)HealthbarSprite).color = GetColor(num); Transform transform = ((BraveBehaviour)Heart).transform; transform.localPosition = new Vector3(transform.localPosition.x, Easing.DoLerpT(Mathf.PingPong(Time.timeSinceLevelLoad, 1f) - 0.5f) * 0.25f); } public Color GetColor(float value) { //IL_0001: 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_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_0023: Unknown result type (might be due to invalid IL or missing references) return Color.Lerp(Color.red, new Color(0.5f, 1f, 0.2f), value); } } public class Cake : PlayerItem, ILabelItem { public static GameObject EffectPrefab; public static GameActorCharmEffect charmingRoundsEffect = ((Component)PickupObjectDatabase.GetById(527)).GetComponent().CharmModifierEffect; public static GameActorFireEffect hotLeadEffect = ((Component)PickupObjectDatabase.GetById(295)).GetComponent().FireModifierEffect; public RalseiTargetVFX targetVFXInst = null; public int StoredHearts = 7; public float StoredArmor = 0f; public List AllCharmedEnemies = new List(); private bool _Check = false; public float HealthDropChance = 0.02f; private bool Inited = false; private float E = 0f; public AIActor CurrentEnemy = null; 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown //IL_029f: 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) string text = "Slice Of Cake"; GameObject val = new GameObject(text); Cake cake = val.AddComponent(); tk2dSpriteCollectionData itemAndGunCollection = StaticSpriteCollections.ItemAndGunCollection; ItemBuilder.AddSpriteToObjectAssetbundle(text, itemAndGunCollection.GetSpriteIdByName("ralseicake"), itemAndGunCollection, val); string text2 = "For Sharing!"; string text3 = "Allows you to turn enemies to your side, once they have been shown enough love, using up a charge. Charges are restored by using the active on heart pickups. Passively provides a chance for additional health drops. Made purely out of milk."; ItemBuilder.SetupItem((PickupObject)(object)cake, text2, text3, "rlsi"); ItemBuilder.SetCooldownType((PlayerItem)(object)cake, (CooldownType)0, 1f); ((PlayerItem)cake).consumable = false; ((PickupObject)cake).quality = (ItemQuality)(-50); ((PickupObject)cake).CanBeDropped = false; ItemBuilder.AddPassiveStatModifier((PickupObject)(object)cake, (StatType)8, 1f, (ModifyMethod)0); ((PickupObject)cake).PreventStartingOwnerFromDropping = true; GameObject val2 = PrefabBuilder.BuildObject("HealthbarRalsei"); EnemyHealthBarRalsei enemyHealthBarRalsei = val2.AddComponent(); Object.DontDestroyOnLoad((Object)(object)val2); val2.layer = LayerMask.NameToLayer("FG_Critical"); tk2dSprite val3 = val2.AddComponent(); ((tk2dBaseSprite)val3).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_bar_002"); enemyHealthBarRalsei.HealthbarSprite = val3; ((tk2dBaseSprite)val3).HeightOffGround = -10f; ((tk2dBaseSprite)val3).SortingOrder = 20; ((tk2dBaseSprite)val3).usesOverrideMaterial = true; Material val4 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val4.mainTexture = ((BraveBehaviour)val3).renderer.material.mainTexture; ((BraveBehaviour)val3).renderer.material = val4; GameObject val5 = PrefabBuilder.BuildObject("HealthbarRalseiBack"); val5.layer = LayerMask.NameToLayer("FG_Critical"); val3 = val5.AddComponent(); ((tk2dBaseSprite)val3).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_bar_002"); ((tk2dBaseSprite)val3).HeightOffGround = -20f; ((tk2dBaseSprite)val3).SortingOrder = 8; ((tk2dBaseSprite)val3).color = new Color(0f, 0.2f, 0.05f); ((tk2dBaseSprite)val3).usesOverrideMaterial = true; val4 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val4.mainTexture = ((BraveBehaviour)val3).renderer.material.mainTexture; ((BraveBehaviour)val3).renderer.material = val4; val5.transform.SetParent(val2.transform); GameObject val6 = PrefabBuilder.BuildObject("HealthbarRalseiBack"); val6.layer = LayerMask.NameToLayer("FG_Critical"); val3 = val6.AddComponent(); ((tk2dBaseSprite)val3).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_heart_004"); ((tk2dBaseSprite)val3).HeightOffGround = -10f; ((tk2dBaseSprite)val3).SortingOrder = 8; ((tk2dBaseSprite)val3).usesOverrideMaterial = true; val4 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val4.mainTexture = ((BraveBehaviour)val3).renderer.material.mainTexture; ((BraveBehaviour)val3).renderer.material = val4; val6.transform.SetParent(val2.transform); Transform transform = val6.transform; transform.localPosition -= new Vector3(0.375f, 0f); enemyHealthBarRalsei.Heart = val3; EffectPrefab = val2; CustomSynergies.Add("A Hearty Meal", new List { "rlsi:slice_of_cake" }, new List { "antibody" }, false); CustomSynergies.Add("You And What Army", new List { "rlsi:slice_of_cake" }, new List { "battle_standard" }, false); CustomSynergies.Add("Pacify", new List { "rlsi:slice_of_cake" }, new List { "charm_horn" }, false); CustomSynergies.Add("Memories Of Home", new List { "rlsi:slice_of_cake" }, new List { "really_special_lute" }, false); CustomSynergies.Add("Group Huddle", new List { "rlsi:slice_of_cake" }, new List { "old_knights_flask" }, false); CustomSynergies.Add("Heart Maker", new List { "rlsi:slice_of_cake" }, new List { "charmed_bow" }, false); CustomSynergies.Add("Absorb", new List { "rlsi:slice_of_cake" }, new List { "blood_brooch" }, false); AdvancedSynergyEntry val7 = CustomSynergies.Add("...And Tea For The Rest", new List { "rlsi:slice_of_cake", "teapot" }, (List)null, true); val7.bonusSynergies = new List { (CustomSynergyType)372 }; SoundManager.AddCustomSwitchData("WPN_Guns", "rlsi:newspeciallute", "Play_WPN_Gun_Shot_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Play_RalseiLute") }); SoundManager.AddCustomSwitchData("WPN_Guns", "rlsi:newspeciallute", "Stop_WPN_Gun_Loop_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Stop_RalseiLute") }); SoundManager.AddCustomSwitchData("WPN_Guns", "rlsi:newspeciallute", "Play_WPN_gun_empty_01", (SwitchedEvent[])(object)new SwitchedEvent[1] { SwitchedEvent.op_Implicit("Stop_RalseiLute") }); PickupObject byId = PickupObjectDatabase.GetById(506); ((Component)((byId is Gun) ? byId : null)).gameObject.AddComponent(); PickupObject byId2 = PickupObjectDatabase.GetById(200); ((Component)((byId2 is Gun) ? byId2 : null)).gameObject.AddComponent(); } public string GetLabel() { return StoredHearts.ToString(); } public override void Pickup(PlayerController player) { player.OnRoomClearEvent += Player_OnRoomClearEvent; ((PlayerItem)this).Pickup(player); } public void ONFL(PlayerController player) { _Check = !_Check; if (_Check) { StoredHearts += 3; Debug.Log((object)$"AAAAAA {StoredHearts}"); } AllCharmedEnemies.RemoveAll((AIActorModifiers.RalseiCharmedEnemyController self) => (Object)(object)self == (Object)null); foreach (AIActorModifiers.RalseiCharmedEnemyController allCharmedEnemy in AllCharmedEnemies) { if (!((Object)(object)allCharmedEnemy == (Object)null)) { ((BraveBehaviour)allCharmedEnemy).aiActor.parentRoom = GameManager.Instance.Dungeon.data.Entrance; } } } private void Player_OnRoomClearEvent(PlayerController obj) { //IL_0029: 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_0035: 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_0049: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (Random.value < HealthDropChance) { HealthDropChance = 0.02f; IntVector2 bestRewardLocation = obj.CurrentRoom.GetBestRewardLocation(new IntVector2(1, 1), (RewardLocationStyle)0, true); DebrisObject val = LootEngine.SpawnItem(((Component)PickupObjectDatabase.GetById(73)).gameObject, ((IntVector2)(ref bestRewardLocation)).ToVector3(), Vector2.up, 0f, true, false, false); AkSoundEngine.PostEvent("Play_OBJ_med_kit_01", ((Component)obj).gameObject); for (int i = 0; i < 32; i++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)val).sprite.WorldCenter + new Vector2(-0.125f, -0.125f)), Vector2.op_Implicit(((BraveBehaviour)val).sprite.WorldCenter + new Vector2(0.125f, 0.125f)), Vector2.op_Implicit(BraveUtility.RandomVector2(new Vector2(-1f, -1f), new Vector2(1f, 1f)) * Random.Range(1.5f, 2.5f)), 2f, 1f, (float?)0.1f, (float?)0.625f, (Color?)(Color.green * 3f), (SparksType)0); } } else { HealthDropChance += 0.01f; } } public override void OnPreDrop(PlayerController user) { user.OnNewFloorLoaded = (Action)Delegate.Remove(user.OnNewFloorLoaded, new Action(ONFL)); user.OnRoomClearEvent -= Player_OnRoomClearEvent; ((PlayerItem)this).OnPreDrop(user); } public override void OnDestroy() { if ((Object)(object)base.LastOwner != (Object)null) { PlayerController lastOwner = base.LastOwner; lastOwner.OnNewFloorLoaded = (Action)Delegate.Remove(lastOwner.OnNewFloorLoaded, new Action(ONFL)); base.LastOwner.OnRoomClearEvent -= Player_OnRoomClearEvent; } foreach (AIActorModifiers.RalseiCharmedEnemyController allCharmedEnemy in AllCharmedEnemies) { Object.Destroy((Object)(object)((Component)((BraveBehaviour)allCharmedEnemy).aiActor).gameObject); } AllCharmedEnemies.Clear(); ((PlayerItem)this).OnDestroy(); } public override void Update() { //IL_00ca: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_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_018f: 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) ((PlayerItem)this).Update(); if (!Object.op_Implicit((Object)(object)base.LastOwner)) { return; } if (!Inited) { Inited = true; base.LastOwner.OnRoomClearEvent += Player_OnRoomClearEvent; PlayerController lastOwner = base.LastOwner; lastOwner.OnNewFloorLoaded = (Action)Delegate.Combine(lastOwner.OnNewFloorLoaded, new Action(ONFL)); } if ((Object)(object)CurrentEnemy != (Object)null) { if (((BraveBehaviour)CurrentEnemy).healthHaver.IsDead) { CurrentEnemy = null; return; } E += 360f * Time.deltaTime; Vector2 val = ((BraveBehaviour)CurrentEnemy).sprite.WorldBottomCenter + Toolbox.GetUnitOnCircle(E, 1.25f); Vector2 val2 = ((BraveBehaviour)CurrentEnemy).sprite.WorldBottomCenter + Toolbox.GetUnitOnCircle(E + 180f, 1.25f); GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(val2), Vector2.op_Implicit(val2), Vector3.up, 1f, 0.05f, (float?)0.1f, (float?)0.5f, (Color?)(Color.green * 3f), (SparksType)2); GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(val), Vector2.op_Implicit(val), Vector3.up, 1f, 0.05f, (float?)0.1f, (float?)0.5f, (Color?)(Color.green * 3f), (SparksType)2); } } public override bool CanBeUsed(PlayerController user) { //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: 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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Expected I4, but got Unknown RoomHandler currentRoom = user.CurrentRoom; if (currentRoom != null && StoredHearts > 0) { List list = new List(); currentRoom.GetActiveEnemies((ActiveEnemyType)0, ref list); if (list != null) { list.RemoveAll((AIActor self) => Vector2.Distance(((BraveBehaviour)self).sprite.WorldCenter, ((BraveBehaviour)user).sprite.WorldCenter) > 5f); if (list.Count() > 0) { foreach (AIActor item2 in list) { foreach (GameActorEffect activeEffect in ((GameActor)item2).m_activeEffects) { if (activeEffect is RalseiCharmable ralseiCharmable && ralseiCharmable.MaxStacks == ralseiCharmable.currentStackAmount) { if (!((BraveBehaviour)item2).healthHaver.IsDead && ralseiCharmable.MaxStacks <= StoredHearts) { CurrentEnemy = item2; } return true; } } } CurrentEnemy = null; } } } IPlayerInteractable lastInteractable = user.GetLastInteractable(); if (lastInteractable != null) { HealthPickup val = (HealthPickup)(object)((lastInteractable is HealthPickup) ? lastInteractable : null); if (val != null) { return true; } ShopItemController val2 = (ShopItemController)(object)((lastInteractable is ShopItemController) ? lastInteractable : null); if (val2 != null) { PickupObject item = val2.item; HealthPickup val3 = (HealthPickup)(object)((item is HealthPickup) ? item : null); if (val3 != null) { if (val2.ShouldSteal(user)) { return true; } ShopCurrencyType currencyType = val2.CurrencyType; ShopCurrencyType val4 = currencyType; return (int)val4 switch { 0 => user.carriedConsumables.Currency >= val2.ModifiedPrice, 3 => user.carriedConsumables.Currency >= val2.ModifiedPrice, 2 => user.carriedConsumables.KeyBullets >= val2.ModifiedPrice, 1 => Mathf.RoundToInt(GameStatsManager.Instance.GetPlayerStatValue((TrackedStats)25)) >= val2.ModifiedPrice, _ => true, }; } } } return false; } public override void DoEffect(PlayerController user) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown if ((Object)(object)CurrentEnemy != (Object)null) { foreach (GameActorEffect activeEffect in ((GameActor)CurrentEnemy).m_activeEffects) { if (activeEffect is RalseiCharmable ralseiCharmable) { StoredHearts -= ralseiCharmable.MaxStacks; } } AkSoundEngine.PostEvent("Play_NPC_faerie_heal_01", ((Component)user).gameObject); for (int i = 0; i < 16; i++) { EmitParams newParams = default(EmitParams); ((EmitParams)(ref newParams)).position = new Vector3(Random.Range(((BraveBehaviour)CurrentEnemy).sprite.WorldBottomLeft.x, ((BraveBehaviour)CurrentEnemy).sprite.WorldBottomRight.x), Random.Range(((BraveBehaviour)CurrentEnemy).sprite.WorldBottomRight.y, ((BraveBehaviour)CurrentEnemy).sprite.WorldTopRight.y)); ((EmitParams)(ref newParams)).velocity = Vector2.op_Implicit(BraveUtility.RandomVector2(new Vector2(0f, 0.75f), new Vector2(0f, 2.5f))); ((EmitParams)(ref newParams)).startLifetime = 1.5f; ((EmitParams)(ref newParams)).startSize = 0.375f; ParticleBase.EmitParticles("HeartParticle", 1, newParams); } GameObject val = Object.Instantiate((GameObject)ResourceCache.Acquire("Global VFX/BlankVFX_Ghost"), Vector2.op_Implicit(((BraveBehaviour)CurrentEnemy).sprite.WorldCenter), Quaternion.identity); Object.Destroy((Object)(object)val, 2f); CurrentEnemy.RalseifyEnemy(this, isClone: false); CurrentEnemy = null; return; } IPlayerInteractable lastInteractable = user.GetLastInteractable(); if (lastInteractable == null) { return; } bool SynergyActivated = false; HealthPickup val2 = (HealthPickup)(object)((lastInteractable is HealthPickup) ? lastInteractable : null); if (val2 != null) { AkSoundEngine.PostEvent("Play_OBJ_bottle_cork_01", ((Component)user).gameObject); StoredHearts += DetermineHealing(val2, ref SynergyActivated); DoPickupVisual((PickupObject)(object)val2, SynergyActivated); Object.Destroy((Object)(object)((Component)val2).gameObject); } ShopItemController val3 = (ShopItemController)(object)((lastInteractable is ShopItemController) ? lastInteractable : null); if (val3 != null) { PickupObject item = val3.item; HealthPickup val4 = (HealthPickup)(object)((item is HealthPickup) ? item : null); if (val4 != null) { AkSoundEngine.PostEvent("Play_OBJ_bottle_cork_01", ((Component)user).gameObject); StoredHearts += DetermineHealing(val4, ref SynergyActivated); DoPickupVisual((PickupObject)(object)val4, SynergyActivated); FakeInteract(val3, user); } } } public void DoPickupVisual(PickupObject pickup, bool synergyActivated = false) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0061: 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_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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0149: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("sucked sprite"); val.transform.position = ((BraveBehaviour)pickup).transform.position; tk2dSprite val2 = tk2dSprite.AddComponent(val, ((BraveBehaviour)pickup).sprite.collection, ((BraveBehaviour)pickup).sprite.spriteId); ((MonoBehaviour)GameManager.Instance.Dungeon).StartCoroutine(HandleSuck(val2)); for (int i = 0; i < 24; i++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldCenter), Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(15 * i, 2f)), 1f, 0.05f, (float?)0.125f, (float?)0.5f, (Color?)(Color.red * 3f), (SparksType)2); } if (synergyActivated) { for (int j = 0; j < 24; j++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldCenter), Vector2.op_Implicit(((BraveBehaviour)val2).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle((float)(15 * j) + 7.5f, 3f)), 1f, 0.05f, (float?)0.1f, (float?)1.25f, (Color?)(Color.red * 3f), (SparksType)2); } } } public int DetermineHealing(HealthPickup healthPickup, ref bool SynergyActivated) { int num = 0; float num2 = 6f; float num3 = 12f; if (CustomSynergies.PlayerHasActiveSynergy(base.LastOwner, "A Hearty Meal") && Random.value >= 0.5f) { SynergyActivated = true; num2 *= 2f; } num += (int)(healthPickup.healAmount * num2); num += (int)((float)healthPickup.armorAmount * num3); return Mathf.RoundToInt((float)num); } private IEnumerator HandleSuck(tk2dSprite targetSprite) { float elapsed = 0f; float duration = 0.5f; PlayerController owner = base.LastOwner; if (Object.op_Implicit((Object)(object)targetSprite)) { Vector3 startPosition = ((BraveBehaviour)targetSprite).transform.position; while (elapsed < duration && Object.op_Implicit((Object)(object)owner)) { elapsed += BraveTime.DeltaTime; if (Object.op_Implicit((Object)(object)targetSprite)) { ((BraveBehaviour)targetSprite).transform.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.1f, 0.1f, 0.1f), elapsed / duration); ((BraveBehaviour)targetSprite).transform.position = Vector3.Lerp(startPosition, Vector2Extensions.ToVector3ZisY(((GameActor)owner).CenterPosition, 0f), elapsed / duration); } yield return null; } } Object.Destroy((Object)(object)((Component)targetSprite).gameObject); } public void FakeInteract(ShopItemController shopItemController, PlayerController player) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Invalid comparison between Unknown and I4 //IL_007e: 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_008c: Invalid comparison between Unknown and I4 //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Invalid comparison between Unknown and I4 //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Invalid comparison between Unknown and I4 //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Expected O, but got Unknown //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Invalid comparison between Unknown and I4 //IL_0424: Unknown result type (might be due to invalid IL or missing references) shopItemController.LastInteractingPlayer = player; if ((int)shopItemController.CurrencyType == 0 || (int)shopItemController.CurrencyType == 3 || (int)shopItemController.CurrencyType == 2) { bool flag = false; bool flag2 = true; if (shopItemController.ShouldSteal(player)) { flag = shopItemController.m_baseParentShop.AttemptToSteal(); flag2 = false; if (!flag) { player.DidUnstealthyAction(); shopItemController.m_baseParentShop.NotifyStealFailed(); return; } } if (flag2) { bool flag3 = false; if ((int)shopItemController.CurrencyType == 0 || (int)shopItemController.CurrencyType == 3) { flag3 = player.carriedConsumables.Currency >= shopItemController.ModifiedPrice; } else if ((int)shopItemController.CurrencyType == 2) { flag3 = player.carriedConsumables.KeyBullets >= shopItemController.ModifiedPrice; } if (shopItemController.IsResourcefulRatKey) { if (!flag3) { int num = Mathf.RoundToInt(GameStatsManager.Instance.GetPlayerStatValue((TrackedStats)84)); if (num >= 1000) { AkSoundEngine.PostEvent("Play_OBJ_purchase_unable_01", ((Component)this).gameObject); if ((Object)(object)shopItemController.m_parentShop != (Object)null) { shopItemController.m_parentShop.NotifyFailedPurchase(shopItemController); } if ((Object)(object)shopItemController.m_baseParentShop != (Object)null) { shopItemController.m_baseParentShop.NotifyFailedPurchase(shopItemController); } } else if (player.carriedConsumables.Currency > 0) { GameStatsManager.Instance.RegisterStatChange((TrackedStats)84, (float)player.carriedConsumables.Currency); player.carriedConsumables.Currency = 0; shopItemController.OnExitRange(player); shopItemController.OnEnteredRange(player); } else { AkSoundEngine.PostEvent("Play_OBJ_purchase_unable_01", ((Component)this).gameObject); if ((Object)(object)shopItemController.m_parentShop != (Object)null) { shopItemController.m_parentShop.NotifyFailedPurchase(shopItemController); } if ((Object)(object)shopItemController.m_baseParentShop != (Object)null) { shopItemController.m_baseParentShop.NotifyFailedPurchase(shopItemController); } } return; } PlayerConsumables carriedConsumables = player.carriedConsumables; carriedConsumables.Currency -= shopItemController.ModifiedPrice; GameStatsManager.Instance.RegisterStatChange((TrackedStats)84, (float)shopItemController.ModifiedPrice); flag2 = false; } else if (!flag3) { AkSoundEngine.PostEvent("Play_OBJ_purchase_unable_01", ((Component)this).gameObject); if ((Object)(object)shopItemController.m_parentShop != (Object)null) { shopItemController.m_parentShop.NotifyFailedPurchase(shopItemController); } if ((Object)(object)shopItemController.m_baseParentShop != (Object)null) { shopItemController.m_baseParentShop.NotifyFailedPurchase(shopItemController); } return; } } if (shopItemController.pickedUp) { return; } shopItemController.pickedUp = !shopItemController.item.PersistsOnPurchase; if (flag2) { if ((int)shopItemController.CurrencyType == 0 || (int)shopItemController.CurrencyType == 3) { PlayerConsumables carriedConsumables2 = player.carriedConsumables; carriedConsumables2.Currency -= shopItemController.ModifiedPrice; } else if ((int)shopItemController.CurrencyType == 2) { PlayerConsumables carriedConsumables3 = player.carriedConsumables; carriedConsumables3.KeyBullets -= shopItemController.ModifiedPrice; } } if ((Object)(object)shopItemController.m_parentShop != (Object)null) { shopItemController.m_parentShop.PurchaseItem(shopItemController, !flag, true); } if ((Object)(object)shopItemController.m_baseParentShop != (Object)null) { shopItemController.m_baseParentShop.PurchaseItem(shopItemController, !flag, true); } if (flag) { StatModifier val = new StatModifier(); val.statToBoost = (StatType)14; val.amount = 1f; val.modifyType = (ModifyMethod)0; player.ownerlessStatModifiers.Add(val); player.stats.RecalculateStats(player, false, false); player.HandleItemStolen(shopItemController); shopItemController.m_baseParentShop.NotifyStealSucceeded(); player.IsThief = true; GameStatsManager.Instance.RegisterStatChange((TrackedStats)60, 1f); if (shopItemController.SetsFlagOnSteal) { GameStatsManager.Instance.SetFlag(shopItemController.FlagToSetOnSteal, true); } } else { if ((int)shopItemController.CurrencyType == 3) { int blanks = player.Blanks; player.Blanks = blanks + 1; } player.HandleItemPurchased(shopItemController); } if (!shopItemController.item.PersistsOnPurchase) { GameUIRoot.Instance.DeregisterDefaultLabel(((BraveBehaviour)this).transform); } AkSoundEngine.PostEvent("Play_OBJ_item_purchase_01", ((Component)this).gameObject); } else { if ((int)shopItemController.CurrencyType != 1) { return; } int num2 = Mathf.RoundToInt(GameStatsManager.Instance.GetPlayerStatValue((TrackedStats)25)); if (num2 < shopItemController.ModifiedPrice) { AkSoundEngine.PostEvent("Play_OBJ_purchase_unable_01", ((Component)this).gameObject); if ((Object)(object)shopItemController.m_parentShop != (Object)null) { shopItemController.m_parentShop.NotifyFailedPurchase(shopItemController); } if ((Object)(object)shopItemController.m_baseParentShop != (Object)null) { shopItemController.m_baseParentShop.NotifyFailedPurchase(shopItemController); } } else if (!shopItemController.pickedUp) { shopItemController.pickedUp = !shopItemController.item.PersistsOnPurchase; GameStatsManager.Instance.ClearStatValueGlobal((TrackedStats)25); GameStatsManager.Instance.SetStat((TrackedStats)25, (float)(num2 - shopItemController.ModifiedPrice)); GameStatsManager.Instance.RegisterStatChange((TrackedStats)21, (float)shopItemController.ModifiedPrice); if ((Object)(object)shopItemController.m_parentShop != (Object)null) { shopItemController.m_parentShop.PurchaseItem(shopItemController, true, true); } if ((Object)(object)shopItemController.m_baseParentShop != (Object)null) { shopItemController.m_baseParentShop.PurchaseItem(shopItemController, true, true); } player.HandleItemPurchased(shopItemController); if (!shopItemController.item.PersistsOnPurchase) { GameUIRoot.Instance.DeregisterDefaultLabel(((BraveBehaviour)this).transform); } AkSoundEngine.PostEvent("Play_OBJ_item_purchase_01", ((Component)this).gameObject); } } } public override void MidGameSerialize(List data) { ((PickupObject)this).MidGameSerialize(data); data.Add(StoredHearts); AllCharmedEnemies.RemoveAll((AIActorModifiers.RalseiCharmedEnemyController x) => (Object)(object)x == (Object)null); data.Add(AllCharmedEnemies.Count); foreach (AIActorModifiers.RalseiCharmedEnemyController allCharmedEnemy in AllCharmedEnemies) { if ((Object)(object)((BraveBehaviour)allCharmedEnemy).aiActor != (Object)null) { data.Add(((BraveBehaviour)allCharmedEnemy).aiActor.EnemyGuid); data.Add(((BraveBehaviour)((BraveBehaviour)allCharmedEnemy).aiActor).healthHaver.currentHealth); data.Add(((BraveBehaviour)((BraveBehaviour)allCharmedEnemy).aiActor).healthHaver.maximumHealth); } } } public override void MidGameDeserialize(List data) { ((PickupObject)this).MidGameDeserialize(data); int num = 2; StoredHearts = (int)data[0]; StoredHearts += 3; int num2 = (int)data[1]; for (int i = 0; i < num2; i++) { string gUID = (string)data[num++]; float hP = (float)data[num++]; float max = (float)data[num++]; ((MonoBehaviour)this).StartCoroutine(DoSpawn(gUID, hP, max)); } } public IEnumerator DoSpawn(string GUID, float HP, float Max) { yield return null; while ((Object)(object)base.LastOwner == (Object)null) { yield return null; } while (base.LastOwner.CurrentRoom == null) { yield return null; } yield return (object)new WaitForSeconds(0.25f); AIActor enemy = AIActor.Spawn(EnemyDatabase.GetOrLoadByGuid(GUID), Vector2.op_Implicit(((BraveBehaviour)base.LastOwner).transform.position), base.LastOwner.CurrentRoom, false, (AwakenAnimationType)0, true); yield return null; enemy.reinforceType = (ReinforceType)2; enemy.RalseifyEnemy(this, isClone: false); ((BraveBehaviour)enemy).healthHaver.SetHealthMaximum(Max, (float?)null, false); ((BraveBehaviour)enemy).healthHaver.currentHealth = HP; } } public class CustomScarfDoer : MonoBehaviour { public Material ScarfMaterial; public float StartWidth; public float EndWidth; public float AnimationSpeed; public float ScarfLength; public float AngleLerpSpeed; public float ForwardZOffset; public float BackwardZOffset; public float CatchUpScale; public float SinSpeed; public float AmplitudeMod; public float WavelengthMod; public Vector2 MinOffset; public Vector2 MaxOffset; public GameActor AttachTarget; private Vector2 m_currentOffset; private Vector3[] m_vertices; private Mesh m_mesh; private MeshFilter m_stringFilter; public MeshRenderer m_mr; private bool m_isLerpingBack; private float m_additionalOffsetTime; private float m_lastVelAngle; private float m_targetLength; private float m_currentLength; public Vector3 AdditionalOffset = Vector2.op_Implicit(Vector2.zero); public CustomScarfDoer() { //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_000b: Unknown result type (might be due to invalid IL or missing references) StartWidth = 0.0625f; EndWidth = 0.125f; AnimationSpeed = 1f; ScarfLength = 1.5f; AngleLerpSpeed = 15f; BackwardZOffset = -0.2f; CatchUpScale = 2f; SinSpeed = 1f; AmplitudeMod = 0.25f; WavelengthMod = 1f; m_currentLength = 0.05f; PickupObject byId = PickupObjectDatabase.GetById(436); BlinkPassiveItem val = (BlinkPassiveItem)(object)((byId is BlinkPassiveItem) ? byId : null); ScarfMaterial = val.ScarfPrefab.ScarfMaterial; } public void Initialize(GameActor target) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_015b: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) m_targetLength = ScarfLength; AttachTarget = target; m_currentOffset = new Vector2(1f, 2f); m_mesh = new Mesh(); m_vertices = (Vector3[])(object)new Vector3[20]; m_mesh.vertices = m_vertices; int[] array = new int[54]; Vector2[] uv = (Vector2[])(object)new Vector2[20]; int num = 0; for (int i = 0; i < 9; i++) { array[i * 6] = num; array[i * 6 + 1] = num + 2; array[i * 6 + 2] = num + 1; array[i * 6 + 3] = num + 2; array[i * 6 + 4] = num + 3; array[i * 6 + 5] = num + 1; num += 2; } m_mesh.triangles = array; m_mesh.uv = uv; GameObject val = new GameObject("balloon string"); m_stringFilter = val.AddComponent(); m_mr = val.AddComponent(); ((Renderer)m_mr).material = ScarfMaterial; if (AttachTarget is PlayerController) { Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); Object.DontDestroyOnLoad((Object)(object)val); } m_stringFilter.mesh = m_mesh; ((Component)this).transform.position = ((BraveBehaviour)AttachTarget).transform.position + Vector2Extensions.ToVector3ZisY(m_currentOffset, -3f) + AdditionalOffset; } private void LateUpdate() { //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: 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_031d: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: 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_03f7: 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_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_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_044c: 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_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: 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_046c: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) if (GameManager.Instance.IsLoadingLevel || Dungeon.IsGenerating || !((Object)(object)AttachTarget != (Object)null)) { return; } if (AttachTarget is AIActor && (!Object.op_Implicit((Object)(object)AttachTarget) || ((BraveBehaviour)AttachTarget).healthHaver.IsDead)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } m_targetLength = ScarfLength; bool flag = false; if (AttachTarget is PlayerController) { GameActor attachTarget = AttachTarget; PlayerController val = (PlayerController)(object)((attachTarget is PlayerController) ? attachTarget : null); ((Renderer)m_mr).enabled = val.IsVisible && ((BraveBehaviour)((BraveBehaviour)val).sprite).renderer.enabled; ((Component)m_mr).gameObject.layer = ((Component)val).gameObject.layer; if (((GameActor)val).FacingDirection <= 155f && ((GameActor)val).FacingDirection >= 25f) { flag = true; } if (((GameActor)val).IsFalling) { m_targetLength = 0.05f; } } else if (AttachTarget is AIActor) { GameActor attachTarget2 = AttachTarget; AIActor val2 = (AIActor)(object)((attachTarget2 is AIActor) ? attachTarget2 : null); ((Renderer)m_mr).enabled = ((BraveBehaviour)((BraveBehaviour)val2).sprite).renderer.enabled; ((Component)m_mr).gameObject.layer = ((Component)val2).gameObject.layer; if (((GameActor)val2).FacingDirection <= 155f && ((GameActor)val2).FacingDirection >= 25f) { flag = true; } if (((GameActor)val2).IsFalling) { m_targetLength = 0.05f; } } m_currentLength = Mathf.MoveTowards(m_currentLength, m_targetLength, BraveTime.DeltaTime * 2.5f); if (m_currentLength < 0.1f) { ((Renderer)m_mr).enabled = false; } Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 0f); if (AttachTarget is PlayerController) { GameActor attachTarget3 = AttachTarget; val3 = ((PlayerController)((attachTarget3 is PlayerController) ? attachTarget3 : null)).LastCommandedDirection; } else if (AttachTarget is AIActor && Object.op_Implicit((Object)(object)((BraveBehaviour)AttachTarget).specRigidbody)) { val3 = ((BraveBehaviour)AttachTarget).specRigidbody.Velocity; } if (((Vector2)(ref val3)).magnitude < 0.125f) { m_isLerpingBack = true; } else { m_isLerpingBack = false; } float lastVelAngle = m_lastVelAngle; if (m_isLerpingBack) { float num = Mathf.DeltaAngle(m_lastVelAngle, -45f); float num2 = Mathf.DeltaAngle(m_lastVelAngle, 135f); float num3 = ((!(num <= num2)) ? 180 : 0); lastVelAngle = num3; } else { lastVelAngle = BraveMathCollege.Atan2Degrees(val3); } m_lastVelAngle = Mathf.LerpAngle(m_lastVelAngle, lastVelAngle, BraveTime.DeltaTime * AngleLerpSpeed * Mathf.Lerp(1f, 2f, Mathf.DeltaAngle(m_lastVelAngle, lastVelAngle) / 180f)); float num4 = m_currentLength * Mathf.Lerp(2f, 1f, Vector2.Distance(Vector3Extensions.XY(((Component)this).transform.position), ((BraveBehaviour)AttachTarget).sprite.WorldCenter) / 3f); m_currentOffset = Vector2.op_Implicit(Vector2Extensions.ToVector3ZisY(Vector3Extensions.XY(Quaternion.Euler(0f, 0f, m_lastVelAngle) * Vector2.op_Implicit(Vector2.left) * num4), 0f)); Vector2 val4 = Vector2.Lerp(MinOffset, MaxOffset, Mathf.SmoothStep(0f, 1f, Mathf.PingPong(Time.realtimeSinceStartup * AnimationSpeed, 3f) / 3f)); m_currentOffset += val4; Vector3 val5 = Vector2.op_Implicit(((BraveBehaviour)AttachTarget).sprite.WorldCenter + new Vector2(0f, -0.3125f)); Vector3 val6 = val5 + Vector2Extensions.ToVector3ZisY(m_currentOffset, -3f) + AdditionalOffset; float num5 = Vector3.Distance(((Component)this).transform.position, val6); if (num5 > 10f) { ((Component)this).transform.position = val6; } else { ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, val6, BraveMathCollege.UnboundedLerp(1f, 10f, num5 / CatchUpScale) * BraveTime.DeltaTime); } Vector2 val7 = Vector3Extensions.XY(val6) - Vector3Extensions.XY(((Component)this).transform.position); m_additionalOffsetTime += Random.Range(0f, BraveTime.DeltaTime); BuildMeshAlongCurve(Vector2.op_Implicit(val5), Vector3Extensions.XY(val5) + new Vector2(0f, 0.1f), Vector3Extensions.XY(((Component)this).transform.position) + val7, Vector3Extensions.XY(((Component)this).transform.position), (!flag) ? ForwardZOffset : BackwardZOffset); m_mesh.vertices = m_vertices; m_mesh.RecalculateBounds(); m_mesh.RecalculateNormals(); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)m_stringFilter)) { Object.Destroy((Object)(object)((Component)m_stringFilter).gameObject); } } private void BuildMeshAlongCurve(Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3, float zOffset) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_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_003d: 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_0052: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0079: 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) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_0158: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0205: 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_0211: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) Vector3[] vertices = m_vertices; Vector2? val = null; Vector2 val2 = p3 - p0; Vector2 val3 = Vector3Extensions.XY(Quaternion.Euler(0f, 0f, 90f) * Vector2.op_Implicit(val2)); for (int i = 0; i < 10; i++) { Vector2 val4 = BraveMathCollege.CalculateBezierPoint((float)i / 9f, p0, p1, p2, p3); Vector2? val5 = ((i != 9) ? new Vector2?(BraveMathCollege.CalculateBezierPoint((float)i / 9f, p0, p1, p2, p3)) : ((Vector2?)null)); Vector2 val6 = Vector2.zero; Vector2 val8; if (val.HasValue) { Vector2 val7 = val6; val8 = Vector3Extensions.XY(Quaternion.Euler(0f, 0f, 90f) * Vector2.op_Implicit(val4 - val.Value)); val6 = val7 + ((Vector2)(ref val8)).normalized; } if (val5.HasValue) { Vector2 val9 = val6; val8 = Vector3Extensions.XY(Quaternion.Euler(0f, 0f, 90f) * Vector2.op_Implicit(val5.Value - val4)); val6 = val9 + ((Vector2)(ref val8)).normalized; } val6 = ((Vector2)(ref val6)).normalized; float num = Mathf.Lerp(StartWidth, EndWidth, (float)i / 9f); val4 += ((Vector2)(ref val3)).normalized * Mathf.Sin(Time.realtimeSinceStartup * SinSpeed + (float)i * WavelengthMod) * AmplitudeMod * ((float)i / 9f); val4 += new Vector2(AdditionalOffset.x, AdditionalOffset.y); vertices[i * 2] = Vector2Extensions.ToVector3ZisY(val4 + val6 * num, zOffset); vertices[i * 2 + 1] = Vector2Extensions.ToVector3ZisY(val4 + -val6 * num, zOffset); val = val4; } } } public class CustomProjectileSlashingBehaviour : MonoBehaviour { public float initialDelay; private float timer; public float timeBetweenSlashes; public bool SlashDamageUsesBaseProjectileDamage; public bool DestroyBaseAfterFirstSlash; public bool DestroysOnlyComponentAfterFirstSlash = false; public CustomSlashData slashParameters; private Projectile m_projectile; private PlayerController owner; public float timeBetweenCustomSequenceSlashes; public List customSequence; public float angleVariance; public CustomProjectileSlashingBehaviour() { DestroyBaseAfterFirstSlash = false; timeBetweenSlashes = 1f; initialDelay = 0f; slashParameters = ScriptableObject.CreateInstance(); SlashDamageUsesBaseProjectileDamage = true; timeBetweenCustomSequenceSlashes = 0.15f; customSequence = null; angleVariance = 0f; } private void Start() { m_projectile = ((Component)this).GetComponent(); timer = initialDelay; if (Object.op_Implicit((Object)(object)m_projectile.Owner) && m_projectile.Owner is PlayerController) { ref PlayerController reference = ref owner; GameActor obj = m_projectile.Owner; reference = (PlayerController)(object)((obj is PlayerController) ? obj : null); } } private void Update() { if (Object.op_Implicit((Object)(object)m_projectile)) { if (timer > 0f) { timer -= BraveTime.DeltaTime; } else { ((MonoBehaviour)m_projectile).StartCoroutine(DoAttackSequence()); } } } private IEnumerator DoAttackSequence() { if (customSequence != null && customSequence.Count > 0) { foreach (float angle in customSequence) { DoSlash(angle); yield return (object)new WaitForSeconds(timeBetweenCustomSequenceSlashes); } } else { DoSlash(0f); } timer = timeBetweenSlashes; if (DestroyBaseAfterFirstSlash) { ((MonoBehaviour)this).StartCoroutine(Suicide()); } } private void DoSlash(float angle) { //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) Projectile projectile = m_projectile; List list = new List(); list.AddRange(ProjectileUtility.GetFullListOfStatusEffects(projectile, true)); CustomSlashData customSlashData = slashParameters.ReturnClone(); customSlashData.Owner = (GameActor)(((object)projectile.Owner) ?? ((object)owner)); if (SlashDamageUsesBaseProjectileDamage) { customSlashData.damage = m_projectile.baseData.damage; customSlashData.bossDamageMult = m_projectile.BossDamageMultiplier; customSlashData.jammedDamageMult = m_projectile.BlackPhantomDamageMultiplier; customSlashData.enemyKnockbackForce = m_projectile.baseData.force; } customSlashData.OnHitTarget = (Action)Delegate.Combine(customSlashData.OnHitTarget, new Action(SlashHitTarget)); customSlashData.OnHitBullet = (Action)Delegate.Combine(customSlashData.OnHitBullet, new Action(SlashHitBullet)); customSlashData.OnHitMajorBreakable = (Action)Delegate.Combine(customSlashData.OnHitMajorBreakable, new Action(SlashHitMajorBreakable)); customSlashData.OnHitMinorBreakable = (Action)Delegate.Combine(customSlashData.OnHitMinorBreakable, new Action(SlashHitMinorBreakable)); angle += Random.Range(angleVariance, 0f - angleVariance); CustomSlashDoer.DoSwordSlash(((BraveBehaviour)m_projectile).specRigidbody.UnitCenter, Vector2Extensions.ToAngle(m_projectile.Direction) + angle, (GameActor)(((object)projectile.Owner) ?? ((object)owner)), customSlashData); } private IEnumerator Suicide() { yield return null; if (DestroysOnlyComponentAfterFirstSlash) { Object.Destroy((Object)(object)this); } else { Object.Destroy((Object)(object)((Component)m_projectile).gameObject); } } public virtual void SlashHitTarget(GameActor target, bool fatal) { } public virtual void SlashHitBullet(Projectile target) { } public virtual void SlashHitMinorBreakable(MinorBreakable target) { } public virtual void SlashHitMajorBreakable(MajorBreakable target) { } } public abstract class CustomSlashData : ScriptableObject { public bool doVFX = true; public VFXPool VFX; public bool doHitVFX; public VFXPool hitVFX; public CustomSlashDoer.ProjInteractMode projInteractMode; public float playerKnockbackForce; public float enemyKnockbackForce; public List statusEffects; public float jammedDamageMult; public float bossDamageMult; public bool doOnSlash; public bool doPostProcessSlash; public float slashRange; public float slashDegrees; public float damage; public bool damagesBreakables; public string soundEvent; public Action OnHitTarget; public Action OnHitBullet; public Action OnHitMinorBreakable; public Action OnHitMajorBreakable; public Action CustomReflectProjectile; public bool HitSecretRoomWalls; public GameActor Owner; public abstract CustomSlashData ReturnClone(); public virtual void OnHitEnemy(GameActor gameActor, bool b, float Angle, Vector2 arcOrigin, Vector2 contact) { } public virtual void OnProjectileReflect(Projectile p, bool retargetReflectedBullet, GameActor newOwner, float minReflectedBulletSpeed, bool doPostProcessing = false, float scaleModifier = 1f, float baseDamage = 10f, float spread = 0f, string sfx = null) { //IL_005a: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) p.RemoveBulletScriptControl(); if (sfx != null) { AkSoundEngine.PostEvent(sfx, ((Component)GameManager.Instance).gameObject); } if (retargetReflectedBullet && Object.op_Implicit((Object)(object)p.Owner) && Object.op_Implicit((Object)(object)((BraveBehaviour)p.Owner).specRigidbody)) { Vector2 val = ((BraveBehaviour)p.Owner).specRigidbody.GetUnitCenter((ColliderType)2) - ((BraveBehaviour)p).specRigidbody.UnitCenter; p.Direction = ((Vector2)(ref val)).normalized; } if (spread != 0f) { p.Direction = Vector2Extensions.Rotate(p.Direction, Random.Range(0f - spread, spread)); } if (Object.op_Implicit((Object)(object)p.Owner) && Object.op_Implicit((Object)(object)((BraveBehaviour)p.Owner).specRigidbody)) { ((BraveBehaviour)p).specRigidbody.DeregisterSpecificCollisionException(((BraveBehaviour)p.Owner).specRigidbody); } p.Owner = newOwner; p.SetNewShooter(((BraveBehaviour)newOwner).specRigidbody); p.allowSelfShooting = false; if (newOwner is AIActor) { p.collidesWithPlayer = true; p.collidesWithEnemies = false; } else if (newOwner is PlayerController) { p.collidesWithPlayer = false; p.collidesWithEnemies = true; } if (scaleModifier != 1f) { SpawnManager.PoolManager.Remove(((BraveBehaviour)p).transform); p.RuntimeUpdateScale(scaleModifier); } if (p.Speed < minReflectedBulletSpeed) { p.Speed = minReflectedBulletSpeed; } p.baseData.damage = baseDamage; if (doPostProcessing && doPostProcessing && newOwner is PlayerController) { PlayerController val2 = (PlayerController)(object)((newOwner is PlayerController) ? newOwner : null); if ((Object)(object)val2 != (Object)null) { ProjectileData baseData = p.baseData; baseData.damage *= val2.stats.GetStatValue((StatType)5); ProjectileData baseData2 = p.baseData; baseData2.speed *= val2.stats.GetStatValue((StatType)6); p.UpdateSpeed(); ProjectileData baseData3 = p.baseData; baseData3.force *= val2.stats.GetStatValue((StatType)12); ProjectileData baseData4 = p.baseData; baseData4.range *= val2.stats.GetStatValue((StatType)26); p.BossDamageMultiplier *= val2.stats.GetStatValue((StatType)22); p.RuntimeUpdateScale(val2.stats.GetStatValue((StatType)15)); val2.DoPostProcessProjectile(p); } } if (newOwner is AIActor) { p.baseData.damage = 0.5f; p.baseData.SetAll(((BraveBehaviour)((newOwner is AIActor) ? newOwner : null)).bulletBank.GetBullet("default").ProjectileData); ((BraveBehaviour)p).specRigidbody.CollideWithTileMap = false; p.ResetDistance(); p.collidesWithEnemies = ((AIActor)((newOwner is AIActor) ? newOwner : null)).CanTargetEnemies; p.collidesWithPlayer = true; p.UpdateCollisionMask(); ((BraveBehaviour)p).sprite.color = new Color(1f, 0.1f, 0.1f); p.MakeLookLikeEnemyBullet(true); p.RemovePlayerOnlyModifiers(); if (((AIActor)((newOwner is AIActor) ? newOwner : null)).IsBlackPhantom) { p.baseData.damage = 1f; p.BecomeBlackBullet(); } } p.UpdateCollisionMask(); p.Reflected(); p.SendInDirection(p.Direction, true, true); } protected CustomSlashData() { ref VFXPool vFX = ref VFX; PickupObject byId = PickupObjectDatabase.GetById(417); vFX = ((Gun)((byId is Gun) ? byId : null)).muzzleFlashEffects; doHitVFX = true; ref VFXPool reference = ref hitVFX; PickupObject byId2 = PickupObjectDatabase.GetById(417); reference = ((Gun)((byId2 is Gun) ? byId2 : null)).DefaultModule.projectiles[0].hitEffects.enemy; projInteractMode = CustomSlashDoer.ProjInteractMode.IGNORE; playerKnockbackForce = 5f; enemyKnockbackForce = 10f; statusEffects = new List(); jammedDamageMult = 1f; bossDamageMult = 1f; doOnSlash = true; doPostProcessSlash = true; slashRange = 2.5f; slashDegrees = 90f; damage = 5f; damagesBreakables = true; soundEvent = "Play_WPN_blasphemy_shot_01"; OnHitTarget = null; OnHitBullet = null; OnHitMinorBreakable = null; OnHitMajorBreakable = null; CustomReflectProjectile = null; HitSecretRoomWalls = false; ((ScriptableObject)this)..ctor(); } } public class BasicSlash : CustomSlashData { public override CustomSlashData ReturnClone() { BasicSlash basicSlash = ScriptableObject.CreateInstance(); basicSlash.doVFX = doVFX; basicSlash.VFX = VFX; basicSlash.doHitVFX = doHitVFX; basicSlash.hitVFX = hitVFX; basicSlash.projInteractMode = projInteractMode; basicSlash.playerKnockbackForce = playerKnockbackForce; basicSlash.enemyKnockbackForce = enemyKnockbackForce; basicSlash.statusEffects = statusEffects; basicSlash.jammedDamageMult = jammedDamageMult; basicSlash.bossDamageMult = bossDamageMult; basicSlash.doOnSlash = doOnSlash; basicSlash.doPostProcessSlash = doPostProcessSlash; basicSlash.slashRange = slashRange; basicSlash.slashDegrees = slashDegrees; basicSlash.damage = damage; basicSlash.damagesBreakables = damagesBreakables; basicSlash.soundEvent = soundEvent; basicSlash.OnHitTarget = OnHitTarget; basicSlash.OnHitBullet = OnHitBullet; basicSlash.OnHitMinorBreakable = OnHitMinorBreakable; basicSlash.OnHitMajorBreakable = OnHitMajorBreakable; return basicSlash; } } public class CustomSlashDoer { public enum ProjInteractMode { IGNORE, DESTROY, REFLECT, REFLECTANDPOSTPROCESS } public static void DoSwordSlash(Vector2 position, float angle, GameActor owner, CustomSlashData slashParameters, Transform parentTransform = null) { //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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) if (!(owner is PlayerController) || !((Object)(object)PlayerUtility.GetExtComp((PlayerController)(object)((owner is PlayerController) ? owner : null)) != (Object)null) || PlayerUtility.GetExtComp((PlayerController)(object)((owner is PlayerController) ? owner : null)).PreProcessSlash != null) { } if (slashParameters.doVFX && slashParameters.VFX != null) { GameObject val = Object.Instantiate(slashParameters.VFX.effects[0].effects[0].effect, Vector2.op_Implicit(position), Quaternion.Euler(0f, 0f, angle)); tk2dBaseSprite component = val.GetComponent(); if (Object.op_Implicit((Object)(object)owner)) { component.FlipY = owner.SpriteFlipped; ((BraveBehaviour)component).transform.SetParent(((BraveBehaviour)owner).transform, true); Transform transform = ((BraveBehaviour)component).transform; transform.localPosition += new Vector3(0f, 0.5f); } } if (!string.IsNullOrEmpty(slashParameters.soundEvent) && (Object)(object)owner != (Object)null && (Object)(object)((Component)owner).gameObject != (Object)null) { AkSoundEngine.PostEvent(slashParameters.soundEvent, ((Component)owner).gameObject); } ((MonoBehaviour)GameManager.Instance).StartCoroutine(HandleSlash(position, angle, owner, slashParameters)); } private static IEnumerator HandleSlash(Vector2 position, float angle, GameActor owner, CustomSlashData slashParameters) { //IL_0007: 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) int slashId = Time.frameCount; List alreadyHit = new List(); if (slashParameters.playerKnockbackForce != 0f && (Object)(object)owner != (Object)null) { ((BraveBehaviour)owner).knockbackDoer.ApplyKnockback(BraveMathCollege.DegreesToVector(angle, 1f), slashParameters.playerKnockbackForce, 0.25f, false); } float ela = 0f; while (ela < 0.2f) { ela += BraveTime.DeltaTime; HandleHeroSwordSlash(alreadyHit, position, angle, slashId, owner, slashParameters); yield return null; } if (!(owner is PlayerController) || !((Object)(object)PlayerUtility.GetExtComp((PlayerController)(object)((owner is PlayerController) ? owner : null)) != (Object)null) || PlayerUtility.GetExtComp((PlayerController)(object)((owner is PlayerController) ? owner : null)).PostProcessSlash == null) { } } private static bool SlasherIsPlayerOrFriendly(GameActor slasher) { if (slasher is PlayerController) { return true; } if (slasher is AIActor) { if (Object.op_Implicit((Object)(object)((Component)slasher).GetComponent())) { return true; } if (!((BraveBehaviour)slasher).aiActor.CanTargetPlayers && ((BraveBehaviour)slasher).aiActor.CanTargetEnemies) { return true; } } return false; } private static bool ProjectileIsValid(Projectile proj, GameActor slashOwner) { if (Object.op_Implicit((Object)(object)proj)) { if ((Object)(object)slashOwner == (Object)null) { return false; } if (SlasherIsPlayerOrFriendly(slashOwner)) { if ((Object.op_Implicit((Object)(object)proj.Owner) && !(proj.Owner is PlayerController)) || proj.ForcePlayerBlankable) { return true; } } else if (slashOwner is AIActor) { if (Object.op_Implicit((Object)(object)proj.Owner) && proj.Owner is PlayerController) { return true; } } else if (Object.op_Implicit((Object)(object)proj.Owner)) { return true; } } return false; } private static bool ObjectWasHitBySlash(Vector2 ObjectPosition, Vector2 SlashPosition, float slashAngle, float SlashRange, float SlashDimensions) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_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) if (Vector2.Distance(ObjectPosition, SlashPosition) < SlashRange) { float num = BraveMathCollege.Atan2Degrees(ObjectPosition - SlashPosition); float num2 = Math.Min(SlashDimensions, 0f - SlashDimensions); float num3 = Math.Max(SlashDimensions, 0f - SlashDimensions); bool result = false; float num4 = slashAngle + num3; float num5 = slashAngle + num2; if (MathsAndLogicHelper.IsBetweenRange(num, num5, num4)) { result = true; } if (num4 > 180f) { float num6 = num4 - 180f; if (MathsAndLogicHelper.IsBetweenRange(num, -180f, -180f + num6)) { result = true; } } if (num5 < -180f) { float num7 = num5 + 180f; if (MathsAndLogicHelper.IsBetweenRange(num, 180f + num7, 180f)) { result = true; } } return result; } return false; } private static void HandleHeroSwordSlash(List alreadyHit, Vector2 arcOrigin, float slashAngle, int slashId, GameActor owner, CustomSlashData slashParameters) { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_01e6: 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_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: 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) float slashDegrees = slashParameters.slashDegrees; float slashRange = slashParameters.slashRange; ReadOnlyCollection allProjectiles = StaticReferenceManager.AllProjectiles; for (int num = allProjectiles.Count - 1; num >= 0; num--) { Projectile val = allProjectiles[num]; if (ProjectileIsValid(val, owner)) { Vector2 worldCenter = ((BraveBehaviour)val).sprite.WorldCenter; if (ObjectWasHitBySlash(worldCenter, arcOrigin, slashAngle, slashRange, slashDegrees)) { if (slashParameters.OnHitBullet != null) { slashParameters.OnHitBullet(val); } if (slashParameters.projInteractMode != ProjInteractMode.IGNORE || val.collidesWithProjectiles) { if (slashParameters.projInteractMode == ProjInteractMode.DESTROY || slashParameters.projInteractMode == ProjInteractMode.IGNORE) { val.DieInAir(false, true, true, true); } else if ((slashParameters.projInteractMode == ProjInteractMode.REFLECT || slashParameters.projInteractMode == ProjInteractMode.REFLECTANDPOSTPROCESS) && (Object)(object)val.Owner != (Object)null && val.LastReflectedSlashId != slashId) { slashParameters.OnProjectileReflect(val, retargetReflectedBullet: true, owner, 5f, slashParameters.projInteractMode == ProjInteractMode.REFLECTANDPOSTPROCESS, 1f, 5f); val.LastReflectedSlashId = slashId; } } } } } DealDamageToEnemiesInArc(owner, arcOrigin, slashAngle, slashRange, slashParameters, alreadyHit); if (!slashParameters.damagesBreakables) { return; } List allMinorBreakables = StaticReferenceManager.AllMinorBreakables; for (int num2 = allMinorBreakables.Count - 1; num2 >= 0; num2--) { MinorBreakable val2 = allMinorBreakables[num2]; if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((BraveBehaviour)val2).specRigidbody) && !val2.IsBroken && Object.op_Implicit((Object)(object)((BraveBehaviour)val2).sprite) && ObjectWasHitBySlash(((BraveBehaviour)val2).sprite.WorldCenter, arcOrigin, slashAngle, slashRange, slashDegrees)) { if (slashParameters.OnHitMinorBreakable != null) { slashParameters.OnHitMinorBreakable(val2); } val2.Break(); } } List allMajorBreakables = StaticReferenceManager.AllMajorBreakables; for (int num3 = allMajorBreakables.Count - 1; num3 >= 0; num3--) { MajorBreakable val3 = allMajorBreakables[num3]; if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)((BraveBehaviour)val3).specRigidbody) && !alreadyHit.Contains(((BraveBehaviour)val3).specRigidbody) && (slashParameters.HitSecretRoomWalls || !val3.IsSecretDoor) && !val3.IsDestroyed && ObjectWasHitBySlash(((BraveBehaviour)val3).specRigidbody.UnitCenter, arcOrigin, slashAngle, slashRange, slashDegrees)) { float num4 = slashParameters.damage; if (Object.op_Implicit((Object)(object)((BraveBehaviour)val3).healthHaver)) { num4 *= 0.2f; } if (slashParameters.OnHitMajorBreakable != null) { slashParameters.OnHitMajorBreakable(val3); } val3.ApplyDamage(num4, ((BraveBehaviour)val3).specRigidbody.UnitCenter - arcOrigin, false, false, false); alreadyHit.Add(((BraveBehaviour)val3).specRigidbody); } } } private static void DealDamageToEnemiesInArc(GameActor owner, Vector2 arcOrigin, float arcAngle, float arcRadius, CustomSlashData slashParameters, List alreadyHit = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) RoomHandler absoluteRoom = Vector3Extensions.GetAbsoluteRoom(arcOrigin); if (absoluteRoom == null) { return; } if (SlasherIsPlayerOrFriendly(owner)) { List activeEnemies = absoluteRoom.GetActiveEnemies((ActiveEnemyType)0); if (activeEnemies == null) { return; } RaycastResult val3 = default(RaycastResult); for (int i = 0; i < activeEnemies.Count; i++) { AIActor val = activeEnemies[i]; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)((BraveBehaviour)val).specRigidbody) || !val.IsNormalEnemy || ((GameActor)val).IsGone || !Object.op_Implicit((Object)(object)((BraveBehaviour)val).healthHaver) || (alreadyHit != null && alreadyHit.Contains(((BraveBehaviour)val).specRigidbody))) { continue; } for (int j = 0; j < ((BraveBehaviour)val).healthHaver.NumBodyRigidbodies; j++) { SpeculativeRigidbody bodyRigidbody = ((BraveBehaviour)val).healthHaver.GetBodyRigidbody(j); PixelCollider hitboxPixelCollider = bodyRigidbody.HitboxPixelCollider; if (hitboxPixelCollider == null) { continue; } Vector2 val2 = BraveMathCollege.ClosestPointOnRectangle(arcOrigin, hitboxPixelCollider.UnitBottomLeft, hitboxPixelCollider.UnitDimensions); if (!ObjectWasHitBySlash(val2, arcOrigin, arcAngle, arcRadius, 90f)) { continue; } bool flag = true; int num = CollisionMask.LayerToMask((CollisionLayer)6, (CollisionLayer)8, (CollisionLayer)12); if (PhysicsEngine.Instance.Raycast(arcOrigin, val2 - arcOrigin, Vector2.Distance(val2, arcOrigin), ref val3, true, true, num, (CollisionLayer?)null, false, (Func)null, (SpeculativeRigidbody)null) && (Object)(object)val3.SpeculativeRigidbody != (Object)(object)bodyRigidbody) { flag = false; } RaycastResult.Pool.Free(ref val3); if (!flag) { continue; } float num2 = DealSwordDamageToEnemy(owner, (GameActor)(object)val, arcOrigin, val2, arcAngle, slashParameters); if (alreadyHit != null) { if (alreadyHit.Count == 0) { StickyFrictionManager.Instance.RegisterSwordDamageStickyFriction(num2); } alreadyHit.Add(((BraveBehaviour)val).specRigidbody); } break; } } return; } List list = new List(); if (Object.op_Implicit((Object)(object)GameManager.Instance.PrimaryPlayer)) { list.Add(GameManager.Instance.PrimaryPlayer); } if (Object.op_Implicit((Object)(object)GameManager.Instance.SecondaryPlayer)) { list.Add(GameManager.Instance.SecondaryPlayer); } RaycastResult val6 = default(RaycastResult); for (int k = 0; k < list.Count; k++) { PlayerController val4 = list[k]; if (!Object.op_Implicit((Object)(object)val4) || !Object.op_Implicit((Object)(object)((BraveBehaviour)val4).specRigidbody) || !Object.op_Implicit((Object)(object)((BraveBehaviour)val4).healthHaver) || val4.IsGhost || (alreadyHit != null && alreadyHit.Contains(((BraveBehaviour)val4).specRigidbody))) { continue; } SpeculativeRigidbody specRigidbody = ((BraveBehaviour)val4).specRigidbody; PixelCollider hitboxPixelCollider2 = specRigidbody.HitboxPixelCollider; if (hitboxPixelCollider2 == null) { continue; } Vector2 val5 = BraveMathCollege.ClosestPointOnRectangle(arcOrigin, hitboxPixelCollider2.UnitBottomLeft, hitboxPixelCollider2.UnitDimensions); if (!ObjectWasHitBySlash(val5, arcOrigin, arcAngle, arcRadius, 90f)) { continue; } bool flag2 = true; int num3 = CollisionMask.LayerToMask((CollisionLayer)6, (CollisionLayer)8, (CollisionLayer)12); if (PhysicsEngine.Instance.Raycast(arcOrigin, val5 - arcOrigin, Vector2.Distance(val5, arcOrigin), ref val6, true, true, num3, (CollisionLayer?)null, false, (Func)null, (SpeculativeRigidbody)null) && (Object)(object)val6.SpeculativeRigidbody != (Object)(object)specRigidbody) { flag2 = false; } RaycastResult.Pool.Free(ref val6); if (!flag2) { continue; } float num4 = DealSwordDamageToEnemy(owner, (GameActor)(object)val4, arcOrigin, val5, arcAngle, slashParameters); if (alreadyHit != null) { if (alreadyHit.Count == 0) { StickyFrictionManager.Instance.RegisterSwordDamageStickyFriction(num4); } alreadyHit.Add(((BraveBehaviour)val4).specRigidbody); } break; } } private static float DealSwordDamageToEnemy(GameActor owner, GameActor targetEnemy, Vector2 arcOrigin, Vector2 contact, float angle, CustomSlashData slashParameters) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((BraveBehaviour)targetEnemy).healthHaver)) { float num = slashParameters.damage; if (Object.op_Implicit((Object)(object)((BraveBehaviour)targetEnemy).healthHaver) && ((BraveBehaviour)targetEnemy).healthHaver.IsBoss) { num *= slashParameters.bossDamageMult; } if (targetEnemy is AIActor && ((AIActor)((targetEnemy is AIActor) ? targetEnemy : null)).IsBlackPhantom) { num *= slashParameters.jammedDamageMult; } DamageCategory val = (DamageCategory)0; if (owner is AIActor && ((AIActor)((owner is AIActor) ? owner : null)).IsBlackPhantom) { val = (DamageCategory)4; } if (slashParameters.doHitVFX && slashParameters.hitVFX != null) { slashParameters.hitVFX.SpawnAtPosition(new Vector3(contact.x, contact.y), 0f, ((BraveBehaviour)targetEnemy).transform, (Vector2?)null, (Vector2?)null, (float?)null, false, (SpawnMethod)null, (tk2dBaseSprite)null, false); bool isAlive = ((BraveBehaviour)targetEnemy).healthHaver.IsAlive; ((BraveBehaviour)targetEnemy).healthHaver.ApplyDamage(num, contact - arcOrigin, owner.ActorName, (CoreDamageTypes)0, val, false, (PixelCollider)null, false); if (!(owner is PlayerController) || !((Object)(object)PlayerUtility.GetExtComp((PlayerController)(object)((owner is PlayerController) ? owner : null)) != (Object)null) || PlayerUtility.GetExtComp((PlayerController)(object)((owner is PlayerController) ? owner : null)).OnSlashHitEnemy == null || targetEnemy is AIActor) { } bool flag = false; if (isAlive && ((BraveBehaviour)targetEnemy).healthHaver.IsDead) { flag = true; } if (slashParameters.OnHitTarget != null) { slashParameters.OnHitTarget(targetEnemy, flag); } slashParameters.OnHitEnemy(targetEnemy, flag, angle, arcOrigin, contact); } if (Object.op_Implicit((Object)(object)((BraveBehaviour)targetEnemy).knockbackDoer)) { ((BraveBehaviour)targetEnemy).knockbackDoer.ApplyKnockback(contact - arcOrigin, slashParameters.enemyKnockbackForce, false); } if (slashParameters.statusEffects != null && slashParameters.statusEffects.Count > 0) { foreach (GameActorEffect statusEffect in slashParameters.statusEffects) { targetEnemy.ApplyEffect(statusEffect, 1f, (Projectile)null); } } } return slashParameters.damage; } } 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 static class SynergyPatches { [HarmonyPatch(typeof(RadialCharmItem), "AffectEnemy")] public class AffectEnemy_StartPatch { [HarmonyPostfix] public static void Postfix(RadialCharmItem __instance, AIActor target) { if (CustomSynergies.PlayerHasActiveSynergy(((PlayerItem)__instance).LastOwner, "Pacify")) { for (int i = 0; i < 3; i++) { ((GameActor)target).ApplyEffect((GameActorEffect)(object)new RalseiCharmable { duration = 10000f }, 1f, (Projectile)null); } } } } [HarmonyPatch(typeof(EstusFlaskItem), "HandleDrinkEstus")] public class Glug { [HarmonyPostfix] public static void Postfix(EstusFlaskItem __instance, PlayerController user) { if (!CustomSynergies.PlayerHasActiveSynergy(user, "Group Huddle")) { return; } Cake cake = Toolbox.isCakedUp(); if (Object.op_Implicit((Object)(object)cake)) { cake.AllCharmedEnemies.ForEach(delegate(AIActorModifiers.RalseiCharmedEnemyController self) { ((BraveBehaviour)((BraveBehaviour)self).aiActor).healthHaver.FullHeal(); self.DoHealParticles(); }); } } } [HarmonyPatch(typeof(CardboardBoxItem), "DoEffect")] public class CardboarxBox_PutOn { [HarmonyPostfix] public static void Postfix(CardboardBoxItem __instance, PlayerController user) { Cake cake = Toolbox.isCakedUp(); if (Object.op_Implicit((Object)(object)cake)) { cake.AllCharmedEnemies.ForEach(delegate(AIActorModifiers.RalseiCharmedEnemyController self) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) float num = (float)((BraveBehaviour)self).specRigidbody.HitboxPixelCollider.Height / 32f; GameObject val = ((GameActor)(object)((BraveBehaviour)self).aiActor).SmartPlayEffectOnActor(__instance.prefabToAttachToPlayer, new Vector3(-0.5f, 0.5f + num)); self.AttachedEffectsAdditional.Add("cardboardBox", val); tk2dSpriteAnimator component = val.GetComponent(); component.Play("cardboard_on"); }); } } } [HarmonyPatch(typeof(CardboardBoxItem), "BreakStealth")] public class CardboarxBox_PutOff { [HarmonyPostfix] public static void Postfix(CardboardBoxItem __instance, PlayerController obj) { Cake cake = Toolbox.isCakedUp(); if (!Object.op_Implicit((Object)(object)cake)) { return; } cake.AllCharmedEnemies.ForEach(delegate(AIActorModifiers.RalseiCharmedEnemyController self) { self.AttachedEffectsAdditional.TryGetValue("cardboardBox", out var value); if ((Object)(object)value != (Object)null) { ((BraveBehaviour)self).aiActor.DeregisterAttachedObject(value, completeDestruction: false); ((BraveBehaviour)value.GetComponent()).spriteAnimator.PlayAndDestroyObject("cardboard_off", (Action)null); self.AttachedEffectsAdditional.Remove("cardboardBox"); } }); } } [HarmonyPatch(typeof(YellowChamberItem), "OnEnteredCombat")] public class YellowChamberItem_Enter { [HarmonyPostfix] public static void Postfix(YellowChamberItem __instance) { if (Object.op_Implicit((Object)(object)__instance.m_currentlyCharmedEnemy)) { RalseiCharmable.InvalidSpecificEnemies.Add(__instance.m_currentlyCharmedEnemy); } } } [HarmonyPatch] private static class RegenerationPassiveItemPlayerDealtDamagenPatch { [HarmonyPatch(typeof(RegenerationPassiveItem), "PlayerDealtDamage")] [HarmonyILManipulator] private static void GameUIAmmoControllerUpdateUIGunIL(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction instr) => ILPatternMatchingExt.MatchCallvirt(instr, "ApplyHealing") })) { val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Call, (MethodBase)typeof(RegenerationPassiveItemPlayerDealtDamagenPatch).GetMethod("UpdateHP", BindingFlags.Static | BindingFlags.NonPublic)); } } private static void UpdateHP(RegenerationPassiveItem regenerationPassiveItem) { if (Object.op_Implicit((Object)(object)((PassiveItem)regenerationPassiveItem).Owner) && CustomSynergies.PlayerHasActiveSynergy(((PassiveItem)regenerationPassiveItem).Owner, "Absorb")) { Cake cake = Toolbox.isCakedUp(); if (!((Object)(object)cake == (Object)null)) { cake.StoredHearts += 3; } } } } } public class ParticleBase { public static Dictionary _ParticleSystems = new Dictionary(); public static void InitParticleBase() { _ParticleSystems = new Dictionary { { "HeartParticle", Object.Instantiate(RalseiModule.assetBundle.LoadAsset("RalseiHeartParticle").GetComponent()) }, { "HealParticle", Object.Instantiate(RalseiModule.assetBundle.LoadAsset("RalseiHealParticle").GetComponent()) } }; foreach (KeyValuePair particleSystem in _ParticleSystems) { Object.DontDestroyOnLoad((Object)(object)particleSystem.Value); } } public static ParticleSystem ReturnParticleSystem(string name) { if (!_ParticleSystems.ContainsKey(name)) { return null; } return _ParticleSystems[name]; } public static void EmitParticles(string name, int amount, EmitParams newParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (_ParticleSystems.ContainsKey(name)) { ParticleSystem val = _ParticleSystems[name]; val.Emit(newParams, amount); } } public static void EmitParticles(string name, int amount, Vector2 position, Vector3 Velocity, float rotation = 0f, float lifeTime = 1f, float size = 1f) { //IL_0018: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (_ParticleSystems.ContainsKey(name)) { EmitParams val = default(EmitParams); ((EmitParams)(ref val)).position = Vector2.op_Implicit(position); ((EmitParams)(ref val)).rotation = rotation; ((EmitParams)(ref val)).startLifetime = lifeTime; ((EmitParams)(ref val)).startSize = size; ((EmitParams)(ref val)).velocity = Velocity; ParticleSystem val2 = _ParticleSystems[name]; val2.Emit(val, amount); } } public static void EmitParticles(ParticleSystem particleSystem, int amount, Vector2 position, Vector3 Velocity, float rotation = 0f, float lifeTime = 1f, float size = 1f) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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) EmitParams val = default(EmitParams); ((EmitParams)(ref val)).position = Vector2.op_Implicit(position); ((EmitParams)(ref val)).rotation = rotation; ((EmitParams)(ref val)).startLifetime = lifeTime; ((EmitParams)(ref val)).startSize = size; ((EmitParams)(ref val)).velocity = Velocity; particleSystem.Emit(val, amount); } public static void EmitParticles(ParticleSystem particleSystem, int amount, EmitParams newParams) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) particleSystem.Emit(newParams, amount); } } public class ScarfWeapon : GunBehaviour { [HarmonyPatch] private static class GameUIAmmoControllerUpdateUIGunPatch { [HarmonyPatch(typeof(GameUIAmmoController), "UpdateUIGun")] [HarmonyILManipulator] private static void GameUIAmmoControllerUpdateUIGunIL(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction instr) => ILPatternMatchingExt.MatchLdfld(instr, "IsHeroSword") })) { val.Emit(OpCodes.Ldloc_0); val.Emit(OpCodes.Call, (MethodBase)typeof(GameUIAmmoControllerUpdateUIGunPatch).GetMethod("CheckHideAmmo", BindingFlags.Static | BindingFlags.NonPublic)); } } private static bool CheckHideAmmo(bool oldValue, Gun gun) { if (oldValue) { return true; } if (((PickupObject)gun).PickupObjectId == RalseiScarfID) { return true; } return false; } } public class StunnableSlash : RalseiSlash { public override bool isStunnable => true; public override bool isCharmable => false; public override bool isEnemyTag => true; public override CustomSlashData ReturnClone() { StunnableSlash stunnableSlash = ScriptableObject.CreateInstance(); stunnableSlash.doVFX = doVFX; stunnableSlash.VFX = VFX; stunnableSlash.doHitVFX = doHitVFX; stunnableSlash.hitVFX = hitVFX; stunnableSlash.projInteractMode = projInteractMode; stunnableSlash.playerKnockbackForce = playerKnockbackForce; stunnableSlash.enemyKnockbackForce = enemyKnockbackForce; stunnableSlash.statusEffects = statusEffects; stunnableSlash.jammedDamageMult = jammedDamageMult; stunnableSlash.bossDamageMult = bossDamageMult; stunnableSlash.doOnSlash = doOnSlash; stunnableSlash.doPostProcessSlash = doPostProcessSlash; stunnableSlash.slashRange = slashRange; stunnableSlash.slashDegrees = slashDegrees; stunnableSlash.damage = damage; stunnableSlash.damagesBreakables = damagesBreakables; stunnableSlash.soundEvent = soundEvent; stunnableSlash.OnHitTarget = OnHitTarget; stunnableSlash.OnHitBullet = OnHitBullet; stunnableSlash.OnHitMinorBreakable = OnHitMinorBreakable; stunnableSlash.OnHitMajorBreakable = OnHitMajorBreakable; return stunnableSlash; } } public class BasicSlash2 : RalseiSlash { public override bool isCharmable => true; public override CustomSlashData ReturnClone() { BasicSlash2 basicSlash = ScriptableObject.CreateInstance(); basicSlash.doVFX = doVFX; basicSlash.VFX = VFX; basicSlash.doHitVFX = doHitVFX; basicSlash.hitVFX = hitVFX; basicSlash.projInteractMode = projInteractMode; basicSlash.playerKnockbackForce = playerKnockbackForce; basicSlash.enemyKnockbackForce = enemyKnockbackForce; basicSlash.statusEffects = statusEffects; basicSlash.jammedDamageMult = jammedDamageMult; basicSlash.bossDamageMult = bossDamageMult; basicSlash.doOnSlash = doOnSlash; basicSlash.doPostProcessSlash = doPostProcessSlash; basicSlash.slashRange = slashRange; basicSlash.slashDegrees = slashDegrees; basicSlash.damage = damage; basicSlash.damagesBreakables = damagesBreakables; basicSlash.soundEvent = soundEvent; basicSlash.OnHitTarget = OnHitTarget; basicSlash.OnHitBullet = OnHitBullet; basicSlash.OnHitMinorBreakable = OnHitMinorBreakable; basicSlash.OnHitMajorBreakable = OnHitMajorBreakable; return basicSlash; } } public class Whrilwind : RalseiSlash { public override bool isStunnable => true; public override bool isCharmable => true; public override int Stacks => 2; public override CustomSlashData ReturnClone() { Whrilwind whrilwind = ScriptableObject.CreateInstance(); whrilwind.doVFX = doVFX; whrilwind.VFX = VFX; whrilwind.doHitVFX = doHitVFX; whrilwind.hitVFX = hitVFX; whrilwind.projInteractMode = projInteractMode; whrilwind.playerKnockbackForce = playerKnockbackForce; whrilwind.enemyKnockbackForce = enemyKnockbackForce; whrilwind.statusEffects = statusEffects; whrilwind.jammedDamageMult = jammedDamageMult; whrilwind.bossDamageMult = bossDamageMult; whrilwind.doOnSlash = doOnSlash; whrilwind.doPostProcessSlash = doPostProcessSlash; whrilwind.slashRange = slashRange; whrilwind.slashDegrees = slashDegrees; whrilwind.damage = damage; whrilwind.damagesBreakables = damagesBreakables; whrilwind.soundEvent = soundEvent; whrilwind.OnHitTarget = OnHitTarget; whrilwind.OnHitBullet = OnHitBullet; whrilwind.OnHitMinorBreakable = OnHitMinorBreakable; whrilwind.OnHitMajorBreakable = OnHitMajorBreakable; return whrilwind; } } public class RalseiSlash : CustomSlashData { public static RalseiTargetVFX targetVFX; public static float Cooldown; public virtual bool isCharmable => true; public virtual bool isStunnable => false; public virtual int Stacks => 1; public virtual bool isEnemyTag => false; public override CustomSlashData ReturnClone() { RalseiSlash ralseiSlash = ScriptableObject.CreateInstance(); ralseiSlash.doVFX = doVFX; ralseiSlash.VFX = VFX; ralseiSlash.doHitVFX = doHitVFX; ralseiSlash.hitVFX = hitVFX; ralseiSlash.projInteractMode = projInteractMode; ralseiSlash.playerKnockbackForce = playerKnockbackForce; ralseiSlash.enemyKnockbackForce = enemyKnockbackForce; ralseiSlash.statusEffects = statusEffects; ralseiSlash.jammedDamageMult = jammedDamageMult; ralseiSlash.bossDamageMult = bossDamageMult; ralseiSlash.doOnSlash = doOnSlash; ralseiSlash.doPostProcessSlash = doPostProcessSlash; ralseiSlash.slashRange = slashRange; ralseiSlash.slashDegrees = slashDegrees; ralseiSlash.damage = damage; ralseiSlash.damagesBreakables = damagesBreakables; ralseiSlash.soundEvent = soundEvent; ralseiSlash.OnHitTarget = OnHitTarget; ralseiSlash.OnHitBullet = OnHitBullet; ralseiSlash.OnHitMinorBreakable = OnHitMinorBreakable; ralseiSlash.OnHitMajorBreakable = OnHitMajorBreakable; return ralseiSlash; } public override void OnHitEnemy(GameActor gameActor, bool b, float Angle, Vector2 arcOrigin, Vector2 contact) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) AIActor val = (AIActor)(object)((gameActor is AIActor) ? gameActor : null); if (val == null || b || !Object.op_Implicit((Object)(object)val) || !val.IsNormalEnemy || !Object.op_Implicit((Object)(object)((BraveBehaviour)val).healthHaver)) { return; } if (!((BraveBehaviour)val).healthHaver.IsBoss && Object.op_Implicit((Object)(object)((BraveBehaviour)val).behaviorSpeculator)) { if (isStunnable) { float num = Vector2.Distance(contact, arcOrigin); if (num >= slashRange * 0.8f && num <= slashRange) { ((BraveBehaviour)val).behaviorSpeculator.Stun(Mathf.Min(5f, Mathf.Sqrt(damage)), true); } } if (isCharmable) { for (int i = 0; i < Stacks; i++) { ((GameActor)val).ApplyEffect((GameActorEffect)(object)new RalseiCharmable { duration = 10000f }, 1f, (Projectile)null); } } } if (AIActorModifiers.RalseiCharmedEnemyController.allCharmed.Count > 0 && isEnemyTag && Cooldown <= 0f) { if ((Object)(object)targetVFX != (Object)null) { Object.Destroy((Object)(object)((Component)targetVFX).gameObject); targetVFX = null; } Cooldown = 1f; targetVFX = ((GameActor)(object)val).SmartPlayEffectOnActor(((Component)EffectPrefab).gameObject, new Vector3(0f, 0f)).GetComponent(); targetVFX.TargetInst = val; } } } public static Projectile SlashLeft; public static Projectile SlashRight; public static Projectile SlashWhip; public static Projectile SlashSmall; public static Projectile SlashSmallSlashless; public static RalseiTargetVFX EffectPrefab; public static ScarfAttachmentDoer scarfRef; private CustomScarfDoer scarfInstance; private int SlashValue = 0; public float WhipTimer = 0f; public float ChargeForWhirl = 0f; public float Reset = 0f; public static int RalseiScarfID; public static void Add() { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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_01d1: 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_01f2: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Expected O, but got Unknown //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Expected O, but got Unknown //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Expected O, but got Unknown //IL_09e2: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0ade: Unknown result type (might be due to invalid IL or missing references) //IL_0ae3: Unknown result type (might be due to invalid IL or missing references) //IL_0c69: Unknown result type (might be due to invalid IL or missing references) //IL_0c9f: Unknown result type (might be due to invalid IL or missing references) //IL_0ca4: Unknown result type (might be due to invalid IL or missing references) //IL_0d2c: Unknown result type (might be due to invalid IL or missing references) //IL_0d31: Unknown result type (might be due to invalid IL or missing references) //IL_0eb7: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0ef2: Unknown result type (might be due to invalid IL or missing references) //IL_0f9c: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Unknown result type (might be due to invalid IL or missing references) //IL_1170: Unknown result type (might be due to invalid IL or missing references) //IL_1175: Unknown result type (might be due to invalid IL or missing references) //IL_119a: Unknown result type (might be due to invalid IL or missing references) //IL_11d0: Unknown result type (might be due to invalid IL or missing references) //IL_11d5: Unknown result type (might be due to invalid IL or missing references) //IL_1380: Unknown result type (might be due to invalid IL or missing references) //IL_1385: Unknown result type (might be due to invalid IL or missing references) //IL_13aa: Unknown result type (might be due to invalid IL or missing references) //IL_13e0: Unknown result type (might be due to invalid IL or missing references) //IL_13e5: Unknown result type (might be due to invalid IL or missing references) //IL_1429: Unknown result type (might be due to invalid IL or missing references) //IL_1430: Unknown result type (might be due to invalid IL or missing references) //IL_1438: Unknown result type (might be due to invalid IL or missing references) //IL_143d: Unknown result type (might be due to invalid IL or missing references) //IL_1457: Unknown result type (might be due to invalid IL or missing references) //IL_1518: Unknown result type (might be due to invalid IL or missing references) //IL_151f: Expected O, but got Unknown //IL_15b6: Unknown result type (might be due to invalid IL or missing references) //IL_15bd: Expected O, but got Unknown Gun val = Databases.Items.NewGun("Warm Scarf", "ralseisverywarmscarf"); Game.Items.Rename("outdated_gun_mods:warm_scarf", "rlsi:warm_scarf"); ((Component)val).gameObject.AddComponent(); GunExt.SetShortDescription((PickupObject)(object)val, "Fluffy And Cozy"); GunExt.SetLongDescription((PickupObject)(object)val, "A warm, hand-knitted scarf. Show love to your enemies, and maybe they will turn to your side. Rolling allows for a longer-range hug that pulls attention for your friends, and holding the reload button charges up a radial hug with increased love."); GunInt.SetupSpritePrebaked(val, StaticSpriteCollections.ItemAndGunCollection, "warmscarf", (string)null); ((BraveBehaviour)val).spriteAnimator.Library = StaticSpriteCollections.ItemAndGunAnimation; ((BraveBehaviour)val).sprite.SortingOrder = 1; val.reloadAnimation = "scarf_true"; val.idleAnimation = "scarf_true"; val.shootAnimation = "scarf_true"; ((BraveBehaviour)val).sprite.scale = Vector3.zero; val.PreventOutlines = true; ((PickupObject)val).CanBeDropped = false; ((PickupObject)val).PreventStartingOwnerFromDropping = true; PickupObject byId = PickupObjectDatabase.GetById(86); GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId is Gun) ? byId : null), true, true); PickupObject byId2 = PickupObjectDatabase.GetById(86); GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId2 is Gun) ? byId2 : null), true, false); PickupObject byId3 = PickupObjectDatabase.GetById(86); GunExt.AddProjectileModuleFrom(val, (Gun)(object)((byId3 is Gun) ? byId3 : null), true, false); for (int i = 0; i < val.Volley.projectiles.Count; i++) { ProjectileModule val2 = val.Volley.projectiles[i]; val2.ammoCost = 1; val2.shootStyle = (ShootStyle)1; val2.sequenceStyle = (ProjectileSequenceStyle)0; val2.cooldownTime = ((i == 0) ? 0.7f : 0.25f); val2.numberOfShotsInClip = -1; val2.angleVariance = 5f; } val.reloadTime = 0f; val.PreventNormalFireAudio = true; val.OverrideNormalFireAudioEvent = ""; ref string gunSwitchGroup = ref val.gunSwitchGroup; PickupObject byId4 = PickupObjectDatabase.GetById(335); gunSwitchGroup = ((Gun)((byId4 is Gun) ? byId4 : null)).gunSwitchGroup; val.SetBaseMaxAmmo(360); val.InfiniteAmmo = true; ((PickupObject)val).quality = (ItemQuality)(-50); val.CurrentStrengthTier = 0; val.Volley.ModulesAreTiers = true; VFXPool val3 = new VFXPool(); val3.type = (VFXPoolType)0; val3.effects = (VFXComplex[])(object)new VFXComplex[0]; val.muzzleFlashEffects = val3; GameObject val4 = PrefabBuilder.BuildObject("(Ralsei)SlashEffect_Default(Left)"); FakePrefab.MarkAsFakePrefab(val4); Object.DontDestroyOnLoad((Object)(object)val4); tk2dSprite val5 = val4.AddComponent(); ((tk2dBaseSprite)val5).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_slash_default1_002"); ((tk2dBaseSprite)val5).IsPerpendicular = false; tk2dSpriteAnimator orAddComponent = GameObjectExtensions.GetOrAddComponent(val4); orAddComponent.library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.Library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.DefaultClipId = orAddComponent.GetClipIdByName("scarf_slash_0"); orAddComponent.playAutomatically = true; SpriteAnimatorKiller val6 = ((Component)orAddComponent).gameObject.AddComponent(); val6.animator = orAddComponent; ((BraveBehaviour)orAddComponent).sprite.usesOverrideMaterial = true; Material val7 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val7.mainTexture = ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material.mainTexture; ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material = val7; GameObject val8 = PrefabBuilder.BuildObject("(Ralsei)SlashEffect_Default(Right)"); FakePrefab.MarkAsFakePrefab(val8); Object.DontDestroyOnLoad((Object)(object)val8); tk2dSprite val9 = val8.AddComponent(); ((tk2dBaseSprite)val9).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_slash_default1_002"); ((tk2dBaseSprite)val9).IsPerpendicular = false; orAddComponent = GameObjectExtensions.GetOrAddComponent(val8); orAddComponent.library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.Library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.DefaultClipId = orAddComponent.GetClipIdByName("scarf_slash_1"); orAddComponent.playAutomatically = true; val6 = ((Component)orAddComponent).gameObject.AddComponent(); val6.animator = orAddComponent; ((BraveBehaviour)orAddComponent).sprite.usesOverrideMaterial = true; val7 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val7.mainTexture = ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material.mainTexture; ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material = val7; GameObject val10 = PrefabBuilder.BuildObject("(Ralsei)SlashEffect_Whip"); FakePrefab.MarkAsFakePrefab(val10); Object.DontDestroyOnLoad((Object)(object)val10); tk2dSprite val11 = val10.AddComponent(); ((tk2dBaseSprite)val11).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_slash_default1_002"); ((tk2dBaseSprite)val11).IsPerpendicular = false; orAddComponent = GameObjectExtensions.GetOrAddComponent(val10); orAddComponent.library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.Library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.DefaultClipId = orAddComponent.GetClipIdByName("scarf_slash_2"); orAddComponent.playAutomatically = true; val6 = ((Component)orAddComponent).gameObject.AddComponent(); val6.animator = orAddComponent; ((BraveBehaviour)orAddComponent).sprite.usesOverrideMaterial = true; val7 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val7.mainTexture = ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material.mainTexture; ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material = val7; GameObject val12 = PrefabBuilder.BuildObject("(Ralsei)SlashEffect_Whirl"); FakePrefab.MarkAsFakePrefab(val12); Object.DontDestroyOnLoad((Object)(object)val12); tk2dSprite val13 = val12.AddComponent(); ((tk2dBaseSprite)val13).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_slash_default1_002"); ((tk2dBaseSprite)val13).IsPerpendicular = false; orAddComponent = GameObjectExtensions.GetOrAddComponent(val12); orAddComponent.library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.Library = StaticSpriteCollections.ItemAndGunAnimation; orAddComponent.DefaultClipId = orAddComponent.GetClipIdByName("scarf_slash_3"); orAddComponent.playAutomatically = true; val6 = ((Component)orAddComponent).gameObject.AddComponent(); val6.animator = orAddComponent; ((BraveBehaviour)orAddComponent).sprite.usesOverrideMaterial = true; val7 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val7.mainTexture = ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material.mainTexture; ((BraveBehaviour)((BraveBehaviour)orAddComponent).sprite).renderer.material = val7; RalseiSlash ralseiSlash = ScriptableObject.CreateInstance(); ralseiSlash.projInteractMode = CustomSlashDoer.ProjInteractMode.IGNORE; ralseiSlash.playerKnockbackForce = 1f; ralseiSlash.enemyKnockbackForce = 20f; ralseiSlash.VFX = val4.CreateQuickVFXPool(DeathPersistance: true, Attachment: true, (VFXAlignment)1); ralseiSlash.doVFX = true; ralseiSlash.doHitVFX = true; ralseiSlash.slashRange = 4.5f; ralseiSlash.slashDegrees = 72f; ralseiSlash.soundEvent = "Play_ENM_gunnut_swing_01"; ralseiSlash.damage = 2.7f; ralseiSlash.damagesBreakables = true; ref VFXPool hitVFX = ref ralseiSlash.hitVFX; PickupObject byId5 = PickupObjectDatabase.GetById(539); hitVFX = ((Gun)((byId5 is Gun) ? byId5 : null)).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.enemy; BasicSlash2 basicSlash = ScriptableObject.CreateInstance(); basicSlash.projInteractMode = CustomSlashDoer.ProjInteractMode.IGNORE; basicSlash.playerKnockbackForce = 1f; basicSlash.enemyKnockbackForce = 20f; basicSlash.doVFX = true; basicSlash.VFX = val8.CreateQuickVFXPool(DeathPersistance: true, Attachment: true, (VFXAlignment)1); basicSlash.doHitVFX = true; basicSlash.slashRange = 4.5f; basicSlash.slashDegrees = 72f; basicSlash.soundEvent = "Play_ENM_gunnut_swing_01"; basicSlash.damage = 2.7f; basicSlash.damagesBreakables = true; ref VFXPool hitVFX2 = ref basicSlash.hitVFX; PickupObject byId6 = PickupObjectDatabase.GetById(539); hitVFX2 = ((Gun)((byId6 is Gun) ? byId6 : null)).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.enemy; StunnableSlash stunnableSlash = ScriptableObject.CreateInstance(); stunnableSlash.projInteractMode = CustomSlashDoer.ProjInteractMode.DESTROY; stunnableSlash.playerKnockbackForce = 1f; stunnableSlash.enemyKnockbackForce = 40f; stunnableSlash.VFX = val10.CreateQuickVFXPool(DeathPersistance: true, Attachment: true, (VFXAlignment)1); stunnableSlash.doVFX = true; stunnableSlash.doHitVFX = true; stunnableSlash.slashRange = 6.5f; stunnableSlash.slashDegrees = 15f; stunnableSlash.soundEvent = "Play_ENM_wizardred_swing_01"; stunnableSlash.damage = 11f; stunnableSlash.damagesBreakables = true; ref VFXPool hitVFX3 = ref stunnableSlash.hitVFX; PickupObject byId7 = PickupObjectDatabase.GetById(539); hitVFX3 = ((Gun)((byId7 is Gun) ? byId7 : null)).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.enemy; Whrilwind whrilwind = ScriptableObject.CreateInstance(); whrilwind.projInteractMode = CustomSlashDoer.ProjInteractMode.DESTROY; whrilwind.playerKnockbackForce = 50f; whrilwind.enemyKnockbackForce = 40f; whrilwind.VFX = val12.CreateQuickVFXPool(DeathPersistance: true, Attachment: true, (VFXAlignment)1); whrilwind.doVFX = true; whrilwind.doHitVFX = true; whrilwind.slashRange = 5f; whrilwind.slashDegrees = 360f; whrilwind.soundEvent = "Play_obj_katana_slash_01"; whrilwind.damage = 2f; whrilwind.damagesBreakables = true; ref VFXPool hitVFX4 = ref whrilwind.hitVFX; PickupObject byId8 = PickupObjectDatabase.GetById(539); hitVFX4 = ((Gun)((byId8 is Gun) ? byId8 : null)).DefaultModule.chargeProjectiles[0].Projectile.hitEffects.enemy; PickupObject byId9 = PickupObjectDatabase.GetById(86); SlashLeft = Object.Instantiate(((Gun)((byId9 is Gun) ? byId9 : null)).DefaultModule.projectiles[0]); ((Component)SlashLeft).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)SlashLeft).gameObject); Object.DontDestroyOnLoad((Object)(object)SlashLeft); PierceProjModifier val14 = ((Component)SlashLeft).gameObject.AddComponent(); val14.penetratesBreakables = true; SlashLeft.baseData.damage = 1.8f; SlashLeft.baseData.speed = 12.5f; SlashLeft.baseData.AccelerationCurve = AnimationCurve.Linear(0f, 1f, 1f, 0.2f); SlashLeft.baseData.CustomAccelerationCurveDuration = 1f; SlashLeft.baseData.UsesCustomAccelerationCurve = true; SlashLeft.shouldRotate = true; SlashLeft.pierceMinorBreakables = true; CustomProjectileSlashingBehaviour customProjectileSlashingBehaviour = ((Component)SlashLeft).gameObject.AddComponent(); customProjectileSlashingBehaviour.DestroyBaseAfterFirstSlash = true; customProjectileSlashingBehaviour.slashParameters = ralseiSlash; customProjectileSlashingBehaviour.DestroysOnlyComponentAfterFirstSlash = true; customProjectileSlashingBehaviour.initialDelay = 0f; customProjectileSlashingBehaviour.SlashDamageUsesBaseProjectileDamage = false; ref ProjectileImpactVFXPool hitEffects = ref SlashLeft.hitEffects; PickupObject byId10 = PickupObjectDatabase.GetById(345); hitEffects = ((Gun)((byId10 is Gun) ? byId10 : null)).DefaultModule.projectiles[0].hitEffects; int length = 6; ProjectileBuilders.AnimateProjectileBundle(SlashLeft, "slash_normal", StaticSpriteCollections.ProjectileCollection, StaticSpriteCollections.ProjectileAnimation, "slash_normal", Toolbox.ConstructListOfSameValues(new IntVector2(15, 46), length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues((Anchor)4, length), Toolbox.ConstructListOfSameValues(value: true, length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues(Vector2.op_Implicit(new Vector2(0f, 0f)), length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length)); val.Volley.projectiles[0].projectiles[0] = SlashLeft; val.DefaultModule.projectiles[0] = SlashLeft; ImprovedAfterImage val15 = ((Component)SlashLeft).gameObject.AddComponent(); val15.spawnShadows = true; val15.shadowLifetime = 0.25f; val15.shadowTimeDelay = 0.05f; val15.dashColor = new Color(0f, 0.5f, 0.1f, 0.02f); PickupObject byId11 = PickupObjectDatabase.GetById(86); SlashRight = Object.Instantiate(((Gun)((byId11 is Gun) ? byId11 : null)).DefaultModule.projectiles[0]); ((Component)SlashRight).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)SlashRight).gameObject); Object.DontDestroyOnLoad((Object)(object)SlashRight); val14 = ((Component)SlashRight).gameObject.AddComponent(); val14.penetratesBreakables = true; SlashRight.baseData.damage = 1.8f; SlashRight.baseData.speed = 12.5f; SlashRight.baseData.AccelerationCurve = AnimationCurve.Linear(0f, 1f, 1f, 0.2f); SlashRight.baseData.CustomAccelerationCurveDuration = 1f; SlashRight.baseData.UsesCustomAccelerationCurve = true; SlashRight.shouldRotate = true; SlashRight.pierceMinorBreakables = true; ref ProjectileImpactVFXPool hitEffects2 = ref SlashRight.hitEffects; PickupObject byId12 = PickupObjectDatabase.GetById(345); hitEffects2 = ((Gun)((byId12 is Gun) ? byId12 : null)).DefaultModule.projectiles[0].hitEffects; customProjectileSlashingBehaviour = ((Component)SlashRight).gameObject.AddComponent(); customProjectileSlashingBehaviour.DestroyBaseAfterFirstSlash = true; customProjectileSlashingBehaviour.slashParameters = basicSlash; customProjectileSlashingBehaviour.DestroysOnlyComponentAfterFirstSlash = true; customProjectileSlashingBehaviour.initialDelay = 0f; customProjectileSlashingBehaviour.SlashDamageUsesBaseProjectileDamage = false; length = 6; ProjectileBuilders.AnimateProjectileBundle(SlashRight, "slash_normal", StaticSpriteCollections.ProjectileCollection, StaticSpriteCollections.ProjectileAnimation, "slash_normal", Toolbox.ConstructListOfSameValues(new IntVector2(15, 46), length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues((Anchor)4, length), Toolbox.ConstructListOfSameValues(value: true, length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues(Vector2.op_Implicit(new Vector2(0f, 0f)), length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length)); val15 = ((Component)SlashRight).gameObject.AddComponent(); val15.spawnShadows = true; val15.shadowLifetime = 0.25f; val15.shadowTimeDelay = 0.05f; val15.dashColor = new Color(0f, 0.5f, 0.1f, 0.02f); PickupObject byId13 = PickupObjectDatabase.GetById(86); SlashWhip = Object.Instantiate(((Gun)((byId13 is Gun) ? byId13 : null)).DefaultModule.projectiles[0]); ((Component)SlashWhip).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)SlashWhip).gameObject); Object.DontDestroyOnLoad((Object)(object)SlashWhip); val14 = ((Component)SlashWhip).gameObject.AddComponent(); val14.penetratesBreakables = true; SlashWhip.baseData.damage = 10f; SlashWhip.baseData.speed = 22f; SlashWhip.baseData.AccelerationCurve = AnimationCurve.Linear(0f, 1f, 1f, 0.2f); SlashWhip.baseData.CustomAccelerationCurveDuration = 1f; SlashWhip.baseData.UsesCustomAccelerationCurve = true; SlashWhip.shouldRotate = true; SlashWhip.pierceMinorBreakables = true; ref ProjectileImpactVFXPool hitEffects3 = ref SlashWhip.hitEffects; PickupObject byId14 = PickupObjectDatabase.GetById(345); hitEffects3 = ((Gun)((byId14 is Gun) ? byId14 : null)).DefaultModule.projectiles[0].hitEffects; customProjectileSlashingBehaviour = ((Component)SlashWhip).gameObject.AddComponent(); customProjectileSlashingBehaviour.DestroyBaseAfterFirstSlash = true; customProjectileSlashingBehaviour.slashParameters = stunnableSlash; customProjectileSlashingBehaviour.DestroysOnlyComponentAfterFirstSlash = true; customProjectileSlashingBehaviour.initialDelay = 0f; customProjectileSlashingBehaviour.SlashDamageUsesBaseProjectileDamage = false; length = 5; ProjectileBuilders.AnimateProjectileBundle(SlashWhip, "slash_whip", StaticSpriteCollections.ProjectileCollection, StaticSpriteCollections.ProjectileAnimation, "slash_whip", Toolbox.ConstructListOfSameValues(new IntVector2(30, 11), length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues((Anchor)4, length), Toolbox.ConstructListOfSameValues(value: true, length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues(Vector2.op_Implicit(new Vector2(0f, 0f)), length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length)); val.Volley.projectiles[1].projectiles[0] = SlashWhip; val15 = ((Component)SlashWhip).gameObject.AddComponent(); val15.spawnShadows = true; val15.shadowLifetime = 0.25f; val15.shadowTimeDelay = 0.05f; val15.dashColor = new Color(0f, 0.5f, 0.1f, 0.02f); PickupObject byId15 = PickupObjectDatabase.GetById(86); SlashSmall = Object.Instantiate(((Gun)((byId15 is Gun) ? byId15 : null)).DefaultModule.projectiles[0]); ((Component)SlashSmall).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)SlashSmall).gameObject); Object.DontDestroyOnLoad((Object)(object)SlashSmall); val14 = ((Component)SlashSmall).gameObject.AddComponent(); val14.penetratesBreakables = true; SlashSmall.baseData.damage = 1.8f; SlashSmall.baseData.speed = 18f; SlashSmall.baseData.AccelerationCurve = AnimationCurve.Linear(0f, 1f, 1f, 0.2f); SlashSmall.baseData.CustomAccelerationCurveDuration = 1f; SlashSmall.baseData.UsesCustomAccelerationCurve = true; SlashSmall.shouldRotate = true; SlashSmall.pierceMinorBreakables = true; ref ProjectileImpactVFXPool hitEffects4 = ref SlashSmall.hitEffects; PickupObject byId16 = PickupObjectDatabase.GetById(345); hitEffects4 = ((Gun)((byId16 is Gun) ? byId16 : null)).DefaultModule.projectiles[0].hitEffects; customProjectileSlashingBehaviour = ((Component)SlashSmall).gameObject.AddComponent(); customProjectileSlashingBehaviour.DestroyBaseAfterFirstSlash = true; customProjectileSlashingBehaviour.slashParameters = whrilwind; customProjectileSlashingBehaviour.DestroysOnlyComponentAfterFirstSlash = true; customProjectileSlashingBehaviour.initialDelay = 0f; customProjectileSlashingBehaviour.SlashDamageUsesBaseProjectileDamage = false; val.Volley.projectiles[2].projectiles[0] = SlashSmall; val15 = ((Component)SlashSmall).gameObject.AddComponent(); val15.spawnShadows = true; val15.shadowLifetime = 0.25f; val15.shadowTimeDelay = 0.05f; val15.dashColor = new Color(0f, 0.5f, 0.1f, 0.02f); length = 4; ProjectileBuilders.AnimateProjectileBundle(SlashSmall, "slash_small", StaticSpriteCollections.ProjectileCollection, StaticSpriteCollections.ProjectileAnimation, "slash_small", Toolbox.ConstructListOfSameValues(new IntVector2(15, 24), length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues((Anchor)4, length), Toolbox.ConstructListOfSameValues(value: true, length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues(Vector2.op_Implicit(new Vector2(0f, 0f)), length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length)); PickupObject byId17 = PickupObjectDatabase.GetById(86); SlashSmallSlashless = Object.Instantiate(((Gun)((byId17 is Gun) ? byId17 : null)).DefaultModule.projectiles[0]); ((Component)SlashSmallSlashless).gameObject.SetActive(false); FakePrefab.MarkAsFakePrefab(((Component)SlashSmallSlashless).gameObject); Object.DontDestroyOnLoad((Object)(object)SlashSmallSlashless); val14 = ((Component)SlashSmall).gameObject.AddComponent(); val14.penetratesBreakables = true; SlashSmallSlashless.baseData.damage = 1.8f; SlashSmallSlashless.baseData.speed = 18f; SlashSmallSlashless.baseData.AccelerationCurve = AnimationCurve.Linear(0f, 1f, 1f, 0.2f); SlashSmallSlashless.baseData.CustomAccelerationCurveDuration = 1f; SlashSmallSlashless.baseData.UsesCustomAccelerationCurve = true; SlashSmallSlashless.shouldRotate = true; SlashSmallSlashless.pierceMinorBreakables = true; ref ProjectileImpactVFXPool hitEffects5 = ref SlashSmallSlashless.hitEffects; PickupObject byId18 = PickupObjectDatabase.GetById(345); hitEffects5 = ((Gun)((byId18 is Gun) ? byId18 : null)).DefaultModule.projectiles[0].hitEffects; val15 = ((Component)SlashSmallSlashless).gameObject.AddComponent(); val15.spawnShadows = true; val15.shadowLifetime = 0.25f; val15.shadowTimeDelay = 0.05f; val15.dashColor = new Color(0f, 0.5f, 0.1f, 0.02f); length = 4; ProjectileBuilders.AnimateProjectileBundle(SlashSmallSlashless, "slash_small", StaticSpriteCollections.ProjectileCollection, StaticSpriteCollections.ProjectileAnimation, "slash_small", Toolbox.ConstructListOfSameValues(new IntVector2(15, 24), length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues((Anchor)4, length), Toolbox.ConstructListOfSameValues(value: true, length), Toolbox.ConstructListOfSameValues(value: false, length), Toolbox.ConstructListOfSameValues(Vector2.op_Implicit(new Vector2(0f, 0f)), length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length), Toolbox.ConstructListOfSameValues(null, length)); val.gunClass = (GunClass)55; val.gunHandedness = (GunHandedness)4; val.carryPixelOffset = new IntVector2(0, 0); val.barrelOffset.localPosition = new Vector3(0f, 0f, 0f); Databases.Items.Add((PickupObject)(object)val, false, "ANY"); RalseiScarfID = ((PickupObject)val).PickupObjectId; PickupObject byId19 = PickupObjectDatabase.GetById(436); scarfRef = ((BlinkPassiveItem)((byId19 is BlinkPassiveItem) ? byId19 : null)).ScarfPrefab; GameObject val16 = PrefabBuilder.BuildObject("SetTargetRalsei"); RalseiTargetVFX ralseiTargetVFX = val16.AddComponent(); Object.DontDestroyOnLoad((Object)(object)val16); val16.layer = LayerMask.NameToLayer("FG_Critical"); tk2dSprite val17 = val16.AddComponent(); ((tk2dBaseSprite)val17).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "priorityTarget_text_001"); ((tk2dBaseSprite)val17).usesOverrideMaterial = true; ((tk2dBaseSprite)val17).HeightOffGround = -200f; ((tk2dBaseSprite)val17).IsPerpendicular = false; ((tk2dBaseSprite)val17).SortingOrder = 200; val7 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val7.mainTexture = ((BraveBehaviour)val17).renderer.material.mainTexture; ((BraveBehaviour)val17).renderer.material = val7; GameObject val18 = PrefabBuilder.BuildObject("SetTargetRalsei Bracket"); val18.layer = LayerMask.NameToLayer("FG_Critical"); val17 = val18.AddComponent(); ((tk2dBaseSprite)val17).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "priorityTarget_bracket_001"); ((tk2dBaseSprite)val17).usesOverrideMaterial = true; ((tk2dBaseSprite)val17).HeightOffGround = -200f; ((tk2dBaseSprite)val17).SortingOrder = 200; ((tk2dBaseSprite)val17).IsPerpendicular = false; val7 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val7.mainTexture = ((BraveBehaviour)val17).renderer.material.mainTexture; ((BraveBehaviour)val17).renderer.material = val7; tk2dSpriteAnimator val19 = val18.AddComponent(); val19.library = StaticSpriteCollections.ItemAndGunAnimation; val19.Library = StaticSpriteCollections.ItemAndGunAnimation; val19.playAutomatically = true; val19.DefaultClipId = StaticSpriteCollections.ItemAndGunAnimation.GetClipIdByName("targetClip"); ralseiTargetVFX.BracketPrefab = val18; EffectPrefab = ralseiTargetVFX; } public override void OnCreation(Gun gun) { gun.OnPreFireProjectileModifier = (Func)Delegate.Combine(gun.OnPreFireProjectileModifier, new Func(DetermineSlashType)); gun.OnPostFired = (Action)Delegate.Combine(gun.OnPostFired, new Action(Finish)); } public override void OnPlayerPickup(PlayerController player) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) ((GunBehaviour)this).OnPlayerPickup(player); scarfInstance = Object.Instantiate(((Component)scarfRef).gameObject).AddComponent(); scarfInstance.AttachTarget = (GameActor)(object)player; scarfInstance.ScarfMaterial = new Material(scarfRef.ScarfMaterial); scarfInstance.StartWidth = 0.075f; scarfInstance.EndWidth = 0.1f; scarfInstance.AnimationSpeed = 20f; scarfInstance.ScarfLength = 0.4f; scarfInstance.AngleLerpSpeed = 4f; scarfInstance.BackwardZOffset = -0.75f; scarfInstance.CatchUpScale = 0.99f; scarfInstance.SinSpeed = 9f; scarfInstance.AmplitudeMod = 0.135f; scarfInstance.WavelengthMod = 1.1f; scarfInstance.ScarfMaterial.SetColor("_OverrideColor", new Color(0.42f, 0.1f, 0.42f)); scarfInstance.Initialize((GameActor)(object)player); scarfInstance.AdditionalOffset = new Vector3(0f, 0.0625f); player.OnPreDodgeRoll += Player_OnPreDodgeRoll; } public void Finish(PlayerController player, Gun gun) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (SlashValue == 3) { for (int i = 1; i < 16; i++) { GameObject val = SpawnManager.SpawnProjectile(((Component)SlashSmallSlashless).gameObject, ((Component)gun.barrelOffset).transform.position, Quaternion.Euler(0f, 0f, gun.CurrentAngle + 22.5f * (float)i), true); Projectile component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.SpawnedFromOtherPlayerProjectile = true; component.Shooter = ((BraveBehaviour)base.gun.CurrentOwner).specRigidbody; component.Owner = base.gun.CurrentOwner; } } ChargeForWhirl = 0f; UpdateSlashType(0); } else { UpdateSlashType((SlashValue == 0) ? 1 : 0, isFiring: true); } } public IEnumerator ResetValues(int Value) { yield return null; UpdateSlashType(Value, isFiring: true); } public void UpdateSlashType(int Value, bool isFiring = false) { SlashValue = Value; switch (SlashValue) { case 0: if (base.gun.CurrentStrengthTier != 0) { base.gun.CurrentStrengthTier = 0; } break; case 1: if (base.gun.CurrentStrengthTier != 0) { base.gun.CurrentStrengthTier = 0; } break; case 2: base.gun.CurrentStrengthTier = 1; break; case 3: base.gun.CurrentStrengthTier = 2; break; } } private IEnumerator HandleModuleCooldown(ProjectileModule mod) { base.gun.m_moduleData[mod].onCooldown = true; float elapsed = 0f; float fireMultiplier = ((!(base.gun.m_owner is PlayerController)) ? 1f : ((PlayerController)/*isinst with value type is only supported in some contexts*/).stats.GetStatValue((StatType)1)); float cooldownTime = 0.5f * fireMultiplier; while (elapsed < cooldownTime) { elapsed += BraveTime.DeltaTime; yield return null; } if (base.gun.m_moduleData != null && base.gun.m_moduleData.ContainsKey(mod)) { base.gun.m_moduleData[mod].onCooldown = false; base.gun.m_moduleData[mod].chargeTime = 0f; base.gun.m_moduleData[mod].chargeFired = false; } } public Projectile DetermineSlashType(Gun gun, Projectile projectile, ProjectileModule projectileModule) { gun.m_isCurrentlyFiring = false; if (SlashValue == 0) { base.gun.Volley.projectiles[0].cooldownTime = 0.25f; return SlashLeft; } if (SlashValue == 1) { base.gun.Volley.projectiles[0].cooldownTime = 0.8f; return SlashRight; } if ((SlashValue == 2) | (SlashValue == 3)) { gun.ClearBurstState(); ((MonoBehaviour)gun).StartCoroutine(HandleModuleCooldown(gun.Volley.projectiles[0])); } return projectile; } private void Player_OnPreDodgeRoll(PlayerController obj) { if (SlashValue != 3) { WhipTimer = 1.25f; base.gun.ClearCooldowns(); UpdateSlashType(2); } } public override void Update() { //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01f5: 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_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) ((GunBehaviour)this).Update(); if (!((Object)(object)base.gun.CurrentOwner != (Object)null)) { return; } base.gun.PreventNormalFireAudio = true; GameActor currentOwner = base.gun.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val == null) { return; } if ((Object)(object)((GameActor)val).CurrentGun != (Object)null && (Object)(object)((GameActor)val).CurrentGun == (Object)(object)base.gun && val.m_activeActions != null && val.m_activeActions.ReloadAction != null) { if (((OneAxisInputControl)val.m_activeActions.ReloadAction).State && !base.gun.IsFiring) { ChargeForWhirl += Time.deltaTime * 1.5f; } else if (ChargeForWhirl < 1f) { ChargeForWhirl = 0f; } } if (ChargeForWhirl > 1f && SlashValue != 3) { UpdateSlashType(3); base.gun.DoChargeCompletePoof(); } else if (SlashValue == 1 && !base.gun.IsFiring) { Reset += Time.deltaTime; if (Reset > 0.5f) { UpdateSlashType(0); Reset = 0f; } } if (ChargeForWhirl > 0f) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)val).sprite.WorldCenter), Vector2.op_Implicit(((BraveBehaviour)val).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), 2.5f * Mathf.Min(1f, ChargeForWhirl) + 3f)), 1f, 0.05f, (float?)0.05f, (float?)0.5f, (Color?)(Color.green * 3f), (SparksType)2); } if (WhipTimer > 0f) { WhipTimer -= Time.deltaTime; } else if (SlashValue == 2) { UpdateSlashType(0); } if (Object.op_Implicit((Object)(object)scarfInstance)) { ((Renderer)scarfInstance.m_mr).enabled = !base.gun.m_isCurrentlyFiring; } } public override void OnDroppedByPlayer(PlayerController player) { if (Object.op_Implicit((Object)(object)scarfInstance)) { Object.Destroy((Object)(object)((Component)scarfInstance).gameObject); scarfInstance = null; } player.OnPreDodgeRoll -= Player_OnPreDodgeRoll; ((GunBehaviour)this).OnDroppedByPlayer(player); } public override void OnDestroy() { ((BraveBehaviour)this).OnDestroy(); if (Object.op_Implicit((Object)(object)base.gun.CurrentOwner)) { GameActor currentOwner = base.gun.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val != null) { val.OnPreDodgeRoll -= Player_OnPreDodgeRoll; } } if (Object.op_Implicit((Object)(object)scarfInstance)) { Object.Destroy((Object)(object)((Component)scarfInstance).gameObject); scarfInstance = null; } } } public static class SpriteOffseter { internal static void MakeOffset(this tk2dSpriteCollectionData tk2DSpriteCollectionData, tk2dSpriteDefinition def, Vector3 offset, string[] ApplyToAttachPoints = null, 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_0097: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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; } if (ApplyToAttachPoints == null) { return; } AttachPoint[] attachPoints = def.GetAttachPoints(tk2DSpriteCollectionData, tk2DSpriteCollectionData.GetSpriteIdByName(def.name)); if (attachPoints == null) { return; } AttachPoint[] array = attachPoints; foreach (AttachPoint val in array) { foreach (string text in ApplyToAttachPoints) { if (val.name == text) { val.position += offset; break; } } } } } public static class Toolbox { private static readonly HashSet adjustedDefs = new HashSet(); public static void DeregisterAttachedObject(this AIActor enemy, GameObject instance, bool completeDestruction = true) { if (Object.op_Implicit((Object)(object)instance)) { tk2dBaseSprite[] componentsInChildren = instance.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { } if (completeDestruction) { Object.Destroy((Object)(object)instance); } else { instance.transform.parent = null; } } } public static GameObject RegisterAttachedObject(this AIActor enemy, GameObject prefab, string attachPoint, float depth = 0f) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(prefab); if (!string.IsNullOrEmpty(attachPoint)) { tk2dSpriteAttachPoint orAddComponent = GameObjectExtensions.GetOrAddComponent(((Component)((BraveBehaviour)enemy).sprite).gameObject); val.transform.parent = orAddComponent.GetAttachPointByName(attachPoint); } else { val.transform.parent = ((BraveBehaviour)((BraveBehaviour)enemy).sprite).transform; } val.transform.localPosition = Vector3.zero; if ((Object)(object)val.transform.parent == (Object)null) { Debug.LogError((object)("FAILED TO FIND ATTACHPOINT " + attachPoint + " ON ENEMY")); } tk2dBaseSprite val2 = val.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val.GetComponentInChildren(); } ((BraveBehaviour)enemy).sprite.AttachRenderer(val2); tk2dBaseSprite[] componentsInChildren = val.GetComponentsInChildren(); return val; } public static Cake isCakedUp() { PlayerController[] allPlayers = GameManager.Instance.AllPlayers; foreach (PlayerController val in allPlayers) { if (val.activeItems == null) { continue; } foreach (PlayerItem activeItem in val.activeItems) { if (activeItem is Cake result) { return result; } } } return null; } public static object InvokeNotOverride(this MethodInfo methodInfo, object targetObject, params object[] arguments) { ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length == 0) { if (arguments != null && arguments.Length != 0) { throw new Exception("Arguments cont doesn't match"); } } else if (parameters.Length != arguments.Length) { throw new Exception("Arguments cont doesn't match"); } Type returnType = null; if ((object)methodInfo.ReturnType != typeof(void)) { returnType = methodInfo.ReturnType; } Type type = targetObject.GetType(); DynamicMethod dynamicMethod = new DynamicMethod("", returnType, new Type[2] { type, typeof(object) }, type); ILGenerator iLGenerator = dynamicMethod.GetILGenerator(); iLGenerator.Emit(OpCodes.Ldarg_0); for (int i = 0; i < parameters.Length; i++) { ParameterInfo parameterInfo = parameters[i]; iLGenerator.Emit(OpCodes.Ldarg_1); iLGenerator.Emit(OpCodes.Ldc_I4_S, i); iLGenerator.Emit(OpCodes.Ldelem_Ref); Type parameterType = parameterInfo.ParameterType; if (parameterType.IsPrimitive) { iLGenerator.Emit(OpCodes.Unbox_Any, parameterType); } else if ((object)parameterType != typeof(object)) { iLGenerator.Emit(OpCodes.Castclass, parameterType); } } iLGenerator.Emit(OpCodes.Call, methodInfo); iLGenerator.Emit(OpCodes.Ret); return dynamicMethod.Invoke(null, new object[2] { targetObject, arguments }); } public static VFXPool CreateQuickVFXPool(this GameObject gameObject, bool DeathPersistance = true, bool Attachment = true, VFXAlignment alignment = (VFXAlignment)1, bool Destroyable = false, bool usesZHeight = false, float ZHeight = 0f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //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_0014: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0039: 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) VFXPool val = new VFXPool(); val.type = (VFXPoolType)1; VFXComplex val2 = new VFXComplex(); VFXObject val3 = new VFXObject(); val3.attached = Attachment; val3.persistsOnDeath = DeathPersistance; val3.usesZHeight = usesZHeight; val3.zHeight = ZHeight; val3.alignment = alignment; val3.destructible = Destroyable; val3.effect = gameObject; val2.effects = (VFXObject[])(object)new VFXObject[1] { val3 }; val.effects = (VFXComplex[])(object)new VFXComplex[1] { val2 }; return val; } 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 List ConstructListOfSameValues(T value, int length) { List list = new List(); for (int i = 0; i < length; i++) { list.Add(value); } return list; } 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 RalseiCharmVFX : MonoBehaviour { private Cake CakeRef; public tk2dSprite HeartPrefab; public tk2dSprite DepletionBarInstance; public List HeartSprites = new List(); public Transform Left; public Transform Right; private int CurrentStacks = 0; private int CurrentMax = 1; private bool isLast = false; public static GameObject EffectPrefab; public void InitEffect(float amountOfHearts) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) CurrentStacks = 0; CurrentMax = Mathf.RoundToInt(amountOfHearts); PlayerController[] allPlayers = GameManager.Instance.AllPlayers; foreach (PlayerController val in allPlayers) { if (val.activeItems != null) { foreach (PlayerItem activeItem in val.activeItems) { if (activeItem is Cake cakeRef) { CakeRef = cakeRef; break; } } } if ((Object)(object)CakeRef != (Object)null) { break; } } for (float num = 0f; num < amountOfHearts; num += 1f) { float num2 = (num + 1f) / (amountOfHearts + 1f); tk2dBaseSprite component = ((Component)Object.Instantiate(HeartPrefab, ((Component)this).transform)).GetComponent(); HeartSprites.Add(component); ((BraveBehaviour)component).transform.position = Vector3.Lerp(Left.position, Right.position, num2); } } public void OnAmountChanged(int NewAmount, int MaxStacks) { CurrentMax = MaxStacks; CurrentStacks = NewAmount; HeartSprites.RemoveAll((tk2dBaseSprite self) => (Object)(object)self == (Object)null); if (HeartSprites.Count == 0 || NewAmount == MaxStacks) { return; } for (int num = 0; num < MaxStacks; num++) { if (NewAmount > num) { HeartSprites[num].SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_heart_002"); } else { HeartSprites[num].SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_heart_001"); } } } public void UpdateBar(float Value) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0195: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)DepletionBarInstance)) { ((tk2dBaseSprite)DepletionBarInstance).color = GetColor(Value); ((tk2dBaseSprite)DepletionBarInstance).scale = new Vector3(Value, 1f, 1f); } if (Object.op_Implicit((Object)(object)CakeRef)) { if (CurrentMax == CurrentStacks) { if (!isLast && CakeRef.StoredHearts >= CurrentMax) { foreach (tk2dBaseSprite heartSprite in HeartSprites) { heartSprite.SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_heart_003"); } isLast = true; } } else if (isLast) { OnAmountChanged(CurrentStacks, CurrentMax); isLast = false; } } float num = HeartSprites.Count; for (float num2 = 0f; num2 < num; num2 += 1f) { float num3 = num2 / num; if (Object.op_Implicit((Object)(object)HeartSprites[(int)num2])) { Transform transform = ((BraveBehaviour)HeartSprites[(int)num2]).transform; transform.localPosition = new Vector3(transform.localPosition.x, 0.5f + Easing.DoLerpT(Mathf.PingPong(Time.timeSinceLevelLoad + num3, 1f) - 0.5f) * 0.333f); } } } public Color GetColor(float value) { //IL_0010: 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_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_0023: Unknown result type (might be due to invalid IL or missing references) return Color.Lerp(new Color(0.5f, 0.12f, 0.5f), Color.white, value); } public static void InitializeEffect() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabBuilder.BuildObject("CharmEffectRalsei"); RalseiCharmVFX ralseiCharmVFX = val.AddComponent(); Object.DontDestroyOnLoad((Object)(object)val); val.layer = LayerMask.NameToLayer("FG_Critical"); tk2dSprite val2 = val.AddComponent(); ((tk2dBaseSprite)val2).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_bar_001"); ralseiCharmVFX.DepletionBarInstance = val2; ((tk2dBaseSprite)val2).HeightOffGround = -10f; ((tk2dBaseSprite)val2).usesOverrideMaterial = true; Material val3 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val3.mainTexture = ((BraveBehaviour)val2).renderer.material.mainTexture; ((BraveBehaviour)val2).renderer.material = val3; GameObject val4 = PrefabBuilder.BuildObject("HeartRalsei"); val2 = val4.AddComponent(); ((tk2dBaseSprite)val2).SetSprite(StaticSpriteCollections.ItemAndGunCollection, "ralsei_charm_heart_001"); ralseiCharmVFX.HeartPrefab = val2; ((tk2dBaseSprite)val2).HeightOffGround = -10f; ((tk2dBaseSprite)val2).usesOverrideMaterial = true; val3 = new Material(Shader.Find("tk2d/CutoutVertexColorTilted")); val3.mainTexture = ((BraveBehaviour)val2).renderer.material.mainTexture; ((BraveBehaviour)val2).renderer.material = val3; val4.layer = LayerMask.NameToLayer("FG_Critical"); GameObject val5 = PrefabBuilder.BuildObject("[Left]"); GameObject val6 = PrefabBuilder.BuildObject("[Right]"); val5.transform.SetParent(val.transform); val6.transform.SetParent(val.transform); val5.transform.localPosition = new Vector3(-1.125f, 0.5f); val6.transform.localPosition = new Vector3(1.125f, 0.5f); ralseiCharmVFX.Left = val5.transform; ralseiCharmVFX.Right = val6.transform; EffectPrefab = val; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("somebunny.etg.ralsei", "== Ralsei! ==", "1.0.4")] public class RalseiModule : BaseUnityPlugin { public const string GUID = "somebunny.etg.ralsei"; public const string NAME = "== Ralsei! =="; public const string VERSION = "1.0.4"; public const string TEXT_COLOR = "#6aff13"; public static AssetBundle assetBundle; public static PlayableCharacters Ralsei; public void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) new Harmony("somebunny.etg.ralsei").PatchAll(); string filePath = ETGMod.FolderPath((BaseUnityPlugin)(object)this); assetBundle = AssetBundleLoader.LoadAssetBundleFromLiterallyAnywhere(filePath, "ralseibundle"); AudioResourceLoader.loadFromAssembly("RalseiBank.bnk", "RalseiMod"); ETGModMainBehaviour.WaitForGameManagerStart((Action)GMStart); } public void GMStart(GameManager g) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00d2: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0227: 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) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Expected O, but got Unknown //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Expected O, but got Unknown StaticSpriteCollections.Init(); ParticleBase.InitParticleBase(); ScarfWeapon.Add(); Cake.Init(); RalseiCharmVFX.InitializeEffect(); Ralsei = ETGModCompatibility.ExtendEnum("somebunny.etg.ralsei", "Ralsei"); CustomCharacterData val = Loader.BuildCharacterBundle("Ralsei/RalseiData", StaticSpriteCollections.RalseiCharacterCollection, StaticSpriteCollections.RalseiCharacterAnimation, StaticSpriteCollections.RalseiCharacterCollection, StaticSpriteCollections.RalseiCharacterAnimation, "somebunny.etg.ralsei", new Vector3(27.4f, 24.5f), false, new Vector3(27.4f, 24.5f), true, false, false, 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, "", assetBundle.LoadAsset("ralseibosscard_001")); val.animator.defaultClipId = 27; CharacterSelectIdleDoer idleDoer = val.idleDoer; idleDoer.idleMax = 20f; idleDoer.idleMin = 4f; List idsModified = new List(); val.animator.GetClipByName("chest_recover").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("death").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("death_shot").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("run_down").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("run_right").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("run_right_bw").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("run_up").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("doorway").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("dodge").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("dodge_bw").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("dodge_left").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("dodge_left_bw").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("ghost_sneeze_left").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("ghost_sneeze_right").ApplyOffsetToAnimation(new Vector2(-0.25f, 0f), idsModified); val.animator.GetClipByName("spit_out").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("pet").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("item_get").ApplyOffsetToAnimation(new Vector2(-0.125f, 0f), idsModified); val.animator.GetClipByName("select_startsparkles").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("select_loopsparkles").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("select_endsparkles").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("select_startwrite").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("select_loopwrite").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); val.animator.GetClipByName("select_endwrite").ApplyOffsetToAnimation(new Vector2(-0.0625f, 0f), idsModified); idleDoer.phases = (CharacterSelectIdlePhase[])(object)new CharacterSelectIdlePhase[2] { new CharacterSelectIdlePhase { inAnimation = "select_startsparkles", holdAnimation = "select_loopsparkles", outAnimation = "select_endsparkles", holdMin = 5f, holdMax = 7f }, new CharacterSelectIdlePhase { inAnimation = "select_startwrite", holdAnimation = "select_loopwrite", outAnimation = "select_endwrite", optionalHoldIdleAnimation = "select_loopwait", optionalHoldChance = 0.7f, holdMin = 12f, holdMax = 16f } }; Log("== Ralsei! == v1.0.4 started successfully.", "#6aff13"); } public static void Log(string text, string color = "#FFFFFF") { ETGModConsole.Log((object)("" + text + ""), false); } } public class StaticSpriteCollections { public static tk2dSpriteCollectionData RalseiCharacterCollection; public static tk2dSpriteAnimation RalseiCharacterAnimation; public static tk2dSpriteCollectionData ItemAndGunCollection; public static tk2dSpriteAnimation ItemAndGunAnimation; public static tk2dSpriteCollectionData ProjectileCollection; public static tk2dSpriteAnimation ProjectileAnimation; public static void Init() { RalseiCharacterCollection = RalseiModule.assetBundle.LoadAsset("RalseiCollection").GetComponent(); RalseiCharacterAnimation = RalseiModule.assetBundle.LoadAsset("RalseiAnimation").GetComponent(); ItemAndGunCollection = RalseiModule.assetBundle.LoadAsset("ItemCollection").GetComponent(); ItemAndGunAnimation = RalseiModule.assetBundle.LoadAsset("ItemAnimation").GetComponent(); ProjectileCollection = RalseiModule.assetBundle.LoadAsset("ProjectileCollection").GetComponent(); ProjectileAnimation = RalseiModule.assetBundle.LoadAsset("ProjectileAnimation").GetComponent(); } } } namespace Ralsei.Code { internal class AssetBundleLoader { public static AssetBundle LoadAssetBundleFromLiterallyAnywhere(string FilePath, string name, bool logs = false) { AssetBundle result = null; string text = name + GetPlatformBundleExtension(); if (File.Exists(FilePath + "/" + text)) { try { result = AssetBundle.LoadFromFile(Path.Combine(FilePath, 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 CharmedBowModifier : BraveBehaviour { private Gun GunRef; private bool LastSynergyState = false; public string SynergyName = "Heart Maker"; public void Start() { GunRef = ((Component)this).GetComponent(); } public void Update() { if (!Object.op_Implicit((Object)(object)GunRef) || !Object.op_Implicit((Object)(object)GunRef.CurrentOwner)) { return; } GameActor currentOwner = GunRef.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val != null) { bool flag = CustomSynergies.PlayerHasActiveSynergy(val, SynergyName); if (LastSynergyState != flag) { LastSynergyState = CustomSynergies.PlayerHasActiveSynergy(val, SynergyName); ToggleSynergy(LastSynergyState); } } } public void ToggleSynergy(bool Value) { if (Value) { Gun gunRef = GunRef; gunRef.PostProcessProjectile = (Action)Delegate.Combine(gunRef.PostProcessProjectile, new Action(PPP)); } else { Gun gunRef2 = GunRef; gunRef2.PostProcessProjectile = (Action)Delegate.Remove(gunRef2.PostProcessProjectile, new Action(PPP)); } } public void PPP(Projectile projectile) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (Random.value > 0.5f) { projectile.statusEffectsToApply = projectile.statusEffectsToApply ?? new List(); projectile.statusEffectsToApply.Add((GameActorEffect)(object)new RalseiCharmable { StackAmountToApply = 3 }); ProjectileData baseData = projectile.baseData; baseData.speed *= 1.5f; projectile.UpdateSpeed(); ImprovedAfterImage val = ((Component)projectile).gameObject.AddComponent(); val.shadowLifetime = 0.3f; val.shadowTimeDelay = 0.05f; val.spawnShadows = true; val.dashColor = new Color(1f, 0.5f, 0.8f, 1f); } } } public class LuteSwitch : MonoBehaviour { public Gun LuteRef; private bool LastSynergyState = false; private string SwitchGroupOld; public void Start() { LuteRef = ((Component)this).GetComponent(); SwitchGroupOld = LuteRef.gunSwitchGroup; } public void Update() { if (Object.op_Implicit((Object)(object)LuteRef) && Object.op_Implicit((Object)(object)LuteRef.CurrentOwner)) { GameActor currentOwner = LuteRef.CurrentOwner; PlayerController val = (PlayerController)(object)((currentOwner is PlayerController) ? currentOwner : null); if (val != null && LastSynergyState != CustomSynergies.PlayerHasActiveSynergy(val, "Memories Of Home")) { LastSynergyState = CustomSynergies.PlayerHasActiveSynergy(val, "Memories Of Home"); ToggleSynergy(LastSynergyState); } } } public void ToggleSynergy(bool Value) { if (Value) { LuteRef.gunSwitchGroup = "rlsi:newspeciallute"; } else { LuteRef.gunSwitchGroup = SwitchGroupOld; } } } public class RalseiCharmable : GameActorEffect { public static string[] InvalidEnemyGuids = new string[14] { EnemyGUIDs.Advanced_Dragun_Knife_GUID, EnemyGUIDs.Draguns_Knife_GUID, EnemyGUIDs.Spent_GUID, EnemyGUIDs.Chance_Kin_GUID, EnemyGUIDs.Key_Bullet_Kin_GUID, EnemyGUIDs.Mountain_Cube_GUID, EnemyGUIDs.Lead_Cube_GUID, EnemyGUIDs.Flesh_Cube_GUID, EnemyGUIDs.Grip_Master_GUID, EnemyGUIDs.Tarnisher_GUID, EnemyGUIDs.Gunreaper_GUID, EnemyGUIDs.Fuselier_GUID, EnemyGUIDs.Blockners_Ghost_GUID, EnemyGUIDs.Shadow_Magician_GUID }; public static Dictionary AdditionalHealthCostModifiers = new Dictionary { { EnemyGUIDs.Ammomancer_GUID, new Vector2(1f, 1f) }, { EnemyGUIDs.Jammomancer_GUID, new Vector2(1f, 1.25f) }, { EnemyGUIDs.Jamerlengo_GUID, new Vector2(1f, 1.25f) }, { EnemyGUIDs.Gunsinger_GUID, new Vector2(0f, 1.5f) }, { EnemyGUIDs.Aged_Gunsinger_GUID, new Vector2(0f, 1.5f) }, { EnemyGUIDs.Spogre_GUID, new Vector2(1f, 1f) }, { EnemyGUIDs.Misfire_Beast_GUID, new Vector2(2f, 1.1f) }, { EnemyGUIDs.Bombshee_GUID, new Vector2(1f, 1.1f) } }; public static List InvalidSpecificEnemies = new List(); public int currentStackAmount = 1; public int MaxStacks = 3; public int StackAmountToApply = 1; private RalseiCharmVFX extantOverheadder; private GameActor Enemy; private CrazedController CrazedController; public float DegradeMult = 5f; private float DegradePrevention = 0f; public float HeartDrop = 1f; public RalseiCharmable() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) base.AppliesTint = false; base.AppliesDeathTint = false; base.AffectsPlayers = false; base.AffectsEnemies = true; base.stackMode = (EffectStackingMode)3; base.effectIdentifier = "ralsei:charmablestacking"; currentStackAmount = 1; base.duration = 10000f; StackAmountToApply = 1; } public override void OnEffectApplied(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) CrazedController = ((Component)actor).gameObject.GetComponent(); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 1f); if (((Object)(object)CrazedController != (Object)null && (int)CrazedController.m_state > 0) || (Object)(object)((Component)actor).gameObject.GetComponent() != (Object)null || (Object)(object)((Component)actor).gameObject.GetComponent() != (Object)null) { return; } AIActor val2 = (AIActor)(object)((actor is AIActor) ? actor : null); if (val2 != null) { if (InvalidSpecificEnemies.Contains(val2)) { return; } if (InvalidEnemyGuids.Contains(val2.EnemyGuid)) { ((GameActorEffect)this).OnEffectRemoved(actor, effectData); return; } if (AdditionalHealthCostModifiers.ContainsKey(val2.EnemyGuid)) { val = AdditionalHealthCostModifiers[val2.EnemyGuid]; } if (AlexandriaTags.HasTag(val2, "Ralsei:Uncharmable")) { return; } } HeartDrop = 1f; MaxStacks = Mathf.RoundToInt(Mathf.Sqrt(((BraveBehaviour)actor).healthHaver.GetMaxHealth() * val.y / 2.5f) + (1f + val.x)); MaxStacks = Mathf.Min(16, MaxStacks); currentStackAmount = Mathf.Min(StackAmountToApply, MaxStacks); extantOverheadder = actor.SmartPlayEffectOnActor(RalseiCharmVFX.EffectPrefab.gameObject, new Vector3(0f, 1f)).GetComponent(); extantOverheadder.InitEffect(MaxStacks); extantOverheadder.OnAmountChanged(currentStackAmount, MaxStacks); ((GameActorEffect)this).OnEffectApplied(actor, effectData, partialAmount); Enemy = actor; ((BraveBehaviour)actor).healthHaver.OnPreDeath += HealthHaver_OnPreDeath; float num = Mathf.Sqrt(((BraveBehaviour)actor).healthHaver.GetMaxHealth()) * 0.3f; DegradeMult = Mathf.Max(1.5f, DegradeMult - num); } private void HealthHaver_OnPreDeath(Vector2 obj) { Object.Destroy((Object)(object)((Component)extantOverheadder).gameObject); currentStackAmount = 0; ((BraveBehaviour)Enemy).healthHaver.OnPreDeath -= HealthHaver_OnPreDeath; Enemy.RemoveEffect(base.effectIdentifier); } public override void EffectTick(GameActor actor, RuntimeGameActorEffectData effectData) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Invalid comparison between Unknown and I4 Vector2 val = Vector3Extensions.XY(((BraveBehaviour)actor).transform.position); if (Object.op_Implicit((Object)(object)((BraveBehaviour)actor).specRigidbody) && ((BraveBehaviour)actor).specRigidbody.HitboxPixelCollider != null) { val = dfVectorExtensions.Quantize(((BraveBehaviour)actor).specRigidbody.HitboxPixelCollider.UnitTopCenter, 0.0625f); } if (Object.op_Implicit((Object)(object)extantOverheadder)) { extantOverheadder.UpdateBar(HeartDrop); } if (HeartDrop > 0f) { if (DegradePrevention > 0f) { DegradePrevention -= Time.deltaTime; } else { HeartDrop -= ((currentStackAmount == MaxStacks) ? (Time.deltaTime / (DegradeMult * 1.5f)) : (Time.deltaTime / DegradeMult)); } } else { currentStackAmount = Mathf.Max(0, currentStackAmount - (MaxStacks - 1)); HeartDrop = 1f; extantOverheadder.OnAmountChanged(currentStackAmount, MaxStacks); if (currentStackAmount == 0) { ((GameActorEffect)this).OnEffectRemoved(actor, effectData); } } if ((Object)(object)CrazedController != (Object)null && (int)CrazedController.m_state > 0) { ((GameActorEffect)this).OnEffectRemoved(actor, effectData); } ((GameActorEffect)this).EffectTick(actor, effectData); } public override bool IsFinished(GameActor actor, RuntimeGameActorEffectData effectData, float elapsedTime) { return (Object)(object)extantOverheadder == (Object)null; } public override void OnEffectRemoved(GameActor actor, RuntimeGameActorEffectData effectData) { if (Object.op_Implicit((Object)(object)extantOverheadder)) { Object.Destroy((Object)(object)((Component)extantOverheadder).gameObject); } currentStackAmount = 0; if (Object.op_Implicit((Object)(object)Enemy)) { ((BraveBehaviour)Enemy).healthHaver.OnPreDeath -= HealthHaver_OnPreDeath; } ((GameActorEffect)this).OnEffectRemoved(actor, effectData); } public override void OnDarkSoulsAccumulate(GameActor actor, RuntimeGameActorEffectData effectData, float partialAmount = 1f, Projectile sourceProjectile = null) { for (int i = 0; i < actor.m_activeEffects.Count; i++) { if (actor.m_activeEffects[i].effectIdentifier == base.effectIdentifier && actor.m_activeEffects[i] is RalseiCharmable ralseiCharmable) { ralseiCharmable.AddStackLayer(actor); } } ((GameActorEffect)this).OnDarkSoulsAccumulate(actor, effectData, partialAmount, sourceProjectile); } public void AddStackLayer(GameActor actor) { bool flag = currentStackAmount != MaxStacks; currentStackAmount = Mathf.Min(currentStackAmount + StackAmountToApply, MaxStacks); if (currentStackAmount == MaxStacks && flag) { HeartDrop = 0.6f; if (Object.op_Implicit((Object)(object)Enemy)) { ((BraveBehaviour)Enemy).behaviorSpeculator.Stun(1f, true); ((MonoBehaviour)Enemy).StartCoroutine(owo()); } } if (currentStackAmount > MaxStacks - 2) { } DegradePrevention = 0.5f; HeartDrop = Mathf.Min(HeartDrop * 1.1f + 0.025f, 1f); extantOverheadder?.OnAmountChanged(currentStackAmount, MaxStacks); } public IEnumerator owo() { yield return (object)new WaitForSeconds(0.5f); AkSoundEngine.PostEvent("Play_NPC_Blessing_Synergy_Get_01", ((Component)Enemy).gameObject); for (int i = 0; i < 3; i++) { if ((Object)(object)Enemy == (Object)null) { break; } for (int a = 0; a < 16; a++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)Enemy).sprite.WorldCenter), Vector2.op_Implicit(((BraveBehaviour)Enemy).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(BraveUtility.RandomAngle(), 5f + 1.5f * (float)i)), 1f, 0.05f, (float?)0.1f, (float?)1f, (Color?)(Color.white * 3f), (SparksType)2); } yield return (object)new WaitForSeconds(0.1666f); } } } } namespace Ralsei.Code.VFX { public class RalseiTargetVFX : MonoBehaviour { public GameObject BracketPrefab; public GameObject[] BracketInst; public AIActor TargetInst; private Vector2 Size; public void Start() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)TargetInst)) { for (int i = 0; i < 24; i++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter), Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(15 * i, 2f)), 1f, 0.05f, (float?)0.1f, (float?)1f, (Color?)(Color.white * 3f), (SparksType)2); } PixelCollider hitboxPixelCollider = ((BraveBehaviour)TargetInst).specRigidbody.HitboxPixelCollider; Size = new Vector2(0f - (float)hitboxPixelCollider.Width / 32f, (float)hitboxPixelCollider.Height / 32f); ((Component)this).transform.position = Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter - new Vector2(0.125f, Size.y + 0.375f)); BracketInst = (GameObject[])(object)new GameObject[2]; GameObject val = Object.Instantiate(BracketPrefab, ((Component)this).transform); val.transform.position = Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter + new Vector2(Size.x, Size.y) + new Vector2(0f, 0.125f)); BracketInst[0] = val; GameObject val2 = Object.Instantiate(BracketPrefab, ((Component)this).transform); val2.transform.position = Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter - new Vector2(Size.x, Size.y) + new Vector2(0f, 0.125f)); val2.transform.localRotation = Quaternion.Euler(0f, 0f, 180f); BracketInst[1] = val2; } } public void Update() { //IL_0025: 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_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_0078: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)TargetInst)) { ((Component)this).transform.position = Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter - new Vector2(0f, Size.y + 0.375f)); GameObject val = BracketInst[0]; GameObject val2 = BracketInst[1]; val.transform.position = Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter + new Vector2(Size.x, Size.y) + new Vector2(0f, 0.125f)); val.transform.position = Vector3Extensions.WithZ(val.transform.position, 100f); val2.transform.position = Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter - new Vector2(Size.x, Size.y) + new Vector2(0f, 0.125f)); val2.transform.position = Vector3Extensions.WithZ(val2.transform.position, 100f); } if (ScarfWeapon.RalseiSlash.Cooldown > 0f) { ScarfWeapon.RalseiSlash.Cooldown -= Time.deltaTime; } } public void OnDestroy() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) ScarfWeapon.RalseiSlash.Cooldown = -1f; for (int i = 0; i < 24; i++) { GlobalSparksDoer.DoRandomParticleBurst(1, Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter), Vector2.op_Implicit(((BraveBehaviour)TargetInst).sprite.WorldCenter), Vector2.op_Implicit(Toolbox.GetUnitOnCircle(15 * i, 5f)), 1f, 0.05f, (float?)0.1f, (float?)0.35f, (Color?)(Color.white * 3f), (SparksType)2); } } } }