using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using DM; using FhpSLib; using HarmonyLib; using Landfall.TABS; using Landfall.TABS.AI.Components.Modifiers; using Landfall.TABS.GameState; using Landfall.TABS.UnitEditor; using RandomUnits; using RandomUnitsCustomScripts; using RandomUnitsUtilities; using SLMA; using TFBGames; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("RandomUnits")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("RandomUnits")] [assembly: AssemblyProduct("RandomUnits")] [assembly: AssemblyCopyright("Copyright © Laiftime")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7acfaef0-7669-4401-8bff-5a9a02e18c75")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.4.0")] [module: UnverifiableCode] namespace RandomUnits { public static class UManager { private static string comment; public static AssetBundle bundle; public static void SetBlueprint(UnitBlueprint unit, LandfallContentDatabase db) { //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_01e4: 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_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Expected O, but got Unknown //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_05a6: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: Expected O, but got Unknown //IL_05c7: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Expected O, but got Unknown //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Expected O, but got Unknown //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0638: Unknown result type (might be due to invalid IL or missing references) //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Expected O, but got Unknown //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0832: Expected O, but got Unknown //IL_084d: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Expected O, but got Unknown //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_0a8b: Unknown result type (might be due to invalid IL or missing references) //IL_0a91: Expected O, but got Unknown //IL_0aac: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Expected O, but got Unknown //IL_0ac0: Unknown result type (might be due to invalid IL or missing references) //IL_0ac6: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Unknown result type (might be due to invalid IL or missing references) //IL_0c96: Expected O, but got Unknown //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) //IL_0cb7: Expected O, but got Unknown //IL_0cc5: Unknown result type (might be due to invalid IL or missing references) //IL_0ccb: Unknown result type (might be due to invalid IL or missing references) if (unit.Entity.Name == "Arsenico") { SLMATool.UnitCost(unit, 10000); unit.Entity.SetUnlockKey("SECRET_ARSENICO"); unit.UnitBase = UPool.MyPool.GetObject("Arsenico_Base"); s.SetField(unit, "VocalRef", (object)"Ancient Attack Vocals/Archer_Snake"); s.SetField(unit, "DeathRef", (object)"Ancient Death Vocals/Archer_Snake"); s.SetField(unit, "footRef", (object)"Footsteps/Big"); s.SetField(unit, "VoicePitch", (object)0.6f); unit.health = 7500f; unit.minSizeRandom = 1f; unit.maxSizeRandom = 1f; unit.sizeMultiplier = 1f; unit.massMultiplier = 10f; unit.balanceMultiplier = 1f; unit.animationMultiplier = 1f; unit.balanceForceMultiplier = 1f; unit.movementSpeedMuiltiplier = 1.5f; unit.holdinigWithTwoHands = true; unit.RightWeapon = UPool.MyPool.GetObject("Hiveflail"); unit.m_props = (GameObject[])(object)new GameObject[5] { UPool.MyPool.GetObject("ArsenicHatchlingThing"), UPool.MyPool.GetObject("LeatherWeatheredClothing"), UPool.MyPool.GetObject("LeatherWeatheredHood"), UPool.MyPool.GetObject("ClothWrapArmor"), UPool.MyPool.GetObject("ArsenicoSkinCovers") }; unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[4] { (GameObject)SLMALoader.SDic["moves"]["Small_Hover"], UPool.MyPool.GetObject("Move_CondensedSpewspit"), UPool.MyPool.GetObject("Move_DispersingDodge"), UPool.MyPool.GetObject("Move_RadioactiveToxicity") }; unit.MovementComponents = new List { (IMovementComponent)(object)default(KeepPreferredDistance) }; } if (unit.Entity.Name == "NYAN-CHAN-UNIT") { SLMATool.UnitCost(unit, 10000); unit.Entity.SetUnlockKey("SECRET_NYANCHAN"); unit.UnitBase = UPool.MyPool.GetObject("NyanChan_UnitBase"); s.SetField(unit, "VocalRef", (object)"Fantasy Dark Attack Vocals/EvilTank"); s.SetField(unit, "DeathRef", (object)"Fantasy Dark Death Vocals/EvilTank"); s.SetField(unit, "footRef", (object)"Footsteps/Small"); s.SetField(unit, "VoicePitch", (object)1.6f); unit.health = 4000f; unit.minSizeRandom = 1f; unit.maxSizeRandom = 1f; unit.sizeMultiplier = 1f; unit.massMultiplier = 0.8f; unit.balanceMultiplier = 1f; unit.animationMultiplier = 1f; unit.balanceForceMultiplier = 1f; unit.movementSpeedMuiltiplier = 1f; unit.LeftWeapon = UPool.MyPool.GetObject("CwiticalCattack"); unit.RightWeapon = UPool.MyPool.GetObject("CwiticalCattack"); unit.m_props = (GameObject[])(object)new GameObject[4] { UPool.MyPool.GetObject("NyanChanHair"), UPool.MyPool.GetObject("NyanHeadCatMonitor"), UPool.MyPool.GetObject("NyanChanSuitArmor"), UPool.MyPool.GetObject("NyanChanCatTail") }; unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5] { UPool.MyPool.GetObject("Move_PurrfectPawwages"), UPool.MyPool.GetObject("Move_Meowrsenal"), UPool.MyPool.GetObject("Move_Zoomies"), UPool.MyPool.GetObject("Move_Woomies"), (GameObject)SLMALoader.SDic["moves"]["Small_Hover"] }; unit.MovementComponents = new List { (IMovementComponent)(object)default(NeverStopRunning) }; } comment = "Eliyah"; if (unit.Entity.Name == "Gore Guild") { SLMATool.UnitCost(unit, 10000); unit.Entity.SetUnlockKey("SECRET_GOREGUILD"); unit.UnitBase = UPool.MyPool.GetObject("Eliyah_UnitBase"); s.SetField(unit, "VocalRef", (object)"Fantasy Dark Attack Vocals/DarkKingTransformed"); s.SetField(unit, "DeathRef", (object)"Fantasy Dark Death Vocals/DarkKingTransformed"); s.SetField(unit, "footRef", (object)"Footsteps/Minotaur"); s.SetField(unit, "VoicePitch", (object)0.6f); unit.health = 7500f; unit.minSizeRandom = 1f; unit.maxSizeRandom = 1f; unit.sizeMultiplier = 1f; unit.massMultiplier = 10f; unit.balanceMultiplier = 1f; unit.animationMultiplier = 1f; unit.balanceForceMultiplier = 1f; unit.movementSpeedMuiltiplier = 1f; unit.holdinigWithTwoHands = true; unit.RightWeapon = UPool.MyPool.GetObject("LumberjackChainsaw"); unit.m_props = (GameObject[])(object)new GameObject[5] { UPool.MyPool.GetObject("LumberjackUniform"), UPool.MyPool.GetObject("LumberjackHair"), UPool.MyPool.GetObject("LumberjackBeard"), UPool.MyPool.GetObject("LumberjackBoots"), UPool.MyPool.GetObject("LumberjackPant") }; unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[6] { (GameObject)SLMALoader.SDic["moves"]["Small_Hover"], (GameObject)SLMALoader.SDic["moves"]["SpinSlashKhopesh"], (GameObject)SLMALoader.SDic["moves"]["Fencer_Dodge"], UPool.MyPool.GetObject("Move_Teardown"), UPool.MyPool.GetObject("Move_Breakthrough"), UPool.MyPool.GetObject("Move_SpawnBunyunCompanion") }; unit.MovementComponents = new List { (IMovementComponent)(object)default(NeverStopRunning) }; } if (unit.Entity.Name == "Bunyun16") { unit.UnitBase = UPool.MyPool.GetObject("Bunyun16_UnitBase"); s.SetField(unit, "VocalRef", (object)"Fantasy Dark Attack Vocals/EvilTank"); s.SetField(unit, "DeathRef", (object)"Fantasy Dark Death Vocals/EvilTank"); s.SetField(unit, "footRef", (object)"Footsteps/Small"); s.SetField(unit, "VoicePitch", (object)0.6f); unit.health = 5500f; unit.minSizeRandom = 1f; unit.maxSizeRandom = 1f; unit.sizeMultiplier = 1f; unit.massMultiplier = 0.8f; unit.balanceMultiplier = 1f; unit.animationMultiplier = 1f; unit.balanceForceMultiplier = 1f; unit.movementSpeedMuiltiplier = 1f; unit.LeftWeapon = UPool.MyPool.GetObject("PaleriteBlade"); unit.RightWeapon = UPool.MyPool.GetObject("PaleriteBlade"); unit.m_props = (GameObject[])(object)new GameObject[8] { UPool.MyPool.GetObject("BunyunHair"), UPool.MyPool.GetObject("VilepaleAgentBoots"), UPool.MyPool.GetObject("VilepaleAgentGlove"), UPool.MyPool.GetObject("VilepaleAgentHeadband"), UPool.MyPool.GetObject("VilepaleAgentPant"), UPool.MyPool.GetObject("VilepaleAgentShortSkirt"), UPool.MyPool.GetObject("VilepaleAgentShoulderpads"), UPool.MyPool.GetObject("VilepaleAgentUniform") }; unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5] { (GameObject)SLMALoader.SDic["moves"]["Small_Hover"], (GameObject)SLMALoader.SDic["moves"]["Boxer_Dodge"], (GameObject)SLMALoader.SDic["moves"]["SwordArtParry_Piratequeen"], UPool.MyPool.GetObject("Move_Teardown"), UPool.MyPool.GetObject("Move_Infiltrate") }; unit.MovementComponents = new List { (IMovementComponent)(object)default(NeverStopRunning) }; } if (unit.Entity.Name == "Johnny Dawnedson") { SLMATool.UnitCost(unit, 10000); unit.Entity.SetUnlockKey("SECRET_JOHNNYDAWNEDSON"); unit.UnitBase = UPool.MyPool.GetObject("JohnnyDawnedsonUnitBase"); s.SetField(unit, "VocalRef", (object)"Halloween Attack Vocals/Reaper"); s.SetField(unit, "DeathRef", (object)"Halloween Death Vocals/Reaper"); s.SetField(unit, "footRef", (object)"Footsteps/Mammoth"); s.SetField(unit, "VoicePitch", (object)0.5f); unit.health = 40000f; unit.minSizeRandom = 1f; unit.maxSizeRandom = 1f; unit.sizeMultiplier = 1f; unit.massMultiplier = 1000f; unit.balanceMultiplier = 1f; unit.animationMultiplier = 1.2f; unit.balanceForceMultiplier = 1f; unit.movementSpeedMuiltiplier = 0.5f; unit.LeftWeapon = UPool.MyPool.GetObject("BindingJaggedCombatKnife"); unit.RightWeapon = UPool.MyPool.GetObject("BindingJaggedCombatKnife"); unit.m_props = (GameObject[])(object)new GameObject[7] { UPool.MyPool.GetObject("CustomizableShadingProp"), UPool.MyPool.GetObject("DarkShadowCovers"), UPool.MyPool.GetObject("WickedSmile"), UPool.MyPool.GetObject("BigPastorGown"), UPool.MyPool.GetObject("JohnnyDawnedsonHair"), UPool.MyPool.GetObject("MuscularBodyBoots"), UPool.MyPool.GetObject("MuscularBodyPartsTights") }; unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[4] { UPool.MyPool.GetObject("Move_TemperedDawn"), UPool.MyPool.GetObject("Move_Restriction"), (GameObject)SLMALoader.SDic["moves"]["Small_Hover"], (GameObject)SLMALoader.SDic["moves"]["SwordArtParry_Piratequeen"] }; unit.MovementComponents = new List { (IMovementComponent)(object)default(NeverStopRunning) }; } if (unit.Entity.Name == "Omni-Man") { SLMATool.UnitCost(unit, 10000); unit.Entity.SetUnlockKey("SECRET_OMNIMAN"); unit.UnitBase = UPool.MyPool.GetObject("SlightMuscularUnitBase"); s.SetField(unit, "VocalRef", (object)"Medieval Attack Vocals/TheKing"); s.SetField(unit, "DeathRef", (object)"Medieval Death Vocals/TheKing"); s.SetField(unit, "footRef", (object)"Footsteps/Big"); s.SetField(unit, "VoicePitch", (object)0.6f); unit.health = 80000f; unit.minSizeRandom = 1f; unit.maxSizeRandom = 1f; unit.sizeMultiplier = 1f; unit.massMultiplier = 10f; unit.balanceMultiplier = 1f; unit.animationMultiplier = 1f; unit.balanceForceMultiplier = 1f; unit.movementSpeedMuiltiplier = 5f; unit.LeftWeapon = UPool.MyPool.GetObject("SupersonicFist"); unit.RightWeapon = UPool.MyPool.GetObject("SupersonicFist"); unit.m_props = (GameObject[])(object)new GameObject[3] { UPool.MyPool.GetObject("OmniSuit"), UPool.MyPool.GetObject("OmniTight"), UPool.MyPool.GetObject("NolanHairAndMoustache") }; unit.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5] { UPool.MyPool.GetObject("Move_AirborneUppercut"), UPool.MyPool.GetObject("Move_KnockoutPunch"), UPool.MyPool.GetObject("Move_DynamicFlight"), (GameObject)SLMALoader.SDic["moves"]["Hover"], (GameObject)SLMALoader.SDic["moves"]["Hover"] }; unit.MovementComponents = new List { (IMovementComponent)(object)default(NeverStopRunning) }; } } public static void SetClothes(GameObject cloth, CharacterItem item, PropItemData data, LandfallContentDatabase db) { if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("CustomizableShadingProp")) { cloth.AddComponent(); } if ((Object)(object)cloth == (Object)(object)UPool.MyPool.GetObject("WickedSmile")) { cloth.AddComponent(); } } public static void SetMoves(GameObject move, LandfallContentDatabase db) { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_PurrfectPawwages")) { move.AddComponent(); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Zoomies")) { move.AddComponent().particles = UTI.Uti.LoBuGaOb("ZoomiesParticle"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Woomies")) { move.AddComponent().particle = UTI.Uti.LoBuGaOb("WoomiesParticle"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_BeegServalStretch")) { move.AddComponent(); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Teardown")) { move.AddComponent().indicationObject = UTI.Uti.LoBuGaOb("BloodSplotchVFX"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Infiltrate")) { move.AddComponent(); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_SpawnBunyunCompanion")) { move.AddComponent().unitBlueprint = (UnitBlueprint)SLMATool.SLMADic["Bunyun16"]; } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_CondensedSpewspit")) { move.GetComponentInChildren().objectToSpawn = UPool.MyPool.GetObject("P_CondensedSpewspit"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_RadioactiveToxicity")) { move.GetComponentInChildren().EffectPrefab = (UnitEffectBase)(object)UPool.MyPool.GetObject("Eff_GreenStrychnine").GetComponentInChildren(); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_AirborneUppercut")) { move.AddComponent().explosion = UPool.MyPool.GetObject("E_AirborneUppercutGrounded"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_KnockoutPunch")) { move.AddComponent().explosion = UPool.MyPool.GetObject("E_AirborneUppercutGrounded"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_DynamicFlight")) { DynamicFlightMovement dynamicFlightMovement = move.AddComponent(); dynamicFlightMovement.trailObject = UTI.Uti.LoBuGaOb("OmnimanTrail"); dynamicFlightMovement.redMaterial = UTI.Uti.LoadBundleMaterial("TeamColor_OmniRedTrail"); dynamicFlightMovement.blueMaterial = UTI.Uti.LoadBundleMaterial("TeamColor_OmniBlueTrail"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_Restriction")) { move.AddComponent().indicationObject = UTI.Uti.LoBuGaOb("RestrictionIndicationObject"); } if ((Object)(object)move == (Object)(object)UPool.MyPool.GetObject("Move_TemperedDawn")) { move.AddComponent(); } } public static void SetUnits(Unit unit, LandfallContentDatabase db) { //IL_002d: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0117: 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_02db: 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_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("NyanChan_UnitBase")).name) { Transform transform = ((Component)unit).transform; transform.localScale *= 1.1f; ((Component)unit).GetComponentInChildren().stopForTurns = false; ((Component)unit).GetComponentInChildren().randomizeRigidbodySizes = false; SkinnedMeshRenderer[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.tag = "UnitMesh"; } } if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("Eliyah_UnitBase")).name) { Transform transform2 = ((Component)unit).transform; transform2.localScale *= 1.2f; ((Component)unit).GetComponentInChildren().randomizeRigidbodySizes = false; TeamColor[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren(); foreach (TeamColor obj in componentsInChildren2) { obj.redMaterial = new Material(obj.redMaterial); obj.blueMaterial = new Material(obj.blueMaterial); obj.redMaterial.color = new Color(0.65f, 0.4f, 0.4f); obj.blueMaterial.color = new Color(0.4f, 0.4f, 0.65f); } SkinnedMeshRenderer[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren(); for (int k = 0; k < componentsInChildren3.Length; k++) { ((Component)componentsInChildren3[k]).gameObject.tag = "UnitMesh"; } } if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("Bunyun16_UnitBase")).name) { Transform transform3 = ((Component)unit).transform; transform3.localScale *= 0.9f; ((Component)unit).gameObject.AddComponent(); ((Component)unit).GetComponentInChildren().stopForTurns = false; ((Component)unit).GetComponentInChildren().randomizeRigidbodySizes = false; SkinnedMeshRenderer[] componentsInChildren4 = ((Component)unit).GetComponentsInChildren(); for (int l = 0; l < componentsInChildren4.Length; l++) { ((Component)componentsInChildren4[l]).gameObject.tag = "UnitMesh"; } } if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("Arsenico_Base")).name) { Transform transform4 = ((Component)unit).transform; transform4.localScale *= 1.2f; ((Component)unit).gameObject.AddComponent().particleObject = UTI.Uti.LoBuGaOb("ArsenicoDeathParticle"); ((Component)unit).GetComponentInChildren().stopForTurns = false; ((Component)unit).GetComponentInChildren().randomizeRigidbodySizes = false; SkinnedMeshRenderer[] componentsInChildren5 = ((Component)unit).GetComponentsInChildren(); for (int m = 0; m < componentsInChildren5.Length; m++) { ((Component)componentsInChildren5[m]).gameObject.tag = "UnitMesh"; } } if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("JohnnyDawnedsonUnitBase")).name) { Transform transform5 = ((Component)unit).transform; transform5.localScale *= 1.5f; ((Component)unit).GetComponentInChildren().stopForTurns = false; ((Component)unit).GetComponentInChildren().randomizeRigidbodySizes = false; SkinnedMeshRenderer[] componentsInChildren6 = ((Component)unit).GetComponentsInChildren(); for (int n = 0; n < componentsInChildren6.Length; n++) { ((Component)componentsInChildren6[n]).gameObject.tag = "UnitMesh"; } } if (((Object)((Component)unit).gameObject).name == ((Object)UPool.MyPool.GetObject("SlightMuscularUnitBase")).name) { Transform transform6 = ((Component)unit).transform; transform6.localScale *= 1.25f; ((Component)unit).GetComponentInChildren().stopForTurns = false; ((Component)unit).GetComponentInChildren().randomizeEyes = false; ((Component)unit).GetComponentInChildren().randomizeRigidbodySizes = false; SkinnedMeshRenderer[] componentsInChildren7 = ((Component)unit).GetComponentsInChildren(); for (int num = 0; num < componentsInChildren7.Length; num++) { ((Component)componentsInChildren7[num]).gameObject.tag = "UnitMesh"; } } } public static void Init(LandfallContentDatabase db) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0031: 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_00b1: Expected O, but got Unknown //IL_013f: 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_01a1: 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_0203: 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) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_040b: 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_046d: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_0562: 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_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: 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_071b: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_077d: 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_07df: Unknown result type (might be due to invalid IL or missing references) //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_08c1: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Unknown result type (might be due to invalid IL or missing references) //IL_091c: Unknown result type (might be due to invalid IL or missing references) //IL_0936: Expected O, but got Unknown //IL_0937: Unknown result type (might be due to invalid IL or missing references) //IL_0961: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Expected O, but got Unknown //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Expected O, but got Unknown //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09eb: Unknown result type (might be due to invalid IL or missing references) //IL_0a05: Expected O, but got Unknown //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a37: Unknown result type (might be due to invalid IL or missing references) //IL_0a61: Unknown result type (might be due to invalid IL or missing references) //IL_0a7b: Expected O, but got Unknown //IL_0a7c: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Unknown result type (might be due to invalid IL or missing references) //IL_0ac0: Expected O, but got Unknown //IL_0ac1: Unknown result type (might be due to invalid IL or missing references) //IL_0af2: Unknown result type (might be due to invalid IL or missing references) //IL_0b23: Unknown result type (might be due to invalid IL or missing references) //IL_0b54: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b98: Expected O, but got Unknown //IL_0b99: Unknown result type (might be due to invalid IL or missing references) //IL_0bc3: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: Expected O, but got Unknown //IL_0bde: Unknown result type (might be due to invalid IL or missing references) //IL_0c08: Unknown result type (might be due to invalid IL or missing references) //IL_0c22: Expected O, but got Unknown //IL_0c23: Unknown result type (might be due to invalid IL or missing references) //IL_0c4d: Unknown result type (might be due to invalid IL or missing references) //IL_0c67: Expected O, but got Unknown //IL_0c68: Unknown result type (might be due to invalid IL or missing references) //IL_0c99: Unknown result type (might be due to invalid IL or missing references) //IL_0ce8: Unknown result type (might be due to invalid IL or missing references) //IL_0d19: Unknown result type (might be due to invalid IL or missing references) //IL_0d4a: Unknown result type (might be due to invalid IL or missing references) //IL_0d7b: Unknown result type (might be due to invalid IL or missing references) //IL_0dac: Unknown result type (might be due to invalid IL or missing references) //IL_0ddd: Unknown result type (might be due to invalid IL or missing references) //IL_0e2c: Unknown result type (might be due to invalid IL or missing references) //IL_0e5d: Unknown result type (might be due to invalid IL or missing references) //IL_0e8e: Unknown result type (might be due to invalid IL or missing references) //IL_0ed3: Unknown result type (might be due to invalid IL or missing references) //IL_0efa: Unknown result type (might be due to invalid IL or missing references) //IL_0f21: Unknown result type (might be due to invalid IL or missing references) //IL_0f48: Unknown result type (might be due to invalid IL or missing references) //IL_0f6f: Unknown result type (might be due to invalid IL or missing references) //IL_0fb4: Unknown result type (might be due to invalid IL or missing references) //IL_0fdb: Unknown result type (might be due to invalid IL or missing references) //IL_1002: Unknown result type (might be due to invalid IL or missing references) //IL_1029: Unknown result type (might be due to invalid IL or missing references) //IL_1050: Unknown result type (might be due to invalid IL or missing references) //IL_1077: Unknown result type (might be due to invalid IL or missing references) Sprite val = UTI.Uti.LoadBundleTextureToSprite("spriterandomunits"); Faction val2 = (Faction)SLMALoader.SDic["factions"]["Secret"]; string categoryName = "Random Units"; TagType tagType = (TagType)0; comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Create Custom Units"; comment = "----------------------------------------------------------------------------------------------------------------------------"; SLMATool.CreateUnit("Arsenico", (UnitBlueprint)null, val2, UTI.Uti.LoadBundleTextureToSprite("arsenico_icon")); SLMATool.CreateUnit("Gore Guild", (UnitBlueprint)null, val2, UTI.Uti.LoadBundleTextureToSprite("goreguild_icon")); SLMATool.CreateUnit("Bunyun16", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Subunits"], UTI.Uti.LoadBundleTextureToSprite("goreguild_icon")); SLMATool.CreateUnit("Johnny Dawnedson", (UnitBlueprint)null, val2, UTI.Uti.LoadBundleTextureToSprite("johnnydawnedson_icon")); SLMATool.CreateUnit("NYAN-CHAN-UNIT", (UnitBlueprint)null, val2, UTI.Uti.LoadBundleTextureToSprite("nyanchan_icon")); SLMATool.CreateUnit("Omni-Man", (UnitBlueprint)null, val2, UTI.Uti.LoadBundleTextureToSprite("omniman_icon")); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Weapons"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("CwiticalCattack", UTI.Uti.LoBuGaOb("CwiticalCattack"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Weapon, 735454345), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LumberjackChainsaw", UTI.Uti.LoBuGaOb("LumberjackChainsaw"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Weapon, 734345423), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("PaleriteBlade", UTI.Uti.LoBuGaOb("PaleriteBlade"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Weapon, 734123423), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Hiveflail", UTI.Uti.LoBuGaOb("Hiveflail"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Weapon, 463532431), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("SupersonicFist", UTI.Uti.LoBuGaOb("SupersonicFist"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Weapon, 735454323), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("BindingJaggedCombatKnife", UTI.Uti.LoBuGaOb("BindingJaggedCombatKnife"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Weapon, 643423432), true), categoryName, tagType); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Clothing"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("NyanChanHair", UTI.Uti.LoBuGaOb("NyanChanHair"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 623432432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("NyanHeadCatMonitor", UTI.Uti.LoBuGaOb("NyanHeadCatMonitor"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 62434233), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("NyanChanSuitArmor", UTI.Uti.LoBuGaOb("NyanChanSuitArmor"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 624324234), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("NyanChanCatTail", UTI.Uti.LoBuGaOb("NyanChanCatTail"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 53243243), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LumberjackUniform", UTI.Uti.LoBuGaOb("LumberjackUniform"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 82489343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LumberjackHair", UTI.Uti.LoBuGaOb("LumberjackHair"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 95235732), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LumberjackBeard", UTI.Uti.LoBuGaOb("LumberjackBeard"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 63243423), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LumberjackBoots", UTI.Uti.LoBuGaOb("LumberjackBoots"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 23432483), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LumberjackPant", UTI.Uti.LoBuGaOb("LumberjackPant"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 124532483), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("BunyunHair", UTI.Uti.LoBuGaOb("BunyunHair"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 62344343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentBoots", UTI.Uti.LoBuGaOb("VilepaleAgentBoots"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 67345234), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentGlove", UTI.Uti.LoBuGaOb("VilepaleAgentGlove"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 1236234732), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentHeadband", UTI.Uti.LoBuGaOb("VilepaleAgentHeadband"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 734524432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentPant", UTI.Uti.LoBuGaOb("VilepaleAgentPant"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 314135133), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentShortSkirt", UTI.Uti.LoBuGaOb("VilepaleAgentShortSkirt"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 643532434), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentShoulderpads", UTI.Uti.LoBuGaOb("VilepaleAgentShoulderpads"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 231232341), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("VilepaleAgentUniform", UTI.Uti.LoBuGaOb("VilepaleAgentUniform"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 424342343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("ArsenicHatchlingThing", UTI.Uti.LoBuGaOb("ArsenicHatchlingThing"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 365437643), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LeatherWeatheredHood", UTI.Uti.LoBuGaOb("LeatherWeatheredHood"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 1263122312), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("LeatherWeatheredClothing", UTI.Uti.LoBuGaOb("LeatherWeatheredClothing"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 561231231), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("ClothWrapArmor", UTI.Uti.LoBuGaOb("ClothWrapArmor"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 123432432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("ArsenicoSkinCovers", UTI.Uti.LoBuGaOb("ArsenicoSkinCovers"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 634523432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("CustomizableShadingProp", UTI.Uti.LoBuGaOb("CustomizableShadingProp"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 272442342), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("WickedSmile", UTI.Uti.LoBuGaOb("WickedSmile"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 643532343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("DarkShadowCovers", UTI.Uti.LoBuGaOb("DarkShadowCovers"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 532332343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("BigPastorGown", UTI.Uti.LoBuGaOb("BigPastorGown"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 63543543), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("JohnnyDawnedsonHair", UTI.Uti.LoBuGaOb("JohnnyDawnedsonHair"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 62342343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("MuscularBodyBoots", UTI.Uti.LoBuGaOb("MuscularBodyBoots"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 52432423), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("MuscularBodyPartsTights", UTI.Uti.LoBuGaOb("MuscularBodyPartsTights"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 645324234), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("OmniSuit", UTI.Uti.LoBuGaOb("OmniSuit"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 53343123), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("OmniTight", UTI.Uti.LoBuGaOb("OmniTight"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 73243242), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("NolanHairAndMoustache", UTI.Uti.LoBuGaOb("NolanHairAndMoustache"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Prop, 123151423), true), categoryName, tagType); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Ability"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Meowrsenal", UTI.Uti.LoBuGaOb("Move_Meowrsenal"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 344324432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_PurrfectPawwages", UTI.Uti.LoBuGaOb("Move_PurrfectPawwages"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 66243242), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Zoomies", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 23423223), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Woomies", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 62353432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_BeegServalStretch", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 23562343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Teardown", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 524312312), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Breakthrough", UTI.Uti.LoBuGaOb("Move_Breakthrough"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 62432324), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Infiltrate", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 635321432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_SpawnBunyunCompanion", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 345234324), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_CondensedSpewspit", UTI.Uti.LoBuGaOb("Move_CondensedSpewspit"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 176453432), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_DispersingDodge", UTI.Uti.LoBuGaOb("Move_DispersingDodge"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 236234343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_RadioactiveToxicity", UTI.Uti.LoBuGaOb("Move_RadioactiveToxicity"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 232563253), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_AirborneUppercut", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 83454345), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_KnockoutPunch", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 95465234), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_DynamicFlight", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 73454532), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_Restriction", (GameObject)SLMALoader.SDic["moves"]["Head_up"], true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 12351243), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Move_TemperedDawn", UTI.Uti.LoBuGaOb("Move_TemperedDawn"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Ability, 62312231), true), categoryName, tagType); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Unit Bases"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("NyanChan_UnitBase", UTI.Uti.LoBuGaOb("NyanChan_UnitBase"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.UnitBase, 52723423), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Eliyah_UnitBase", UTI.Uti.LoBuGaOb("Eliyah_UnitBase"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.UnitBase, 412651231), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Bunyun16_UnitBase", UTI.Uti.LoBuGaOb("Bunyun16_UnitBase"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.UnitBase, 253433243), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Arsenico_Base", UTI.Uti.LoBuGaOb("Arsenico_Base"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.UnitBase, 86465435), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("SlightMuscularUnitBase", UTI.Uti.LoBuGaOb("SlightMuscularUnitBase"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.UnitBase, 63453343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("JohnnyDawnedsonUnitBase", UTI.Uti.LoBuGaOb("JohnnyDawnedsonUnitBase"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.UnitBase, 643523432), true), categoryName, tagType); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Projectile"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("P_G4TOMissile", UTI.Uti.LoBuGaOb("P_G4TOMissile"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Projectile, 62341343), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("P_PawwagesLaser", UTI.Uti.LoBuGaOb("P_PawwagesLaser"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Projectile, 624324324), true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("P_CondensedSpewspit", UTI.Uti.LoBuGaOb("P_CondensedSpewspit"), true, (HideFlags)52, val, UTI.Uti.IDChecker(UTI.AssetType.Projectile, 934332834), true), categoryName, tagType); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Effects"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Eff_Bunmark", UTI.Uti.LoBuGaOb("Eff_Bunmark"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Eff_Rapture", UTI.Uti.LoBuGaOb("Eff_Rapture"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Eff_GreenStrychnine", UTI.Uti.LoBuGaOb("Eff_GreenStrychnine"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Eff_PurpleDoomspores", UTI.Uti.LoBuGaOb("Eff_PurpleDoomspores"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("Eff_YellowParalipowder", UTI.Uti.LoBuGaOb("Eff_YellowParalipowder"), true, (HideFlags)52, val, 0, true), categoryName, tagType); comment = "----------------------------------------------------------------------------------------------------------------------------"; comment = "Custom Explosions"; comment = "----------------------------------------------------------------------------------------------------------------------------"; UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("E_MiniGatoExplosion", UTI.Uti.LoBuGaOb("E_MiniGatoExplosion"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("E_PawwagesLaser", UTI.Uti.LoBuGaOb("E_PawwagesLaser"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("E_DelayedDeathClaw", UTI.Uti.LoBuGaOb("E_DelayedDeathClaw"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("E_YellowParalipowder", UTI.Uti.LoBuGaOb("E_YellowParalipowder"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("E_PurpleDoomspores", UTI.Uti.LoBuGaOb("E_PurpleDoomspores"), true, (HideFlags)52, val, 0, true), categoryName, tagType); UTI.Uti.ItemCat.SetTag(UPool.MyPool.AddObject("E_AirborneUppercutGrounded", UTI.Uti.LoBuGaOb("E_AirborneUppercutGrounded"), true, (HideFlags)52, val, 0, true), categoryName, tagType); } public static void SetWeapon(GameObject weapon, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db) { if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("CwiticalCattack")) { weapon.AddComponent().explosion = UPool.MyPool.GetObject("E_DelayedDeathClaw"); } if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("PaleriteBlade")) { weapon.GetComponentInChildren().EffectPrefab = (UnitEffectBase)(object)UPool.MyPool.GetObject("Eff_Bunmark").GetComponentInChildren(); } if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("LumberjackChainsaw")) { weapon.AddComponent(); weapon.AddComponent(); weapon.GetComponentInChildren().EffectPrefab = (UnitEffectBase)(object)UPool.MyPool.GetObject("Eff_Rapture").GetComponentInChildren(); } if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("SupersonicFist")) { weapon.AddComponent(); } if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("BindingJaggedCombatKnife")) { weapon.AddComponent(); weapon.AddComponent(); } if ((Object)(object)weapon == (Object)(object)UPool.MyPool.GetObject("Hiveflail")) { weapon.AddComponent(); } } public static void SetEffects(GameObject effect) { BunmarkEffectDetection bunmarkEffectDetection = default(BunmarkEffectDetection); if (Object.op_Implicit((Object)(object)(effect = UPool.MyPool.GetObject("Eff_Bunmark"))) && !effect.TryGetComponent(ref bunmarkEffectDetection)) { effect.AddComponent(); } RaptureEffectDetection raptureEffectDetection = default(RaptureEffectDetection); if (Object.op_Implicit((Object)(object)(effect = UPool.MyPool.GetObject("Eff_Rapture"))) && !effect.TryGetComponent(ref raptureEffectDetection)) { effect.AddComponent(); } GreenStrychnineEffect greenStrychnineEffect = default(GreenStrychnineEffect); if (Object.op_Implicit((Object)(object)(effect = UPool.MyPool.GetObject("Eff_GreenStrychnine"))) && !effect.TryGetComponent(ref greenStrychnineEffect)) { effect.AddComponent(); } } public static void SetExplosion(GameObject explosion) { } public static void SetProjectile(GameObject proj, ProjectileHit projhit, LandfallContentDatabase db) { if ((Object)(object)proj == (Object)(object)UPool.MyPool.GetObject("P_CondensedSpewspit")) { proj.GetComponentInChildren().EffectPrefab = (UnitEffectBase)(object)UPool.MyPool.GetObject("Eff_GreenStrychnine").GetComponentInChildren(); } } public static Faction SetFaction(Faction faction, bool secret, bool lockSecrets, Color color, int index) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) s.SetField(faction, "m_isSecret", (object)secret); s.SetField(faction, "m_lockSecrets", (object)lockSecrets); faction.m_FactionColor = color; faction.index = index; return faction; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("GeeztJeez.RandomUnits", "RandomUnits", "1.0.4")] internal class Loader : BaseUnityPlugin { public static string modName; public static bool DebugEnabled; private void Awake() { ApplyHarmony(); ((MonoBehaviour)this).StartCoroutine(Call()); } private IEnumerator Call() { yield return (object)new WaitUntil((Func)(() => (Object)(object)Object.FindObjectOfType() != (Object)null)); yield return (object)new WaitUntil((Func)(() => ServiceLocator.GetService() != null)); Log($"Loading {modName}!"); LoadMod(); Log($"Loaded {modName} Successfully!"); } public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode) { try { if (((Scene)(ref scene)).name == "05_AsiaTemple_VC") { Object.Instantiate(UTI.Uti.LoBuGaOb("NyanChanSecretProp")); } if (((Scene)(ref scene)).name == "03_Sandbox_Ancient_01_VC") { Object.Instantiate(UTI.Uti.LoBuGaOb("GoreguildSecretProp")); } if (((Scene)(ref scene)).name == "00_Simulation_12_FinalDestination_VC") { Object.Instantiate(UTI.Uti.LoBuGaOb("OmnimanSecretProp")); } if (((Scene)(ref scene)).name == "09_Lvl1_Fantasy_Good_VC") { Object.Instantiate(UTI.Uti.LoBuGaOb("JohnnyDawnedsonSecretProp")); } if (((Scene)(ref scene)).name == "09_Lvl1_Fantasy_Evil_VC") { Object.Instantiate(UTI.Uti.LoBuGaOb("ArsenicoSecretProp")); } } catch (Exception arg) { LogError($"SceneLoaded failed: {arg}"); } } private void ApplyHarmony() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) try { new Harmony("RandomUnits").PatchAll(Assembly.GetExecutingAssembly()); Log("Harmony patched successfully!"); } catch (Exception ex) { LogError("Harmony patch failed: " + ex); Log("Please contact Geezt Jeez or try reloading the game for proper installation..."); } } public static void Log(string message) { if (DebugEnabled) { Debug.Log((object)$"[{modName}] {message}"); } } public static void LogWarning(string message) { if (DebugEnabled) { Debug.LogWarning((object)$"[{modName}] {message}"); } } public static void LogError(string message) { if (DebugEnabled) { Debug.LogError((object)$"[{modName}] {message}"); } } static Loader() { modName = "Random Units"; DebugEnabled = true; } public void LoadMod() { SLMALoader.GetInstance(); SceneManager.sceneLoaded += SceneLoaded; LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase; UTI.bundle = UTI.Uti.LoadBundle("randomunitsbundle"); UManager.Init(landfallContentDatabase); UTI.Uti.AddLocalization(); GameObject[] array = Resources.FindObjectsOfTypeAll(); for (int i = 0; i < array.Length; i++) { if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetExplosion(array[i]); } if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetProjectile(array[i], array[i].GetComponent(), landfallContentDatabase); } if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetUnits(array[i].GetComponent(), landfallContentDatabase); } if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetWeapon(array[i], array[i].GetComponent(), array[i].GetComponent(), landfallContentDatabase); } if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetEffects(array[i]); } if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetMoves(array[i], landfallContentDatabase); } if (Object.op_Implicit((Object)(object)array[i].GetComponent())) { UManager.SetClothes(array[i], array[i].GetComponent(), array[i].GetComponent(), landfallContentDatabase); } } UnitBlueprint[] array2 = Resources.FindObjectsOfTypeAll(); for (int j = 0; j < array2.Length; j++) { UManager.SetBlueprint(array2[j], landfallContentDatabase); array2[j].Validate(); } } } } namespace RandomUnitsCustomScripts { public class ShadedClothing : MonoBehaviour { public Unit rootUnit; public SkinnedMeshRenderer skinnedMeshRenderer; public void Start() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown rootUnit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); skinnedMeshRenderer = ((Component)this).GetComponentInChildren(); if ((Object)(object)skinnedMeshRenderer != (Object)null && (Object)(object)((Renderer)skinnedMeshRenderer).material != (Object)null) { ((Renderer)skinnedMeshRenderer).material = new Material(((Renderer)skinnedMeshRenderer).material); } } public void Update() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)rootUnit) && !rootUnit.data.Dead) { float health = rootUnit.data.health; float maxHealth = rootUnit.data.maxHealth; float num = Mathf.Clamp01(1f - health / maxHealth); Color color = default(Color); ((Color)(ref color))..ctor(0f, 0f, 0f, num); if ((Object)(object)skinnedMeshRenderer != (Object)null && (Object)(object)((Renderer)skinnedMeshRenderer).material != (Object)null) { ((Renderer)skinnedMeshRenderer).material.color = color; } } } } public class BindingEffectStick : CollisionWeaponEffect { private Rigidbody rig; public Rigidbody otherRigidbody; [HideInInspector] public ConfigurableJoint joint; private GeneralInput input; private Holdable holdable; private ForcePoint forcePoint; private Unit holder; private Unit target; private void Start() { rig = ((Component)this).GetComponent(); holdable = ((Component)this).GetComponent(); holder = ((Component)((Component)this).transform.root).GetComponentInParent(); input = ((Component)holder).GetComponentInChildren(); forcePoint = ((Component)this).GetComponentInChildren(); } private void FixedUpdate() { //IL_0051: 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_0067: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)joint)) { if (Object.op_Implicit((Object)(object)((Joint)joint).connectedBody) && (!Object.op_Implicit((Object)(object)holder.data) || !holder.data.Dead)) { ((Joint)joint).connectedBody.AddForce(Vector3.up, (ForceMode)0); input.inputDirection = Vector3.zero; } if ((Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)target.data) && target.data.Dead) || (Object.op_Implicit((Object)(object)holder.data) && holder.data.Dead) || !Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)holder)) { RemoveStickJoint(); } } } public override void DoEffect(Transform hitTransform, Collision collision) { //IL_003f: 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) if (!Object.op_Implicit((Object)(object)joint)) { target = ((Component)collision.transform).GetComponentInParent(); if ((!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)holder) || holder.Team != target.Team) && Object.op_Implicit((Object)(object)collision.rigidbody)) { otherRigidbody = collision.rigidbody; joint = AttachJoint(rig, collision.rigidbody, ((Component)forcePoint).transform); } } } public void RemoveStickJoint() { if (Object.op_Implicit((Object)(object)joint)) { Object.Destroy((Object)(object)joint); } } public static ConfigurableJoint AttachJoint(Rigidbody myRig, Rigidbody otherRig, Transform forcePoint) { //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_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_0066: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = forcePoint.position; ConfigurableJoint val = ((Component)myRig).gameObject.AddComponent(); ((Joint)val).anchor = ((Component)myRig).transform.InverseTransformPoint(position); val.xMotion = (ConfigurableJointMotion)0; val.yMotion = (ConfigurableJointMotion)0; val.zMotion = (ConfigurableJointMotion)0; val.angularXMotion = (ConfigurableJointMotion)0; val.angularYMotion = (ConfigurableJointMotion)0; val.angularZMotion = (ConfigurableJointMotion)0; if (Object.op_Implicit((Object)(object)otherRig)) { ((Joint)val).connectedBody = otherRig; } val.projectionMode = (JointProjectionMode)1; JointDrive angularXDrive = val.angularXDrive; ((JointDrive)(ref angularXDrive)).positionSpring = 10f; ((JointDrive)(ref angularXDrive)).positionDamper = 2f; val.angularXDrive = angularXDrive; val.angularYZDrive = angularXDrive; ((Joint)val).enablePreprocessing = false; return val; } } public class TemperedDawnPassive : MonoBehaviour { public ParticleSystem particleSystem; public void Start() { particleSystem = ((Component)this).GetComponentInChildren(); } } } namespace RandomUnitsHarmonyPatches { [HarmonyPatch(typeof(HealthHandler), "TakeDamage")] internal class TakeDamagePatch { private static void Prefix(HealthHandler __instance, float damage) { //IL_0316: 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_01df: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) if (float.IsNaN(damage) || float.IsInfinity(damage) || damage == 0f) { return; } FieldInfo field = typeof(HealthHandler).GetField("data", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); object? obj = ((field != null) ? field.GetValue(__instance) : null); DataHandler val = (DataHandler)((obj is DataHandler) ? obj : null); FieldInfo field2 = typeof(HealthHandler).GetField("isInvulnerable", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); bool flag = (((field2 != null) ? field2.GetValue(__instance) : null) as bool?) ?? false; if (field == null) { Loader.LogError("Couldn't find data field in HealthHandler"); } if ((Object)(object)val == (Object)null || val.Dead || flag) { return; } TemperedDawnPassive componentInChildren = ((Component)val.unit).gameObject.GetComponentInChildren(); if (val.lifeTime >= 0.3f && (val.immunityForSeconds <= 0f || damage > 0f) && damage < val.health && !val.Dead && Object.op_Implicit((Object)(object)val.mainRig) && Object.op_Implicit((Object)(object)componentInChildren)) { float health = val.health; float maxHealth = val.maxHealth; if (health >= maxHealth * 0.25f) { val.health += (damage *= Mathf.Clamp01(1f - health / maxHealth)); componentInChildren.particleSystem.Play(); } else if (Random.Range(0f, 1f) <= 0.75f) { val.health += damage; componentInChildren.particleSystem.Play(); } else { val.health += (damage *= Mathf.Clamp01(1f - health / maxHealth)); } ServiceLocator.GetService().PlaySoundEffect("Effects/PriestHeal", 0.7f, val.mainRig.position, (MaterialType)0, (Transform)null, 0.5f); ServiceLocator.GetService().PlaySoundEffect("Effects/Log", 1f, val.mainRig.position, (MaterialType)0, (Transform)null, 0.7f); } if (val.lifeTime >= 0.3f && (val.immunityForSeconds <= 0f || damage > 0f) && damage < val.health && !val.Dead && Object.op_Implicit((Object)(object)((Component)val.unit).gameObject.GetComponentInChildren())) { if (damage > val.health) { val.healthHandler.Die((Unit)null); } else { val.health -= damage; } ServiceLocator.GetService().PlaySoundEffect("Effects/Slice", 1f, val.mainRig.position, (MaterialType)0, (Transform)null, 0.7f); } if (val.lifeTime >= 0.3f && (val.immunityForSeconds <= 0f || damage < 0f) && !val.Dead && Object.op_Implicit((Object)(object)((Component)val.unit).gameObject.GetComponentInChildren())) { val.health += damage; ServiceLocator.GetService().PlaySoundEffect("Effects/PotionEffect", 0.7f, val.mainRig.position, (MaterialType)0, (Transform)null, 0.5f); } } } } namespace RandomUnitsCustomScripts { public class RemoveClothingIfDead : MonoBehaviour { public Unit rootUnit; public void Start() { rootUnit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); } public void Update() { if (Object.op_Implicit((Object)(object)rootUnit) && rootUnit.data.Dead) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class ContinuousDamageWeaponQuickfist : MonoBehaviour { private CollisionWeapon collisionWeapon; private Rigidbody rig; private float damageInterval = 0.5f; private float damageTimer; private void Start() { collisionWeapon = ((Component)this).GetComponent(); rig = ((Component)this).GetComponent(); if ((Object)(object)collisionWeapon == (Object)null) { Debug.LogError((object)"CollisionWeapon component missing!"); } damageTimer = damageInterval; } private void Update() { //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) Vector3 velocity = rig.velocity; if (!(((Vector3)(ref velocity)).magnitude <= 0f)) { damageTimer -= Time.deltaTime; if (damageTimer <= 0f) { ApplyContinuousDamage(); damageTimer = damageInterval; } } } private void ApplyContinuousDamage() { //IL_0006: 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_0075: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_0096: Unknown result type (might be due to invalid IL or missing references) Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 1.5f); foreach (Collider val in array) { if ((Object)(object)val.attachedRigidbody == (Object)null || (Object)(object)((Component)val).transform.root == (Object)(object)((Component)this).transform.root) { continue; } Damagable componentInParent = ((Component)val.attachedRigidbody).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null)) { Vector3 val2 = ((Component)val).transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; componentInParent.TakeDamage(collisionWeapon.damage, normalized, (Unit)null, (DamageType)0); UnityEvent dealDamageEvent = collisionWeapon.dealDamageEvent; if (dealDamageEvent != null) { dealDamageEvent.Invoke(); } } } } } public class DamageCollisionQuickknife : MonoBehaviour { private CollisionWeapon collisionWeapon; private CollisionSound collisionSound; private BindingEffectStick bindingGrabStick; public Unit unit; private float counter; private float timer; private MeleeWeapon meleeWeapon; private void OnCollisionEnter(Collision collision) { //IL_0092: 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_00e4: 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) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)collision.gameObject != (Object)null) || !(counter >= timer) || !meleeWeapon.isSwinging || Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent()) || Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent()) || Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent())) { return; } Unit componentInChildren = ((Component)collision.gameObject.transform.root).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren) && componentInChildren.Team != unit.Team && (Object)(object)componentInChildren != (Object)(object)unit) { counter = 0f; ((Damagable)componentInChildren.data.healthHandler).TakeDamage(collisionWeapon.damage, collision.gameObject.transform.position, unit, (DamageType)0); _ = componentInChildren.data.allRigs.AllRigs; if (Object.op_Implicit((Object)(object)bindingGrabStick)) { ((CollisionWeaponEffect)bindingGrabStick).DoEffect(((Component)this).transform, collision); } if (Object.op_Implicit((Object)(object)collisionSound)) { SoundPlayer service = ServiceLocator.GetService(); string soundEffectRef = collisionSound.SoundEffectRef; ContactPoint contact = collision.GetContact(0); service.PlaySoundEffect(soundEffectRef, 1f, ((ContactPoint)(ref contact)).point, (MaterialType)0, (Transform)null, 0.7f); } } } private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); meleeWeapon = ((Component)this).GetComponentInChildren(); collisionWeapon = ((Component)this).GetComponentInChildren(); collisionSound = ((Component)this).GetComponentInChildren(); bindingGrabStick = ((Component)this).GetComponentInChildren(); } public void Update() { if (counter < timer) { counter += Time.deltaTime; } if (!Object.op_Implicit((Object)(object)bindingGrabStick)) { bindingGrabStick = ((Component)this).GetComponentInChildren(); } } public DamageCollisionQuickknife() { timer = 0.01f; } } public class RestrictionMovementPassive : MonoBehaviour { public GameObject indicationObject; private MeleeWeapon[] meleeWeapons; private Unit unit; private Vector3 lastPosition; public float maxMovability = 35f; private float counter; public float cooldown = 4f; private Unit target; private List joints; public float range = 10f; public float dashDuration = 0.15f; public float trailSpacing = 1f; public float trailTotalDelay = 0.3f; public float minDamage = 500f; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); meleeWeapons = ((Component)unit).GetComponentsInChildren(); counter = cooldown; joints = new List(); } public void FixedUpdate() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: 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_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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) if (joints.Count > 0) { if (Object.op_Implicit((Object)(object)target)) { Rigidbody[] allRigs = target.data.allRigs.AllRigs; foreach (Rigidbody obj in allRigs) { obj.velocity *= 0.25f; } } for (int num = joints.Count - 1; num >= 0; num--) { ConfigurableJoint val = joints[num]; if (Object.op_Implicit((Object)(object)((Joint)val).connectedBody) && Object.op_Implicit((Object)(object)unit) && !unit.data.Dead) { ((Joint)val).connectedBody.AddForce(Vector3.down, (ForceMode)0); } if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)unit) || (Object.op_Implicit((Object)(object)target.data) && target.data.Dead) || (Object.op_Implicit((Object)(object)unit.data) && unit.data.Dead)) { RemoveStickJoint(val); joints.RemoveAt(num); } } } if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)unit.data.targetData.unit) && !unit.data.Dead) { target = unit.data.targetData.unit; Rigidbody mainRig = target.data.mainRig; float num2 = Vector3.Distance(mainRig.position, unit.data.mainRig.position); if (joints.Count <= 0 && Object.op_Implicit((Object)(object)target) && num2 <= range && CheckVelocityAndAngularVelocity(mainRig) && counter >= cooldown) { counter = 0f; ((MonoBehaviour)this).StartCoroutine(DoDashAndRestrict(target)); } lastPosition = mainRig.position; } } private bool CheckVelocityAndAngularVelocity(Rigidbody rb) { //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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = rb.velocity; if (!(((Vector3)(ref val)).magnitude > maxMovability)) { val = rb.angularVelocity; return ((Vector3)(ref val)).magnitude > maxMovability; } return true; } public static ConfigurableJoint AttachJoint(Rigidbody myRig, Rigidbody otherRig, Transform forcePoint) { //IL_0007: 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_002a: 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_003f: 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_0041: 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_0052: 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_0059: 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_0060: 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_009c: 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) ((Component)myRig).transform.position = otherRig.position; ConfigurableJoint val = ((Component)myRig).gameObject.AddComponent(); ((Joint)val).anchor = ((Component)myRig).transform.InverseTransformPoint(forcePoint.position); ConfigurableJointMotion val2 = (ConfigurableJointMotion)0; val.zMotion = (ConfigurableJointMotion)0; ConfigurableJointMotion xMotion = (val.yMotion = val2); val.xMotion = xMotion; val2 = (ConfigurableJointMotion)0; val.angularZMotion = (ConfigurableJointMotion)0; xMotion = (val.angularYMotion = val2); val.angularXMotion = xMotion; if (Object.op_Implicit((Object)(object)otherRig)) { ((Joint)val).connectedBody = otherRig; } val.projectionMode = (JointProjectionMode)1; JointDrive angularXDrive = val.angularXDrive; ((JointDrive)(ref angularXDrive)).positionSpring = 10f; ((JointDrive)(ref angularXDrive)).positionDamper = 2f; val.angularXDrive = angularXDrive; val.angularYZDrive = angularXDrive; ((Joint)val).enablePreprocessing = false; return val; } public void Update() { counter += Time.deltaTime; } public void RemoveStickJoint(ConfigurableJoint joint) { if (Object.op_Implicit((Object)(object)joint)) { Object.Destroy((Object)(object)joint); } } private IEnumerator DoDashAndRestrict(Unit target) { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)target) && !((Object)(object)target.data == (Object)null)) { Rigidbody[] allRigs = unit.data.allRigs.AllRigs; Vector3 position = unit.data.mainRig.position; Vector3 position2 = target.data.mainRig.position; Vector3 delta = position2 - position; Object.Instantiate(indicationObject, position2, Quaternion.identity, (Transform)null); yield return ((MonoBehaviour)this).StartCoroutine(SmoothDash(allRigs, delta, dashDuration)); float num = Mathf.Clamp(target.data.maxHealth * 0.25f, minDamage, float.PositiveInfinity); ((Damagable)target.data.healthHandler).TakeDamage(num, unit.data.mainRig.position, unit, (DamageType)1); MeleeWeapon[] array = meleeWeapons; foreach (MeleeWeapon obj in array) { Rigidbody componentInChildren = ((Component)obj).GetComponentInChildren(); Transform transform = ((Component)((Component)obj).GetComponentInChildren()).transform; ConfigurableJoint item = AttachJoint(componentInChildren, target.data.mainRig, transform); joints.Add(item); } } } private IEnumerator SmoothDash(Rigidbody[] rigParts, Vector3 delta, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float elapsed = 0f; Vector3[] startPositions = (Vector3[])(object)new Vector3[rigParts.Length]; for (int i = 0; i < rigParts.Length; i++) { startPositions[i] = rigParts[i].position; } while (elapsed < duration) { elapsed += Time.deltaTime; float num = elapsed / duration; for (int j = 0; j < rigParts.Length; j++) { rigParts[j].position = Vector3.Lerp(startPositions[j], startPositions[j] + delta, num); } yield return null; } } } public class DynamicFlightMovement : GameStateListener { private Unit unit; private bool onBattle; private List fists; private float orbitSpeed; private float angleHorizontal; private float angleVertical; private float orbitRadius; private Vector3 orbitOffsetDirection; private float randomizationTimer; public float flightForce; private float randomizationTimerCooldown; private float rotationSpeed; private float orbitMin; private float orbitMax; private float maxVelocity = 200f; public GameObject trailObject; public Material redMaterial; public Material blueMaterial; public void Start() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); ((Component)unit).GetComponentInChildren().gravityData = new GravityData { gravity = 0f }; Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { val.useGravity = false; ParticleSystemRenderer componentInChildren = Object.Instantiate(trailObject, val.position, Quaternion.identity, ((Component)val).transform).gameObject.GetComponentInChildren(); if ((int)unit.Team == 0) { ((Renderer)componentInChildren).material = redMaterial; componentInChildren.trailMaterial = redMaterial; } else { ((Renderer)componentInChildren).material = blueMaterial; componentInChildren.trailMaterial = blueMaterial; } } MeleeWeapon[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren(); foreach (MeleeWeapon val2 in componentsInChildren) { fists.Add(((Component)val2).GetComponent()); } orbitRadius = Random.Range(orbitMin, orbitMax); angleHorizontal = Random.Range(0f, 360f); angleVertical = Random.Range(-30f, 30f); orbitOffsetDirection = Random.onUnitSphere; } protected override void Awake() { ((GameStateListener)this).Awake(); } public override void OnEnterBattleState() { onBattle = true; } public override void OnEnterPlacementState() { onBattle = false; } public void Update() { if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && onBattle && !unit.data.Dead && Object.op_Implicit((Object)(object)unit.data.targetData) && !unit.data.targetData.Dead && Object.op_Implicit((Object)(object)unit.data.targetData.unit)) { Rigidbody[] allRigs = unit.data.allRigs.AllRigs; for (int i = 0; i < allRigs.Length; i++) { allRigs[i].useGravity = false; } UpdateOrbit(); Flight(fists, unit.data.targetData.unit); } } private void UpdateOrbit() { //IL_0081: 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_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) angleHorizontal += orbitSpeed * Time.deltaTime; angleVertical += orbitSpeed * 0.5f * Time.deltaTime; randomizationTimer += Time.deltaTime; if (randomizationTimer >= randomizationTimerCooldown) { orbitRadius = Mathf.Lerp(orbitRadius, Random.Range(orbitMin, orbitMax), 0.75f); orbitOffsetDirection = Vector3.Slerp(orbitOffsetDirection, Random.onUnitSphere, 0.3f); randomizationTimer = 0f; } } private void Flight(List rigidbodies, Unit target) { //IL_000c: 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_001c: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0045: 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_0062: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) Vector3 val = SetRotationPivot(target.data.mainRig.position, orbitRadius); foreach (Rigidbody rigidbody in rigidbodies) { Vector3 val2 = val - rigidbody.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; rigidbody.AddForce(normalized * flightForce, (ForceMode)5); Quaternion val3 = Quaternion.LookRotation(target.data.mainRig.position - rigidbody.position); rigidbody.MoveRotation(Quaternion.Slerp(rigidbody.rotation, val3, Time.deltaTime * rotationSpeed)); } } public Vector3 SetRotationPivot(Vector3 targetPosition, float radius) { //IL_004f: 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_005b: 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) float num = angleHorizontal * ((float)Math.PI / 180f); float num2 = angleVertical * ((float)Math.PI / 180f); float num3 = radius * Mathf.Cos(num2) * Mathf.Cos(num); float num4 = radius * Mathf.Sin(num2); float num5 = radius * Mathf.Cos(num2) * Mathf.Sin(num); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(num3, num4, num5); return targetPosition + Quaternion.LookRotation(orbitOffsetDirection) * val; } public DynamicFlightMovement() { randomizationTimerCooldown = 2f; rotationSpeed = 75f; orbitMax = 20f; flightForce = 4500f; fists = new List(); orbitSpeed = 1000f; } private void FixedUpdate() { //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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0049: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { Vector3 velocity = val.velocity; if (((Vector3)(ref velocity)).magnitude > maxVelocity) { velocity = val.velocity; val.velocity = ((Vector3)(ref velocity)).normalized * maxVelocity; } } } } public class OmniKnockbackEffect : CollisionWeaponEffect { private float force; private Unit holder; private Unit target; private Rigidbody rigidbody; private void Start() { holder = ((Component)((Component)this).transform.root).GetComponentInParent(); rigidbody = ((Component)this).GetComponentInChildren(); } public override void DoEffect(Transform hitTransform, Collision collision) { //IL_0049: 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_0068: 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_0070: 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_0078: Unknown result type (might be due to invalid IL or missing references) target = ((Component)collision.transform).GetComponentInParent(); if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)holder)) { Rigidbody[] allRigs = target.data.allRigs.AllRigs; foreach (Rigidbody obj in allRigs) { Vector3 val = obj.position - holder.data.mainRig.position; Vector3 normalized = ((Vector3)(ref val)).normalized; obj.AddForce(normalized * force, (ForceMode)5); } } } public OmniKnockbackEffect() { force = 4000f; } } public class AirborneUppercutMovement : MonoBehaviour { private Unit unit; private float counter; private float force; public float cooldown; public float range; public GameObject explosion; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); counter = cooldown; } public void DoMovement(Unit target) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_005d: 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_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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00ce: Expected O, but got Unknown Vector3 position = target.data.mainRig.position; Rigidbody[] allRigs = unit.data.allRigs.AllRigs; for (int i = 0; i < allRigs.Length; i++) { allRigs[i].position = position; } Rigidbody[] allRigs2 = target.data.allRigs.AllRigs; for (int j = 0; j < allRigs2.Length; j++) { allRigs2[j].AddForce(Vector3.up * force, (ForceMode)5); } GameObject obj = Object.Instantiate(explosion, unit.data.mainRig.position, Quaternion.identity, (Transform)null); TeamHolder val = new TeamHolder { spawner = ((Component)unit).gameObject, team = unit.Team }; TeamHolder.AddTeamHolder(obj, unit, val); } public void Update() { //IL_009c: 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) counter += Time.deltaTime; if (counter >= cooldown && Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)unit.data.targetData.unit)) { Unit val = unit.data.targetData.unit; if (Vector3.Distance(val.data.mainRig.position, unit.data.mainRig.position) <= range) { counter = 0f; DoMovement(val); } } } public AirborneUppercutMovement() { force = 13000f; cooldown = 2f; range = 12f; } } public class KnockoutPunchMovement : MonoBehaviour { private Unit unit; private float counter; private float force; public float cooldown; public float range; public GameObject explosion; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); } public void DoMovement(Unit target) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_008b: 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_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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown Vector3 position = target.data.mainRig.position; Rigidbody[] allRigs = unit.data.allRigs.AllRigs; for (int i = 0; i < allRigs.Length; i++) { allRigs[i].position = position; } Rigidbody[] allRigs2 = target.data.allRigs.AllRigs; for (int j = 0; j < allRigs2.Length; j++) { Vector3 val = allRigs2[j].position - unit.data.mainRig.position; Vector3 normalized = ((Vector3)(ref val)).normalized; allRigs2[j].AddForce(normalized * force, (ForceMode)5); } GameObject obj = Object.Instantiate(explosion, unit.data.mainRig.position, Quaternion.identity, (Transform)null); TeamHolder val2 = new TeamHolder { spawner = ((Component)unit).gameObject, team = unit.Team }; TeamHolder.AddTeamHolder(obj, unit, val2); } public void Update() { //IL_009c: 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) counter += Time.deltaTime; if (counter >= cooldown && Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)unit.data.targetData.unit)) { Unit val = unit.data.targetData.unit; if (Vector3.Distance(val.data.mainRig.position, unit.data.mainRig.position) <= range) { counter = 0f; DoMovement(val); } } } public KnockoutPunchMovement() { force = 8000f; cooldown = 0.5f; range = 12f; } } public class GreenStrychnineEffect : MonoBehaviour { public float duration = 5f; private Unit unit; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); ((MonoBehaviour)this).StartCoroutine(SlowDownAllRigidbodies()); } private IEnumerator SlowDownAllRigidbodies() { Rigidbody[] rigidbodies = unit.data.allRigs.AllRigs; float elapsedTime = 0f; Vector3[] originalVelocities = (Vector3[])(object)new Vector3[rigidbodies.Length]; for (int i = 0; i < rigidbodies.Length; i++) { originalVelocities[i] = rigidbodies[i].velocity; } while (elapsedTime < duration) { elapsedTime += Time.deltaTime; float num = elapsedTime / duration; float num2 = 1f - Mathf.Pow(1f - num, 3f); for (int j = 0; j < rigidbodies.Length; j++) { if ((Object)(object)rigidbodies[j] != (Object)null) { Vector3 val = Vector3.Lerp(originalVelocities[j], Vector3.zero, num2); rigidbodies[j].velocity = new Vector3(val.x, rigidbodies[j].velocity.y, val.z); } } yield return null; } for (int k = 0; k < rigidbodies.Length; k++) { if ((Object)(object)rigidbodies[k] != (Object)null) { rigidbodies[k].velocity = new Vector3(0f, rigidbodies[k].velocity.y, 0f); } } } } public class OnDeathFadeAway : MonoBehaviour { private Unit unit; public GameObject particleObject; public void Start() { unit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); unit.data.healthHandler.AddDieAction((Action)Execute); } private void Execute() { //IL_0025: 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) Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { Object.Instantiate(particleObject, val.position, Quaternion.identity, (Transform)null); } Object.Destroy((Object)(object)((Component)unit).gameObject); } } public class DestroyIfUnitNull : MonoBehaviour { public Unit unit; public void Update() { if (!Object.op_Implicit((Object)(object)unit)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class UnitInstaSpawner : MonoBehaviour { private Unit rootUnit; public UnitBlueprint unitBlueprint; public int amountToSpawn = 1; private TeamHolder teamHolder; private void Start() { teamHolder = ((Component)this).GetComponentInParent(); rootUnit = ((Component)((Component)this).transform.root).GetComponent(); for (int i = 0; i < amountToSpawn; i++) { Spawn(); } } public void Spawn() { //IL_0023: 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) if (Object.op_Implicit((Object)(object)rootUnit)) { try { Unit val = default(Unit); unitBlueprint.Spawn(rootUnit.data.mainRig.position, ((Component)this).transform.rotation, rootUnit.data.team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null); ((Component)val).gameObject.AddComponent().unit = rootUnit; } catch (Exception ex) { Debug.Log((object)ex); } } } } public class ChainsawShakeBehaviour : MonoBehaviour { public Rigidbody rb; public float shakeIntensity = 100f; public float torqueIntensity = 150f; public float shakeFrequency = 0.05f; private float nextShakeTime; private void Start() { if ((Object)(object)rb == (Object)null) { rb = ((Component)this).GetComponent(); } } private void FixedUpdate() { if (Time.time >= nextShakeTime) { ApplyShake(); nextShakeTime = Time.time + shakeFrequency; } } private void ApplyShake() { //IL_0080: 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) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Random.Range(0f - shakeIntensity, shakeIntensity), Random.Range(0f - shakeIntensity, shakeIntensity), Random.Range(0f - shakeIntensity, shakeIntensity)); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(Random.Range(0f - torqueIntensity, torqueIntensity), Random.Range(0f - torqueIntensity, torqueIntensity), Random.Range(0f - torqueIntensity, torqueIntensity)); rb.AddForce(val, (ForceMode)1); rb.AddTorque(val2, (ForceMode)1); } } public class DamageCollisionTeardownBehaviour : MonoBehaviour { private CollisionWeapon collisionWeapon; private CollisionSound collisionSound; public GameObject bloodParticles; public Unit unit; private float counter; public float timer = 0.001f; private MeleeWeapon meleeWeapon; private MeleeWeaponAddEffect meleeWeaponAddEffect; public float maxCap = 5f; public float volume = 1.5f; public float pitch = 1.2f; private void OnCollisionEnter(Collision collision) { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)collision.gameObject != (Object)null) || !(counter >= timer) || (!meleeWeapon.isSwinging && !meleeWeapon.canDealDamageOutSideOfSwing) || Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent()) || Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent()) || Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent())) { return; } Unit componentInChildren = ((Component)collision.transform.root).GetComponentInChildren(); if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)componentInChildren.data) || componentInChildren.data.Dead || componentInChildren.Team == unit.Team || !((Object)(object)componentInChildren != (Object)(object)unit)) { return; } counter = 0f; float damage = collisionWeapon.damage; Vector3 velocity = unit.data.mainRig.velocity; float num = Mathf.Clamp(damage * ((Vector3)(ref velocity)).magnitude, 0f, damage * maxCap); ((Damagable)componentInChildren.data.healthHandler).TakeDamage(num, collision.transform.position, unit, (DamageType)1); if (Object.op_Implicit((Object)(object)bloodParticles) && Object.op_Implicit((Object)(object)collisionSound)) { ContactPoint[] contacts = collision.contacts; for (int i = 0; i < contacts.Length; i++) { ContactPoint val = contacts[i]; Transform transform = Object.Instantiate(bloodParticles, ((ContactPoint)(ref val)).point, Quaternion.identity, (Transform)null).transform; transform.localScale *= Random.Range(1f, 2f); ServiceLocator.GetService().PlaySoundEffect(collisionSound.SoundEffectRef, volume, ((ContactPoint)(ref val)).point, (MaterialType)0, (Transform)null, pitch); } } if (Object.op_Implicit((Object)(object)meleeWeaponAddEffect)) { ((CollisionWeaponEffect)meleeWeaponAddEffect).DoEffect(collision.transform, collision); } } private void Start() { unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren(); meleeWeapon = ((Component)this).GetComponentInChildren(); collisionWeapon = ((Component)this).GetComponentInChildren(); collisionSound = ((Component)this).GetComponentInChildren(); meleeWeaponAddEffect = ((Component)this).GetComponentInChildren(); } public void Update() { if (counter < timer) { counter += Time.deltaTime; } } } public class InfiltrateMovement : GameStateListener { public float force = 1000f; private float counter; public float cooldown = 1f; private Unit unit; private bool onBattle; private Vector3 currentDestination; public float velocityCap = 3f; public void Start() { //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) unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); currentDestination = unit.data.mainRig.position; } public void Update() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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) if (!onBattle || !Object.op_Implicit((Object)(object)unit) || !Object.op_Implicit((Object)(object)unit.data) || unit.data.Dead || !Object.op_Implicit((Object)(object)unit.data.mainRig)) { return; } counter += Time.deltaTime; if (counter >= cooldown && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)unit.data.targetData.unit)) { Vector3 velocity = unit.data.mainRig.velocity; if (((Vector3)(ref velocity)).magnitude <= velocityCap) { counter = 0f; Movement(CalculateDestination(unit.data.targetData.unit)); } } } protected override void Awake() { ((GameStateListener)this).Awake(); } public override void OnEnterBattleState() { onBattle = true; } public override void OnEnterPlacementState() { onBattle = false; } private Vector3 CalculateDestination(Unit target) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_006c: 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_0078: 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_0054: 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_0060: 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) Vector3 position = unit.data.mainRig.position; Vector3 position2 = target.data.mainRig.position; position2.y = position.y; Vector3 val = position2 - position; if (Mathf.Abs(val.x) > Mathf.Abs(val.z)) { return new Vector3(position2.x, position.y, position.z); } return new Vector3(position.x, position.y, position2.z); } private void Movement(Vector3 destination) { //IL_001f: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0039: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { Vector3 val2 = destination - val.position; val.AddForce(((Vector3)(ref val2)).normalized * force, (ForceMode)5); } } } public class RaptureEffectDetection : MonoBehaviour { } public class BunmarkEffectDetection : MonoBehaviour { } public class BEEGServalStretchPassive : MonoBehaviour { public Unit unit; private void Start() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)unit == (Object)null) { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); } if (!Object.op_Implicit((Object)(object)unit.data) || !Object.op_Implicit((Object)(object)unit.data.allRigs)) { return; } Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { if (!((Object)(object)val == (Object)(object)unit.data.mainRig)) { ConfigurableJoint val2 = ((Component)val).GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = ((Component)val).gameObject.AddComponent(); ((Joint)val2).connectedBody = unit.data.mainRig; } val2.xMotion = (ConfigurableJointMotion)1; val2.yMotion = (ConfigurableJointMotion)1; val2.zMotion = (ConfigurableJointMotion)1; ConfigurableJoint obj = val2; SoftJointLimitSpring linearLimitSpring = default(SoftJointLimitSpring); ((SoftJointLimitSpring)(ref linearLimitSpring)).spring = 80f; ((SoftJointLimitSpring)(ref linearLimitSpring)).damper = 15f; obj.linearLimitSpring = linearLimitSpring; ConfigurableJoint obj2 = val2; SoftJointLimit linearLimit = default(SoftJointLimit); ((SoftJointLimit)(ref linearLimit)).limit = 0.25f; obj2.linearLimit = linearLimit; val2.angularXMotion = (ConfigurableJointMotion)2; val2.angularYMotion = (ConfigurableJointMotion)2; val2.angularZMotion = (ConfigurableJointMotion)2; ((Joint)val2).autoConfigureConnectedAnchor = false; ((Joint)val2).anchor = Vector3.zero; ((Joint)val2).connectedAnchor = Vector3.zero; ((Joint)val2).massScale = 1f; ((Joint)val2).connectedMassScale = 2f; } } } } public class WoomiesMovement : MonoBehaviour { private Unit unit; private float counter; private float multiplier = 3f; public float cooldown = 3f; public GameObject particle; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); } public void DoMovement(Unit target) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] allRigs = target.data.allRigs.AllRigs; for (int i = 0; i < allRigs.Length; i++) { allRigs[i].AddForce(allRigs[i].velocity * multiplier, (ForceMode)5); ServiceLocator.GetService().PlaySoundEffect("Effects/Log", 1.5f, unit.data.mainRig.position, (MaterialType)0, (Transform)null, 0.7f); Object.Instantiate(particle, allRigs[i].position, Quaternion.identity, (Transform)null); } } public void Update() { counter += Time.deltaTime; if (counter >= cooldown && Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)unit.data.targetData.unit)) { _ = unit.data.targetData.unit; counter = 0f; DoMovement(unit); } } } public class ZoomiesMovement : GameStateListener { public float force = 2000f; private float counter; public float cooldown = 0.25f; private Unit unit; private bool onBattle; private Vector3 currentDestination; private bool moveDiagonalNext; public GameObject particles; public void Start() { //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) unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); currentDestination = unit.data.mainRig.position; } protected override void Awake() { ((GameStateListener)this).Awake(); } public override void OnEnterBattleState() { onBattle = true; } public override void OnEnterPlacementState() { onBattle = false; } public void Update() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (onBattle && Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.data) && !unit.data.Dead) { counter += Time.deltaTime; if (counter >= cooldown && Object.op_Implicit((Object)(object)unit.data.targetData) && Object.op_Implicit((Object)(object)unit.data.targetData.unit)) { counter = 0f; Movement(CalculateDestination(unit.data.targetData.unit)); moveDiagonalNext = !moveDiagonalNext; } } } private Vector3 CalculateDestination(Unit target) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_009e: 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_004f: 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_006f: 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_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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_00d5: 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_00b1: 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_00bd: Unknown result type (might be due to invalid IL or missing references) Vector3 position = unit.data.mainRig.position; Vector3 position2 = target.data.mainRig.position; position2.y = position.y; Vector3 val = position2 - position; if (moveDiagonalNext) { float num = Mathf.Min(Mathf.Abs(val.x), Mathf.Abs(val.z)); float num2 = Mathf.Sign(val.x) * num; float num3 = Mathf.Sign(val.z) * num; return position + new Vector3(num2, 0f, num3); } if (Mathf.Abs(val.x) > Mathf.Abs(val.z)) { return new Vector3(position2.x, position.y, position.z); } return new Vector3(position.x, position.y, position2.z); } private void Movement(Vector3 destination) { //IL_0025: 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_0037: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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) Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { Object.Instantiate(particles, val.position, Quaternion.identity, (Transform)null); Vector3 val2 = destination - val.position; val.AddForce(((Vector3)(ref val2)).normalized * force, (ForceMode)5); } } } public class CwiticalDelayedExplosion : MonoBehaviour { private Unit unit; private float counter; private ForcePoint forcePoint; private MeleeWeapon meleeWeapon; public float cooldown = 0.1f; public GameObject explosion; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); meleeWeapon = ((Component)this).GetComponentInChildren(); forcePoint = ((Component)this).GetComponentInChildren(); counter = cooldown; } public void Update() { //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_0068: 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_007e: 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_0090: Expected O, but got Unknown counter += Time.deltaTime; if (counter >= cooldown && Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)meleeWeapon) && meleeWeapon.isSwinging) { GameObject obj = Object.Instantiate(explosion, ((Component)forcePoint).transform.position, Quaternion.identity, (Transform)null); TeamHolder val = new TeamHolder { spawner = ((Component)unit).gameObject, team = unit.Team }; TeamHolder.AddTeamHolder(obj, unit, val); } } } public class AimedDroneBehaviour : MonoBehaviour { public Unit rootUnit; public Unit target; private float speed = 12f; private Rigidbody rigidbody; public SpawnObject spawnObject; public void Start() { if (!Object.op_Implicit((Object)(object)rigidbody)) { rigidbody = ((Component)this).GetComponentInChildren(); } if (!Object.op_Implicit((Object)(object)spawnObject)) { spawnObject = ((Component)this).GetComponentInChildren(); } rootUnit = ((Component)((Component)this).gameObject.transform.root).GetComponentInChildren(); } public void Update() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //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_00bf: 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_00c9: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)rootUnit) && Object.op_Implicit((Object)(object)rootUnit.data.targetData) && Object.op_Implicit((Object)(object)rootUnit.data)) { target = rootUnit.data.targetData.unit; if (Object.op_Implicit((Object)(object)rigidbody) && Object.op_Implicit((Object)(object)target) && (Object)(object)target != (Object)null && !rootUnit.data.Dead) { Vector3 val = target.data.mainRig.position - ((Component)this).transform.position; Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized); Quaternion val3 = Quaternion.Slerp(rigidbody.rotation, val2, speed * Time.deltaTime); rigidbody.MoveRotation(val3); } } } } public class FixedWeaponHandling : MonoBehaviour { public enum WeaponType { Ranged, Melee, Hybrid } public Unit unit; private RangeWeapon rangeWeapon; private MeleeWeapon meleeWeapon; public WeaponType weaponType; private Rigidbody weaponRig; private Rigidbody leftHandRig; private Rigidbody rightHandRig; private Holdable holdable; private void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); holdable = ((Component)this).GetComponentInChildren(); rangeWeapon = ((Component)this).GetComponentInChildren(); meleeWeapon = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)rangeWeapon) && Object.op_Implicit((Object)(object)meleeWeapon)) { weaponType = WeaponType.Hybrid; } else if (Object.op_Implicit((Object)(object)rangeWeapon)) { weaponType = WeaponType.Ranged; } else { weaponType = WeaponType.Melee; } weaponRig = ((Component)this).GetComponentInChildren(); if (Object.op_Implicit((Object)(object)unit) && (Object)(object)unit.data != (Object)null) { Transform leftHand = unit.data.leftHand; leftHandRig = (((Object)(object)leftHand != (Object)null) ? ((Component)leftHand).GetComponentInChildren() : null); Transform rightHand = unit.data.rightHand; rightHandRig = (((Object)(object)rightHand != (Object)null) ? ((Component)rightHand).GetComponentInChildren() : null); } } private void Update() { //IL_0092: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_010c: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0160: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)weaponRig != (Object)null && Object.op_Implicit((Object)(object)holdable) && holdable.holdableData != null && weaponRig.isKinematic && (Object)(object)unit != (Object)null && (Object)(object)unit.data != (Object)null && !unit.data.Dead) { Debug.LogError((object)"Weapon not connected to hands yet, connecting..."); Debug.LogError((object)("HandLeftPos: " + leftHandRig.position)); Vector3 val = Vector3.zero; Transform leftHand = holdable.holdableData.leftHand; if ((Object)(object)leftHand != (Object)null) { val = ((Component)leftHand).transform.position; } if ((Object)(object)leftHandRig != (Object)null) { leftHandRig.position = val; } Debug.LogError((object)("HandLeftSupposedToBe: " + val)); Debug.LogError((object)("HandRightPos: " + rightHandRig.position)); Vector3 val2 = Vector3.zero; Transform rightHand = holdable.holdableData.rightHand; if ((Object)(object)rightHand != (Object)null) { val2 = ((Component)rightHand).transform.position; } if ((Object)(object)rightHandRig != (Object)null) { rightHandRig.position = val2; } Debug.LogError((object)("HandRightSupposedToBe: " + val2)); } } } public class SpeedyIdleWobble : MonoBehaviour { [Header("Wobble Settings")] [Tooltip("Cycles per second (0.2–1.0 feels heavy).")] public float wobbleFrequency = 0.5f; [Tooltip("Horizontal sway in meters.")] public float swayAmplitude = 0.1f; [Tooltip("Vertical compression amplitude.")] public float compressAmplitude = 0.1f; [Tooltip("Tilt angle (degrees) for sway.")] public float tiltAngle = 6f; [Tooltip("Randomize phase offset for uniqueness.")] public bool randomizePhase = true; private Transform rootTransform; private Vector3 originalPos; private Quaternion originalRot; private float phaseOffset; private void Start() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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) rootTransform = ((Component)this).transform.root; originalPos = rootTransform.localPosition; originalRot = rootTransform.localRotation; phaseOffset = (randomizePhase ? Random.Range(0f, 1000f) : 0f); } private void Update() { //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_006f: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) float num = (float)Math.PI * 2f * wobbleFrequency; float num2 = Time.time * num + phaseOffset; float num3 = Mathf.Sin(num2) * swayAmplitude; float num4 = Mathf.Abs(Mathf.Cos(num2)) * compressAmplitude; float num5 = Mathf.Sin(num2) * tiltAngle; Vector3 localPosition = originalPos; localPosition.x += num3; localPosition.y -= num4; rootTransform.localPosition = localPosition; Quaternion localRotation = originalRot * Quaternion.Euler(0f, 0f, num5); rootTransform.localRotation = localRotation; } private void OnDisable() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rootTransform != (Object)null) { rootTransform.localPosition = originalPos; rootTransform.localRotation = originalRot; } } } internal class AddTeardownBehaviour : MonoBehaviour { public GameObject indicationObject; public Unit unit; public void Start() { unit = ((Component)((Component)this).transform.root).GetComponentInChildren(); MeleeWeapon[] componentsInChildren = ((Component)unit).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.AddComponent().bloodParticles = indicationObject; } } } } namespace RandomUnitsUtilities { public sealed class UTI { public class Uti : MonoBehaviour { public static class ItemCat { public static GameObject SetTag(GameObject item, string categoryName = "Random Units", TagType tagType = (TagType)0) { //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_002e: Unknown result type (might be due to invalid IL or missing references) try { CharacterItem componentInChildren = item.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { componentInChildren.tags = new List { new Tag { tagType = tagType, value = categoryName } }; } } catch (Exception ex) { Loader.Log(ex.ToString()); } return item; } } private static Dictionary CombatMoves { get { Dictionary dictionary = HelpLibrary.m_combatMoves; if (dictionary == null) { dictionary = (HelpLibrary.m_combatMoves = new Dictionary()); } return dictionary; } } private static Dictionary CharacterProps { get { Dictionary dictionary = HelpLibrary.m_characterProps; if (dictionary == null) { dictionary = (HelpLibrary.m_characterProps = new Dictionary()); } return dictionary; } } private static Dictionary UnitBases { get { Dictionary dictionary = HelpLibrary.m_unitBases; if (dictionary == null) { dictionary = (HelpLibrary.m_unitBases = new Dictionary()); } return dictionary; } } private static Dictionary Factions { get { Dictionary dictionary = HelpLibrary.m_factions; if (dictionary == null) { dictionary = (HelpLibrary.m_factions = new Dictionary()); } return dictionary; } } private static Dictionary Weapons { get { Dictionary dictionary = HelpLibrary.m_weapons; if (dictionary == null) { dictionary = (HelpLibrary.m_weapons = new Dictionary()); } return dictionary; } } private static Dictionary Projectiles { get { Dictionary dictionary = HelpLibrary.m_projectiles; if (dictionary == null) { dictionary = (HelpLibrary.m_projectiles = new Dictionary()); } return dictionary; } } public static AssetBundle LoadBundle(string assetBundleName) { Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(assetBundleName); if (manifestResourceStream == null) { Loader.LogError("Failed to find resource: " + assetBundleName); return null; } if (!manifestResourceStream.CanRead) { Loader.LogError("Resource stream is not readable: " + assetBundleName); return null; } return AssetBundle.LoadFromStream(manifestResourceStream); } public static Sprite LoadBundleTextureToSprite(string name) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0041: 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) Loader.Log("Loading the texture named: " + name); Texture2D val = (Texture2D)bundle.LoadAsset(name); ((Texture)val).filterMode = (FilterMode)0; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } public static GameObject LoBuGaOb(string name) { return bundle.LoadAsset(name); } public static AudioClip LoadBundleAudioClip(string name) { return bundle.LoadAsset(name); } public static Material LoadBundleMaterial(string name) { return bundle.LoadAsset(name); } public static int IDChecker(AssetType type, int startId = 1) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) int num = Math.Max(1, startId); DatabaseID id = default(DatabaseID); ((DatabaseID)(ref id))..ctor(num); while (IsOccupied(type, id)) { Loader.LogWarning($"ID {num} in use for {type}, trying {num + 1}…"); num++; ((DatabaseID)(ref id))..ctor(num); } Loader.Log($"Found free ID for {type}: {num}"); return num; } private static bool IsOccupied(AssetType type, DatabaseID id) { //IL_0025: 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_003d: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) return type switch { AssetType.Prop => CharacterProps.ContainsKey(id), AssetType.UnitBase => UnitBases.ContainsKey(id), AssetType.Faction => Factions.ContainsKey(id), AssetType.Ability => CombatMoves.ContainsKey(id), AssetType.Weapon => Weapons.ContainsKey(id), AssetType.Projectile => Projectiles.ContainsKey(id), _ => throw new ArgumentOutOfRangeException("type", type, null), }; } public static void AddLocalization() { (string, string, string, string, string)[] array = new(string, string, string, string, string)[1] { ("NYAN-CHAN-UNIT", "Nyan-chan", "にゃちゃん", "喵酱", "Нян-тян") }; Dictionary> dictionary = (Dictionary>)typeof(Localizer).GetField("m_localization", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); try { for (int i = 0; i < array.Length; i++) { dictionary[(Language)7].Add(array[i].Item1, array[i].Item4); dictionary[(Language)3].Add(array[i].Item1, array[i].Item2); dictionary[(Language)0].Add(array[i].Item1, array[i].Item2); dictionary[(Language)4].Add(array[i].Item1, array[i].Item2); dictionary[(Language)1].Add(array[i].Item1, array[i].Item2); dictionary[(Language)2].Add(array[i].Item1, array[i].Item2); dictionary[(Language)8].Add(array[i].Item1, array[i].Item3); dictionary[(Language)5].Add(array[i].Item1, array[i].Item2); dictionary[(Language)6].Add(array[i].Item1, array[i].Item5); } } catch { } } } public enum AssetType { Prop, UnitBase, Faction, Ability, Weapon, Projectile } public static AssetBundle bundle; } }