4902-No_Console_Spam icon

No Console Spam

Adds a cooldown to messages that are logged every frame

By 4902

CHANGELOG

1.5.0
-added cooldowns 28,29 with strings
28-"grabInvalidated: {0}"
29-"Got player in physics region: {0}"

1.4.0
-added cooldown 27 with string "Following player, like meter: {0}; decreasing loneliness by {1} * Time.deltaTime"

1.3.0
-added cooldown 26 with string "Setting position of ropes"
-added section text to config

1.2.1
-renamed class/namespace

1.2.0
-added cooldowns 22,23,24,25 with strings
22-"Fox spotted meter: {0}"
22-"Fox A"
22-"Fox B"
22-"Fox C; {0}; {1}"
22-"Fox D"
22-"Fox E"
22-"Fox F"
22-"Fox G"
22-"Fox H"
22-"Fox I"
22-"Fox J"
22-"Bush wolf: No game objects found with spore tag; cancelling"
22-"{0}: Mold spore {1} at {2} surrounded by {3}"
22-"Bush wolf: Most surrounding spores is {0}"
22-"Bush wolf: All spores found were lone spores; cancelling"
23-"weeds found at pos {0}: {1}"
23-"Index: {0}"
23-"Mold iteration {0}"
23-"Spore duplication count: {0}"
23-"Mold #{0} of it#{1} pos: {2} ; {3}"
23-"previousSpores[{0}]: pos {1}, marked {2}"
23-"{0}; {1}; too close?: {2}"
23-"Adding mold to previously destroyed mold"
23-"Spore #{0} of iteration #{1} marked for deletion; \n found spore position?: {2}; \n stemmed from destroyed spore?: {3}; \n too close to other?: {4}"
23-"Added spore"
23-"Growing back mold at index {0}"
24-"{0}; {1}"
24-"Set on interact early"
25-"Collect items in truck A"
25-"Collect items in truck B; {0}"
25-"Collect items in truck C; {0}"
25-"{0}; {1}; {2}"
25-"Magneted? : {0}"
25-"Play collision audio with type {0} A"
-added source code to the changelog

1.1.0
-added cooldowns 19,20,21 with strings
19-"Set local player to sinking!"
19-"Quicksand is not sinking local player!"
19-"Quicksand is sinking local player!"
19-"Quicksand is sinking local player! B"
19-"Quicksand is sinking local player! C"
20-"Player is not targetable"
21-"Noise heard relative loudness: {0}"
21-"Can't hear noise reason A"
21-"Can't hear noise reason B"

1.0.0
Source code

1.5.0

