Decompiled source of Hacker Peasant v2.1.5
HackerPeasant.dll
Decompiled 12 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using DM; using HackerPeasant.Skillset; using HackerPeasant.StupidUtility; using HackerPeasant.VFX; using HarmonyLib; using Landfall.TABC; using Landfall.TABS; using Landfall.TABS.AI; using Landfall.TABS.AI.Systems; using Landfall.TABS.GameMode; using Landfall.TABS.GameState; using Landfall.TABS.RuntimeCleanup; using Landfall.TABS.Services; using Landfall.TABS.UnitPlacement; using TFBGames; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("HackerPeasant")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("HackerPeasant")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8a5412ef-f1e9-45f2-95e4-b79e5d23572e")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("1.0.0.0")] namespace HackerPeasant { public class BeGlitchy : MonoBehaviour { public bool dont = false; private void Start() { } private void Update() { } } [BepInPlugin("tabsthegame.exmagikguy.drhaxmod", "Hacker Peasant", "1.0.0")] public class DrHaxSystem : BaseUnityPlugin { public static UnitButton peasantButton; public static TextMeshProUGUI peasantButtonCost; public static LocalizeText peasantButtonName; public static UnitBlueprint peasantBlueprint; public static DrHaxSystem mevar; public static List<string> fakeNames; public static int AliasesCount; public static string originalPeasantName = "Peasant"; public static Harmony harmony; public static GameState oldState = (GameState)0; public static GameStateManager stateManager = null; public static bool harmonized = false; public static Dictionary<string, GameObject> projectiles = new Dictionary<string, GameObject>(); public static ProjectilesSpawnManager projectilor; public static List<TextMeshProUGUI> alwaysUpdateText = new List<TextMeshProUGUI>(); public float slowUpdate = 0f; public static GameModeService modeService; private void Awake() { mevar = this; TotallyRealNames.Populate(); Log(0, "Hi :)"); ShitLoader3000.Init(); } public static void Log(int level = 0, string log = "Log") { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) LogLevel val = (LogLevel)16; switch (level) { case 1: val = (LogLevel)4; break; case 2: val = (LogLevel)2; break; } ((BaseUnityPlugin)mevar).Logger.Log(val, (object)log); } public static int NORMALRandom(int min, int max) { return Random.Range(min, max + 1); } public static float NORMALRandom(float min, float max) { return Random.Range(min, max + 1f); } public static string GenerateRandomString(string charset, int length) { string text = ""; char[] array = charset.ToCharArray(); for (int i = 0; i < length; i++) { text += array[NORMALRandom(0, array.Length - 1)]; } return text; } private void Update() { //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Invalid comparison between Unknown and I4 //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Invalid comparison between Unknown and I4 if (!harmonized && Input.GetKeyDown((KeyCode)284)) { harmony = new Harmony("tabsthegame.exmagikguy.drhaxmod"); harmony.PatchAll(Assembly.GetExecutingAssembly()); harmonized = true; } if ((Object)(object)peasantButton != (Object)null && Input.GetKey((KeyCode)284)) { if (((Behaviour)peasantButtonCost).enabled) { ((TMP_Text)peasantButtonCost).text = ((Random.value < 0.5f) ? "-" : " ") + GenerateRandomString("123456789012345678901234567890!@$#", 6); } ((TMP_Text)peasantButtonName.Text).text = fakeNames[NORMALRandom(0, AliasesCount)]; peasantButtonName.Localized = false; peasantBlueprint.forceCost = 99999999u; } if ((Object)(object)peasantButton != (Object)null && Input.GetKeyUp((KeyCode)284)) { ((TMP_Text)peasantButtonCost).text = "30"; peasantButtonName.Localized = true; ((TMP_Text)peasantButtonName.Text).text = originalPeasantName; peasantBlueprint.forceCost = 30u; } if (stateManager == null) { stateManager = ServiceLocator.GetService<GameStateManager>(); } if ((Object)(object)modeService == (Object)null) { modeService = ServiceLocator.GetService<GameModeService>(); } if ((int)stateManager.GameState == 1 && Hax.allHackers.Count > 0 && (Object)(object)peasantBlueprint != (Object)null) { if ((Object)(object)modeService != (Object)null && !Hax.matchOverTwo && modeService.CurrentGameMode.MatchOver) { Time.timeScale = 1f; modeService.CurrentGameMode.MatchOver = false; ServiceLocator.GetService<TimeService>().UnPause(); Hax.matchOverTwo = false; } foreach (Unit allHacker in Hax.allHackers) { if ((Object)(object)allHacker != (Object)null && (Object)(object)((Component)allHacker).GetComponent<Hax>() == (Object)null) { ((Component)allHacker).gameObject.AddComponent<Hax>(); } else if ((Object)(object)allHacker != (Object)null && !((Behaviour)((Component)allHacker).GetComponent<Hax>()).enabled) { ((Behaviour)((Component)allHacker).GetComponent<Hax>()).enabled = true; } } Hax.heartbeat -= Mathf.Clamp(Time.fixedDeltaTime, 0f, 0.11f); if (Hax.heartbeat < 0f) { Hax.protectedObjects.Clear(); try { List<Unit> list = new List<Unit>(Hax.allHackers.ToArray()); foreach (Unit item in list) { if ((Object)(object)item != (Object)null && (Object)(object)((Component)item).GetComponent<Hax>() != (Object)null) { Object.DestroyImmediate((Object)(object)((Component)item).GetComponent<Hax>()); item.DestroyUnit(); } } } catch { } Hax.allHackers.Clear(); Unit unitToSpawn; Hax hax = MEGASpawn(peasantBlueprint, Hax.lastHackerSpawnPos.Key, Hax.lastHackerSpawnPos.Value, Hax.HackerTeam, out unitToSpawn, 1f, isCampaignUnit: false, spawnRiders: false)[0].AddComponent<Hax>(); if ((Object)(object)unitToSpawn != (Object)null) { Hax.allHackers.Add(unitToSpawn); } Time.timeScale = 1f; modeService.CurrentGameMode.MatchOver = false; ServiceLocator.GetService<TimeService>().UnPause(); Hax.matchOverTwo = false; Hax.heartbeat = 0.2f; } } else { Hax.heartbeat = 0.2f; } if (stateManager.GameState != oldState) { if (!harmonized) { harmony = new Harmony("tabsthegame.exmagikguy.drhaxmod"); harmony.PatchAll(Assembly.GetExecutingAssembly()); harmonized = true; } Hax.hackerInMatch = (Object)(object)Object.FindObjectOfType<Hax>() != (Object)null; Hax.matchUnendable = Object.FindObjectsOfType<Hax>().Length > 1; Log(0, $"New State, Hacker? {Hax.hackerInMatch}"); oldState = stateManager.GameState; if ((int)oldState == 0) { while (alwaysUpdateText.Count > 0) { ToggleTextPreProcessor(alwaysUpdateText[0], null, 0); } Hax.protectedObjects.Clear(); List<Unit> list2 = new List<Unit>(Hax.allHackers.ToArray()); foreach (Unit item2 in list2) { Object.DestroyImmediate((Object)(object)((Component)item2).GetComponent<Hax>()); item2.DestroyUnit(); } Hax.allHackers.Clear(); Hax.matchOverTwo = false; } } if (alwaysUpdateText.Count <= 0) { return; } foreach (TextMeshProUGUI item3 in alwaysUpdateText) { ((TMP_Text)item3).ForceMeshUpdate(false, false); } } public static void ToggleTextPreProcessor(TextMeshProUGUI textMesh, ITextPreprocessor preprocessor = null, int enabled = 2, bool makeAlwaysUpdate = false) { if ((enabled == 2 && ((TMP_Text)textMesh).textPreprocessor == null) || enabled == 1) { ((TMP_Text)textMesh).textPreprocessor = preprocessor; if (makeAlwaysUpdate && !alwaysUpdateText.Contains(textMesh)) { alwaysUpdateText.Add(textMesh); } } else if ((enabled == 2 && ((TMP_Text)textMesh).textPreprocessor != null) || enabled == 0) { ((TMP_Text)textMesh).textPreprocessor = null; alwaysUpdateText.Remove(textMesh); } ((TMP_Text)textMesh).ForceMeshUpdate(false, false); } public static GameObject[] MEGASpawn(UnitBlueprint bp, Vector3 posistion, Quaternion rotation, Team team, out Unit unitToSpawn, float sentSizeMulti = 1f, bool isCampaignUnit = false, bool spawnRiders = true, int martianInstanceId = 0, UnitPoolInfo? poolInfo = null) { //IL_0046: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0533: Expected O, but got Unknown //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Expected O, but got Unknown //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Expected O, but got Unknown //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_0830: Invalid comparison between Unknown and I4 //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08de: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_0993: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Unknown result type (might be due to invalid IL or missing references) //IL_0909: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Invalid comparison between Unknown and I4 //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0c39: Unknown result type (might be due to invalid IL or missing references) //IL_0c3e: Unknown result type (might be due to invalid IL or missing references) List<GameObject> list = new List<GameObject>(); Weapon val = null; Weapon val2 = null; if ((Object)(object)bp.UnitBase == (Object)null) { Debug.LogError((object)("UnitBase is Null: " + bp.Entity.Name)); } GlobalSettingsHandler service = ServiceLocator.GetService<GlobalSettingsHandler>(); GameObject val3 = Object.Instantiate<GameObject>(bp.UnitBase, posistion, rotation); SettingsInstance settingsInstance = service.GetSettingsInstance("VIDEO_SPAWN"); GameModeService service2 = ServiceLocator.GetService<GameModeService>(); BaseGameMode currentGameMode = service2.CurrentGameMode; bool flag = service2.IsGameModeRestricted(); if (settingsInstance.currentValue == 0 || currentGameMode is MainMenuGameMode) { PlacementSpawnEffects componentInChildren = val3.GetComponentInChildren<PlacementSpawnEffects>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { Object.Destroy((Object)(object)((Component)componentInChildren).gameObject); } } TeamColor[] componentsInChildren = val3.GetComponentsInChildren<TeamColor>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].SetTeamColor(team); } list.Add(val3); float num = 1f; if (((object)currentGameMode).GetType() == typeof(OnlineMultiplayerGameMode)) { num = sentSizeMulti * bp.sizeMultiplier; } else { if (bp.minSizeRandom != bp.maxSizeRandom) { num = NormalRandom.GetRandom(bp.minSizeRandom, bp.maxSizeRandom) * bp.sizeMultiplier; } if (Random.Range(0, 10000) == 0) { num *= ((Random.value < 0.7f) ? 0.1f : 2f); } } num *= sentSizeMulti; if (bp.forceNoRandomSize) { num = sentSizeMulti * bp.sizeMultiplier; } if (Bugs._DLC_ACTIVATED && !flag) { SettingsInstance settingsInstance2 = service.GetSettingsInstance("BUG_BIG_UNITS"); SettingsInstance settingsInstance3 = service.GetSettingsInstance("BUG_SMALL_UNITS"); if (settingsInstance2.currentValue == 1) { num *= 1.5f; } if (settingsInstance3.currentValue == 1) { num /= 1.5f; } } val3.SetActive(false); Transform transform = val3.transform; transform.localScale *= num; val3.SetActive(true); unitToSpawn = val3.GetComponent<Unit>(); unitToSpawn.InitializeUnit(team); unitToSpawn.unitBlueprint = bp; unitToSpawn.Team = team; unitToSpawn.data.health = bp.health * num * num; unitToSpawn.RemoteInstanceId = (short)martianInstanceId; unitToSpawn.PoolInfo = poolInfo; unitToSpawn.SetEnableSyncTransforms(!unitToSpawn.IsInPool); unitToSpawn.OriginatesFromClient = martianInstanceId != 0; if (bp.targetingPriorityMultiplier != 0f) { unitToSpawn.targetingPriorityMultiplier = bp.targetingPriorityMultiplier; } if (isCampaignUnit) { unitToSpawn.SetCampaignUnit(); } if (bp.objectsToSpawnAsChildren != null) { for (int j = 0; j < bp.objectsToSpawnAsChildren.Length; j++) { if (!((Object)(object)bp.objectsToSpawnAsChildren[j] == (Object)null)) { GameObject val4 = Object.Instantiate<GameObject>(bp.objectsToSpawnAsChildren[j], ((Component)unitToSpawn).transform.position, ((Component)unitToSpawn).transform.rotation, ((Component)unitToSpawn).transform); TeamColor[] componentsInChildren2 = val3.GetComponentsInChildren<TeamColor>(); for (int k = 0; k < componentsInChildren2.Length; k++) { componentsInChildren2[j].SetTeamColor(team); } } } } UnitSounds componentInChildren2 = ((Component)unitToSpawn).GetComponentInChildren<UnitSounds>(); if (Object.op_Implicit((Object)(object)componentInChildren2)) { FieldInfo field = typeof(UnitBlueprint).GetField("vocalPathData", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field2 = typeof(UnitBlueprint).GetField("footPathData", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field3 = typeof(UnitBlueprint).GetField("deathPathData", BindingFlags.Instance | BindingFlags.NonPublic); if (field.GetValue(bp) == null || ((AudioPathData)field.GetValue(bp)).Category == null || field2.GetValue(bp) == null || ((AudioPathData)field2.GetValue(bp)).Category == null || field3.GetValue(bp) == null || ((AudioPathData)field3.GetValue(bp)).Category == null) { bp.Validate(); } if (Bugs._DLC_ACTIVATED && !flag) { SettingsInstance settingsInstance4 = service.GetSettingsInstance("BUG_BIG_UNITS"); SettingsInstance settingsInstance5 = service.GetSettingsInstance("BUG_SMALL_UNITS"); if (settingsInstance4.currentValue == 1 && settingsInstance5.currentValue != 1) { ((AudioPathData)field.GetValue(bp)).EffectPitch = 0.5f; } if (settingsInstance5.currentValue == 1 && settingsInstance4.currentValue != 1) { ((AudioPathData)field.GetValue(bp)).EffectPitch = 2f; } } componentInChildren2.VocalPathData = (AudioPathData)field.GetValue(bp); componentInChildren2.FootPathData = (AudioPathData)field2.GetValue(bp); componentInChildren2.DeathPathData = (AudioPathData)field3.GetValue(bp); if (bp.VoicePitch <= 0f) { bp.VoicePitch = 1f; } componentInChildren2.Pitch = bp.VoicePitch; } Balance componentInChildren3 = ((Component)unitToSpawn).GetComponentInChildren<Balance>(); if (bp.balanceMultiplier == 0f) { bp.balanceMultiplier = 1f; } if (bp.balanceForceMultiplier == 0f) { bp.balanceForceMultiplier = 1f; } if (Object.op_Implicit((Object)(object)componentInChildren3)) { componentInChildren3.allowedFootDistance *= bp.balanceMultiplier * bp.sizeMultiplier; componentInChildren3.allowedLegAngle *= bp.balanceMultiplier; componentInChildren3.allowedTorsoAngle *= bp.balanceMultiplier; componentInChildren3.forceMultiplier *= bp.balanceForceMultiplier; } if (Object.op_Implicit((Object)(object)bp.Mount)) { GameObject[] array = val3.AddComponent<Mount>().EnterMount(bp.Mount, (Unit)null, 0); for (int l = 0; l < array.Length; l++) { list.Add(array[l]); } } UnitBlueprint[] unitRiders = bp.UnitRiders; if (unitRiders != null && spawnRiders) { RiderHolder val5 = val3.AddComponent<RiderHolder>(); List<GameObject> list2 = new List<GameObject>(); Unit val6 = default(Unit); for (int m = 0; m < unitRiders.Length; m++) { if (!((Object)(object)unitRiders[m] == (Object)null)) { GameObject[] array2 = unitRiders[m].Spawn(posistion, rotation, team, ref val6, 1f, false, false, 0, (UnitPoolInfo?)null); if (isCampaignUnit) { val6.SetCampaignUnit(); } list2.Add(array2[0]); for (int n = 0; n < array2.Length; n++) { list.Add(array2[n]); } ((Component)val6).gameObject.AddComponent<Mount>().EnterMount((UnitBlueprint)null, unitToSpawn, m); for (int num2 = 0; num2 < array2.Length; num2++) { list.Add(array2[num2]); } val6.IsRider = true; if (martianInstanceId != 0) { val6.IsRiderWithLinkedMount = true; } } } val5.Addriders(list2); } if (Object.op_Implicit((Object)(object)bp.RightWeapon)) { val = bp.SetWeapon(unitToSpawn, team, bp.RightWeapon, bp.RightWeaponData, (HandType)0, rotation, list, false); if (Object.op_Implicit((Object)(object)val)) { if (bp.scaleWeapons) { Transform transform2 = ((Component)val).transform; transform2.localScale *= sentSizeMulti; } unitToSpawn.targetYourFriends = (int)val.m_weaponTargetType == 1; } if (Object.op_Implicit((Object)(object)val) && ((object)val).GetType() == typeof(RangeWeapon) && (Object)(object)bp.rightProjectile != (Object)null) { ((RangeWeapon)val).ObjectToSpawn = ((Component)bp.rightProjectile).gameObject; } } if (Object.op_Implicit((Object)(object)bp.LeftWeapon)) { val2 = bp.SetWeapon(unitToSpawn, team, bp.LeftWeapon, bp.LeftWeaponData, (HandType)1, rotation, list, false); if (Object.op_Implicit((Object)(object)val2)) { if (bp.scaleWeapons) { Transform transform3 = ((Component)val2).transform; transform3.localScale *= sentSizeMulti; } if (!unitToSpawn.targetYourFriends && (Object)(object)val != (Object)null) { unitToSpawn.targetYourFriends = (int)val.m_weaponTargetType == 1; } } if (Object.op_Implicit((Object)(object)val2) && ((object)val2).GetType() == typeof(RangeWeapon) && (Object)(object)bp.leftProjectile != (Object)null) { ((RangeWeapon)val2).ObjectToSpawn = ((Component)bp.leftProjectile).gameObject; } } if (!Object.op_Implicit((Object)(object)bp.RightWeapon) && !Object.op_Implicit((Object)(object)bp.LeftWeapon)) { bp.SetWeapon(unitToSpawn, team, (GameObject)null, (PropItemData)null, (HandType)0, rotation, list, false); } CurveAnimation[] componentsInChildren3 = val3.GetComponentsInChildren<CurveAnimation>(); foreach (CurveAnimation obj in componentsInChildren3) { obj.multiplier *= bp.animationMultiplier; } Unit component = val3.GetComponent<Unit>(); if (Object.op_Implicit((Object)(object)component)) { component.thickness += Mathf.Clamp((bp.sizeMultiplier - 1f) * 0.3f, 0f, 100f); } RigidbodyHolder componentInChildren4 = val3.GetComponentInChildren<RigidbodyHolder>(); if (Object.op_Implicit((Object)(object)componentInChildren4) && bp.dragMultiplier != 0f) { componentInChildren4.dragMultiplier *= bp.dragMultiplier; } MovementHandler componentInChildren5 = val3.GetComponentInChildren<MovementHandler>(); if (Object.op_Implicit((Object)(object)componentInChildren5)) { componentInChildren5.multiplier *= bp.movementSpeedMuiltiplier; } StepHandler componentInChildren6 = val3.GetComponentInChildren<StepHandler>(); if (Object.op_Implicit((Object)(object)componentInChildren6)) { componentInChildren6.multiplier *= bp.stepMultiplier; } WheelMovementHandler componentInChildren7 = val3.GetComponentInChildren<WheelMovementHandler>(); if (Object.op_Implicit((Object)(object)componentInChildren7)) { componentInChildren7.multiplier *= bp.movementSpeedMuiltiplier; } if (bp.ArmLimitMultiplier != 1f && bp.ArmLimitMultiplier != 0f) { if (Object.op_Implicit((Object)(object)unitToSpawn.data.rightArm)) { SetGlobalJointSettings.SetJointMultiplier(bp.ArmLimitMultiplier, ((Component)unitToSpawn.data.rightArm).GetComponent<Rigidbody>()); } if (Object.op_Implicit((Object)(object)unitToSpawn.data.leftArm)) { SetGlobalJointSettings.SetJointMultiplier(bp.ArmLimitMultiplier, ((Component)unitToSpawn.data.leftArm).GetComponent<Rigidbody>()); } } if (bp.neckLimitMultiplier != 1f && bp.neckLimitMultiplier != 0f && Object.op_Implicit((Object)(object)unitToSpawn.data.head)) { SetGlobalJointSettings.SetJointMultiplier(bp.neckLimitMultiplier, ((Component)unitToSpawn.data.head).GetComponent<Rigidbody>()); } unitToSpawn.SetMassMultiplier(bp.massMultiplier * num * num); bp.DoMultipliers(unitToSpawn); try { if (bp.m_props != null && bp.m_props.Length != 0) { UnitRig component2 = val3.GetComponent<UnitRig>(); if (!((Object)(object)component2 == (Object)null)) { component2.SpawnProps(bp.m_props, bp.m_propData, unitToSpawn.RigType, team); } } } catch (Exception ex) { Debug.LogError((object)("Spawning prop failed: " + ex.Message + Environment.NewLine + ex.StackTrace)); } if (Object.op_Implicit((Object)(object)val2) && unitToSpawn.m_AttackDistance < val2.maxRange) { unitToSpawn.m_AttackDistance = val2.maxRange; } if (Object.op_Implicit((Object)(object)val) && unitToSpawn.m_AttackDistance < val.maxRange) { unitToSpawn.m_AttackDistance = val.maxRange; } unitToSpawn.m_PreferedDistance = unitToSpawn.m_AttackDistance - 0.3f; GameObject[] array3 = list.ToArray(); ServiceLocator.GetService<RuntimeGarbageCollector>().AddGameObjects(array3); unitToSpawn.spawnedObjects = array3; LodGroupMerger component3 = val3.GetComponent<LodGroupMerger>(); if ((Object)(object)component3 != (Object)null) { component3.ConsolidateChildLodGroups(); } return array3; } } public class GlitchNumberTextProcessor : ITextPreprocessor { public string PreprocessText(string text) { return ((Random.value < 0.5f) ? "-" : " ") + DrHaxSystem.GenerateRandomString("123456789012345678901234567890!@$#", 8); } } [HarmonyPatch] public class Patches { public static UnitBlueprint CostReturnBlueprint = null; public static FieldInfo teamUnitsF = typeof(TeamSystem).GetField("m_teamUnits", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo HPBarDataF = typeof(TABCUnitUI).GetField("m_dataHandler", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo HPHanUnitF = typeof(HealthHandler).GetField("unit", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo UnAPIUnitF = typeof(UnitAPI).GetField("m_unit", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo DelayedEndCF = typeof(BaseGameMode).GetField("m_delayedEndGameRoutine", BindingFlags.Instance | BindingFlags.NonPublic); public static FieldInfo DelayedEndSF = typeof(BaseGameMode).GetField("m_delayGameOverSetting", BindingFlags.Instance | BindingFlags.NonPublic); public static MethodInfo DelayedEndFunc = typeof(BaseGameMode).GetMethod("DelayedCheckMatchOver", BindingFlags.Instance | BindingFlags.NonPublic); [HarmonyPatch(typeof(UnitButton), "SetupUnit", new Type[] { typeof(UnitButtonData) })] [HarmonyPostfix] private static void FindPeasantButton(UnitButton __instance, UnitButtonData unitButtonData) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown if ((Object)(object)unitButtonData.unit != (Object)null && !unitButtonData.unit.IsCustomUnit && !unitButtonData.unit.IsModUnit && unitButtonData.unit.Name == "UNIT_LEGACY_PEASANT") { if ((Object)(object)DrHaxSystem.peasantButton == (Object)null && unitButtonData.unit.GetUnitCost(true) == 30) { DrHaxSystem.peasantButton = __instance; DrHaxSystem.peasantBlueprint = unitButtonData.unit; DrHaxSystem.peasantButtonCost = (TextMeshProUGUI)typeof(UnitButton).GetField("m_cost", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); DrHaxSystem.peasantButtonName = (LocalizeText)typeof(UnitButton).GetField("m_unitName", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); DrHaxSystem.originalPeasantName = ((TMP_Text)DrHaxSystem.peasantButtonName.Text).text; } else { unitButtonData.unit.forceCost = (Input.GetKey((KeyCode)284) ? 99999999u : 30u); } } } [HarmonyPatch(typeof(UnitButton), "SetupUnit", new Type[] { typeof(Sprite), typeof(DatabaseID), typeof(IPlacementUI), typeof(bool) })] [HarmonyPostfix] private static void FindPeasantButton2(UnitButton __instance, Sprite icon, DatabaseID id, IPlacementUI placementUI, bool Unlocked) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown UnitBlueprint unitBlueprint = ContentDatabase.Instance().GetUnitBlueprint(id); if ((Object)(object)DrHaxSystem.peasantButton == (Object)null && (Object)(object)unitBlueprint != (Object)null && unitBlueprint.Name == "UNIT_LEGACY_PEASANT" && unitBlueprint.GetUnitCost(true) == 30 && !unitBlueprint.IsCustomUnit && !unitBlueprint.IsModUnit) { DrHaxSystem.peasantButton = __instance; DrHaxSystem.peasantBlueprint = unitBlueprint; DrHaxSystem.peasantButtonCost = (TextMeshProUGUI)typeof(UnitButton).GetField("m_cost", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); DrHaxSystem.peasantButtonName = (LocalizeText)typeof(UnitButton).GetField("m_unitName", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance); DrHaxSystem.originalPeasantName = ((TMP_Text)DrHaxSystem.peasantButtonName.Text).text; } } [HarmonyPatch(typeof(UnitPlacementBrush), "RemoveUnitInternal")] [HarmonyPrefix] private static bool FixHaxCost(UnitPlacementBrush __instance, Unit unit, Team team) { //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)unit).GetComponent<Hax>() != (Object)null) { Hax.protectedObjects.Remove((Object)(object)((Component)unit).gameObject); Hax.allHackers.Remove(unit); if (unit.spawnedObjects != null) { GameObject[] spawnedObjects = unit.spawnedObjects; foreach (GameObject val in spawnedObjects) { if ((Object)(object)val != (Object)null) { Hax.protectedObjects.Remove((Object)(object)val); } } } Transform[] componentsInChildren = ((Component)((Component)unit).transform).GetComponentsInChildren<Transform>(); foreach (Transform val2 in componentsInChildren) { Hax.protectedObjects.Remove((Object)(object)((Component)val2).gameObject); } } UnitBlueprint unitBlueprint = unit.unitBlueprint; if (unitBlueprint.Name == "UNIT_LEGACY_PEASANT" && !unitBlueprint.IsCustomUnit && !unitBlueprint.IsModUnit) { unitBlueprint.forceCost = (((Object)(object)((Component)unit).gameObject.GetComponent<Hax>() != (Object)null) ? 99999999u : 30u); if (unitBlueprint.forceCost > 40) { MoneyUI val3 = (MoneyUI)typeof(PlacementUI).GetField((((int)team == 0) ? "red" : "blue") + "Money", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(PlacementUI.Instance); int num = 0; Hax[] array = Object.FindObjectsOfType<Hax>(); foreach (Hax hax in array) { if (hax.hacker.Team == team) { num++; } } if (num < 2) { DrHaxSystem.ToggleTextPreProcessor(val3.moneyText, null, 0); DrHaxSystem.ToggleTextPreProcessor(val3.unitCountText, null, 0); } } CostReturnBlueprint = unitBlueprint; } return true; } [HarmonyPatch(typeof(UnitPlacementBrush), "RemoveUnitInternal")] [HarmonyPostfix] private static void ReturnPeasantCost(UnitPlacementBrush __instance, Unit unit, Team team) { if ((Object)(object)CostReturnBlueprint != (Object)null) { CostReturnBlueprint.forceCost = (Input.GetKey((KeyCode)284) ? 99999999u : 30u); CostReturnBlueprint = null; } } [HarmonyPatch(typeof(Unit), "Start")] [HarmonyPostfix] private static void AddHax(Unit __instance) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown if (__instance.unitBlueprint.Name == "UNIT_LEGACY_PEASANT" && __instance.unitBlueprint.forceCost > 99999998 && !__instance.unitBlueprint.IsCustomUnit && !__instance.unitBlueprint.IsModUnit) { ((Component)__instance).gameObject.AddComponent<Hax>(); MoneyUI val = (MoneyUI)typeof(PlacementUI).GetField((((int)__instance.Team == 0) ? "red" : "blue") + "Money", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(PlacementUI.Instance); DrHaxSystem.ToggleTextPreProcessor(val.moneyText, (ITextPreprocessor)(object)new GlitchNumberTextProcessor(), 1, makeAlwaysUpdate: true); DrHaxSystem.ToggleTextPreProcessor(val.unitCountText, (ITextPreprocessor)(object)new GlitchNumberTextProcessor(), 1, makeAlwaysUpdate: true); } } [HarmonyPatch(typeof(HealthHandler), "Die", new Type[] { typeof(Unit) })] [HarmonyPrefix] private static bool ExtraUnkillablility(HealthHandler __instance, Unit damager, ref bool __result) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((Component)(Unit)HPHanUnitF.GetValue(__instance)).gameObject.GetComponent<Hax>() != (Object)null) { __result = false; return false; } return true; } [HarmonyPatch(typeof(BaseGameMode), "DecideWinner")] [HarmonyPrefix] private static bool NuhUh(BaseGameMode __instance, Team winningTeam, string subText) { //IL_000f: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and O //IL_0089: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown if (Hax.hackerInMatch && !Hax.matchUnendable && winningTeam == Hax.HackerTeam) { if ((object)(Coroutine)DelayedEndCF.GetValue(__instance) != null) { ((MonoBehaviour)__instance.GameModeService).StopCoroutine((Coroutine)DelayedEndCF.GetValue(__instance)); DelayedEndCF.SetValue(__instance, null); } DelayedEndCF.SetValue(__instance, ((MonoBehaviour)__instance.GameModeService).StartCoroutine((IEnumerator)DelayedEndFunc.Invoke(__instance, new object[3] { ((SettingsInstance)DelayedEndSF.GetValue(__instance)).currentSliderValue, winningTeam, subText }))); return false; } if (!Hax.hackerInMatch) { return true; } return false; } [HarmonyPatch(typeof(HealthHandler), "TakeDamage")] [HarmonyPrefix] private static bool InfiniteDamage(HealthHandler __instance, float damage, Vector3 direction, Unit damager = null, DamageType damageType = (DamageType)0) { //IL_0042: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)damager != (Object)null && (Object)(object)((Component)damager).gameObject.GetComponent<Hax>() != (Object)null) { Unit componentInParent = ((Component)__instance).GetComponentInParent<Unit>(); Hax.HacKill(((Component)damager).gameObject.GetComponent<Hax>(), componentInParent, noHacksGarantee: false, componentInParent.data.mainRig.position - ((Vector3)(ref direction)).normalized * 5f); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Halloween Hits/ReaperScythe", 1f, ((Component)componentInParent.data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); return true; } return true; } [HarmonyPatch(typeof(TABCUnitUI), "LateUpdate")] [HarmonyPostfix] private static void HealthBarGlitch(TABCUnitUI __instance) { //IL_002a: 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) BeGlitchy component = ((Component)__instance).GetComponent<BeGlitchy>(); if ((Object)(object)component == (Object)null) { ((Component)__instance).gameObject.AddComponent<BeGlitchy>().dont = (Object)(object)((Component)((DataHandler)HPBarDataF.GetValue(__instance)).unit).GetComponent<Hax>() == (Object)null; } else if (!component.dont) { __instance.m_HealthBar.fillAmount = Random.value; __instance.m_WhiteHealthBar.fillAmount = Random.value; ((Graphic)__instance.m_HealthBar).color = Random.ColorHSV(); } } [HarmonyPatch(typeof(Unit), "DestroyUnit")] [HarmonyPrefix] private static bool DeleteImmune(Unit __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 if ((Object)(object)((Component)__instance).GetComponent<Hax>() != (Object)null && DrHaxSystem.stateManager != null && (int)DrHaxSystem.stateManager.GameState == 1) { return false; } return true; } [HarmonyPatch(typeof(Object), "Destroy", new Type[] { typeof(Object) })] [HarmonyPrefix] private static bool DeleteImmune01(Object obj) { return !Hax.protectedObjects.Contains(obj); } [HarmonyPatch(typeof(Object), "Destroy", new Type[] { typeof(Object), typeof(float) })] [HarmonyPrefix] private static bool DeleteImmune02(Object obj, float t) { return !Hax.protectedObjects.Contains(obj); } [HarmonyPatch(typeof(Object), "DestroyImmediate", new Type[] { typeof(Object) })] [HarmonyPrefix] private static bool DeleteImmune03(Object obj) { return !Hax.protectedObjects.Contains(obj); } [HarmonyPatch(typeof(Object), "DestroyImmediate", new Type[] { typeof(Object), typeof(bool) })] [HarmonyPrefix] private static bool DeleteImmune04(Object obj) { return !Hax.protectedObjects.Contains(obj); } [HarmonyPatch(typeof(Object), "DestroyObject", new Type[] { typeof(Object) })] [HarmonyPrefix] private static bool DeleteImmune05(Object obj) { return !Hax.protectedObjects.Contains(obj); } [HarmonyPatch(typeof(Object), "DestroyObject", new Type[] { typeof(Object), typeof(float) })] [HarmonyPrefix] private static bool DeleteImmune06(Object obj, float t) { return !Hax.protectedObjects.Contains(obj); } [HarmonyPatch(typeof(TeamSystem), "GetTeamUnits")] [HarmonyPrefix] private static bool ImNotReal(TeamSystem __instance, Team team, ref List<Unit> __result) { //IL_0013: 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) Dictionary<Team, List<Unit>> dictionary = (Dictionary<Team, List<Unit>>)teamUnitsF.GetValue(__instance); if (!dictionary.ContainsKey(team)) { __result = new List<Unit>(); } else { __result = dictionary[team]; __result.RemoveAll((Unit u) => (Object)(object)((Component)u).GetComponent<Hax>() != (Object)null); } return false; } [HarmonyPatch(typeof(TeamSystem), "TriggerUnitDeathAction")] [HarmonyPrefix] private static bool NuhUherNuhUh(TeamSystem __instance, Unit unit) { return (Object)(object)((Component)unit).GetComponent<Hax>() == (Object)null; } [HarmonyPatch(typeof(UnitAPI), "SetIsDead")] [HarmonyPrefix] private static bool DontSetIsDead(UnitAPI __instance) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) return (Object)(object)((Component)(Unit)UnAPIUnitF.GetValue(__instance)).GetComponent<Hax>() == (Object)null; } [HarmonyPatch(typeof(BaseGameMode), "OnWinnerDecided")] [HarmonyPrefix] private static bool NuhUhestNuhUh(BaseGameMode __instance, Team winningTeam, string winSubText) { //IL_000f: 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) if (Hax.hackerInMatch && !Hax.matchUnendable && winningTeam == Hax.HackerTeam) { return true; } if (!Hax.hackerInMatch) { return true; } return false; } [HarmonyPatch(typeof(BaseGameMode), "DelayedCheckMatchOver")] [HarmonyPrefix] private static bool NuhUhesterNuhUh(BaseGameMode __instance, float delay, Team winningTeam, string winSubtext) { //IL_000f: 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) if (Hax.hackerInMatch && !Hax.matchUnendable && winningTeam == Hax.HackerTeam) { return true; } if (!Hax.hackerInMatch) { return true; } return false; } [HarmonyPatch(typeof(TimeService), "Lock")] [HarmonyPrefix] private static bool NuhUhestestNuhUh(TimeService __instance) { if (Hax.hackerInMatch && !Hax.matchOverTwo) { return false; } return true; } } public class TotallyRealNames { public static void Populate() { DrHaxSystem.fakeNames = new List<string> { "Peasant", "Dark Peasant", "Super Peasant", "Clubber", "The Teacher", "Philosopher", "Mark Zuckerberg", "John Cena", "John Rod", "One Punch Man", "Genos", "Seraphim", "Gojo Satoru", "Ryomen Sukuna", "The Thing", "Tom", "Bob", "Tainted Cain", "I see you :)", "YOU", "Landfall", "Toby Fox", "Rick Prime", "Dr. Hax", "ExMagikGuy", "Sandbag", "Sandbert", "Yo mama", "Headcrab", "Protector", "Chieftan", "Ice Giant", "Da Vinci Himself", "Everything", "Everyone", "You can't imagine", "Evil Morty", "Isaac", "Limbless Necromorph", "Mother of Sin", "Only a Sinner", "The One Behind You", "Look Over There", "Stare At Me.", "Catch Me if You Can!", "The Strongest Unit Ever", "Inchoation", "Dark Donald", "Ronald McDonald", "Colonel Sanders", "Alternative Ending", "Billy", "Polyphemus", "Balor", "Mirror", "Your Maker", "Their Maker", "Pencil", "You aren't real.", "Who am I?", "I forgot.", "Memorable name", "Book of Belial", "Astral Beast", "Famine", "Death", "War", "Pestilance", "Father of God", "Father of All", "Above.", "The Devil", "Endless Sea", "94th Line", "C isn't Sharp", "C**", "pynput", "Rod of Harmony", "Endless Beauty", "Nature Itself", "The World", "Temperance and Labor", "Persistance", "Refusal", "Technoblade", "Folkcat", "Folk Valley Itself", "Manifestation", "The Redacted One", "We Won't Meet Again", "Peppino Spaghetti", "The Noise", "Nameless Deity", "Me.", "Mr. Frog", "Laser Gun", "Cube(Clone)", "Hercules", "Thor", "Thanos", "Thanatos", "COVID-19", "Modulo Yuji", "Isagi (with Glock)", "All of Europe", "America", "The Martians", "The Elites", "Uncle Ekbar", "Uncle Shein", "Scuf", "Time Police", "Readcon", "Major Plot Twist", "It", "The Clown", "The Sun", "R136a1", "Ares", "Artemis", "Mars", "Venus", "Meteor Man", "Death Certificate", "Their Parents", "Delirium", "Hush", "Satan", "God", "Ultra Greedier", "Bad Luck", "Technoblade", "10 Dollars", "A Guy", "UNIT_HACKER_HACKER", "10 TMTrainer items", "Every Item", "The Creator of Beginning and the End", "Big Bang Donald-R", "Major Major Major Major", "Dih Toucher", "Wanker 3000", "True Level", "A Singular Molecule", "H2O", "Water", "52! megatons of TNT", "9000 decibel sound", "Solar Eruption", "50 Dynamite", "Moon Lord", "Glitched Crown", "The Other Cavaliers", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Lebron James", "Pizzaface before you fight it as a boss", "The boss before you unlock it as a playable character", "Man", "Corruption of the Divine", "Vicious Mockery Damage", "Paying more than $5", "Schitzophrenia", "Magnus Carlsen", "Albert Einstein with balanced stats", "Less Dumb", "Reverse Stars Tarot Card", "Dice Room Effect (5)", "Forget Me Now", "R Key", "Power Button", "The End.", "Big Bang", "Pure Energy", "Reality Manipulation", "Archie Sonic Annihilator", "NOT Alien X", "Zeno Sama", "Universe C-137", "Hacker of all Hackers", "These names ARE ABSOLUTELY procedually generated", "Missingno.", "I repeat everything that's said to me meme", "Curse of the Tower", "The Lover Tarot Card", "On my mooma, I will beat you.", "Trashbag", "Your wife", "Slop", "Flock Cameras", "Barrack Obama", "Biden Blast", "W. D. Gaster", "Dohodyaga", "Green nigga", "Theory", "Everywhere at the end of time 10 hour loop", "11 years of school", "Maxwell's Notebook", "Average Dark Souls Boss", "Funnily enough I already", "mentioned Corruption of the Divine above", "If you found me, congrats", "Fear Hole", "SCP-001", "Omega Flowery", "Jarona True Form", "Blingo Blizzard", "Unnerfed Gerson", "Tidal Wave", "Heliopolis", "KOCMOC Unleashed", "Slaughterhouse", "Hoooooooooooooo", "rse", "Infinity", "Vergil", "Cobson", "The 69 children in my basement.", "Bedtime", "T cubed", "Nihil", "Literally 15 other Dragon Ball characters", "Any Hypernull tier", "Computer Science", "Conquest", "M16 rifle", "Everyone yielding everything", "Zero Punch Man", "Concept of Infinity", "THE MULTIVERSE", "The Weeping God", "1.2 Exabytes Hard Drive", "Everyone knowing everything", "The Fallen", "Mega Fatty", "Zaurzo", "Peacekeeper", "Invincible NPC", "An Admin Gun", "Reverse Emperor Tarot Card", "Magic 8 Ball", "The Roaring Knight", "The Roaring Non-Fraud", "My dawgs", "You in my basement", "Negative One Kick Man", "TotallyRealNames.cs", "Scemer", "Hecker", "Dunce Cap", "UI Shaggy 100%", "Sunrise", "Amogus potion at 3 AM", "Power Outage", "Call of Druki", "MANDO", "Mini Mango", "Magic Mango", "Tuff Valley Monster", "Impasta", "Mogger 3000", "AssBeater 6000", "9000th byte", "Cursed Omelet", "Moonzy X", "A Cat (Awakened)", "Mandela Effect", "Delete Button", "CTRL + Z", "Kuroudo Akabane", "L_Reimu", "2nd Death Star", "Average CoD Lobby Ppl", "300 bucks", "Big Guy", "Big H", "Toe Stub", "120 volts (x1000)", "Erie True Form VotV", "Minecraft Hardcore Youtuber", "CPU Fryer", "Lose if you want a 5090", "\"We have T.N.T\"", "Terence Angry Birds", "Allied Mastercomputer", "Judge Holden", "The Qu", "Infinity-sided Dice", "Chaotic Good Barbarian", "Kick Buttowski", "Someone saying KYS", "Low Tier God", "Da Infinite Skateboard", "QTG Hacker NPC", "Garry Newman", "Markus Person", "Notch", "Herobrine", "Nicole Waterson", "Batman w/ 1 year prep time", "Toon Force", "Ban Hammer", "The Boiled One", "You'll be asleep in bed.", "I will be there", "I will see you.", "Forever, I will see you.", "Friend", "Omega Tom Hanks", "Mathrus (real version)", "Dr. Jackal" }; DrHaxSystem.fakeNames.Add("User named " + Environment.UserName); DrHaxSystem.fakeNames.Add("The " + Environment.ProcessorCount + " processors."); List<string> list = new List<string> { "Cube", "Sphere", "World", "Person", "Cat", "Dog", "Epstein", "Einstein", "Youtube Channel", "McDonald", "Tom", "Jerry", "Alice", "Keyboard", "Mouse", "Mirror", "Force", "Cap", "Hat", "Phone", "Head", "Glitch", "Dollar", "Earth", "Law", "Curve", "Fantasy", "Engine", "Drums", "Room", "PC", "Lebron", "James", "Messi" }; list.Add(Environment.UserName); List<string> list2 = new List<string> { "Unnatural", "Magical", "Surprising", "Compelling", "Destructive", "Processing", "Confused", "Venomous", "Poinsonous", "Immortal", "Infinite", "Central", "Finite", "Amazing", "Fantastic", "Incredible", "Excellent", "Rightous", "Professional", "Imaginary", "Phantom", "Invisible", "Big", "Small", "Messy" }; list2.Add(Environment.MachineName); for (int i = 0; i < 7; i++) { DrHaxSystem.fakeNames.Add(list2[Random.Range(0, list2.Count)] + " " + list[Random.Range(0, list.Count)]); } for (int i = 0; i < 7; i++) { DrHaxSystem.fakeNames.Add(list2[Random.Range(0, list2.Count)] + ", " + list2[Random.Range(0, list2.Count)] + " " + list[Random.Range(0, list.Count)]); } for (int i = 0; i < 4; i++) { DrHaxSystem.fakeNames.Add(list[Random.Range(0, list.Count)] + " of the " + list2[Random.Range(0, list2.Count)]); } DrHaxSystem.fakeNames.Add(list[Random.Range(0, list.Count)] + " staring at the " + list2[Random.Range(0, list2.Count)]); DrHaxSystem.fakeNames.Add("The one " + list2[Random.Range(0, list2.Count)] + " " + list[Random.Range(0, list.Count)]); DrHaxSystem.fakeNames.Add("The truly only " + list2[Random.Range(0, list2.Count)] + " one."); DrHaxSystem.AliasesCount = DrHaxSystem.fakeNames.Count - 1; } } public class Hax : MonoBehaviour { public Unit hacker; public DataHandler data; public HealthHandler healthHandle; public MovementHandler movement; public Balance balance; public WeaponHandler arsenal; public GameStateManager gameState; public float voiceTime = 0f; public static Team HackerTeam = (Team)0; public static bool matchUnendable = false; public float hitHackerCooldown = 0.35f; public bool matchEnded = false; public float boostTimer = 2f; public static bool hackerInMatch = false; public List<Unit> existanceBlacklist; public List<Unit> googlyDeadList; public float rangedTime = 0f; public string rangedHackType = "__R"; public float projReleaseCd = 0f; public Team mySpecificTeam = (Team)0; public float stamina = 7f; public Coroutine performingSkill = null; public Unit shortest = null; public List<HackSkill> usableSkills; public static bool matchOverTwo = false; public static List<Object> protectedObjects = new List<Object>(); public static List<Unit> allHackers = new List<Unit>(); public static float heartbeat = 0.2f; public static KeyValuePair<Vector3, Quaternion> lastHackerSpawnPos = new KeyValuePair<Vector3, Quaternion>(Vector3.zero, Quaternion.identity); public float slowUpdate = 0f; public float originalSpeed = 1f; private void Start() { //IL_003d: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Invalid comparison between Unknown and I4 //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) heartbeat = 0.2f; hacker = ((Component)this).gameObject.GetComponent<Unit>(); data = hacker.data; lastHackerSpawnPos = new KeyValuePair<Vector3, Quaternion>(((Component)data.mainRig).transform.position, ((Component)data.mainRig).transform.rotation); if ((Object)(object)DrHaxSystem.projectilor == (Object)null) { DrHaxSystem.projectilor = ServiceLocator.GetService<ProjectilesSpawnManager>(); } existanceBlacklist = new List<Unit>(); googlyDeadList = new List<Unit>(); healthHandle = hacker.data.healthHandler; movement = ((Component)this).gameObject.GetComponentInChildren<MovementHandler>(); balance = ((Component)this).gameObject.GetComponentInChildren<Balance>(); arsenal = ((Component)this).gameObject.GetComponentInChildren<WeaponHandler>(); hacker.WasDealtDamageAction = Immortal; originalSpeed = movement.multiplier; gameState = ServiceLocator.GetService<GameStateManager>(); if (gameState != null && (int)gameState.GameState == 0) { allHackers.Add(hacker); } protectedObjects.Add((Object)(object)((Component)this).gameObject); if (hacker.spawnedObjects != null) { GameObject[] spawnedObjects = hacker.spawnedObjects; foreach (GameObject val in spawnedObjects) { if ((Object)(object)val != (Object)null) { protectedObjects.Add((Object)(object)val); } } } Transform[] componentsInChildren = ((Component)((Component)this).transform).GetComponentsInChildren<Transform>(); foreach (Transform val2 in componentsInChildren) { protectedObjects.Add((Object)(object)((Component)val2).gameObject); } HackerTeam = hacker.Team; hackerInMatch = true; int num = 0; Hax[] array = Object.FindObjectsOfType<Hax>(); foreach (Hax hax in array) { num++; if (num > 1) { HackerTeam = (Team)0; matchUnendable = true; break; } } matchUnendable = num > 1; mySpecificTeam = hacker.Team; usableSkills = new List<HackSkill> { new Telekinesis(), new HeatVisionShots(), new LightSpeedDashes() }; } private void OnDestroy() { //IL_0260: 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_0026: Invalid comparison between Unknown and I4 //IL_0224: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Invalid comparison between Unknown and I4 //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) protectedObjects.Remove((Object)(object)((Component)this).gameObject); if (gameState != null && (int)gameState.GameState == 0) { allHackers.Remove(hacker); } if (hacker.spawnedObjects != null) { GameObject[] spawnedObjects = hacker.spawnedObjects; foreach (GameObject val in spawnedObjects) { if ((Object)(object)val != (Object)null) { protectedObjects.Remove((Object)(object)val); } } } Transform[] componentsInChildren = ((Component)((Component)this).transform).GetComponentsInChildren<Transform>(); foreach (Transform val2 in componentsInChildren) { protectedObjects.Remove((Object)(object)((Component)val2).gameObject); } ((MonoBehaviour)this).StopAllCoroutines(); if (gameState == null || (int)gameState.GameState != 1 || !(heartbeat >= 0f)) { return; } try { Vector3 position = ((Component)hacker).transform.position; Quaternion rotation = ((Component)hacker).transform.rotation; Unit[] array = Object.FindObjectsOfType<Unit>(); foreach (Unit val3 in array) { if ((Object)(object)val3 != (Object)(object)hacker) { Rigidbody[] allRigs = hacker.data.allRigs.AllRigs; foreach (Rigidbody val4 in allRigs) { Transform transform = ((Component)val4).transform; transform.position += Vector3.down * 9999f; } val3.DestroyUnit(); position = ((Component)val3).transform.position; } } DrHaxSystem.peasantBlueprint.Spawn(position, rotation, mySpecificTeam, 1f, (UnitPoolInfo?)null)[0].AddComponent<Hax>(); } catch { } matchOverTwo = true; try { ServiceLocator.GetService<GameModeService>().CurrentGameMode.DecideWinner(mySpecificTeam, ServiceLocator.GetService<GameModeService>().CurrentGameMode.WinConditionPropagator.GetWinConditionsForTeam(mySpecificTeam)[0].GetWinDescription()); } catch { ServiceLocator.GetService<GameModeService>().CurrentGameMode.DecideWinner(mySpecificTeam, "Hacker Won."); } } private void Immortal(float damage) { data.Dead = false; data.maxHealth = 1E+09f; data.health = 1E+09f; data.takeFallDamage = false; hacker.dead = false; hacker.SetMassMultiplier(9999f); } public static void HacKill(Hax sourceHacks, Unit unit, bool noHacksGarantee = false, Vector3? repellentForcePoint = null) { //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) if (!noHacksGarantee && (Object)(object)((Component)unit).GetComponent<Hax>() != (Object)null) { return; } try { ((Component)unit).GetComponentInChildren<RigidbodyHolder>().massMultiplier = 1f; Rigidbody[] allRigs = unit.data.allRigs.AllRigs; foreach (Rigidbody val in allRigs) { val.mass = 1000f; unit.data.mainRig.velocity = Vector3.zero; unit.data.mainRig.angularVelocity = Vector3.zero; unit.data.mainRig.drag = sourceHacks.data.mainRig.drag; unit.data.mainRig.angularDrag = sourceHacks.data.mainRig.angularDrag; } if (Object.op_Implicit((Object)(object)unit.WeaponHandler)) { if (Object.op_Implicit((Object)(object)unit.WeaponHandler.rightWeapon) && Object.op_Implicit((Object)(object)unit.unitBlueprint.RightWeapon) && Object.op_Implicit((Object)(object)unit.WeaponHandler.rightWeapon.rigidbody)) { unit.WeaponHandler.rightWeapon.rigidbody.mass = 1000f; } if (Object.op_Implicit((Object)(object)unit.WeaponHandler.leftWeapon) && Object.op_Implicit((Object)(object)unit.unitBlueprint.LeftWeapon) && Object.op_Implicit((Object)(object)unit.WeaponHandler.leftWeapon.rigidbody)) { unit.WeaponHandler.leftWeapon.rigidbody.mass = 1000f; } } } catch { } try { unit.data.health = 0f; unit.data.maxHealth = 1f; unit.data.healthHandler.Die((Unit)null); unit.data.Dead = true; if (repellentForcePoint.HasValue) { unit.data.mainRig.AddExplosionForce(60666664f, repellentForcePoint.Value, 35f); } } catch { } sourceHacks.existanceBlacklist.Add(unit); } public static void SpawnProjectile(Team myTeam, GameObject source, GameObject prefab, Vector3 pos, Quaternion rot, Rigidbody homingTarget = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) GameObject val = DrHaxSystem.projectilor.SpawnProjectile(prefab, pos, rot); try { Level val2 = val.GetComponent<Level>() ?? val.AddComponent<Level>(); val2.levelMultiplier = 1E+09f; val2.level = 999999999; val2.ignoreTeam = true; } catch { } try { TeamHolder val3 = val.GetComponent<TeamHolder>() ?? val.AddComponent<TeamHolder>(); val3.team = myTeam; val3.spawner = source; val3.spawnerWeapon = null; val3.target = homingTarget; } catch { } } private void SlowUpdate() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) data.mainRig.constraints = (RigidbodyConstraints)0; if (data.mainRig.IsSleeping()) { data.mainRig.WakeUp(); } if ((Object)(object)((Component)this).GetComponent<GeneralInput>() != (Object)null && !((Behaviour)((Component)this).GetComponent<GeneralInput>()).enabled) { ((Behaviour)((Component)this).GetComponent<GeneralInput>()).enabled = true; } if ((Object)(object)((Component)this).GetComponent<Move>() != (Object)null && !((Behaviour)((Component)this).GetComponent<GeneralInput>()).enabled) { ((Behaviour)((Component)this).GetComponent<Move>()).enabled = true; } if (gameState != null && (int)gameState.GameState == 0) { Shockwave.NewShockwave(((Component)data.mainRig).transform.position, Quaternion.Euler(Random.value * 360f, Random.value * 360f, Random.value * 360f), 1f + Random.value, Color.HSVToRGB(Random.value, 1f, 1f), Random.value < 0.5f, 0.8f); Shockwave.NewShockwave(((Component)data.mainRig).transform.position, Quaternion.Euler(Random.value * 360f, Random.value * 360f, Random.value * 360f), 2f + Random.value * 3f, Color.HSVToRGB(Random.value, 1f, 1f), Random.value < 0.5f, 0.4f); } } private void Update() { //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Invalid comparison between Unknown and I4 //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0d35: 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_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_0e1c: Unknown result type (might be due to invalid IL or missing references) //IL_0dbc: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_07f2: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_082b: Unknown result type (might be due to invalid IL or missing references) //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0883: Unknown result type (might be due to invalid IL or missing references) //IL_0888: Unknown result type (might be due to invalid IL or missing references) //IL_088d: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_091c: Unknown result type (might be due to invalid IL or missing references) //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0926: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_097c: Unknown result type (might be due to invalid IL or missing references) //IL_0981: Unknown result type (might be due to invalid IL or missing references) //IL_098b: Unknown result type (might be due to invalid IL or missing references) //IL_0990: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Unknown result type (might be due to invalid IL or missing references) //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0eed: Unknown result type (might be due to invalid IL or missing references) //IL_0efa: Unknown result type (might be due to invalid IL or missing references) //IL_0f34: Unknown result type (might be due to invalid IL or missing references) //IL_0f44: Unknown result type (might be due to invalid IL or missing references) //IL_0f49: Unknown result type (might be due to invalid IL or missing references) //IL_0f4e: Unknown result type (might be due to invalid IL or missing references) //IL_0f52: Unknown result type (might be due to invalid IL or missing references) //IL_0f6d: Unknown result type (might be due to invalid IL or missing references) //IL_0f77: Unknown result type (might be due to invalid IL or missing references) //IL_0f81: Unknown result type (might be due to invalid IL or missing references) //IL_09d9: Unknown result type (might be due to invalid IL or missing references) //IL_09de: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_0a19: Unknown result type (might be due to invalid IL or missing references) //IL_0a3b: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: Unknown result type (might be due to invalid IL or missing references) //IL_0a71: Unknown result type (might be due to invalid IL or missing references) //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Unknown result type (might be due to invalid IL or missing references) //IL_0bdd: 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_0c1c: Unknown result type (might be due to invalid IL or missing references) //IL_0c21: Unknown result type (might be due to invalid IL or missing references) //IL_0c3b: Unknown result type (might be due to invalid IL or missing references) //IL_0c4b: Unknown result type (might be due to invalid IL or missing references) //IL_0c5f: Unknown result type (might be due to invalid IL or missing references) //IL_0c64: Unknown result type (might be due to invalid IL or missing references) //IL_0c69: Unknown result type (might be due to invalid IL or missing references) //IL_0c6e: Unknown result type (might be due to invalid IL or missing references) //IL_0c72: Unknown result type (might be due to invalid IL or missing references) //IL_0c77: Unknown result type (might be due to invalid IL or missing references) //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) //IL_0b9a: Unknown result type (might be due to invalid IL or missing references) heartbeat = 0.2f; slowUpdate -= Time.fixedDeltaTime; if (slowUpdate < 0f) { slowUpdate = 0.5f; SlowUpdate(); } data.Dead = false; data.maxHealth = 1E+09f; data.health = 100000000f + Mathf.Round(Random.value * 900000000f); data.takeFallDamage = false; healthHandle.SetInvulnerable(true); hacker.dead = false; hacker.turnSpeedMultiplier = 13f; hacker.attackSpeedMultiplier = 99999f; try { arsenal.leftWeapon.levelMultiplier = 1E+09f; arsenal.rightWeapon.levelMultiplier = 1E+09f; arsenal.attackSpeedMultiplier = 9999999f; GameObjectExtensions.FetchComponent<Level>(((Component)arsenal.leftWeapon).gameObject).levelMultiplier = 1E+09f; GameObjectExtensions.FetchComponent<Level>(((Component)arsenal.rightWeapon).gameObject).levelMultiplier = 1E+09f; arsenal.leftWeapon.internalCooldown = 0f; arsenal.rightWeapon.internalCooldown = 0f; } catch { } hacker.UnfreezeBody(); if (gameState == null || (int)gameState.GameState != 1) { return; } shortest = null; data.canFall = false; balance.forceMultiplier = 10f; balance.allowedTorsoAngle = 180f; balance.allowedLegAngle = 180f; balance.allowedFootDistance = 180f; float num = float.PositiveInfinity; Unit[] array = Object.FindObjectsOfType<Unit>(); foreach (Unit val in array) { float num2 = Vector3.Distance(((Component)val.data.mainRig).transform.position, ((Component)data.mainRig).transform.position); bool flag = existanceBlacklist.Contains(val); if ((Object)(object)val != (Object)(object)hacker && !val.data.Dead && !flag) { if (num > num2) { num = num2; shortest = val; } if (num2 < 4f + val.thickness && ((Object)(object)((Component)val).gameObject.GetComponent<Hax>() == (Object)null || hitHackerCooldown < 0f)) { if ((Object)(object)((Component)val).gameObject.GetComponent<Hax>() == (Object)null) { HacKill(this, val, noHacksGarantee: true, ((Component)data.mainRig).transform.position); boostTimer = Time.deltaTime * 3f; } else { hitHackerCooldown = 0.15f; if (performingSkill == null && ((Component)val).gameObject.GetComponent<Hax>().performingSkill == null) { val.data.mainRig.AddExplosionForce(320000f * Random.Range(0.9f, 2.5f), ((Component)data.mainRig).transform.position, 35f); } } if (rangedTime < -2.5f) { rangedTime = 2f; } Vector3 val2 = shortest.data.mainRig.position - data.mainRig.position; Vector3 position = data.mainRig.position + val2 / 2f; Shockwave.NewShockwave(position, Quaternion.LookRotation(val2), 2.3f, null, reverse: false, 1.5f); Shockwave.NewShockwave(position, Quaternion.Euler(Random.value * 360f, Random.value * 360f, Random.value * 360f)); Shockwave.NewShockwave(position, Quaternion.Euler(Random.value * 360f, Random.value * 360f, Random.value * 360f)); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/Explosion", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Legacy Hits/SuperPeasant", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); if (Object.op_Implicit((Object)(object)ScreenShake.Instance)) { ScreenShake.Instance.AddForce(((Vector3)(ref val2)).normalized * 12f, ((Component)data.mainRig).transform.position); } } } if (!flag) { continue; } try { if (!val.data.Dead) { val.DestroyUnit(); } else { if (googlyDeadList.Contains(val)) { continue; } foreach (GooglyEye spawnedEye in ((Component)val).GetComponent<EyeSpawner>().spawnedEyes) { spawnedEye.SetState((EyeState)2); googlyDeadList.Add(val); } continue; } } catch { } } Vector3 val6; if ((Object)(object)shortest != (Object)null) { if (performingSkill == null) { movement.multiplier = originalSpeed * Mathf.Clamp(num * 0.75f, 13f, 100f); stamina -= Time.deltaTime; if (stamina < 0f) { HackSkill.RandomSkill(this); stamina = Random.Range(350f, 830f) / 100f; } } else { movement.multiplier = originalSpeed * 1f; } if (rangedTime > 0.3f) { hacker.data.mainRig.velocity = Vector3.zero; hacker.data.mainRig.angularVelocity = Vector3.zero; } if (num > 80f && performingSkill == null) { Shockwave.NewShockwave(data.mainRig.position, Quaternion.LookRotation(Vector3.up), 1f, Color.blue); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Legacy Hits/SuperPeasant", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); Vector3 val3 = ((Component)shortest.data.mainRig).transform.position - data.torso.position; Vector3 val4 = ((Component)data.mainRig).transform.forward * 15f; val4.y = 0f; val3 -= val4; Rigidbody[] allRigs = hacker.data.allRigs.AllRigs; foreach (Rigidbody val5 in allRigs) { Transform transform = ((Component)val5).transform; transform.position += val3; } ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Legacy Hits/SuperPeasant", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); Shockwave.NewShockwave(data.mainRig.position, Quaternion.LookRotation(Vector3.up), 1f, Color.yellow); } if (Object.op_Implicit((Object)(object)data.mainRig)) { if (!(data.mainRig.position.y < MapSettings.KillHeight)) { val6 = ((Component)data.mainRig).transform.position; if (!(((Vector3)(ref val6)).magnitude > 1800f)) { goto IL_0a97; } } Shockwave.NewShockwave(data.mainRig.position, Quaternion.LookRotation(Vector3.up), 1f, Color.blue); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Legacy Hits/SuperPeasant", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); Vector3 val7 = lastHackerSpawnPos.Key + Vector3.up * 4f - data.torso.position; Rigidbody[] allRigs2 = hacker.data.allRigs.AllRigs; foreach (Rigidbody val8 in allRigs2) { Transform transform2 = ((Component)val8).transform; transform2.position += val7; } ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Legacy Hits/SuperPeasant", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); hacker.data.mainRig.velocity = Vector3.zero; hacker.data.mainRig.angularVelocity = Vector3.zero; Shockwave.NewShockwave(data.mainRig.position, Quaternion.LookRotation(Vector3.up), 1f, Color.yellow); } goto IL_0a97; } if (!matchEnded && !matchUnendable) { matchOverTwo = true; ServiceLocator.GetService<GameModeService>().CurrentGameMode.DecideWinner(mySpecificTeam, ServiceLocator.GetService<GameModeService>().CurrentGameMode.WinConditionPropagator.GetWinConditionsForTeam(mySpecificTeam)[0].GetWinDescription()); matchEnded = true; hackerInMatch = false; } goto IL_0d6f; IL_0a97: if (num > 20f) { rangedTime = 0.2f; } if (performingSkill != null) { rangedTime = -1f; } if (rangedTime > 0f) { if (rangedHackType == "NONE") { rangedHackType = DrHaxSystem.projectiles.Keys.ToArray()[Random.Range(0, DrHaxSystem.projectiles.Count)]; if (rangedHackType == "UNIT_LEGACY_LEG_WIZARD_R" && num > 11f) { if (DrHaxSystem.projectiles.ContainsKey("UNIT_LEGACY_LEG_DARKP_L")) { rangedHackType = "UNIT_LEGACY_LEG_DARKP_L"; } else { rangedHackType = "UNIT_LEGACY_BLOWDART_L"; } } ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("UI/EquipWeapon", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); } if (projReleaseCd <= 0f && DrHaxSystem.projectiles.ContainsKey(rangedHackType)) { Team team = hacker.Team; GameObject gameObject = ((Component)this).gameObject; GameObject prefab = DrHaxSystem.projectiles[rangedHackType]; Vector3 pos = hacker.data.torso.position + new Vector3(0f, 4f, 0f); val6 = ((Component)shortest.data.mainRig).transform.position - (data.torso.position + new Vector3(0f, 4f, 0f)); SpawnProjectile(team, gameObject, prefab, pos, Quaternion.LookRotation(((Vector3)(ref val6)).normalized), shortest.data.mainRig); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("UI/Unit Placed", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); projReleaseCd = 0.015f; } else { projReleaseCd -= Time.deltaTime; } } else { rangedHackType = "NONE"; } rangedTime -= Time.deltaTime; goto IL_0d6f; IL_0d6f: if (voiceTime < 0f) { if (rangedTime <= 0f) { ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Legacy Attack Vocals/SuperPeasant", 1f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); voiceTime = 1.5f; if (rangedTime < 3f) { rangedTime = 2f; } } else { ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Fantasy Dark Attack Vocals/FireBat", 3f, ((Component)data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); voiceTime = 0.2f; } } else { voiceTime -= Time.deltaTime; } hitHackerCooldown -= Time.deltaTime; boostTimer -= Time.deltaTime; data.fallTime = 0f; boostTimer = Mathf.Clamp(boostTimer, -1f, 2f); if (boostTimer < 0f && (Object)(object)shortest != (Object)null) { Rigidbody[] allRigs3 = hacker.data.allRigs.AllRigs; foreach (Rigidbody val9 in allRigs3) { val9.velocity = Vector3.zero; val9.angularVelocity = Vector3.zero; } Rigidbody mainRig = hacker.data.mainRig; val6 = shortest.data.torso.position - data.torso.position; mainRig.AddForce(((Vector3)(ref val6)).normalized * Mathf.Clamp(num * 0.85f, 15f, 500f) * 90f * Time.deltaTime, (ForceMode)2); boostTimer = 2f; } } } } namespace HackerPeasant.VFX { public class Shockwave : MonoBehaviour { public float scale; public Color color; public bool reverse; public float expansion = 0f; public float speed = 1f; private SpriteRenderer sprite; public static Shockwave NewShockwave(Vector3 position, Quaternion rotation, float scale = 1f, Color? color = null, bool reverse = false, float speed = 3f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Shockwave(Clone)"); val.transform.position = position; val.transform.rotation = rotation; Shockwave shockwave = val.AddComponent<Shockwave>(); shockwave.scale = scale; shockwave.color = ((!color.HasValue) ? Color.white : color.Value); shockwave.reverse = reverse; SpriteRenderer val2 = val.AddComponent<SpriteRenderer>(); val2.color = shockwave.color; val2.sprite = ShitLoader3000.sprites["Shockwave"]; val.transform.localScale = Vector3.one * (scale * (reverse ? 1.5f : 0.1f)); shockwave.expansion = (reverse ? 1.5f : 0.1f); shockwave.sprite = val2; shockwave.speed = speed; return shockwave; } private void Start() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) expansion = (reverse ? 1.5f : 0.1f); if (reverse) { sprite.color = new Color(0f, 0f, 0f, 0f); } } private void Update() { //IL_0031: 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_00a2: Unknown result type (might be due to invalid IL or missing references) expansion += Time.deltaTime * (reverse ? (0f - speed) : speed); ((Component)this).transform.localScale = Vector3.one * (scale * expansion); sprite.color = new Color(color.r, color.g, color.b, color.a * Mathf.Clamp(7.5f - expansion * 5f, 0f, 1f)); if (!reverse && expansion > 1.5f) { Object.Destroy((Object)(object)((Component)this).gameObject); } else if (reverse && expansion < 0.1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class SmallShotLaser : MonoBehaviour { public float scale = 1f; public float life = 1f; public float lifeLeft = 1f; public static SmallShotLaser NewLaser(Vector3 position, Vector3 target, Quaternion rotation, float scale = 1f, Color? color = null, float lifetime = 0.3f) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)2); float num = Vector3.Distance(position, target) / 2f; ((Object)val).name = "SmallShotLaser(Clone)"; val.transform.rotation = rotation; val.transform.position = position + val.transform.up * num; Object.Destroy((Object)(object)val.GetComponent<Collider>()); ((Renderer)val.GetComponent<MeshRenderer>()).material.color = ((!color.HasValue) ? Color.white : color.Value); SmallShotLaser smallShotLaser = val.AddComponent<SmallShotLaser>(); smallShotLaser.scale = scale; smallShotLaser.life = lifetime; smallShotLaser.lifeLeft = smallShotLaser.life; Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(scale, num, scale); val.transform.localScale = localScale; return smallShotLaser; } private void Update() { //IL_0062: 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) lifeLeft -= Time.deltaTime; if (lifeLeft < 0f) { Object.Destroy((Object)(object)((Renderer)((Component)this).GetComponent<MeshRenderer>()).material); Object.Destroy((Object)(object)((Component)this).gameObject); } else { Vector3 localScale = default(Vector3); ((Vector3)(ref localScale))..ctor(scale * (lifeLeft / life), ((Component)this).transform.localScale.y, scale * (lifeLeft / life)); ((Component)this).transform.localScale = localScale; } } } } namespace HackerPeasant.StupidUtility { public class ShitLoader3000 { public static LandfallContentDatabase shitDatabase = ContentDatabase.Instance().LandfallContentDatabase; public static Dictionary<string, UnitBlueprint> units = new Dictionary<string, UnitBlueprint>(); public static Dictionary<string, GameObject> explosions = new Dictionary<string, GameObject>(); public static Dictionary<string, object> assetChace = new Dictionary<string, object>(); public static Dictionary<string, Sprite> sprites = new Dictionary<string, Sprite>(); public static Material unlitShader = null; public static Texture2D LoadTextureAsset(string ClassPath) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown if (assetChace.TryGetValue(ClassPath, out var value)) { return (Texture2D)value; } Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream(ClassPath); if (stream == null) { DrHaxSystem.Log(2, "Failed to load Texture2D: " + ClassPath); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array); if (!assetChace.ContainsKey(ClassPath)) { assetChace.Add(ClassPath, val); } return val; } public static Sprite LoadTextureAssetAsSprite(string ClassPath, Vector2? pivot = null, float PPU = 100f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_005b: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if (!pivot.HasValue) { pivot = new Vector2(0.5f, 0.5f); } if (assetChace.TryGetValue(ClassPath, out var value)) { Texture2D val = (Texture2D)value; return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), pivot.Value, PPU); } Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream(ClassPath); if (stream == null) { DrHaxSystem.Log(2, "Failed to load Image: " + ClassPath); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val2 = new Texture2D(2, 2); ImageConversion.LoadImage(val2, array); if (!assetChace.ContainsKey(ClassPath)) { assetChace.Add(ClassPath, val2); } return Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), pivot.Value, PPU); } public static AudioClip LoadSoundAsset(string ClassPath) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if (assetChace.TryGetValue(ClassPath, out var value)) { return (AudioClip)value; } Assembly executingAssembly = Assembly.GetExecutingAssembly(); using Stream stream = executingAssembly.GetManifestResourceStream(ClassPath); if (stream == null) { DrHaxSystem.Log(2, "Failed to load Wav Sound: " + ClassPath); return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); AudioClip val = AudioClipFromWAVBytes(array); if (!assetChace.ContainsKey(ClassPath)) { assetChace.Add(ClassPath, val); } return val; } public static void Init() { //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown UnitBlueprint[] array = shitDatabase.GetUnitBlueprints().ToArray(); foreach (UnitBlueprint val in array) { units.Add(val.Name, val); try { if (!val.Name.Contains("CROW") && !val.Name.Contains("SNAKE") && !val.Name.Contains("CLAM") && !val.Name.Contains("PRESENT")) { DrHaxSystem.projectiles.Add(val.Name + "_L", (GameObject)typeof(RangeWeapon).GetField("objectToSpawn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(val.LeftWeapon.GetComponent<RangeWeapon>())); } } catch { } try { if (!val.Name.Contains("CROW") && !val.Name.Contains("SNAKE") && !val.Name.Contains("CLAM") && !val.Name.Contains("PRESENT")) { DrHaxSystem.projectiles.Add(val.Name + "_R", (GameObject)typeof(RangeWeapon).GetField("objectToSpawn", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(val.RightWeapon.GetComponent<RangeWeapon>())); } } catch { } } Explosion[] array2 = Resources.FindObjectsOfTypeAll<Explosion>(); foreach (Explosion val2 in array2) { try { explosions.Add(explosions.Count + ((Object)((Component)val2).gameObject).name, ((Component)val2).gameObject); } catch { } } sprites.Add("Shockwave", LoadTextureAssetAsSprite("HackerPeasant.Assets.shockwave.png", Vector2.one / 2f)); } public static AudioClip AudioClipFromWAVBytes(byte[] wavFile, string clipName = "loadedClip(copy)") { int num = BitConverter.ToInt16(wavFile, 22); int num2 = BitConverter.ToInt32(wavFile, 24); int num3 = BitConverter.ToInt32(wavFile, 28); int num4 = FindAudioDataChunkOffset(wavFile); int num5 = (wavFile.Length - num4) / 2; float[] array = new float[num5]; int num6 = 0; for (int i = num4; i < wavFile.Length; i += 2) { short num7 = BitConverter.ToInt16(wavFile, i); array[num6++] = (float)num7 / 32768f; } AudioClip val = AudioClip.Create(clipName, num5 / num, num, num2, false); val.SetData(array, 0); return val; } public static int FindAudioDataChunkOffset(byte[] wavFile) { for (int i = 0; i < wavFile.Length - 4; i++) { if (wavFile[i] == 100 && wavFile[i + 1] == 97 && wavFile[i + 2] == 116 && wavFile[i + 3] == 97) { return i + 8; } } throw new Exception("WAV data chunk not found."); } } } namespace HackerPeasant.Skillset { public class HackSkill { public int repeats = -1; public virtual string Name => "Default Skill"; public virtual float Fun => 0f; public virtual float Unfavorability => 1f; public virtual uint MaxRepeats => 0u; public static void RandomSkill(Hax hacks) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 if (!hacks.matchEnded && hacks.gameState != null && (int)hacks.gameState.GameState == 1 && hacks.usableSkills.Count > 0) { int num = 20; int num2 = hacks.usableSkills[Random.Range(0, hacks.usableSkills.Count)].Activate(hacks); while (num2 == 1 && num > 0) { num2 = hacks.usableSkills[Random.Range(0, hacks.usableSkills.Count)].Activate(hacks); num--; } if (num < 1) { DrHaxSystem.Log(0, "Boom! The Skill Chooser Exploded. The Hacker was too indecisive!"); } } } public virtual bool CanPerform(Hax hacks) { return hacks.performingSkill == null; } public virtual IEnumerator Perform(Hax hacks) { DrHaxSystem.Log(0, "Performing " + Name); yield return (object)new WaitForSeconds(3f); DrHaxSystem.Log(0, "Completed " + Name); hacks.performingSkill = null; Finisher(hacks); } public virtual void Finisher(Hax hacks) { if (Fun > 1f && Random.value < Fun - 1f && repeats < MaxRepeats) { Use(hacks, isRepeat: true); repeats++; } else { repeats = -1; } } public virtual int Activate(Hax hacks) { if (repeats > -1) { DrHaxSystem.Log(0, Name + " skill instance busy. Switch."); return 1; } if (!CanPerform(hacks)) { DrHaxSystem.Log(0, "Does not meet conditions for using " + Name + ". Switching skill..."); return 1; } if (Fun <= 1f && Random.value < Fun) { DrHaxSystem.Log(0, Name + "? Nah, Boring."); return 0; } DrHaxSystem.Log(0, "Using Skill: " + Name); repeats++; Use(hacks, isRepeat: false); return 2; } public virtual void Use(Hax hacks, bool isRepeat) { if (repeats < 0 || (Object)(object)hacks == (Object)null) { DrHaxSystem.Log(0, "What? How is this possible?"); } else { hacks.performingSkill = ((MonoBehaviour)hacks).StartCoroutine(Perform(hacks)); } } } public class HeatVisionShots : HackSkill { public override string Name => "Laser Vision"; public override float Fun => 2f; public override float Unfavorability => 0f; public override uint MaxRepeats => 4u; public override IEnumerator Perform(Hax hacks) { yield return (object)new WaitForEndOfFrame(); Color col = Color.HSVToRGB(Random.value, 1f, 1f); Quaternion rot = Quaternion.LookRotation(hacks.shortest.data.mainRig.position - hacks.data.head.position); Vector3 rotv = new Vector3(((Quaternion)(ref rot)).eulerAngles.x, ((Quaternion)(ref rot)).eulerAngles.y, ((Quaternion)(ref rot)).eulerAngles.z); rotv.x += 90f; try { SmallShotLaser.NewLaser(hacks.data.head.position, hacks.shortest.data.mainRig.position, Quaternion.Euler(rotv), 1f, col); Shockwave.NewShockwave(hacks.data.head.position, rot, 0.5f, col, reverse: false, 2f); } catch { } HealthHandler healthHandler = hacks.shortest.data.healthHandler; Vector3 val = hacks.shortest.data.mainRig.position - hacks.data.head.position; ((Damagable)healthHandler).TakeDamage(1f, ((Vector3)(ref val)).normalized, hacks.hacker, (DamageType)3); SoundPlayer soundplayer = ServiceLocator.GetService<SoundPlayer>(); soundplayer.PlaySoundEffect("UI/Unit Placed", 1f, hacks.data.head.position, (MaterialType)0, (Transform)null, 1f); soundplayer.PlaySoundEffect("UI/DequipItem", 1f, hacks.data.head.position, (MaterialType)0, hacks.data.head, 1.3f); soundplayer.PlaySoundEffect("UI/DequipItem", 2f, hacks.data.head.position, (MaterialType)0, hacks.data.head, 1f); soundplayer.PlaySoundEffect("UI/DequipItem", 1f, hacks.data.head.position, (MaterialType)0, hacks.data.head, 0.7f); soundplayer.PlaySoundEffect("Fantasy Dark Attacks/FireBat", 1f, hacks.data.head.position, (MaterialType)0, hacks.data.head, 1f); yield return (object)new WaitForSeconds(0.5f); hacks.performingSkill = null; Finisher(hacks); } } public class LightSpeedDashes : HackSkill { public override string Name => "Lightspeed Dashes"; public override float Fun => 2f; public override float Unfavorability => 0f; public override uint MaxRepeats => 3u; public override IEnumerator Perform(Hax hacks) { yield return (object)new WaitForEndOfFrame(); Unit victim = hacks.shortest; Vector3 val = victim.data.mainRig.position - ((Component)hacks.data.mainRig).transform.position; Vector3 dir = ((Vector3)(ref val)).normalized; hacks.data.mainRig.angularVelocity = Vector3.zero; hacks.data.mainRig.velocity = Vector3.zero; ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/Explosion", 3f, ((Component)hacks.data.mainRig).transform.position, (MaterialType)0, (Transform)null, 1f); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/Explosion", 2f, ((Component)hacks.data.mainRig).transform.position, (MaterialType)0, (Transform)null, 0.8f); ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/Explosion", 1f, ((Component)hacks.data.mainRig).transform.position, (MaterialType)0, (Transform)null, 0.65f); if (Object.op_Implicit((Object)(object)ScreenShake.Instance)) { ScreenShake.Instance.AddForce(dir * 45f, ((Component)hacks.data.mainRig).transform.position); } Shockwave.NewShockwave(((Component)hacks.data.mainRig).transform.position, Quaternion.LookRotation(dir), 4.5f, null, reverse: false, 1f); float nextShockwave = 0.1f; float seconds = 0f; while (Vector3.Distance(victim.data.mainRig.position, hacks.data.mainRig.position) >= 4f && seconds < 2.5f) { Rigidbody mainRig = hacks.data.mainRig; val = ((Component)victim.data.mainRig).transform.position - hacks.data.torso.position; mainRig.AddForce(((Vector3)(ref val)).normalized * 25f * 60f * Time.deltaTime, (ForceMode)2); nextShockwave -= Time.deltaTime; if (nextShockwave < 0f) { ServiceLocator.GetService<SoundPlayer>().PlaySoundEffect("Effects/Explosion", 1f, ((Component)hacks.data.mainRig).transform.position, (MaterialType)0, (Transform)null, 0.9f); Shockwave.NewShockwave(((Component)hacks.data.mainRig).transform.position, Quaternion.LookRotation(victim.data.mainRig.position - ((Component)hacks.data.mainRig).transform.position), 2.5f, null, reverse: false, 2f); nextShockwave = 0.1f; } seconds += Time.deltaTime; yield return null; } yield return (object)new WaitForSeconds(Mathf.Clamp(0.3f - seconds, 0f, 0.3f)); hacks.performingSkill = null; Finisher(hacks); } } public class Telekinesis : HackSkill { public override string Name => "Telekinesis"; public override float Fun => 1.85f; public override float Unfavorability => 0f; public override uint MaxRepeats => 8u; public override IEnumerator Perform(Hax hacks) { yield return (object)new WaitForEndOfFrame(); Unit victim = hacks.shortest; f