using BindingFlags = System.Reflection.BindingFlags; using GetField = System.Reflection; using BepInEx; using BepInEx.Configuration; using GameNetcodeStuff; using UnityEngine; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.Utils; using MonoMod.RuntimeDetour; namespace bunny { [BepInPlugin("4902.No_Console_Spam", "No_Console_Spam", "1.0.0")] public class no_console_spam : BaseUnityPlugin { private static ConfigEntry<bool> yeet; private static ConfigEntry<uint>[] cfg = new ConfigEntry<uint>[29+1]; private static ConfigEntry<string> cdlist; private static uint cd_01; //average velocity private static uint cd_02; //targetable a private static uint cd_03; //set destination a/b private static uint cd_04; //level timer private static uint cd_05; //fs 1-4 private static uint cd_06; //called teleport function private static uint cd_07; //company desk timer private static uint cd_08; //shower private static uint cd_09; //agent speed private static uint cd_10; //secondary use a-g private static uint cd_11; //player leave web private static uint cd_12; //zapgun private static uint cd_13; //walkie private static uint cd_14; //loud horn private static uint cd_15; //mouth dog private static uint cd_16; //behaviour state private static uint cd_17; //hoarder bug private static uint cd_18; //random nav private static uint cd_19; //quicksand private static uint cd_20; //not targetable private static uint cd_21; //masked private static uint cd_22; //fox private static uint cd_23; //bush private static uint cd_24; //hold interact private static uint cd_25; //truck private static uint cd_26; //ropes private static uint cd_27; //cavedweller private static uint cd_28; //grabinvalidated private static uint cd_29; //physics region private void Awake() { string s1 = "number of frames this string should be on cooldown for after being logged. set to 0 to disable the string completely"; string s2 = "number of frames these strings should be on cooldown for after being logged. set to 0 to disable the strings completely"; yeet = Config.Bind("#", "enabled", true, "whether this mod should be enabled or not\ndefault cooldown values are assuming 60 frames per second, with higher or lower fps you may want to adjust the values"); cdlist = Config.Bind("#", "cd_list", "{01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29}", "if you want to disable individual cooldowns, or if you want to see a variable in a string that the original string would've had (like cd_04), you can disable the cooldown related to that string with this option, which will prevent the transpiler/il from modifying those cooldowns related strings and will be the same as vanilla. to remove a cooldown remove its number from this configs string"); cfg[1] = Config.Bind("#", "01_cooldown", 180u, "[average velocity]\n"+s1+"\nconditions: while using the jetpack or while flower snakes are lifting the player\nfrequency: every frame\n(PlayerControllerB.Update)\n\"Average velocity: {0}\""); cd_01 = cfg[1].Value; cfg[2] = Config.Bind("#", "02_cooldown", 480u, "[targetable a]\n"+s1+"\nconditions: roughly when certain enemies check if the player is targetable while they're in the ship\nfrequency: every frame (per enemy)\n(EnemyAI.PlayerIsTargetable)\n\"Targetable A\""); cd_02 = cfg[2].Value; cfg[3] = Config.Bind("#", "03_cooldown", 480u, "[set destination a/b]\n"+s2+"\nconditions: roughly when an enemy sees a player and is going towards them\nfrequency: every frame (per enemy)\n(EnemyAI.Update)\n\"Set destination to target player A\"\n\"Set destination to target player B\""); cd_03 = cfg[3].Value; cfg[4] = Config.Bind("#", "04_cooldown", 60u, "[level timer]\n"+s1+"\nconditions: during the xp increase/decrease animation after the end of a round\nfrequency: every frame for a short duration\n(HUDManager.SetPlayerLevelSmoothly)\n\"Level up timer: {0}\""); cd_04 = cfg[4].Value; cfg[5] = Config.Bind("#", "05_cooldown", 600u, "[fs 1-4]\n"+s2+"\nconditions: flower snakes existing during a round\nfrequency: every few frames (per flower snake)\n(FlowerSnakeEnemy.DoAIInterval)\n\"FS 1\"\n\"FS 2\"\n\"FS 3\"\n\"FS 4\""); cd_05 = cfg[5].Value; cfg[6] = Config.Bind("#", "06_cooldown", 180u, "[called teleport function]\n"+s1+"\nconditions: anytime TeleportPlayer() is called, most notably while the player is waiting to be respawned while in orbit it will log every frame\nfrequency: either infrequently or every frame\n(PlayerControllerB.TeleportPlayer)\n\"Called teleport function on (player)\""); cd_06 = cfg[6].Value; cfg[7] = Config.Bind("#", "07_cooldown", 60u, "[company desk timer]\n"+s2+"\nconditions: while host and while the desk door is open\nfrequency: every frame for a short duration\n(DepositItemsDesk.Update)\n\"Desk: Waiting to grab the items on the desk; {0}\"\n\"Desk: no objects on counter, waiting with door open; {0}\""); cd_07 = cfg[7].Value; cfg[8] = Config.Bind("#", "08_cooldown", 600u, "[shower]\n"+s2+"\nconditions: while the shower is on and there is spray paint anywhere, and while the shower is on and spray paint is on a player\nfrequency: every frame\n(ShowerTrigger.Update)\n\"Shower is running with players inside!\"\n\"spray decal #{0} found as child of {1}\""); cd_08 = cfg[8].Value; cfg[9] = Config.Bind("#", "09_cooldown", 180u, "[agent speed]\n"+s1+"\nconditions: while a giant was chasing a player and then lost sight of the player\nfrequency: every frame for maybe a short duration\n(ForestGiantAI.Update)\n\"agent speed: {0}\""); cd_09 = cfg[9].Value; cfg[10] = Config.Bind("#", "10_cooldown", 0u, "[secondary use a-g]\n"+s2+"\nconditions: anytime the key that the item secondary use keybind is set to is pressed\nfrequency: up to 7 strings once per press\n(PlayerControllerB.ItemSecondaryUse_performed)\n\"secondary use A\"\n\"secondary use B\"\n\"secondary use C\"\n\"secondary use D\"\n\"secondary use E\"\n\"secondary use F\"\n\"secondary use G\""); cd_10 = cfg[10].Value; cfg[11] = Config.Bind("#", "11_cooldown", 1u, "[player leave web]\n"+s1+"\nconditions: when a player leaves a web or other stuff like going through an entrance\nfrequency: once per web, so with 10 webs it would log 10 lines in 1 frame. cooldown doesn't need to be anything above 1\n(SandSpiderWebTrap.PlayerLeaveWeb)\n\"Player leave web called\""); cd_11 = cfg[11].Value; cfg[12] = Config.Bind("#", "12_cooldown", 240u, "[zapgun]\n"+s2+"\nconditions: activating the zap gun and or zapping something\nfrequency: some strings (multiple times) on each activation and 1 string logged every frame while zapping something\n(PatcherTool.ScanGun)\n\"Scan A\"\n\"Scan B\"\n\"Got shockable transform name :\"\n\"Zap gun light off!!!\"\n(PatcherTool.GunMeetsConditionsToShock)\n\"Target position: {0}\"\n\"Gun not meeting conditions to zap; {0}; {1}; {2}\"\n(PatcherTool.ItemActivate)\n\"Stop shocking gun\"\n\"Start scanning gun\"\n\"Use patcher tool\""); cd_12 = cfg[12].Value; cfg[13] = Config.Bind("#", "13_cooldown", 240u, "[walkie]\n"+s2+"\nconditions: using the walkie\nfrequency: some strings on each activation\n(WalkieTalkie.SetLocalClientSpeaking)\n\"Set local client speaking on walkie talkie: {0}\"\n(WalkieTalkie.SendWalkieTalkieStartTransmissionSFX)\n\"Walkie talkie A\"\n\"Walkie talkie #{0} {1} B\"\n\"is walkie being used: {0}\"\n\"Walkie talkie #{0} {1} C\"\n(WalkieTalkie.PlayerIsHoldingAnotherWalkieTalkie)\n\"False A\"\n\"False B\"\n\"False C\"\n\"{0}\""); cd_13 = cfg[13].Value; cfg[14] = Config.Bind("#", "14_cooldown", 300u, "[loud horn]\n"+s1+"\nconditions: holding the cord\nfrequency: every frame\n(ShipAlarmCord.HoldCordDown)\n\"HOLD horn local client called\""); cd_14 = cfg[14].Value; cfg[15] = Config.Bind("#", "15_cooldown", 480u, "[mouth dog]\n"+s2+"\nconditions: dog hearing noise\nfrequency: some strings initially and 1 string logged maybe every frame if hearing continuous noise\n(MouthDogAI.DetectNoise)\n\"dog '{0}': Heard noise! Distance: {1} meters\"\n(MouthDogAI.EnrageDogOnLocalClient)\n\"Mouth dog targetPos 1: {0}; distanceToNoise: {1}\"\n\"Mouth dog targetPos 2: {0}\"\n\"Dog lastheardnoisePosition: {0}\"\n(MouthDogAI.ReactToOtherDogHowl)\n\"Setting lastHeardNoisePosition to {0}\"\n(MouthDogAI.EndLungeClientRpc)\n\"Ending lunge\""); cd_15 = cfg[15].Value; cfg[16] = Config.Bind("#", "16_cooldown", 600u, "[behaviour state]\n"+s2+"\nconditions: when an enemy changes behaviour state\nfrequency: not common per enemy, however since every enemy can log this it can end up being alot\n(EnemyAI.SwitchToBehaviourStateOnLocalClient)\n\"Current behaviour state: {0}\"\n\"CHANGING BEHAVIOUR STATE!!! to {0}\""); cd_16 = cfg[16].Value; cfg[17] = Config.Bind("#", "17_cooldown", 180u, "[hoarder bug]\n"+s2+"\nconditions: when a hoarder bug finds an item\nfrequency: every frame for maybe a short duration\n(HoarderBugAI.SetGoTowardsTargetObject)\n\": Setting target object and going towards it.\"\n\": i found an object but cannot reach it (or it has been taken by another bug):\""); cd_17 = cfg[17].Value; cfg[18] = Config.Bind("#", "18_cooldown", 300u, "[random nav]\n"+s1+"\nconditions: when some enemies search for a position on the map\nfrequency: usually low\n(RoundManager.GetRandomNavMeshPositionInRadius)\n\"Unable to get random nav mesh position in radius! Returning old pos\""); cd_18 = cfg[18].Value; cfg[19] = Config.Bind("#", "19_cooldown", 480u, "[quicksand]\n"+s2+"\nconditions: interacting with quicksand, can also be triggered by enemies\nfrequency: every frame for a short duration\n(QuicksandTrigger.OnTriggerStay)\n\"Set local player to sinking!\"\n(QuicksandTrigger.OnExit)\n\"Quicksand is not sinking local player!\"\n\"Quicksand is sinking local player!\"\n\"Quicksand is sinking local player! B\"\n\"Quicksand is sinking local player! C\""); cd_19 = cfg[19].Value; cfg[20] = Config.Bind("#", "20_cooldown", 180u, "[not targetable]\n"+s1+"\nconditions: player not being targetable while trying to be hit by an enemy (most commonly while invincable)\nfrequency: every frame for maybe a short duration\n(EnemyAI.MeetsStandardPlayerCollisionConditions)\n\"Player is not targetable\""); cd_20 = cfg[20].Value; cfg[21] = Config.Bind("#", "21_cooldown", 300u, "[masked]\n"+s2+"\nconditions: masked detecting noise\nfrequency: every few frames (per masked)\n(MaskedPlayerEnemy.DetectNoise)\n\"Noise heard relative loudness: {0}\"\n\"Can't hear noise reason A\"\n\"Can't hear noise reason B\""); cd_21 = cfg[21].Value; cfg[22] = Config.Bind("#", "22_cooldown", 600u, "[fox]\n"+s2+"\nconditions: fox existing during a round\nfrequency: every frame\n(BushWolfEnemy.Update)\n\"Fox spotted meter: {0}\"\n\"Fox A\"\n\"Fox B\"\n\"Fox C; {0}; {1}\"\n\"Fox D\"\n\"Fox E\"\n\"Fox F\"\n\"Fox G\"\n\"Fox H\"\n\"Fox I\"\n\"Fox J\"\n(BushWolfEnemy.GetBiggestWeedPatch)\n\"Bush wolf: No game objects found with spore tag; cancelling\"\n\"{0}: Mold spore {1} at {2} surrounded by {3}\"\n\"Bush wolf: Most surrounding spores is {0}\"\n\"Bush wolf: All spores found were lone spores; cancelling\""); cd_22 = cfg[22].Value; cfg[23] = Config.Bind("#", "23_cooldown", 180u, "[bush]\n"+s2+"\nconditions: using spray on bushes or loading a level\nfrequency: every frame for a short duration\n(MoldSpreadManager.DestroyMoldAtPosition)\n\"weeds found at pos {0}: {1}\"\n\"Index: {0}\"\n(MoldSpreadManager.GenerateMold)\n\"Mold iteration {0}\"\n\"Spore duplication count: {0}\"\n\"Mold #{0} of it#{1} pos: {2} ; {3}\"\n\"previousSpores[{0}]: pos {1}, marked {2}\"\n\"{0}; {1}; too close?: {2}\"\n\"Spore #{0} of iteration #{1} marked for deletion; \\n found spore position?: {2}; \\n stemmed from destroyed spore?: {3}; \\n too close to other?: {4}\"\n\"Added spore\"\n\"Growing back mold at index {0}\""); cd_23 = cfg[23].Value; cfg[24] = Config.Bind("#", "24_cooldown", 0u, "[hold interact]\n"+s2+"\nconditions: interacting with any hold interact\nfrequency: every frame\n(InteractTrigger.HoldInteractNotFilled)\n\"{0}; {1}\"\n\"Set on interact early\""); cd_24 = cfg[24].Value; cfg[25] = Config.Bind("#", "25_cooldown", 180u, "[truck]\n"+s2+"\nconditions: spawning truck, using magnet, collecting items with the truck, collide audio playing\nfrequency: some strings multiple times\n(VehicleController.CollectItemsInTruck)\n\"Collect items in truck A\"\n\"Collect items in truck B; {0}\"\n\"Collect items in truck C; {0}\"\n\"{0}; {1}; {2}\"\n\"Magneted? : {0}\"\n(VehicleController.PlayCollisionAudio)\n\"Play collision audio with type {0} A\""); cd_25 = cfg[25].Value; cfg[26] = Config.Bind("#", "26_cooldown", 300u, "[ropes]\n"+s1+"\nconditions: bought cruiser arriving\nfrequency: every frame for a short duration\n(ItemDropship.Update)\n\"Setting position of ropes\""); cd_26 = cfg[26].Value; cfg[27] = Config.Bind("#", "27_cooldown", 480u, "[cavedweller]\n"+s1+"\nconditions: cavedweller being near a player\nfrequency: every frame\n(CaveDwellerAI.BabyUpdate)\n\"Following player, like meter: {0}; decreasing loneliness by {1} * Time.deltaTime\""); cd_27 = cfg[27].Value; cfg[28] = Config.Bind("#", "28_cooldown", 300u, "[grabinvalidated]\n"+s1+"\nconditions: waiting for a grabbed item to be validated\nfrequency: depends on the connection, if laggy then can be every frame\n(PlayerControllerB.GrabObject)\n\"grabInvalidated: {0}\""); cd_28 = cfg[28].Value; cfg[29] = Config.Bind("#", "29_cooldown", 600u, "[physics region]\n"+s1+"\nconditions: being in cruiser and probably other stuff\nfrequency: every frame\n(PlayerPhysicsRegion.OnTriggerStay)\n\"Got player in physics region: {0}\""); cd_29 = cfg[29].Value; if (yeet.Value == true) { if (cdlist.Value.Contains("01") == true) IL.GameNetcodeStuff.PlayerControllerB.Update += pcb_update; if (cdlist.Value.Contains("02") == true) IL.EnemyAI.PlayerIsTargetable += enemy_target; if (cdlist.Value.Contains("03") == true) IL.EnemyAI.Update += enemy_update; if (cdlist.Value.Contains("04") == true) new ILHook((typeof(HUDManager).GetMethod("SetPlayerLevelSmoothly", BindingFlags.NonPublic | BindingFlags.Instance)).GetStateMachineTarget(), level); if (cdlist.Value.Contains("05") == true) IL.FlowerSnakeEnemy.DoAIInterval += snake; if (cdlist.Value.Contains("06") == true) IL.GameNetcodeStuff.PlayerControllerB.TeleportPlayer += pcb_teleport; if (cdlist.Value.Contains("07") == true) IL.DepositItemsDesk.Update += desk; if (cdlist.Value.Contains("08") == true) IL.ShowerTrigger.Update += shower; if (cdlist.Value.Contains("09") == true) IL.ForestGiantAI.Update += giant; if (cdlist.Value.Contains("10") == true) IL.GameNetcodeStuff.PlayerControllerB.ItemSecondaryUse_performed += pcb_secondary; if (cdlist.Value.Contains("11") == true) IL.SandSpiderWebTrap.PlayerLeaveWeb += spider; if (cdlist.Value.Contains("12") == true) { new ILHook((typeof(PatcherTool).GetMethod("ScanGun", BindingFlags.NonPublic | BindingFlags.Instance)).GetStateMachineTarget(), patch_1); IL.PatcherTool.GunMeetsConditionsToShock += patch_2; IL.PatcherTool.ItemActivate += patch_3; } if (cdlist.Value.Contains("13") == true) { IL.WalkieTalkie.SetLocalClientSpeaking += radio_1; IL.WalkieTalkie.SendWalkieTalkieStartTransmissionSFX += radio_2; IL.WalkieTalkie.PlayerIsHoldingAnotherWalkieTalkie += radio_3; } if (cdlist.Value.Contains("14") == true) IL.ShipAlarmCord.HoldCordDown += cord; if (cdlist.Value.Contains("15") == true) { IL.MouthDogAI.DetectNoise += dog_1; IL.MouthDogAI.EnrageDogOnLocalClient += dog_2; IL.MouthDogAI.ReactToOtherDogHowl += dog_3; IL.MouthDogAI.EndLungeClientRpc += dog_4; } if (cdlist.Value.Contains("16") == true) IL.EnemyAI.SwitchToBehaviourStateOnLocalClient += enemy_behaviour; if (cdlist.Value.Contains("17") == true) IL.HoarderBugAI.SetGoTowardsTargetObject += hoarder; if (cdlist.Value.Contains("18") == true) IL.RoundManager.GetRandomNavMeshPositionInRadius += random; if (cdlist.Value.Contains("19") == true) { IL.QuicksandTrigger.OnTriggerStay += sand_1; IL.QuicksandTrigger.OnExit += sand_2; } if (cdlist.Value.Contains("20") == true) IL.EnemyAI.MeetsStandardPlayerCollisionConditions += enemy_not_targetable; if (cdlist.Value.Contains("21") == true) IL.MaskedPlayerEnemy.DetectNoise += masked; if (cdlist.Value.Contains("22") == true) { IL.BushWolfEnemy.Update += bushwolf_update; IL.BushWolfEnemy.GetBiggestWeedPatch += bushwolf_big; } if (cdlist.Value.Contains("23") == true) { IL.MoldSpreadManager.DestroyMoldAtPosition += bush_destroy; IL.MoldSpreadManager.GenerateMold += bush_generate; } if (cdlist.Value.Contains("24") == true) IL.InteractTrigger.HoldInteractNotFilled += hold_interact; if (cdlist.Value.Contains("25") == true) { IL.VehicleController.CollectItemsInTruck += truck_collect; IL.VehicleController.PlayCollisionAudio += truck_audio; } if (cdlist.Value.Contains("26") == true) IL.ItemDropship.Update += ropes; if (cdlist.Value.Contains("27") == true) IL.CaveDwellerAI.BabyUpdate += cavedweller; if (cdlist.Value.Contains("28") == true) new ILHook((typeof(GameNetcodeStuff.PlayerControllerB).GetMethod("GrabObject", BindingFlags.NonPublic | BindingFlags.Instance)).GetStateMachineTarget(), grab); if (cdlist.Value.Contains("29") == true) IL.PlayerPhysicsRegion.OnTriggerStay += physics; } } //01 average velocity public static int _1; private static void pcb_update(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Average velocity: {0}") { c.Index = n; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_01 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<PlayerControllerB>>((self) => { if ((Time.frameCount - _1) >= cd_01) { _1 = Time.frameCount; Debug.Log("Average velocity: " + self.averageVelocity + " [NCS:" + cd_01 + "-" + _1 + "]"); } }); } break; } } } //02 targetable a public static int _2; private static void enemy_target(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Targetable A") { c.Index = n; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_02 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _2) >= cd_02) { _2 = Time.frameCount; Debug.Log("Targetable A [NCS:" + cd_02 + "-" + _2 + "]"); } }); } break; } } } //03 set destination a/b public static int[] _3 = new int[2]; private static void enemy_update(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Set destination to target player A") { c.Index = n; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_03 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _3[0]) >= cd_03) { _3[0] = Time.frameCount; Debug.Log("Set destination to target player A [NCS:" + cd_03 + "-" + _3[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Set destination to target player B") { c.Index = n; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_03 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _3[1]) >= cd_03) { _3[1] = Time.frameCount; Debug.Log("Set destination to target player B [NCS:" + cd_03 + "-" + _3[1] + "]"); } }); } } } } } //04 level timer public static int _4; private static void level(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Level up timer: {0}") { c.Index = n + 8; for (int s = 0; s < 8; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_04 != 0) { //c.Emit(OpCodes.Ldarg_0); //c.Emit(OpCodes.Ldfld, typeof(HUDManager).GetField("SetPlayerLevelSmoothly.timeAtStart", BindingFlags.NonPublic | BindingFlags.Instance)); c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _4) >= cd_04) { _4 = Time.frameCount; Debug.Log("Level up timer: (timer) [NCS:" + cd_04 + "-" + _4 + "]"); } }); } break; } } } //05 fs 1-4 public static int[] _5 = new int[4]; private static void snake(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "FS 1") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_05 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _5[0]) >= cd_05) { _5[0] = Time.frameCount; Debug.Log("FS 1 [NCS:" + cd_05 + "-" + _5[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "FS 2") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_05 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _5[1]) >= cd_05) { _5[1] = Time.frameCount; Debug.Log("FS 2 [NCS:" + cd_05 + "-" + _5[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "FS 3") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_05 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _5[2]) >= cd_05) { _5[2] = Time.frameCount; Debug.Log("FS 3 [NCS:" + cd_05 + "-" + _5[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "FS 4") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_05 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _5[3]) >= cd_05) { _5[3] = Time.frameCount; Debug.Log("FS 4 [NCS:" + cd_05 + "-" + _5[3] + "]"); } }); } } } } } //06 called teleport function public static int _6; private static void pcb_teleport(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Called teleport function on ") { c.Index = n; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_06 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<PlayerControllerB>>((self) => { if ((Time.frameCount - _6) >= cd_06) { _6 = Time.frameCount; Debug.Log("Called teleport function on " + self.gameObject.name + " [NCS:" + cd_06 + "-" + _6 + "]"); } }); } break; } } } //07 company desk timer public static int[] _7 = new int[2]; private static void desk(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Desk: Waiting to grab the items on the desk; {0}") { c.Index = n; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_07 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldfld, typeof(DepositItemsDesk).GetField("grabObjectsTimer", BindingFlags.NonPublic | BindingFlags.Instance)); c.EmitDelegate<System.Action<float>>((timer) => { if ((Time.frameCount - _7[0]) >= cd_07) { _7[0] = Time.frameCount; Debug.Log("Desk: Waiting to grab the items on the desk; " + timer + " [NCS:" + cd_07 + "-" + _7[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Desk: no objects on counter, waiting with door open; {0}") { c.Index = n; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_07 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldfld, typeof(DepositItemsDesk).GetField("waitingWithDoorOpenTimer", BindingFlags.NonPublic | BindingFlags.Instance)); c.EmitDelegate<System.Action<float>>((timer) => { if ((Time.frameCount - _7[1]) >= cd_07) { _7[1] = Time.frameCount; Debug.Log("Desk: no objects on counter, waiting with door open; " + timer + " [NCS:" + cd_07 + "-" + _7[1] + "]"); } }); } } } } } //08 shower public static int[] _8 = new int[2]; private static void shower(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Shower is running with players inside!") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_08 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _8[0]) >= cd_08) { _8[0] = Time.frameCount; Debug.Log("Shower is running with players inside! [NCS:" + cd_08 + "-" + _8[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "spray decal #{0} found as child of {1}") { c.Index = n; for (int s = 0; s < 11; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_08 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldfld, typeof(ShowerTrigger).GetField("cleanDecalIndex", BindingFlags.NonPublic | BindingFlags.Instance)); c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldfld, typeof(ShowerTrigger).GetField("playersInShower", BindingFlags.NonPublic | BindingFlags.Instance)); c.Emit(OpCodes.Ldloc_1); c.EmitDelegate<System.Action<int, System.Collections.Generic.List<PlayerControllerB>, int>>((num, players, index) => { if ((Time.frameCount - _8[1]) >= cd_08) { _8[1] = Time.frameCount; Debug.Log("spray decal #" + num + " found as child of " + players[index] + " [NCS:" + cd_08 + "-" + _8[1] + "]"); } }); } } } } } //09 agent speed public static int _9; private static void giant(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "agent speed: {0}") { c.Index = n; for (int s = 0; s < 7; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_09 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<EnemyAI>>((self) => { if ((Time.frameCount - _9) >= cd_09) { _9 = Time.frameCount; Debug.Log("agent speed: " + self.agent.speed + " [NCS:" + cd_09 + "-" + _9 + "]"); } }); } break; } } } //10 secondary use a-g public static int[] _10 = new int[7]; private static void pcb_secondary(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "secondary use A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[0]) >= cd_10) { _10[0] = Time.frameCount; Debug.Log("secondary use A [NCS:" + cd_10 + "-" + _10[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "secondary use B") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[1]) >= cd_10) { _10[1] = Time.frameCount; Debug.Log("secondary use B [NCS:" + cd_10 + "-" + _10[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "secondary use C") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[2]) >= cd_10) { _10[2] = Time.frameCount; Debug.Log("secondary use C [NCS:" + cd_10 + "-" + _10[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "secondary use D") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[3]) >= cd_10) { _10[3] = Time.frameCount; Debug.Log("secondary use D [NCS:" + cd_10 + "-" + _10[3] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "secondary use E") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[4]) >= cd_10) { _10[4] = Time.frameCount; Debug.Log("secondary use E [NCS:" + cd_10 + "-" + _10[4] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "secondary use F") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[5]) >= cd_10) { _10[5] = Time.frameCount; Debug.Log("secondary use F [NCS:" + cd_10 + "-" + _10[5] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "secondary use G") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_10 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _10[6]) >= cd_10) { _10[6] = Time.frameCount; Debug.Log("secondary use G [NCS:" + cd_10 + "-" + _10[6] + "]"); } }); } } } } } //11 player leave web public static int _11; private static void spider(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Player leave web called") { c.Index = n; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_11 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _11) >= cd_11) { _11 = Time.frameCount; Debug.Log("Player leave web called [NCS:" + cd_11 + "-" + _11 + "]"); } }); } break; } } } //12 zapgun 1 public static int[] _12 = new int[9]; private static void patch_1(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Scan A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _12[0]) >= cd_12) { _12[0] = Time.frameCount; Debug.Log("Scan A [NCS:" + cd_12 + "-" + _12[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Scan B") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _12[1]) >= cd_12) { _12[1] = Time.frameCount; Debug.Log("Scan B [NCS:" + cd_12 + "-" + _12[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Got shockable transform name : ") { c.Index = n + 7; for (int s = 0; s < 7; s = s + 1) { if (s != 1) l.Instrs[n + s].OpCode = OpCodes.Nop; } if (cd_12 != 0) { //c.Emit(OpCodes.Ldloc_S, 4); c.EmitDelegate<System.Action<IShockableWithGun>>((component) => { if ((Time.frameCount - _12[2]) >= cd_12) { _12[2] = Time.frameCount; Debug.Log("Got shockable transform name : " + component.GetShockableTransform().gameObject.name + " [NCS:" + cd_12 + "-" + _12[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Zap gun light off!!!") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _12[3]) >= cd_12) { _12[3] = Time.frameCount; Debug.Log("Zap gun light off!!! [NCS:" + cd_12 + "-" + _12[3] + "]"); } }); } } } } } //12 zapgun 2 private static void patch_2(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Target position: {0}") { c.Index = n; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.Emit(OpCodes.Ldarg_2); c.EmitDelegate<System.Action<Vector3>>((position) => { if ((Time.frameCount - _12[4]) >= cd_12) { _12[4] = Time.frameCount; Debug.Log("Target position: " + position + " [NCS:" + cd_12 + "-" + _12[4] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Gun not meeting conditions to zap; {0}; {1}; {2}") { c.Index = n; for (int s = 0; s < 21; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldfld, typeof(PatcherTool).GetField("gunOverheat")); c.Emit(OpCodes.Ldloc_0); //position c.Emit(OpCodes.Ldarg_2); //target_position c.EmitDelegate<System.Action<float, Vector3, Vector3>>((num, position, target_position) => { if ((Time.frameCount - _12[5]) >= cd_12) { _12[5] = Time.frameCount; Debug.Log("Gun not meeting conditions to zap; " + (num > 2f) + "; " + (Vector3.Distance(position, target_position) < 0.7f) + "; " + (Physics.Linecast(position, target_position, StartOfRound.Instance.collidersAndRoomMask, QueryTriggerInteraction.Ignore)) + " [NCS:" + cd_12 + "-" + _12[5] + "]"); } }); } } } } } //12 zapgun 3 private static void patch_3(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Stop shocking gun") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _12[6]) >= cd_12) { _12[6] = Time.frameCount; Debug.Log("Stop shocking gun [NCS:" + cd_12 + "-" + _12[6] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Start scanning gun") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _12[7]) >= cd_12) { _12[7] = Time.frameCount; Debug.Log("Start scanning gun [NCS:" + cd_12 + "-" + _12[7] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Use patcher tool") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_12 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _12[8]) >= cd_12) { _12[8] = Time.frameCount; Debug.Log("Use patcher tool [NCS:" + cd_12 + "-" + _12[8] + "]"); } }); } } } } } //13 walkie 1 public static int[] _13 = new int[9]; private static void radio_1(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Set local client speaking on walkie talkie: {0}") { c.Index = n; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.Emit(OpCodes.Ldarg_1); c.EmitDelegate<System.Action<bool>>((bol) => { if ((Time.frameCount - _13[0]) >= cd_13) { _13[0] = Time.frameCount; Debug.Log("Set local client speaking on walkie talkie: " + bol + " [NCS:" + cd_13 + "-" + _13[0] + "]"); } }); } break; } } } //13 walkie 2 private static void radio_2(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Walkie talkie A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _13[1]) >= cd_13) { _13[1] = Time.frameCount; Debug.Log("Walkie talkie A [NCS:" + cd_13 + "-" + _13[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Walkie talkie #{0} {1} B") { c.Index = n + 10; for (int s = 0; s < 10; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.Emit(OpCodes.Ldsfld, typeof(WalkieTalkie).GetField("allWalkieTalkies")); c.Emit(OpCodes.Ldloc_0); c.EmitDelegate<System.Action<System.Collections.Generic.List<WalkieTalkie>, int>>((list, index) => { if ((Time.frameCount - _13[2]) >= cd_13) { _13[2] = Time.frameCount; Debug.Log("Walkie talkie #" + index + " " + list[index].gameObject.name + " B [NCS:" + cd_13 + "-" + _13[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "is walkie being used: {0}") { c.Index = n + 8; for (int s = 0; s < 8; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.Emit(OpCodes.Ldsfld, typeof(WalkieTalkie).GetField("allWalkieTalkies")); c.Emit(OpCodes.Ldloc_0); c.EmitDelegate<System.Action<System.Collections.Generic.List<WalkieTalkie>, int>>((list, index) => { if ((Time.frameCount - _13[3]) >= cd_13) { _13[3] = Time.frameCount; Debug.Log("is walkie being used: " + list[index].isBeingUsed + " [NCS:" + cd_13 + "-" + _13[3] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Walkie talkie #{0} {1} C") { c.Index = n + 10; for (int s = 0; s < 10; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.Emit(OpCodes.Ldsfld, typeof(WalkieTalkie).GetField("allWalkieTalkies")); c.Emit(OpCodes.Ldloc_0); c.EmitDelegate<System.Action<System.Collections.Generic.List<WalkieTalkie>, int>>((list, index) => { if ((Time.frameCount - _13[4]) >= cd_13) { _13[4] = Time.frameCount; Debug.Log("Walkie talkie #" + index + " " + list[index].gameObject.name + " C [NCS:" + cd_13 + "-" + _13[4] + "]"); } }); } } } } } //13 walkie 3 private static void radio_3(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "False A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _13[5]) >= cd_13) { _13[5] = Time.frameCount; Debug.Log("False A [NCS:" + cd_13 + "-" + _13[5] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "False B") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _13[6]) >= cd_13) { _13[6] = Time.frameCount; Debug.Log("False B [NCS:" + cd_13 + "-" + _13[6] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "False C") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _13[7]) >= cd_13) { _13[7] = Time.frameCount; Debug.Log("False C [NCS:" + cd_13 + "-" + _13[7] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "{0}") { c.Index = n + 6; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_13 != 0) { c.Emit(OpCodes.Ldarg_1); c.EmitDelegate<System.Action<WalkieTalkie>>((self) => { if ((Time.frameCount - _13[8]) >= cd_13) { _13[8] = Time.frameCount; Debug.Log(self.isPocketed + " [NCS:" + cd_13 + "-" + _13[8] + "]"); } }); } } } } } //14 loud horn public static int _14; private static void cord(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "HOLD horn local client called") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_14 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _14) >= cd_14) { _14 = Time.frameCount; Debug.Log("HOLD horn local client called [NCS:" + cd_14 + "-" + _14 + "]"); } }); } break; } } } //15 mouth dog 1 public static int[] _15 = new int[6]; private static void dog_1(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "dog '{0}': Heard noise! Distance: {1} meters") { c.Index = n; for (int s = 0; s < 8; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_15 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldloc_0); c.EmitDelegate<System.Action<MouthDogAI, float>>((self, num) => { if ((Time.frameCount - _15[0]) >= cd_15) { _15[0] = Time.frameCount; Debug.Log("dog '" + self.gameObject.name + "': Heard noise! Distance: " + num + " meters [NCS:" + cd_15 + "-" + _15[0] + "]"); } }); } break; } } } //15 mouth dog 2 private static void dog_2(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Mouth dog targetPos 1: {0}; distanceToNoise: {1}") { c.Index = n; for (int s = 0; s < 7; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_15 != 0) { c.Emit(OpCodes.Ldarg_1); c.Emit(OpCodes.Ldarg_2); c.EmitDelegate<System.Action<Vector3, float>>((position, distance) => { if ((Time.frameCount - _15[1]) >= cd_15) { _15[1] = Time.frameCount; Debug.Log("Mouth dog targetPos 1: " + position + "; distanceToNoise: " + distance + " [NCS:" + cd_15 + "-" + _15[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Mouth dog targetPos 2: {0}") { c.Index = n; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_15 != 0) { c.Emit(OpCodes.Ldarg_1); c.EmitDelegate<System.Action<Vector3>>((position) => { if ((Time.frameCount - _15[2]) >= cd_15) { _15[2] = Time.frameCount; Debug.Log("Mouth dog targetPos 2: " + position + " [NCS:" + cd_15 + "-" + _15[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Dog lastheardnoisePosition: {0}") { c.Index = n; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_15 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldfld, typeof(MouthDogAI).GetField("lastHeardNoisePosition", BindingFlags.NonPublic | BindingFlags.Instance)); c.EmitDelegate<System.Action<Vector3>>((position) => { if ((Time.frameCount - _15[3]) >= cd_15) { _15[3] = Time.frameCount; Debug.Log("Dog lastheardnoisePosition: " + position + " [NCS:" + cd_15 + "-" + _15[3] + "]"); } }); } } } } } //15 mouth dog 3 private static void dog_3(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Setting lastHeardNoisePosition to {0}") { c.Index = n; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_15 != 0) { c.Emit(OpCodes.Ldarg_1); c.EmitDelegate<System.Action<Vector3>>((position) => { if ((Time.frameCount - _15[4]) >= cd_15) { _15[4] = Time.frameCount; Debug.Log("Setting lastHeardNoisePosition to " + position + " [NCS:" + cd_15 + "-" + _15[4] + "]"); } }); } break; } } } //15 mouth dog 4 private static void dog_4(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Ending lunge") { c.Index = n; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_15 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _15[5]) >= cd_15) { _15[5] = Time.frameCount; Debug.Log("Ending lunge [NCS:" + cd_15 + "-" + _15[5] + "]"); } }); } break; } } } //16 behaviour state public static int[] _16 = new int[2]; private static void enemy_behaviour(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Current behaviour state: {0}") { c.Index = n; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_16 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<EnemyAI>>((self) => { if ((Time.frameCount - _16[0]) >= cd_16) { _16[0] = Time.frameCount; Debug.Log("Current behaviour state: " + self.currentBehaviourStateIndex + " [NCS:" + cd_16 + "-" + _16[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "CHANGING BEHAVIOUR STATE!!! to {0}") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_16 != 0) { c.Emit(OpCodes.Ldarg_1); c.EmitDelegate<System.Action<int>>((index) => { if ((Time.frameCount - _16[1]) >= cd_16) { _16[1] = Time.frameCount; Debug.Log("CHANGING BEHAVIOUR STATE!!! to " + index + " [NCS:" + cd_16 + "-" + _16[1] + "]"); } }); } } } } } //17 hoarder bug public static int[] _17 = new int[2]; private static void hoarder(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == ": Setting target object and going towards it.") { c.Index = n + 3; for (int s = 0; s < 6; s = s + 1) l.Instrs[(n - 3) + s].OpCode = OpCodes.Nop; if (cd_17 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<HoarderBugAI>>((self) => { if ((Time.frameCount - _17[0]) >= cd_17) { _17[0] = Time.frameCount; Debug.Log(self.gameObject.name + " : Setting target object and going towards it. [NCS:" + cd_17 + "-" + _17[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == ": i found an object but cannot reach it (or it has been taken by another bug): ") { c.Index = n + 5; for (int s = 0; s < 8; s = s + 1) l.Instrs[(n - 3) + s].OpCode = OpCodes.Nop; if (cd_17 != 0) { c.Emit(OpCodes.Ldarg_0); c.Emit(OpCodes.Ldarg_1); c.EmitDelegate<System.Action<HoarderBugAI, GameObject>>((self, item) => { if ((Time.frameCount - _17[1]) >= cd_17) { _17[1] = Time.frameCount; Debug.Log(self.gameObject.name + " : i found an object but cannot reach it (or it has been taken by another bug): " + item.name + " [NCS:" + cd_17 + "-" + _17[1] + "]"); } }); } } } } } //18 random nav public static int _18; private static void random(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Unable to get random nav mesh position in radius! Returning old pos") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_18 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _18) >= cd_18) { _18 = Time.frameCount; Debug.Log("Unable to get random nav mesh position in radius! Returning old pos [NCS:" + cd_18 + "-" + _18 + "]"); } }); } break; } } } //19 quicksand 1 public static int[] _19 = new int[5]; private static void sand_1(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Set local player to sinking!") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_19 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _19[0]) >= cd_19) { _19[0] = Time.frameCount; Debug.Log("Set local player to sinking! [NCS:" + cd_19 + "-" + _19[0] + "]"); } }); } break; } } } //19 quicksand 2 private static void sand_2(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Quicksand is not sinking local player!") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_19 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _19[1]) >= cd_19) { _19[1] = Time.frameCount; Debug.Log("Quicksand is not sinking local player! [NCS:" + cd_19 + "-" + _19[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Quicksand is sinking local player!") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_19 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _19[2]) >= cd_19) { _19[2] = Time.frameCount; Debug.Log("Quicksand is sinking local player! [NCS:" + cd_19 + "-" + _19[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Quicksand is sinking local player! B") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_19 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _19[3]) >= cd_19) { _19[3] = Time.frameCount; Debug.Log("Quicksand is sinking local player! B [NCS:" + cd_19 + "-" + _19[3] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Quicksand is sinking local player! C") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_19 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _19[4]) >= cd_19) { _19[4] = Time.frameCount; Debug.Log("Quicksand is sinking local player! C [NCS:" + cd_19 + "-" + _19[4] + "]"); } }); } } } } } //20 not targetable public static int _20; private static void enemy_not_targetable(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Player is not targetable") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_20 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _20) >= cd_20) { _20 = Time.frameCount; Debug.Log("Player is not targetable [NCS:" + cd_20 + "-" + _20 + "]"); } }); } break; } } } //21 masked public static int[] _21 = new int[3]; private static void masked(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Noise heard relative loudness: {0}") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_21 != 0) { c.Emit(OpCodes.Ldloc_1); c.EmitDelegate<System.Action<float>>((num) => { if ((Time.frameCount - _21[0]) >= cd_21) { _21[0] = Time.frameCount; Debug.Log("Noise heard relative loudness: " + num + " [NCS:" + cd_21 + "-" + _21[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Can't hear noise reason A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_21 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _21[1]) >= cd_21) { _21[1] = Time.frameCount; Debug.Log("Can't hear noise reason A [NCS:" + cd_21 + "-" + _21[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Can't hear noise reason B") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_21 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _21[2]) >= cd_21) { _21[2] = Time.frameCount; Debug.Log("Can't hear noise reason B [NCS:" + cd_21 + "-" + _21[2] + "]"); } }); } } } } } //22 fox 1 public static int[] _22 = new int[15]; private static void bushwolf_update(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Fox spotted meter: {0}") { c.Index = n + 6; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<BushWolfEnemy>>((self) => { if ((Time.frameCount - _22[0]) >= cd_22) { _22[0] = Time.frameCount; Debug.Log("Fox spotted meter: " + self.spottedMeter + " [NCS:" + cd_22 + "-" + _22[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[1]) >= cd_22) { _22[1] = Time.frameCount; Debug.Log("Fox A [NCS:" + cd_22 + "-" + _22[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox B") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[2]) >= cd_22) { _22[2] = Time.frameCount; Debug.Log("Fox B [NCS:" + cd_22 + "-" + _22[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox C; {0}; {1}") { c.Index = n + 7; for (int s = 0; s < 7; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.Emit(OpCodes.Ldloc, 14); c.Emit(OpCodes.Ldloc, 15); c.EmitDelegate<System.Action<float, float>>((distance, angle) => { if ((Time.frameCount - _22[3]) >= cd_22) { _22[3] = Time.frameCount; Debug.Log("Fox C; " + distance + "; " + angle + " [NCS:" + cd_22 + "-" + _22[3] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox D") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[4]) >= cd_22) { _22[4] = Time.frameCount; Debug.Log("Fox D [NCS:" + cd_22 + "-" + _22[4] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox E") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[5]) >= cd_22) { _22[5] = Time.frameCount; Debug.Log("Fox E [NCS:" + cd_22 + "-" + _22[5] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox F") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[6]) >= cd_22) { _22[6] = Time.frameCount; Debug.Log("Fox F [NCS:" + cd_22 + "-" + _22[6] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox G") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[7]) >= cd_22) { _22[7] = Time.frameCount; Debug.Log("Fox G [NCS:" + cd_22 + "-" + _22[7] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox H") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[8]) >= cd_22) { _22[8] = Time.frameCount; Debug.Log("Fox H [NCS:" + cd_22 + "-" + _22[8] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox I") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[9]) >= cd_22) { _22[9] = Time.frameCount; Debug.Log("Fox I [NCS:" + cd_22 + "-" + _22[9] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Fox J") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[10]) >= cd_22) { _22[10] = Time.frameCount; Debug.Log("Fox J [NCS:" + cd_22 + "-" + _22[10] + "]"); } }); } } } } } //22 fox 2 private static void bushwolf_big(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Bush wolf: No game objects found with spore tag; cancelling") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[11]) >= cd_22) { _22[11] = Time.frameCount; Debug.Log("Bush wolf: No game objects found with spore tag; cancelling [NCS:" + cd_22 + "-" + _22[11] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "{0}: Mold spore {1} at {2} surrounded by {3}") { c.Index = n + 32; for (int s = 0; s < 32; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.Emit(OpCodes.Ldloc, 6); c.Emit(OpCodes.Ldloc_0); c.Emit(OpCodes.Ldloc_3); c.EmitDelegate<System.Action<int, GameObject[], int>>((index, objects, num) => { if ((Time.frameCount - _22[12]) >= cd_22) { _22[12] = Time.frameCount; Debug.Log(index + ": Mold spore " + objects[index].gameObject.name + " at " + objects[index].transform.position + " surrounded by " + num + " [NCS:" + cd_22 + "-" + _22[12] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Bush wolf: Most surrounding spores is {0}") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.Emit(OpCodes.Ldloc_2); c.EmitDelegate<System.Action<int>>((num) => { if ((Time.frameCount - _22[13]) >= cd_22) { _22[13] = Time.frameCount; Debug.Log("Bush wolf: Most surrounding spores is " + num + " [NCS:" + cd_22 + "-" + _22[13] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Bush wolf: All spores found were lone spores; cancelling") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_22 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _22[14]) >= cd_22) { _22[14] = Time.frameCount; Debug.Log("Bush wolf: All spores found were lone spores; cancelling [NCS:" + cd_22 + "-" + _22[14] + "]"); } }); } } } } } //23 bush 1 public static int[] _23 = new int[11]; private static void bush_destroy(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "weeds found at pos {0}: {1}") { c.Index = n + 7; for (int s = 0; s < 7; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldarg_1); c.Emit(OpCodes.Ldloc_0); c.EmitDelegate<System.Action<Vector3, int>>((position, num) => { if ((Time.frameCount - _23[0]) >= cd_23) { _23[0] = Time.frameCount; Debug.Log("weeds found at pos " + position + ": " + num + " [NCS:" + cd_23 + "-" + _23[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Index: {0}") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc_2); c.EmitDelegate<System.Action<int>>((num) => { if ((Time.frameCount - _23[1]) >= cd_23) { _23[1] = Time.frameCount; Debug.Log("Index: " + num + " [NCS:" + cd_23 + "-" + _23[1] + "]"); } }); } } } } } //23 bush 2 private static void bush_generate(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Mold iteration {0}") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 13); c.EmitDelegate<System.Action<int>>((num) => { if ((Time.frameCount - _23[2]) >= cd_23) { _23[2] = Time.frameCount; Debug.Log("Mold iteration " + num + " [NCS:" + cd_23 + "-" + _23[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Spore duplication count: {0}") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 19); c.EmitDelegate<System.Action<int>>((num) => { if ((Time.frameCount - _23[3]) >= cd_23) { _23[3] = Time.frameCount; Debug.Log("Spore duplication count: " + num + " [NCS:" + cd_23 + "-" + _23[3] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Mold #{0} of it#{1} pos: {2} ; {3}") { c.Index = n + 25; for (int s = 0; s < 25; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 18); c.Emit(OpCodes.Ldloc, 13); c.Emit(OpCodes.Ldloc, 6); c.Emit(OpCodes.Ldloc, 10); c.EmitDelegate<System.Action<int, int, Vector3, bool>>((index1, index2, position, bol) => { if ((Time.frameCount - _23[4]) >= cd_23) { _23[4] = Time.frameCount; Debug.Log("Mold #" + index1 + " of it#" + index2 + " pos: " + position + " ; " + bol + " [NCS:" + cd_23 + "-" + _23[4] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "previousSpores[{0}]: pos {1}, marked {2}") { c.Index = n + 15; for (int s = 0; s < 15; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 18); c.Emit(OpCodes.Ldloc, 4); c.EmitDelegate<System.Action<int, System.Collections.Generic.List<MoldSpore>>>((index, spores) => { if ((Time.frameCount - _23[5]) >= cd_23) { _23[5] = Time.frameCount; Debug.Log("previousSpores[" + index + "]: pos " + spores[index].spawnPosition + ", marked " + spores[index].markedForDestruction + " [NCS:" + cd_23 + "-" + _23[5] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "{0}; {1}; too close?: {2}") { c.Index = n + 9; for (int s = 0; s < 9; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 18); c.Emit(OpCodes.Ldloc, 7); c.Emit(OpCodes.Ldloc, 23); c.EmitDelegate<System.Action<int, int, bool>>((index, num, bol) => { if ((Time.frameCount - _23[6]) >= cd_23) { _23[6] = Time.frameCount; Debug.Log(index + "; " + num + "; too close?: " + bol + " [NCS:" + cd_23 + "-" + _23[6] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Adding mold to previously destroyed mold") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _23[7]) >= cd_23) { _23[7] = Time.frameCount; Debug.Log("Adding mold to previously destroyed mold [NCS:" + cd_23 + "-" + _23[7] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Spore #{0} of iteration #{1} marked for deletion; \n found spore position?: {2}; \n stemmed from destroyed spore?: {3}; \n too close to other?: {4}") { c.Index = n + 41; for (int s = 0; s < 41; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 18); c.Emit(OpCodes.Ldloc, 13); c.Emit(OpCodes.Ldloc, 10); c.Emit(OpCodes.Ldloc, 4); c.Emit(OpCodes.Ldarg_2); c.Emit(OpCodes.Ldloc, 23); c.EmitDelegate<System.Action<int, int, bool, System.Collections.Generic.List<MoldSpore>, int, bool>>((index1, index2, bol1, spores, iterations, bol2) => { if ((Time.frameCount - _23[8]) >= cd_23) { _23[8] = Time.frameCount; Debug.Log("Spore #" + index1 + " of iteration #" + index2 + " marked for deletion; \n found spore position?: " + bol1 + "; \n stemmed from destroyed spore?: " + (spores[index1].markedForDestruction && index2 + 1 == iterations) + "; \n too close to other?: " + bol2 + " [NCS:" + cd_23 + "-" + _23[8] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Added spore") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _23[9]) >= cd_23) { _23[9] = Time.frameCount; Debug.Log("Added spore [NCS:" + cd_23 + "-" + _23[9] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Growing back mold at index {0}") { c.Index = n + 8; for (int s = 0; s < 8; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_23 != 0) { c.Emit(OpCodes.Ldloc, 12); c.Emit(OpCodes.Ldloc, 24); c.EmitDelegate<System.Action<System.Collections.Generic.List<MoldSpore>, int>>((spores, index) => { if ((Time.frameCount - _23[10]) >= cd_23) { _23[10] = Time.frameCount; Debug.Log("Growing back mold at index " + spores[index].generationId + " [NCS:" + cd_23 + "-" + _23[10] + "]"); } }); } } } } } //24 hold interact public static int[] _24 = new int[2]; private static void hold_interact(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "{0}; {1}") { c.Index = n + 9; for (int s = 0; s < 9; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_24 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<InteractTrigger>>((self) => { if ((Time.frameCount - _24[0]) >= cd_24) { _24[0] = Time.frameCount; Debug.Log(self.specialCharacterAnimation + "; " + self.isLadder + " [NCS:" + cd_24 + "-" + _24[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Set on interact early") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_24 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _24[1]) >= cd_24) { _24[1] = Time.frameCount; Debug.Log("Set on interact early [NCS:" + cd_24 + "-" + _24[1] + "]"); } }); } } } } } //25 truck 1 public static int[] _25 = new int[6]; private static void truck_collect(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "Collect items in truck A") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_25 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _25[0]) >= cd_25) { _25[0] = Time.frameCount; Debug.Log("Collect items in truck A [NCS:" + cd_25 + "-" + _25[0] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Collect items in truck B; {0}") { c.Index = n + 7; for (int s = 0; s < 7; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_25 != 0) { c.Emit(OpCodes.Ldloc_0); c.EmitDelegate<System.Action<Collider[]>>((list) => { if ((Time.frameCount - _25[1]) >= cd_25) { _25[1] = Time.frameCount; Debug.Log("Collect items in truck B; " + list.Length + " [NCS:" + cd_25 + "-" + _25[1] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Collect items in truck C; {0}") { c.Index = n + 7; for (int s = 0; s < 7; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_25 != 0) { c.Emit(OpCodes.Ldloc_1); c.EmitDelegate<System.Action<GrabbableObject>>((go) => { if ((Time.frameCount - _25[2]) >= cd_25) { _25[2] = Time.frameCount; Debug.Log("Collect items in truck C; " + (go != null) + " [NCS:" + cd_25 + "-" + _25[2] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "{0}; {1}; {2}") { c.Index = n + 22; for (int s = 0; s < 22; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_25 != 0) { c.Emit(OpCodes.Ldloc_1); c.Emit(OpCodes.Ldloc_0); c.Emit(OpCodes.Ldloc_2); c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<GrabbableObject, Collider[], int, VehicleController>>((go, list, index, self) => { if ((Time.frameCount - _25[3]) >= cd_25) { _25[3] = Time.frameCount; Debug.Log(!go.isHeld + "; " + !go.isHeldByEnemy + "; " + (list[index].transform.parent == self.transform) + " [NCS:" + cd_25 + "-" + _25[3] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "Magneted? : {0}") { c.Index = n + 6; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_25 != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<VehicleController>>((self) => { if ((Time.frameCount - _25[4]) >= cd_25) { _25[4] = Time.frameCount; Debug.Log("Magneted? : " + self.magnetedToShip + " [NCS:" + cd_25 + "-" + _25[4] + "]"); } }); } } } } } //25 truck 2 private static void truck_audio(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Play collision audio with type {0} A") { c.Index = n + 5; for (int s = 0; s < 5; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_25 != 0) { c.Emit(OpCodes.Ldarg_2); c.EmitDelegate<System.Action<int>>((num) => { if ((Time.frameCount - _25[5]) >= cd_25) { _25[5] = Time.frameCount; Debug.Log("Play collision audio with type " + num + " A [NCS:" + cd_25 + "-" + _25[5] + "]"); } }); } break; } } } //26 ropes public static int _26; private static void ropes(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Setting position of ropes") { c.Index = n + 2; for (int s = 0; s < 2; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_26 != 0) { c.EmitDelegate<System.Action>(() => { if ((Time.frameCount - _26) >= cd_26) { _26 = Time.frameCount; Debug.Log("Setting position of ropes [NCS:" + cd_26 + "-" + _26 + "]"); } }); } break; } } } //27 cavedweller public static int _27; private static void cavedweller(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Following player, like meter: {0}; decreasing loneliness by {1} * Time.deltaTime") { c.Index = n + 17; for (int s = 0; s < 17; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_27 != 0) { c.Emit(OpCodes.Ldloc_2); c.EmitDelegate<System.Action<BabyPlayerMemory>>((memory) => { if ((Time.frameCount - _27) >= cd_27) { _27 = Time.frameCount; Debug.Log("Following player, like meter: " + memory.likeMeter + "; decreasing loneliness by " + (Time.deltaTime * (0.07f / Mathf.Max(memory.likeMeter * 3f, 0.45f))) + " * Time.deltaTime [NCS:" + cd_27 + "-" + _27 + "]"); } }); } break; } } } //28 grabinvalidated public static int _28; private static void grab(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "grabInvalidated: {0}") { c.Index = n + 6; for (int s = 0; s < 6; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_28 != 0) { c.Emit(OpCodes.Ldloc_1); c.Emit(OpCodes.Ldfld, typeof(GameNetcodeStuff.PlayerControllerB).GetField("grabInvalidated", BindingFlags.NonPublic | BindingFlags.Instance)); c.EmitDelegate<System.Action<bool>>((grabinvalidated) => { if ((Time.frameCount - _28) >= cd_28) { _28 = Time.frameCount; Debug.Log("grabInvalidated: " + grabinvalidated + " [NCS:" + cd_28 + "-" + _28 + "]"); } }); } break; } } } //29 physics region public static int _29; private static void physics(ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr && l.Instrs[n].Operand.ToString() == "Got player in physics region: {0}") { c.Index = n + 4; for (int s = 0; s < 4; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_29 != 0) { c.Emit(OpCodes.Ldloc_1); c.EmitDelegate<System.Action<PlayerControllerB>>((component) => { if ((Time.frameCount - _29) >= cd_29) { _29 = Time.frameCount; Debug.Log("Got player in physics region: " + component + " [NCS:" + cd_29 + "-" + _29 + "]"); } }); } break; } } } /*template public static int[] = new int[]; private static void (ILContext l) { ILCursor c = new ILCursor(l); for (int n = 0; n < l.Instrs.Count; n = n + 1) { if (l.Instrs[n].OpCode == OpCodes.Ldstr) { if (l.Instrs[n].Operand.ToString() == "") { c.Index = n; for (int s = 0; s <; s = s + 1) l.Instrs[n + s].OpCode = OpCodes.Nop; if (cd_ != 0) { c.Emit(OpCodes.Ldarg_0); c.EmitDelegate<System.Action<>>((self) => { if ((Time.frameCount - _[]) >= cd_) { _[] = Time.frameCount; Debug.Log("[NCS:" + cd_ + "-" + _[] + "]"); } }); } } else if (l.Instrs[n].Operand.ToString() == "") { } } } } */ } }