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.Versioning; using System.Security; using System.Security.Permissions; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalConfig; using LethalConfig.ConfigItems; using LethalConfig.ConfigItems.Options; using LethalLib.Modules; using Microsoft.CodeAnalysis; using MoaiEnemy.NetcodePatcher; using MoaiEnemy.src.MoaiGold; using MoaiEnemy.src.MoaiGreen; using MoaiEnemy.src.MoaiNormal; using MoaiEnemy.src.MoaiPirate; using MoaiEnemy.src.Utilities; using On; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("bcs4313")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Moai Enemy for Lethal Company.")] [assembly: AssemblyFileVersion("1.6.6")] [assembly: AssemblyInformationalVersion("2.2.5+1da131d078da7f55fb3f0574261828c9c3dcf767")] [assembly: AssemblyProduct("MoaiEnemy")] [assembly: AssemblyTitle("MoaiEnemy")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.6.6.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MoaiEnemy { internal class ConfigModel { public static ConfigEntry moaiGlobalSize; public static ConfigEntry moaiGlobalMusicVol; public static ConfigEntry moaiGlobalRarity; public static ConfigEntry moaiGlobalSpeed; public static void setupConfig() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0028: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0050: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0078: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00a0: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown ConfigEntry obj = moaiGlobalSize; FloatSliderOptions val = new FloatSliderOptions(); ((BaseRangeOptions)val).Min = 0.05f; ((BaseRangeOptions)val).Max = 5f; FloatSliderConfigItem val2 = new FloatSliderConfigItem(obj, val); ConfigEntry obj2 = moaiGlobalMusicVol; FloatSliderOptions val3 = new FloatSliderOptions(); ((BaseRangeOptions)val3).Min = 0f; ((BaseRangeOptions)val3).Max = 2f; FloatSliderConfigItem val4 = new FloatSliderConfigItem(obj2, val3); ConfigEntry obj3 = moaiGlobalRarity; FloatSliderOptions val5 = new FloatSliderOptions(); ((BaseRangeOptions)val5).Min = 0f; ((BaseRangeOptions)val5).Max = 10f; FloatSliderConfigItem val6 = new FloatSliderConfigItem(obj3, val5); ConfigEntry obj4 = moaiGlobalSpeed; FloatSliderOptions val7 = new FloatSliderOptions(); ((BaseRangeOptions)val7).Min = 0f; ((BaseRangeOptions)val7).Max = 5f; FloatSliderConfigItem val8 = new FloatSliderConfigItem(obj4, val7); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("MoaiEnemy", "MoaiEnemy", "2.2.5")] public class Plugin : BaseUnityPlugin { public static class Assets { public static AssetBundle MainAssetBundle; public static void PopulateAssets() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); MainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "moaibundle")); if ((Object)(object)MainAssetBundle == (Object)null) { Logger.LogError((object)"Failed to load custom assets."); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_LoadNewLevel <>9__39_0; internal void b__39_0(orig_LoadNewLevel orig, RoundManager self, int randomSeed, SelectableLevel newLevel) { try { if (newLevel.PlanetName.Contains("Easter")) { rawSpawnMultiplier = RawspawnHandler.getSpawnMultiplier(pickMax: true); } else { rawSpawnMultiplier = RawspawnHandler.getSpawnMultiplier(); } RawspawnHandler.enemyRarityPkg enemyRarityPkg = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiEnemy).name, rarity = (int)(46f * baseRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg2 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiPirate).name, rarity = (int)(14f * pirateRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg3 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiGreen).name, rarity = (int)(30f * greenRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg4 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiPurple).name, rarity = (int)(35f * purpleRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg5 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiBlue).name, rarity = (int)(20f * blueRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg6 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiRed).name, rarity = (int)(40f * redRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg7 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiOrange).name, rarity = (int)(22f * orangeRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg8 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiGold).name, rarity = (int)(4f * goldRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.setLevelSpawnWeights(new RawspawnHandler.enemyRarityPkg[8] { enemyRarityPkg, enemyRarityPkg8, enemyRarityPkg5, enemyRarityPkg6, enemyRarityPkg3, enemyRarityPkg4, enemyRarityPkg7, enemyRarityPkg2 }, Array.Empty()); } catch (Exception ex) { Debug.LogError((object)("Moai Enemy Error on level load: " + ex.ToString())); } orig.Invoke(self, randomSeed, newLevel); try { GreenEnemyAI.getMapObjects(); GreenEnemyAI.findTraps(); EntityWarp.mapEntrances = Object.FindObjectsOfType(false); } catch (Exception ex2) { Debug.LogWarning((object)("Moai Enemy: Error during map initialization process. " + ex2.ToString())); } } } public static Harmony _harmony; public static EnemyType ExampleEnemy; public static ManualLogSource Logger; public static MoaiNormalNet networkHandler = new MoaiNormalNet(); public static EnemyType MoaiEnemy; public static TerminalNode tlTerminalNode; public static TerminalKeyword tlTerminalKeyword; public static EnemyType MoaiBlue; public static TerminalNode MoaiBlueTerminalNode; public static TerminalKeyword MoaiBlueTerminalKeyword; public static EnemyType MoaiRed; public static TerminalNode MoaiRedTerminalNode; public static TerminalKeyword MoaiRedTerminalKeyword; public static EnemyType MoaiGreen; public static TerminalNode MoaiGreenTerminalNode; public static TerminalKeyword MoaiGreenTerminalKeyword; public static GameObject plasmaProjectile; public static GameObject consumptionCircle; public static EnemyType MoaiGold; public static TerminalNode MoaiGoldTerminalNode; public static TerminalKeyword MoaiGoldTerminalKeyword; public static EnemyType MoaiPurple; public static TerminalNode MoaiPurpleTerminalNode; public static TerminalKeyword MoaiPurpleTerminalKeyword; public static GameObject PlasmaPad; public static EnemyType MoaiOrange; public static TerminalNode MoaiOrangeTerminalNode; public static TerminalKeyword MoaiOrangeTerminalKeyword; public static EnemyType MoaiPirate; public static TerminalNode MoaiPirateTerminalNode; public static TerminalKeyword MoaiPirateTerminalKeyword; public static GameObject PirateShip; public static GameObject CannonProjectile; public static EnemyType SoulDevourer; public static TerminalNode SoulDevourerTerminalNode; public static TerminalKeyword SoulDevourerTerminalKeyword; public static float rawSpawnMultiplier = 0f; public static ConfigEntry moaiGlobalSize; public static ConfigEntry moaiGlobalSizeVar; public static ConfigEntry moaiAngelChance; public static ConfigEntry moaiSizeCap; public static ConfigEntry moaiGlobalMusicVol; public static ConfigEntry moaiGlobalSpeed; public static ConfigEntry moaiConsumeScrap; public static ConfigEntry moaiSpawnDistribution; public static ConfigEntry baseRarity; public static ConfigEntry blueRarity; public static ConfigEntry redRarity; public static ConfigEntry greenRarity; public static ConfigEntry purpleRarity; public static ConfigEntry goldRarity; public static ConfigEntry orangeRarity; public static ConfigEntry pirateRarity; public static ConfigEntry soulRarity; public static ConfigEntry simpleSpawnMultiplier; public static ConfigEntry moaiTargetBlacklist; public static void LogDebug(string text) { Logger.LogInfo((object)text); } public static void LogProduction(string text) { Logger.LogInfo((object)text); } private void Awake() { //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Assets.PopulateAssets(); bindVars(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } MoaiEnemy = Assets.MainAssetBundle.LoadAsset("MoaiEnemy"); tlTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiEnemyTN"); tlTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiEnemyTK"); MoaiBlue = Assets.MainAssetBundle.LoadAsset("MoaiBlue"); MoaiBlueTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiBlueTN"); MoaiBlueTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiBlueTK"); MoaiRed = Assets.MainAssetBundle.LoadAsset("MoaiRed"); MoaiRedTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiRedTN"); MoaiRedTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiRedTK"); MoaiGreen = Assets.MainAssetBundle.LoadAsset("MoaiGreen"); MoaiGreenTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiGreenTN"); MoaiGreenTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiGreenTK"); MoaiPurple = Assets.MainAssetBundle.LoadAsset("MoaiPurple"); MoaiPurpleTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiGoldTN"); MoaiPurpleTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiGoldTK"); PlasmaPad = Assets.MainAssetBundle.LoadAsset("PlasmaPadPrefab"); MoaiGold = Assets.MainAssetBundle.LoadAsset("MoaiGold"); MoaiGoldTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiGoldTN"); MoaiGoldTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiGoldTK"); MoaiOrange = Assets.MainAssetBundle.LoadAsset("MoaiOrange"); MoaiOrangeTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiOrangeTN"); MoaiOrangeTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiOrangeTK"); MoaiPirate = Assets.MainAssetBundle.LoadAsset("MoaiPirate"); MoaiPirateTerminalNode = Assets.MainAssetBundle.LoadAsset("MoaiPirateTN"); MoaiPirateTerminalKeyword = Assets.MainAssetBundle.LoadAsset("MoaiPirateTK"); PirateShip = Assets.MainAssetBundle.LoadAsset("MoaiEnemyShip"); CannonProjectile = Assets.MainAssetBundle.LoadAsset("CannonBall"); SoulDevourer = Assets.MainAssetBundle.LoadAsset("SoulDev"); SoulDevourerTerminalNode = Assets.MainAssetBundle.LoadAsset("SoulDevTN"); SoulDevourerTerminalKeyword = Assets.MainAssetBundle.LoadAsset("SoulDevTK"); plasmaProjectile = Assets.MainAssetBundle.LoadAsset("PlasmaBall01"); consumptionCircle = Assets.MainAssetBundle.LoadAsset("ConsumptionCircle"); Debug.Log((object)("MOAI ENEMY BUNDLE: " + ((object)Assets.MainAssetBundle).ToString())); Debug.Log((object)("Orange E: " + (object)MoaiOrange)); Debug.Log((object)("SD TN: " + (object)MoaiOrangeTerminalNode)); Debug.Log((object)("SD TK: " + (object)MoaiOrangeTerminalKeyword)); Random.InitState((int)DateTime.Now.Ticks); NetworkPrefabs.RegisterNetworkPrefab(MoaiEnemy.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiBlue.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiRed.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiGreen.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiGold.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiPurple.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiOrange.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(MoaiPirate.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(SoulDevourer.enemyPrefab); NetworkPrefabs.RegisterNetworkPrefab(plasmaProjectile); NetworkPrefabs.RegisterNetworkPrefab(consumptionCircle); NetworkPrefabs.RegisterNetworkPrefab(PlasmaPad); NetworkPrefabs.RegisterNetworkPrefab(PirateShip); NetworkPrefabs.RegisterNetworkPrefab(CannonProjectile); rawSpawnMultiplier = RawspawnHandler.getSpawnMultiplier(); Enemies.RegisterEnemy(MoaiEnemy, 0, (LevelTypes)(-1), (SpawnType)1, tlTerminalNode, tlTerminalKeyword); Enemies.RegisterEnemy(MoaiBlue, 0, (LevelTypes)(-1), (SpawnType)1, MoaiBlueTerminalNode, MoaiBlueTerminalKeyword); Enemies.RegisterEnemy(MoaiRed, 0, (LevelTypes)(-1), (SpawnType)1, MoaiRedTerminalNode, MoaiRedTerminalKeyword); Enemies.RegisterEnemy(MoaiGreen, 0, (LevelTypes)(-1), (SpawnType)1, MoaiGreenTerminalNode, MoaiGreenTerminalKeyword); Enemies.RegisterEnemy(MoaiGold, 0, (LevelTypes)(-1), (SpawnType)1, MoaiGreenTerminalNode, MoaiGreenTerminalKeyword); Enemies.RegisterEnemy(MoaiPurple, 0, (LevelTypes)(-1), (SpawnType)1, MoaiGreenTerminalNode, MoaiGreenTerminalKeyword); Enemies.RegisterEnemy(MoaiOrange, 0, (LevelTypes)(-1), (SpawnType)1, MoaiOrangeTerminalNode, MoaiOrangeTerminalKeyword); Enemies.RegisterEnemy(MoaiPirate, 0, (LevelTypes)(-1), (SpawnType)1, MoaiPirateTerminalNode, MoaiPirateTerminalKeyword); Enemies.RegisterEnemy(SoulDevourer, 0, (LevelTypes)(-1), (SpawnType)2, MoaiGreenTerminalNode, MoaiGreenTerminalKeyword); Debug.Log((object)"MOAI: Registering Moai Net Messages"); object obj = <>c.<>9__39_0; if (obj == null) { hook_LoadNewLevel val = delegate(orig_LoadNewLevel orig, RoundManager self, int randomSeed, SelectableLevel newLevel) { try { if (newLevel.PlanetName.Contains("Easter")) { rawSpawnMultiplier = RawspawnHandler.getSpawnMultiplier(pickMax: true); } else { rawSpawnMultiplier = RawspawnHandler.getSpawnMultiplier(); } RawspawnHandler.enemyRarityPkg enemyRarityPkg = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiEnemy).name, rarity = (int)(46f * baseRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg2 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiPirate).name, rarity = (int)(14f * pirateRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg3 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiGreen).name, rarity = (int)(30f * greenRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg4 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiPurple).name, rarity = (int)(35f * purpleRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg5 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiBlue).name, rarity = (int)(20f * blueRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg6 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiRed).name, rarity = (int)(40f * redRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg7 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiOrange).name, rarity = (int)(22f * orangeRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.enemyRarityPkg enemyRarityPkg8 = new RawspawnHandler.enemyRarityPkg { name = ((Object)MoaiGold).name, rarity = (int)(4f * goldRarity.Value * rawSpawnMultiplier) }; RawspawnHandler.setLevelSpawnWeights(new RawspawnHandler.enemyRarityPkg[8] { enemyRarityPkg, enemyRarityPkg8, enemyRarityPkg5, enemyRarityPkg6, enemyRarityPkg3, enemyRarityPkg4, enemyRarityPkg7, enemyRarityPkg2 }, Array.Empty()); } catch (Exception ex) { Debug.LogError((object)("Moai Enemy Error on level load: " + ex.ToString())); } orig.Invoke(self, randomSeed, newLevel); try { GreenEnemyAI.getMapObjects(); GreenEnemyAI.findTraps(); EntityWarp.mapEntrances = Object.FindObjectsOfType(false); } catch (Exception ex2) { Debug.LogWarning((object)("Moai Enemy: Error during map initialization process. " + ex2.ToString())); } }; <>c.<>9__39_0 = val; obj = (object)val; } RoundManager.LoadNewLevel += (hook_LoadNewLevel)obj; Logger.LogInfo((object)"Plugin MoaiEnemy is loaded!"); } public void bindVars() { //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Expected O, but got Unknown //IL_02d8: Expected O, but got Unknown //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Expected O, but got Unknown //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Expected O, but got Unknown //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Expected O, but got Unknown //IL_0308: Expected O, but got Unknown //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Expected O, but got Unknown //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Expected O, but got Unknown //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_0338: Expected O, but got Unknown //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Expected O, but got Unknown //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown //IL_0368: Expected O, but got Unknown //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Expected O, but got Unknown //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Expected O, but got Unknown //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Expected O, but got Unknown //IL_0398: Expected O, but got Unknown //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Expected O, but got Unknown //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Expected O, but got Unknown //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Expected O, but got Unknown //IL_03c9: Expected O, but got Unknown //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Expected O, but got Unknown //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Expected O, but got Unknown //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Expected O, but got Unknown //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Expected O, but got Unknown //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Expected O, but got Unknown //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: 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_041a: Expected O, but got Unknown //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Expected O, but got Unknown //IL_042c: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Expected O, but got Unknown //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Expected O, but got Unknown //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Expected O, but got Unknown //IL_045d: Expected O, but got Unknown //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_045f: Expected O, but got Unknown //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Expected O, but got Unknown //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Expected O, but got Unknown //IL_048e: Expected O, but got Unknown //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Expected O, but got Unknown //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Expected O, but got Unknown //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Expected O, but got Unknown //IL_04bf: Expected O, but got Unknown //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Expected O, but got Unknown //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Expected O, but got Unknown //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Expected O, but got Unknown //IL_04f0: Expected O, but got Unknown //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Expected O, but got Unknown //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Expected O, but got Unknown //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Expected O, but got Unknown //IL_0521: Expected O, but got Unknown //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Expected O, but got Unknown //IL_0528: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_0540: Expected O, but got Unknown //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Expected O, but got Unknown //IL_0552: Expected O, but got Unknown //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Expected O, but got Unknown //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Expected O, but got Unknown //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Expected O, but got Unknown //IL_0583: Expected O, but got Unknown //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Expected O, but got Unknown //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Expected O, but got Unknown //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Expected O, but got Unknown //IL_05b4: Expected O, but got Unknown //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Expected O, but got Unknown //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Expected O, but got Unknown //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Expected O, but got Unknown //IL_05e5: Expected O, but got Unknown //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Expected O, but got Unknown //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Expected O, but got Unknown //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Expected O, but got Unknown simpleSpawnMultiplier = ((BaseUnityPlugin)this).Config.Bind("Global", "Simple Spawn Multiplier", 1f, "(Recommended) Simplest way to affect spawnrates for all moais. Multiplier to spawnrate and chance for moais to be spawnable on a day"); moaiGlobalMusicVol = ((BaseUnityPlugin)this).Config.Bind("Global", "Enemy Sound Volume", 0.6f, "Changes the volume of all moai sounds. May make moai more sneaky as well."); moaiGlobalSizeVar = ((BaseUnityPlugin)this).Config.Bind("Global", "Size Variant Chance", 0.2f, "The chance of a moai to spawn in a randomly scaled size. Affects their pitch too."); moaiAngelChance = ((BaseUnityPlugin)this).Config.Bind("Global", "Angel Spawn Chance", 0.1f, "Chance for the moai to spawn as an angel (good guy). They guard players and kill enemies, but they certainly aren't friendly forever."); moaiGlobalSize = ((BaseUnityPlugin)this).Config.Bind("Global", "Size Multiplier", 1f, "Changes the size of all moai models. Scales pretty violently. Affects SFX pitch."); moaiSizeCap = ((BaseUnityPlugin)this).Config.Bind("Advanced", "Size Variant Cap", 100f, "Caps the max size of a moai with the size variant. Normal size is 1. 1.5 is slightly taller than the ship. 2 is very large. 3.5+ is giant tier (with 5 being the largest usually)"); moaiGlobalSpeed = ((BaseUnityPlugin)this).Config.Bind("Global", "Enemy Speed Multiplier", 1f, "Changes the speed of all moai. 4x would mean they are 4 times faster, 0.5x would be 2 times slower."); moaiConsumeScrap = ((BaseUnityPlugin)this).Config.Bind("Global", "Allow Scrap Eating Behavior", true, "If enabled, moai can seek out scrap and consume it. Moai that consume scrap become angel variants for a time. Does not apply to dead bodies."); moaiSpawnDistribution = ((BaseUnityPlugin)this).Config.Bind("Advanced", "Enemy Spawn Distribution", "8%150%, 12%75%, 25%50%", "For fine tuning spawn multipliers day to day. Value is a comma separated list. Each value follows the format C%M%, with C being the chance for the spawnrate multiplier to activate on a day (0-100%) and M being the multiplier (0-inf%). If a multiplier isn't activated, the spawnrate will be 0%.\n\n I recommend not using SimpleSpawnMultiplier if you are editing this"); baseRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Basic Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); blueRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Blue Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); redRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Red Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); greenRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Green Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); purpleRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Purple Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); goldRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Gold Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); orangeRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Orange Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); pirateRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Pirate Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); soulRarity = ((BaseUnityPlugin)this).Config.Bind("Variants", "Devourer Spawnrate", 0.4f, "Changes the spawnrate of this... thing. Note that devourers don't spawn naturally, they have a chance to spawn when any moai consumes a corpse."); moaiTargetBlacklist = ((BaseUnityPlugin)this).Config.Bind("Advanced", "Enemy targeting blacklist", "mask hornets, roaming locusts, jester, hygrodere, butler, barber, ghost girl, circuit bees, giant sapsucker, old bird, living trap, pikmin, cutiefly", "A blacklist for enemies that angel moai will not target or damage. Put in the name of the enemy you see when you scan them in game. Not case sensitive. Comma separated list."); ConfigEntry obj = moaiAngelChance; FloatSliderOptions val = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions)val).Min = 0f; ((BaseRangeOptions)val).Max = 1f; FloatSliderConfigItem val2 = new FloatSliderConfigItem(obj, val); ConfigEntry obj2 = moaiGlobalSize; FloatSliderOptions val3 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions)val3).Min = 0.05f; ((BaseRangeOptions)val3).Max = 5f; FloatSliderConfigItem val4 = new FloatSliderConfigItem(obj2, val3); ConfigEntry obj3 = moaiGlobalSizeVar; FloatSliderOptions val5 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions)val5).Min = 0f; ((BaseRangeOptions)val5).Max = 1f; FloatSliderConfigItem val6 = new FloatSliderConfigItem(obj3, val5); ConfigEntry obj4 = moaiSizeCap; FloatInputFieldOptions val7 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val7).Min = 0.01f; ((BaseRangeOptions)val7).Max = 100f; FloatInputFieldConfigItem val8 = new FloatInputFieldConfigItem(obj4, val7); ConfigEntry obj5 = moaiGlobalMusicVol; FloatSliderOptions val9 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions)val9).Min = 0f; ((BaseRangeOptions)val9).Max = 1f; FloatSliderConfigItem val10 = new FloatSliderConfigItem(obj5, val9); ConfigEntry obj6 = moaiGlobalSpeed; FloatSliderOptions val11 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions)val11).Min = 0f; ((BaseRangeOptions)val11).Max = 5f; FloatSliderConfigItem val12 = new FloatSliderConfigItem(obj6, val11); BoolCheckBoxConfigItem val13 = new BoolCheckBoxConfigItem(moaiConsumeScrap, new BoolCheckBoxOptions { RequiresRestart = false }); TextInputFieldConfigItem val14 = new TextInputFieldConfigItem(moaiSpawnDistribution, new TextInputFieldOptions { RequiresRestart = false }); ConfigEntry obj7 = baseRarity; FloatInputFieldOptions val15 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val15).Min = 0f; ((BaseRangeOptions)val15).Max = 10000f; FloatInputFieldConfigItem val16 = new FloatInputFieldConfigItem(obj7, val15); ConfigEntry obj8 = greenRarity; FloatInputFieldOptions val17 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val17).Min = 0f; ((BaseRangeOptions)val17).Max = 10000f; FloatInputFieldConfigItem val18 = new FloatInputFieldConfigItem(obj8, val17); ConfigEntry obj9 = purpleRarity; FloatInputFieldOptions val19 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val19).Min = 0f; ((BaseRangeOptions)val19).Max = 10000f; FloatInputFieldConfigItem val20 = new FloatInputFieldConfigItem(obj9, val19); ConfigEntry obj10 = redRarity; FloatInputFieldOptions val21 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val21).Min = 0f; ((BaseRangeOptions)val21).Max = 10000f; FloatInputFieldConfigItem val22 = new FloatInputFieldConfigItem(obj10, val21); ConfigEntry obj11 = blueRarity; FloatInputFieldOptions val23 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val23).Min = 0f; ((BaseRangeOptions)val23).Max = 10000f; FloatInputFieldConfigItem val24 = new FloatInputFieldConfigItem(obj11, val23); ConfigEntry obj12 = goldRarity; FloatInputFieldOptions val25 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val25).Min = 0f; ((BaseRangeOptions)val25).Max = 10000f; FloatInputFieldConfigItem val26 = new FloatInputFieldConfigItem(obj12, val25); ConfigEntry obj13 = orangeRarity; FloatInputFieldOptions val27 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val27).Min = 0f; ((BaseRangeOptions)val27).Max = 10000f; FloatInputFieldConfigItem val28 = new FloatInputFieldConfigItem(obj13, val27); ConfigEntry obj14 = pirateRarity; FloatInputFieldOptions val29 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val29).Min = 0f; ((BaseRangeOptions)val29).Max = 10000f; FloatInputFieldConfigItem val30 = new FloatInputFieldConfigItem(obj14, val29); ConfigEntry obj15 = soulRarity; FloatInputFieldOptions val31 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val31).Min = 0f; ((BaseRangeOptions)val31).Max = 10000f; FloatInputFieldConfigItem val32 = new FloatInputFieldConfigItem(obj15, val31); ConfigEntry obj16 = simpleSpawnMultiplier; FloatInputFieldOptions val33 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions)val33).Min = 0f; ((BaseRangeOptions)val33).Max = 10000f; FloatInputFieldConfigItem val34 = new FloatInputFieldConfigItem(obj16, val33); TextInputFieldConfigItem val35 = new TextInputFieldConfigItem(moaiTargetBlacklist, new TextInputFieldOptions { RequiresRestart = false }); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val34); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val10); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val4); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val6); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val12); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val13); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val16); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val24); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val22); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val14); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val18); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val20); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val26); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val28); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val30); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val32); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val8); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val35); } } public static class PluginInfo { public const string PLUGIN_GUID = "MoaiEnemy"; public const string PLUGIN_NAME = "MoaiEnemy"; public const string PLUGIN_VERSION = "2.2.5"; } } namespace MoaiEnemy.src.Utilities { internal class EntityWarp { public struct entrancePack { public EntranceTeleport tele; public Vector3 navPosition; } public static EntranceTeleport[] mapEntrances; public static entrancePack findNearestEntrance(EnemyAI __instance) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) float num = 100000000f; EntranceTeleport val = null; EntranceTeleport[] array = mapEntrances; for (int i = 0; i < array.Length; i++) { if (__instance.isOutside == array[i].isEntranceToBuilding && Vector3.Distance(((Component)__instance).transform.position, ((Component)array[i]).transform.position) < num) { num = Vector3.Distance(((Component)__instance).transform.position, ((Component)array[i]).transform.position); val = array[i]; } } entrancePack result = default(entrancePack); NavMeshHit val2 = default(NavMeshHit); if ((Object)(object)val != (Object)null && NavMesh.SamplePosition(((Component)val).transform.position, ref val2, 10f, -1)) { result.navPosition = ((NavMeshHit)(ref val2)).position; } result.tele = val; return result; } public static void SendEnemyInside(EnemyAI __instance) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) __instance.isOutside = false; __instance.allAINodes = GameObject.FindGameObjectsWithTag("AINode"); EntranceTeleport tele = findNearestEntrance(__instance).tele; if (!Object.op_Implicit((Object)(object)tele)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find entrance teleport."); } Transform entrancePoint = tele.entrancePoint; if (!Object.op_Implicit((Object)(object)entrancePoint)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find best exit position."); } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)entrancePoint).transform.position, ref val, 10f, -1)) { __instance.serverPosition = ((NavMeshHit)(ref val)).position; ((Component)__instance).transform.position = ((NavMeshHit)(ref val)).position; __instance.agent.Warp(__instance.serverPosition); __instance.SyncPositionToClients(); } else { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find exit NavmeshHit position"); } } public static void SendEnemyOutside(EnemyAI __instance, bool SpawnOnDoor = true) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) __instance.isOutside = true; __instance.allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode"); EntranceTeleport tele = findNearestEntrance(__instance).tele; if (!Object.op_Implicit((Object)(object)tele)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find entrance teleport."); } Transform entrancePoint = tele.entrancePoint; if (!Object.op_Implicit((Object)(object)entrancePoint)) { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find best exit position."); } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)entrancePoint).transform.position, ref val, 10f, -1)) { __instance.serverPosition = ((NavMeshHit)(ref val)).position; ((Component)__instance).transform.position = ((NavMeshHit)(ref val)).position; __instance.agent.Warp(__instance.serverPosition); __instance.SyncPositionToClients(); } else { Debug.LogError((object)"MOAI EntranceTeleport: Failed to find exit NavmeshHit position"); } } } public class RawspawnHandler { public struct enemyRarityPkg { public string name; public int rarity; } public static void setLevelSpawnWeights(enemyRarityPkg[] dayReferences, enemyRarityPkg[] nightReferences) { RoundManager instance = RoundManager.Instance; SelectableLevel currentLevel = instance.currentLevel; for (int i = 0; i < currentLevel.DaytimeEnemies.Count; i++) { SpawnableEnemyWithRarity val = currentLevel.DaytimeEnemies[i]; for (int j = 0; j < dayReferences.Length; j++) { enemyRarityPkg enemyRarityPkg = dayReferences[j]; if (((Object)val.enemyType).name.Equals(enemyRarityPkg.name)) { currentLevel.DaytimeEnemies[i].rarity = enemyRarityPkg.rarity; } } } for (int k = 0; k < currentLevel.OutsideEnemies.Count; k++) { SpawnableEnemyWithRarity val2 = currentLevel.OutsideEnemies[k]; for (int l = 0; l < nightReferences.Length; l++) { enemyRarityPkg enemyRarityPkg2 = nightReferences[l]; if (((Object)val2.enemyType).name.Equals(enemyRarityPkg2.name)) { currentLevel.OutsideEnemies[k].rarity = enemyRarityPkg2.rarity; } } } } public static float getSpawnMultiplier(bool pickMax = false) { float num = 0f; float num2 = Random.Range(0f, 1f); List list = new List(); List list2 = new List(); string value = Plugin.moaiSpawnDistribution.Value; string[] array = value.Split(","); try { string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split("%"); list.Add(Math.Min(100f, float.Parse(array3[0]) * Plugin.simpleSpawnMultiplier.Value) / 100f); list2.Add(float.Parse(array3[1]) * Plugin.simpleSpawnMultiplier.Value / 100f); } if (pickMax) { float num3 = 0f; for (int j = 0; j < list2.Count; j++) { float num4 = list2[j]; if (num4 > num3) { num3 = num4; num = num4; } } } else { float num5 = 0f; for (int k = 0; k < list.Count; k++) { float num6 = list[k]; float num7 = list2[k]; if (num2 > num5 && num2 < num6 + num5) { num = num7; break; } num5 += num6; } } } catch (Exception ex) { Debug.LogError((object)("Moai Enemy: Exception when parsing spawn distribution chances! Error is: " + ex.ToString())); } Debug.Log((object)"Moai Enemy: Spawn Distribution Parsed is -->"); if (pickMax) { Debug.Log((object)"Moai Enemy: Picked largest spawn multiplier due to being in easter island."); Debug.Log((object)"Moai Enemy: Multipliers:"); Debug.Log((object)string.Join(",", list2)); Debug.Log((object)("Moai Enemy: Selected multiplier for the day is " + num * 100f + "%")); } else { Debug.Log((object)"Moai Enemy: Chances:"); Debug.Log((object)string.Join(",", list)); Debug.Log((object)"Moai Enemy: Multipliers:"); Debug.Log((object)string.Join(",", list2)); Debug.Log((object)"Moai Enemy: Random chance roll:"); Debug.Log((object)num2); Debug.Log((object)("Moai Enemy: Selected multiplier for the day is " + num * 100f + "%")); } return num; } } } namespace MoaiEnemy.src.MoaiPirate { internal class BlunderBlastSimulator { } [RequireComponent(typeof(LineRenderer))] [ExecuteAlways] public class ShipCableProceduralSimple : MonoBehaviour { private LineRenderer line; [SerializeField] public Transform endPointTransform; [SerializeField] [Tooltip("Number of points per unit length, using the straight line from the start to the end transform.")] private float pointDensity = 3f; [SerializeField] private float sagAmplitude = 1f; [SerializeField] private float swayMultiplier = 1f; [SerializeField] private float swayXMultiplier = 1f; [SerializeField] private float swayYMultiplier = 0.5f; [SerializeField] private float swayFrequency = 1f; private int pointsInLineRenderer; private Vector3 vectorFromStartToEnd; private Vector3 sagDirection; private float swayValue; private void Start() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) line = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)endPointTransform)) { Debug.LogError((object)("No Endpoint Transform assigned to Cable_Procedural component attached to " + ((Object)((Component)this).gameObject).name)); return; } vectorFromStartToEnd = endPointTransform.position - ((Component)this).transform.position; ((Component)this).transform.forward = ((Vector3)(ref vectorFromStartToEnd)).normalized; pointsInLineRenderer = Mathf.FloorToInt(pointDensity * ((Vector3)(ref vectorFromStartToEnd)).magnitude); line.positionCount = pointsInLineRenderer; Vector3 gravity = Physics.gravity; sagDirection = ((Vector3)(ref gravity)).normalized; } private void Update() { Draw(); } private void Draw() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)endPointTransform)) { vectorFromStartToEnd = endPointTransform.position - ((Component)this).transform.position; ((Component)this).transform.forward = ((Vector3)(ref vectorFromStartToEnd)).normalized; pointsInLineRenderer = Mathf.Max(2, Mathf.FloorToInt(pointDensity * ((Vector3)(ref vectorFromStartToEnd)).magnitude)); line.positionCount = pointsInLineRenderer; int i = 0; swayValue += swayFrequency * Time.deltaTime; if (swayValue > MathF.PI * 2f) { swayValue = 0f; } if (swayValue < 0f) { swayValue = MathF.PI * 2f; } for (; i < pointsInLineRenderer; i++) { float num = (float)i / (float)(pointsInLineRenderer - 1); float num2 = Mathf.Sin(num * MathF.PI); Vector3 val = vectorFromStartToEnd * num; Vector3 val2 = sagDirection * sagAmplitude; Vector3 val3 = swayMultiplier * ((Component)this).transform.TransformDirection(new Vector3(Mathf.Sin(swayValue) * swayXMultiplier, Mathf.Cos(2f * swayValue + MathF.PI) * 0.5f * swayYMultiplier, 0f)); Vector3 val4 = ((Component)this).transform.position + val + (val3 + Vector3.ClampMagnitude(val2, sagAmplitude)) * num2; line.SetPosition(i, val4); } } } } public class MoaiPirateShip : NetworkBehaviour { public enum AggressiveAction { Cannon, Grapple, Lower } public NavMeshAgent agent; public string phase = "landed"; private MoaiPirateAI captain = null; public GameObject shipModel; public Transform MainDeck; public Transform CrowsNest; public Transform PoopDeck; public Transform Bow; public Transform WheelPoint; public List storedEnemies; public float yLevel = 0f; public float targetYLevel = 0f; public static float yEaseRate = 0.75f; public static float baseLandChance = 0.25f; public static float landChance = 0.25f; public static float cannonFireCooldownMin = 0.3f; public static float cannonFireCooldownMax = 9f; public PlayerControllerB aggroPlayer = null; public EnemyAI aggroEnemy = null; public GrabbableObject aggroScrap = null; public VehicleController aggroCruiser = null; public AggressiveAction aggroAction; private float rescoreTimer = 0f; private const float RESCORE_INTERVAL = 3f; private static float ARRIVAL_DIST = 22f; private static float LAND_DIST = 6f; private const float MIN_ENEMY_SCORE = 20f; public static float strafeDistance = 15f; public static float cannonArrivalDist = 8f; public static float cannonMaxAimAngle = 60f; private bool isCannonStrafing = false; private bool actionExecuted = false; public AudioSource shipHornThreaten; public static float shipHornThreatenCooldownMin = 0.25f; public static float shipHornThreatenCooldownMax = 12f; public AudioSource shipHornStealing; public AudioSource landingBell; public AudioSource shipTakingOffSound; private float baseSpeed = 3.2f; private float speedWhenAggressive = 5.9f; private float speedWhenGrappling = 6.2f; public static float cruiserGrappleAscensionSpeed = 2f; public static float fireCannonOverLoweringChance = 0.83f; public Transform[] cannonFirePoints; public float ExitAggressiveChanceIncrease = 0.2f; public float ExitAggressiveChance = 0f; public AudioSource cannonSound; public AudioSource grappleFireSound; public AudioSource grappleHitSound; public AudioSource grappleRetractSound; public ShipCableProceduralSimple grappleChain; public static float grappleHoldTime = 2.4f; public static float grappleTravelSpeed = 8f; public bool isGrappling = false; public GameObject grabbedGO; public AudioSource VoiceThereBeTreasure; public static float cruiserGrappleHoldTimeMin = 5f; public static float cruiserGrappleHoldTimeMax = 30f; public static float cruiserFleeSpeed = 8f; public static float cruiserFleeSampleRadius = 25f; public static float cruiserDragForce = 60f; private bool grapplingCruiser = false; private Vector3 chainSimTarget = Vector3.zero; private Vector3 chainSimCurrent = Vector3.zero; private float chainSwingTimer = 0f; public static float chainSwingInterval = 0.2f; public static float chainSwingRadius = 13f; public static float chainSwingEase = 2f; public static float chainHangDepth = 12f; public static float lowestHeight = 5f; public static float highestHeight = 25f; [ClientRpc] public void PlayShipHornThreatenClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2645086074u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2645086074u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; shipHornThreaten.Play(); } } } [ClientRpc] public void PlayShipHornStealingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2793292015u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2793292015u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; shipHornStealing.Play(); } } } [ClientRpc] public void PlayLandingBellClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3649238099u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3649238099u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; landingBell.Play(); } } } [ClientRpc] public void PlayShipTakingOffSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1124603934u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1124603934u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; shipTakingOffSound.Play(); } } } private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (((Component)this).transform.localScale.y > 2.1f) { ((Component)this).transform.localScale = new Vector3(2f, 2f, 2f); } storedEnemies = new List(); yLevel = ((Component)this).transform.position.y; targetYLevel = ((Component)this).transform.position.y; try { cannonSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; grappleFireSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; grappleHitSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; grappleRetractSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; shipTakingOffSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; } catch (Exception ex) { Debug.LogError((object)ex); } if (((NetworkBehaviour)RoundManager.Instance).IsHost) { setEnableGrappleClientRpc(enabled: false); } } public void Update() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)captain == (Object)null || !((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } if (((Component)this).transform.localScale.y > 2.1f) { ((Component)this).transform.localScale = new Vector3(2f, 2f, 2f); } switch (phase) { case "rising": if (Math.Abs(yLevel - targetYLevel) < 1f) { InitPhaseTraveling(Vector3.zero); } break; case "lowering": if (Math.Abs(yLevel - targetYLevel) < 1f) { InitPhaseLanded(); } break; case "traveling": { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Component)this).transform.position.x, 0f, ((Component)this).transform.position.z); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(agent.destination.x, 0f, agent.destination.z); if (Vector3.Distance(val, val2) < 3f) { if (Random.Range(0f, 1f) < landChance && !isGrappling) { InitPhaseLowering(); landChance = baseLandChance; } else { InitPhaseTraveling(Vector3.zero); landChance += 0.1f; } } break; } case "aggressive": UpdateAggressive(); break; } yLevel = Mathf.Lerp(yLevel, targetYLevel, yEaseRate * Time.deltaTime); shipModel.transform.position = new Vector3(((Component)this).transform.position.x, ((Component)this).transform.position.y + yLevel, ((Component)this).transform.position.z); if (isGrappling || Object.op_Implicit((Object)(object)aggroCruiser)) { agent.speed = speedWhenGrappling; } else if (Object.op_Implicit((Object)(object)aggroPlayer)) { agent.speed = speedWhenAggressive; } else { agent.speed = baseSpeed; } if (grapplingCruiser) { targetYLevel += cruiserGrappleAscensionSpeed * Time.deltaTime; } } public void LateUpdate() { //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)grabbedGO) && grapplingCruiser) { chainSwingTimer -= Time.deltaTime; if (chainSwingTimer <= 0f) { chainSwingTimer = chainSwingInterval; Vector2 val = Random.insideUnitCircle * chainSwingRadius; float num = shipModel.transform.position.y - chainHangDepth; num = Mathf.Max(num, ((Component)this).transform.position.y); chainSimTarget = new Vector3(shipModel.transform.position.x + val.x, num, shipModel.transform.position.z + val.y); } chainSimCurrent = Vector3.Lerp(chainSimCurrent, chainSimTarget, chainSwingEase * Time.deltaTime); grappleChain.endPointTransform.position = chainSimCurrent; grabbedGO.transform.position = chainSimCurrent; } else if (Object.op_Implicit((Object)(object)grabbedGO)) { grabbedGO.transform.position = grappleChain.endPointTransform.position; } } private void UpdateAggressive() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) if (isGrappling) { return; } rescoreTimer -= Time.deltaTime; if (rescoreTimer <= 0f) { rescoreTimer = 3f; ScoreAndPickTarget(); } if (!HasValidTarget()) { Debug.Log((object)"Moai Pirate Ship: Lost target, resuming patrol."); ExitAggressive(); } else if (!isCannonStrafing) { Vector3 targetPosition = GetTargetPosition(); agent.SetDestination(targetPosition); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(((Component)this).transform.position.x, 0f, ((Component)this).transform.position.z); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(targetPosition.x, 0f, targetPosition.z); if (Vector3.Distance(val, val2) < ARRIVAL_DIST && !actionExecuted) { ExecuteAggroAction(); } } } private void ScoreAndPickTarget() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) float num = float.MinValue; PlayerControllerB val = null; EnemyAI val2 = null; GrabbableObject val3 = null; VehicleController val4 = null; AggressiveAction aggressiveAction = AggressiveAction.Cannon; PlayerControllerB[] array = Object.FindObjectsOfType(); foreach (PlayerControllerB val5 in array) { if ((Object)(object)val5 == (Object)null || val5.isPlayerDead || !val5.isPlayerControlled) { continue; } float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val5).transform.position); if (num2 > MoaiPirateAI.shipSightRange * 1.33f) { continue; } int num3 = 0; if (val5.ItemSlots != null) { GrabbableObject[] itemSlots = val5.ItemSlots; foreach (GrabbableObject val6 in itemSlots) { if ((Object)(object)val6 != (Object)null && val6.itemProperties.isScrap) { num3 += val6.scrapValue; } } } float num4 = 32f - num2 + (float)(num3 / 8); if (num4 > num) { num = num4; val = val5; val2 = null; val3 = null; val4 = null; aggressiveAction = ((!(Random.value < fireCannonOverLoweringChance)) ? AggressiveAction.Lower : AggressiveAction.Cannon); } } EnemyAI[] array2 = Object.FindObjectsOfType(); foreach (EnemyAI val7 in array2) { if ((Object)(object)val7 == (Object)null || val7.isEnemyDead || val7 is MOAIAICORE || val7.enemyHP <= 0) { continue; } float num5 = Vector3.Distance(((Component)this).transform.position, ((Component)val7).transform.position); if (!(num5 > MoaiPirateAI.shipSightRange * 1.33f)) { float num6 = 9f * (float)val7.enemyHP - num5; if (!(num6 < 20f) && num6 > num) { num = num6; val = null; val2 = val7; val3 = null; val4 = null; float value = Random.value; aggressiveAction = ((!(num5 <= LAND_DIST)) ? ((!(value < 0.75f)) ? AggressiveAction.Grapple : AggressiveAction.Cannon) : ((!(value < 0.666f)) ? ((value < 0.333f) ? AggressiveAction.Grapple : AggressiveAction.Lower) : AggressiveAction.Cannon)); } } } GrabbableObject[] array3 = Object.FindObjectsOfType(); foreach (GrabbableObject val8 in array3) { if ((Object)(object)val8 == (Object)null || !val8.itemProperties.isScrap || val8.isHeld || val8.isHeldByEnemy) { continue; } float num7 = Vector3.Distance(((Component)this).transform.position, ((Component)val8).transform.position); if (!(num7 > MoaiPirateAI.shipSightRange * 1.33f)) { float num8 = (float)val8.scrapValue - num7; if (num8 > num && !val8.isInShipRoom) { num = num8; val = null; val2 = null; val3 = val8; val4 = null; aggressiveAction = AggressiveAction.Grapple; } } } VehicleController[] array4 = Object.FindObjectsOfType(); foreach (VehicleController val9 in array4) { if ((Object)(object)val9 == (Object)null || val9.carDestroyed) { continue; } float num9 = Vector3.Distance(((Component)this).transform.position, ((Component)val9).transform.position); if (!(num9 > MoaiPirateAI.shipSightRange * 1.33f)) { float num10 = 180f - num9; if (num10 > num) { num = num10; val = null; val2 = null; val3 = null; val4 = val9; aggressiveAction = AggressiveAction.Grapple; } } } aggroPlayer = val; aggroEnemy = val2; aggroScrap = val3; aggroCruiser = val4; aggroAction = aggressiveAction; actionExecuted = false; if ((Object)(object)aggroPlayer != (Object)null) { Debug.Log((object)$"Moai Pirate Ship: Targeting player {aggroPlayer.playerUsername}, action={aggroAction}, score={num}"); } else if ((Object)(object)aggroEnemy != (Object)null) { Debug.Log((object)$"Moai Pirate Ship: Targeting enemy {aggroEnemy.enemyType.enemyName}, action={aggroAction}, score={num}"); } else if ((Object)(object)aggroScrap != (Object)null) { Debug.Log((object)$"Moai Pirate Ship: Targeting scrap {aggroScrap.itemProperties.itemName}, score={num}"); } else if ((Object)(object)aggroCruiser != (Object)null) { Debug.Log((object)$"Moai Pirate Ship: Targeting cruiser at {((Component)aggroCruiser).transform.position}, action=Grapple, score={num}"); } else { Debug.Log((object)"Moai Pirate Ship: No valid target found during rescore."); } } private bool HasValidTarget() { //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)aggroPlayer != (Object)null) { if (aggroPlayer.isPlayerDead || !aggroPlayer.isPlayerControlled) { return false; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)aggroPlayer).transform.position); return num <= MoaiPirateAI.shipSightRange * 1.33f; } if ((Object)(object)aggroEnemy != (Object)null) { if (aggroEnemy.isEnemyDead || (Object)(object)aggroEnemy == (Object)null) { return false; } float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)aggroEnemy).transform.position); return num2 <= MoaiPirateAI.shipSightRange * 1.33f; } if ((Object)(object)aggroScrap != (Object)null) { if ((Object)(object)aggroScrap == (Object)null) { return false; } float num3 = Vector3.Distance(((Component)this).transform.position, ((Component)aggroScrap).transform.position); return num3 <= MoaiPirateAI.shipSightRange * 1.33f; } if ((Object)(object)aggroCruiser != (Object)null) { if ((Object)(object)aggroCruiser == (Object)null || aggroCruiser.carDestroyed) { return false; } float num4 = Vector3.Distance(((Component)this).transform.position, ((Component)aggroCruiser).transform.position); return num4 <= MoaiPirateAI.shipSightRange * 1.33f; } return false; } private Vector3 GetTargetPosition() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01e8: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; if ((Object)(object)aggroPlayer != (Object)null) { val = ((Component)aggroPlayer).transform.position; } if ((Object)(object)aggroEnemy != (Object)null) { val = ((Component)aggroEnemy).transform.position; } if ((Object)(object)aggroScrap != (Object)null) { val = ((Component)aggroScrap).transform.position; } NavMeshQueryFilter val3; if ((Object)(object)aggroCruiser != (Object)null) { Vector3 position = ((Component)aggroCruiser).transform.position; Vector3 position2 = GetNearestNode(position).transform.position; GameObject nearestNode = GetNearestNode(((Component)aggroCruiser).transform.position); NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(nearestNode.transform.position, ref val2, 5f, -1)) { Debug.Log((object)"Moai Pirate Ship: Used filter with AI Nodes for tracking cruiser"); val3 = default(NavMeshQueryFilter); ((NavMeshQueryFilter)(ref val3)).agentTypeID = agent.agentTypeID; ((NavMeshQueryFilter)(ref val3)).areaMask = ((NavMeshHit)(ref val2)).mask; NavMeshQueryFilter val4 = val3; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)aggroCruiser).transform.position, ref val5, 15f, val4)) { return ((NavMeshHit)(ref val5)).position; } } NavMeshHit val6 = default(NavMeshHit); if (NavMesh.SamplePosition(position2, ref val6, 5f, -1)) { Debug.Log((object)"Moai Pirate Ship: Used AI Nodes for tracking cruiser"); return ((NavMeshHit)(ref val6)).position; } Debug.Log((object)"Moai Pirate Ship: Using fallback for tracking cruiser"); return ((Component)aggroCruiser).transform.position; } if (val == Vector3.zero) { Debug.LogError((object)"Moai Pirate Ship Error: no target available to set destination. This error should not be thrown!"); } val3 = default(NavMeshQueryFilter); ((NavMeshQueryFilter)(ref val3)).agentTypeID = agent.agentTypeID; ((NavMeshQueryFilter)(ref val3)).areaMask = -1; NavMeshQueryFilter val7 = val3; NavMeshHit val8 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val8, 15f, val7)) { return ((NavMeshHit)(ref val8)).position; } return val; } public GameObject GetNearestNode(Vector3 pos) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) GameObject result = null; float num = 999999f; GameObject[] outsideAINodes = RoundManager.Instance.outsideAINodes; foreach (GameObject val in outsideAINodes) { float num2 = Vector3.Distance(val.transform.position, pos); if (Vector3.Distance(val.transform.position, pos) < num) { num = num2; result = val; } } return result; } private void ExecuteAggroAction() { actionExecuted = true; switch (aggroAction) { case AggressiveAction.Cannon: FireCannon(); break; case AggressiveAction.Grapple: if (Object.op_Implicit((Object)(object)shipHornStealing)) { PlayShipHornStealingClientRpc(); } FireGrapple(); break; case AggressiveAction.Lower: if (!isGrappling) { InitPhaseLowering(); Debug.Log((object)"Aggressive Action: Lowering Ship..."); } else { Debug.Log((object)"Aggressive Action: Refusing to lower ship as the ship is grappling something."); } break; } } private void FireCannon() { if (!isCannonStrafing) { ((MonoBehaviour)this).StartCoroutine(CannonAttackRoutine()); } } [ClientRpc] public void PlayCannonSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(672072424u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 672072424u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; cannonSound.Play(); } } } private IEnumerator CannonAttackRoutine() { if (isCannonStrafing) { yield break; } isCannonStrafing = true; Vector3 targetPos = GetTargetPosition(); Vector3 toTarget = targetPos - ((Component)this).transform.position; toTarget.y = 0f; float dotRight = Vector3.Dot(((Vector3)(ref toTarget)).normalized, ((Component)this).transform.right); bool targetOnRight = dotRight >= 0f; bool strafeRight = ((Random.value < 0.7f) ? targetOnRight : (!targetOnRight)); Vector3 strafeDir = (strafeRight ? ((Component)this).transform.right : (-((Component)this).transform.right)); Vector3 strafeDestXZ = ((Component)this).transform.position + strafeDir * strafeDistance; strafeDestXZ.y = ((Component)this).transform.position.y; Vector3 strafeNavDest = strafeDestXZ; NavMeshHit strafeHit = default(NavMeshHit); if (NavMesh.SamplePosition(strafeDestXZ, ref strafeHit, strafeDistance * 0.8f, -1)) { strafeNavDest = ((NavMeshHit)(ref strafeHit)).position; } Debug.Log((object)string.Format("Moai Pirate Ship: Cannon strafe — moving {0}, dest={1}", strafeRight ? "starboard" : "port", strafeNavDest)); agent.SetDestination(strafeNavDest); float strafeTimeout = 6f; float strafeTimer = 0f; while (strafeTimer < strafeTimeout) { strafeTimer += Time.deltaTime; Vector3 shipXZ = new Vector3(((Component)this).transform.position.x, 0f, ((Component)this).transform.position.z); Vector3 destXZ = new Vector3(strafeNavDest.x, 0f, strafeNavDest.z); if (Vector3.Distance(shipXZ, destXZ) < cannonArrivalDist) { break; } yield return null; } targetPos = GetTargetPosition(); int shotsFired = 0; for (int i = 0; i < cannonFirePoints.Length; i++) { Transform firePoint = cannonFirePoints[i]; if ((Object)(object)firePoint == (Object)null) { continue; } Vector3 val = targetPos - firePoint.position; Vector3 dirToTarget = ((Vector3)(ref val)).normalized; val = new Vector3(firePoint.forward.x, 0f, firePoint.forward.z); Vector3 cannonForwardXZ = ((Vector3)(ref val)).normalized; val = new Vector3(dirToTarget.x, 0f, dirToTarget.z); Vector3 dirToTargetXZ = ((Vector3)(ref val)).normalized; float angle = Vector3.Angle(cannonForwardXZ, dirToTargetXZ); if (angle > cannonMaxAimAngle) { Debug.Log((object)$"Moai Pirate Ship: Cannon [{i}] skipped — Y-axis angle {angle:F1}° exceeds {cannonMaxAimAngle}°"); continue; } Quaternion aimRot = Quaternion.LookRotation(dirToTarget); GameObject ball = Object.Instantiate(Plugin.CannonProjectile, firePoint.position + firePoint.forward * 0.5f, aimRot); ball.SetActive(true); float scale = ((Component)this).transform.localScale.y / 4f; ball.transform.localScale = new Vector3(scale, scale, scale); ball.GetComponent().Spawn(false); ball.GetComponent().SetOwner(((Component)captain).gameObject); if (Object.op_Implicit((Object)(object)cannonSound)) { PlayCannonSoundClientRpc(); } shotsFired++; Debug.Log((object)$"Moai Pirate Ship: Cannon [{i}] fired — angle={angle:F1}°"); yield return (object)new WaitForSeconds(0.12f); } Debug.Log((object)$"Moai Pirate Ship: Broadside complete — {shotsFired} cannon(s) fired."); if (Random.value < 0.5f) { Vector3 flipDir = (strafeRight ? (-((Component)this).transform.right) : ((Component)this).transform.right); Vector3 flipDestXZ = ((Component)this).transform.position + flipDir * strafeDistance; flipDestXZ.y = ((Component)this).transform.position.y; Vector3 flipNavDest = flipDestXZ; NavMeshHit flipHit = default(NavMeshHit); if (NavMesh.SamplePosition(flipDestXZ, ref flipHit, strafeDistance * 0.8f, -1)) { flipNavDest = ((NavMeshHit)(ref flipHit)).position; } agent.SetDestination(flipNavDest); Debug.Log((object)"Moai Pirate Ship: Re-rolling — strafing to opposite side."); yield return (object)new WaitForSeconds(1.2f); flipHit = default(NavMeshHit); } else { Debug.Log((object)"Moai Pirate Ship: Re-rolling — breaking off to reposition."); } isCannonStrafing = false; if (Random.Range(0f, 1f) < ExitAggressiveChance) { ExitAggressiveChance = 0f; ExitAggressive(); } else { ExitAggressiveChance += ExitAggressiveChanceIncrease; } } [ClientRpc] public void PlayGrappleFireSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(947693830u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 947693830u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; grappleFireSound.Play(); } } } [ClientRpc] public void PlayGrappleHitSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2836191301u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2836191301u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; grappleHitSound.Play(); } } } [ClientRpc] public void PlayGrappleRetractSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1327127042u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1327127042u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; grappleRetractSound.Play(); } } } [ClientRpc] public void setEnableGrappleClientRpc(bool enabled) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(802136555u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref enabled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 802136555u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ((Component)grappleChain).gameObject.SetActive(enabled); } } } private void FireGrapple() { if ((Object)(object)aggroCruiser != (Object)null) { ((MonoBehaviour)this).StartCoroutine(CruiserGrappleRoutine(aggroCruiser)); return; } Transform val = null; if ((Object)(object)aggroEnemy != (Object)null) { val = ((Component)aggroEnemy).transform; } else if ((Object)(object)aggroScrap != (Object)null) { val = ((Component)aggroScrap).transform; } if ((Object)(object)val == (Object)null) { Debug.Log((object)"Moai Pirate Ship: Grapple — no valid target."); ExitAggressive(); } else { ((MonoBehaviour)this).StartCoroutine(GrappleRoutine(val)); } } [ClientRpc] public void DisableGOClientRpc(ulong uid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1975718055u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1975718055u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; EnemyAI[] array = Object.FindObjectsOfType(); EnemyAI[] array2 = array; foreach (EnemyAI val3 in array2) { if (((NetworkBehaviour)val3).NetworkObjectId != uid) { continue; } GameObject gameObject = ((Component)val3).gameObject; if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { ((Behaviour)gameObject.GetComponent()).enabled = false; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { ((Behaviour)gameObject.GetComponent()).enabled = false; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { if (Object.op_Implicit((Object)(object)VoiceThereBeTreasure) && ((NetworkBehaviour)RoundManager.Instance).IsHost) { PlayVoiceThereBeTreasureClientRpc(); } ((Behaviour)gameObject.GetComponent()).enabled = false; } grabbedGO = gameObject; } } private IEnumerator GrappleRoutine(Transform target) { if (isGrappling) { yield break; } isGrappling = true; actionExecuted = true; setEnableGrappleClientRpc(enabled: true); grappleChain.endPointTransform.position = ((Component)grappleChain).transform.position; if (Object.op_Implicit((Object)(object)grappleFireSound)) { PlayGrappleFireSoundClientRpc(); } while ((Object)(object)target != (Object)null && Vector3.Distance(grappleChain.endPointTransform.position, target.position) > 0.4f) { grappleChain.endPointTransform.position = Vector3.MoveTowards(grappleChain.endPointTransform.position, target.position, grappleTravelSpeed * Time.deltaTime); yield return null; } if (Object.op_Implicit((Object)(object)grappleHitSound)) { PlayGrappleHitSoundClientRpc(); } if ((Object)(object)target != (Object)null && Object.op_Implicit((Object)(object)((Component)target).gameObject)) { grabbedGO = ((Component)target).gameObject; GameObject GO = ((Component)target).gameObject; if (Object.op_Implicit((Object)(object)GO.GetComponent())) { DisableGOClientRpc(GO.GetComponent().NetworkObjectId); } } yield return (object)new WaitForSeconds(grappleHoldTime); if (Object.op_Implicit((Object)(object)grappleRetractSound)) { PlayGrappleHitSoundClientRpc(); } Vector3 retractTarget = ((Component)grappleChain).transform.position; while (Vector3.Distance(grappleChain.endPointTransform.position, retractTarget) > 0.3f) { retractTarget = ((Component)grappleChain).transform.position; grappleChain.endPointTransform.position = Vector3.MoveTowards(grappleChain.endPointTransform.position, retractTarget, grappleTravelSpeed * 1.5f * Time.deltaTime); yield return null; } if ((Object)(object)aggroEnemy != (Object)null) { ((Component)aggroEnemy).gameObject.SetActive(false); storedEnemies.Add(aggroEnemy.enemyType); Object.Destroy((Object)(object)((Component)aggroEnemy).gameObject, 0.1f); aggroEnemy = null; } else if ((Object)(object)aggroScrap != (Object)null) { ((Component)aggroScrap).gameObject.SetActive(false); Object.Destroy((Object)(object)((Component)aggroScrap).gameObject, 0.1f); aggroScrap = null; } setEnableGrappleClientRpc(enabled: false); isGrappling = false; grabbedGO = null; SetGrabbedGONullClientRpc(); ExitAggressive(); } [ClientRpc] public void SetGrabbedGONullClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2743689654u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2743689654u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; grabbedGO = null; } } } [ClientRpc] public void PlayVoiceThereBeTreasureClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3662367917u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3662367917u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; VoiceThereBeTreasure.Play(); } } } private IEnumerator CruiserGrappleRoutine(VehicleController cruiser) { if (isGrappling) { yield break; } isGrappling = true; actionExecuted = true; InitPhaseRising(); while (Mathf.Abs(yLevel - targetYLevel) > 1f) { yield return null; } agent.ResetPath(); if (Object.op_Implicit((Object)(object)VoiceThereBeTreasure)) { PlayVoiceThereBeTreasureClientRpc(); } setEnableGrappleClientRpc(enabled: true); grappleChain.endPointTransform.position = ((Component)grappleChain).transform.position; if (Object.op_Implicit((Object)(object)grappleFireSound)) { PlayGrappleFireSoundClientRpc(); } while ((Object)(object)cruiser != (Object)null && !cruiser.carDestroyed && Vector3.Distance(grappleChain.endPointTransform.position, ((Component)cruiser).transform.position) > 0.8f) { grappleChain.endPointTransform.position = Vector3.MoveTowards(grappleChain.endPointTransform.position, ((Component)cruiser).transform.position, grappleTravelSpeed * Time.deltaTime); yield return null; } if (Object.op_Implicit((Object)(object)grappleHitSound)) { PlayGrappleHitSoundClientRpc(); } Debug.Log((object)"Moai Pirate Ship: Cruiser grapple latched — beginning flee."); grapplingCruiser = true; chainSimCurrent = grappleChain.endPointTransform.position; if (Object.op_Implicit((Object)(object)captain)) { captain.PlayRandomPirateVoiceline(); } grabbedGO = ((Component)cruiser).gameObject; Rigidbody cruiserRb = ((Component)cruiser).GetComponent(); float holdDuration = Random.Range(cruiserGrappleHoldTimeMin, cruiserGrappleHoldTimeMax); float holdTimer = 0f; NavMeshHit hit = default(NavMeshHit); while (holdTimer < holdDuration) { if ((Object)(object)cruiser == (Object)null || cruiser.carDestroyed) { Debug.Log((object)"Moai Pirate Ship: Cruiser destroyed during grapple hold — releasing."); grabbedGO = null; grapplingCruiser = false; break; } holdTimer += Time.deltaTime; PlayerControllerB nearestPlayer = null; float nearestDist = float.MaxValue; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB ply in allPlayerScripts) { if (!((Object)(object)ply == (Object)null) && !ply.isPlayerDead && ply.isPlayerControlled) { float d = Vector3.Distance(((Component)this).transform.position, ((Component)ply).transform.position); if (d < nearestDist) { nearestDist = d; nearestPlayer = ply; } } } if ((Object)(object)nearestPlayer != (Object)null) { Vector3 awayDir = ((Component)this).transform.position - ((Component)nearestPlayer).transform.position; awayDir.y = 0f; ((Vector3)(ref awayDir)).Normalize(); Vector3 fleeTarget = ((Component)this).transform.position + awayDir * cruiserFleeSpeed; if (NavMesh.SamplePosition(fleeTarget, ref hit, cruiserFleeSampleRadius, -1)) { agent.SetDestination(((NavMeshHit)(ref hit)).position); } awayDir = default(Vector3); hit = default(NavMeshHit); } if ((Object)(object)cruiserRb != (Object)null) { Vector3 val = ((Component)grappleChain).transform.position - ((Component)cruiser).transform.position; Vector3 pullDir = ((Vector3)(ref val)).normalized; cruiserRb.AddForce(pullDir * cruiserDragForce, (ForceMode)0); } yield return null; } agent.ResetPath(); grabbedGO = null; if (Object.op_Implicit((Object)(object)grappleRetractSound)) { PlayGrappleRetractSoundClientRpc(); } Debug.Log((object)"Moai Pirate Ship: Releasing cruiser — retracting chain."); Vector3 retractTarget = ((Component)grappleChain).transform.position; while (Vector3.Distance(grappleChain.endPointTransform.position, retractTarget) > 0.3f) { retractTarget = ((Component)grappleChain).transform.position; grappleChain.endPointTransform.position = Vector3.MoveTowards(grappleChain.endPointTransform.position, retractTarget, grappleTravelSpeed * 1.5f + cruiser.speed * Time.deltaTime); yield return null; } setEnableGrappleClientRpc(enabled: false); isGrappling = false; grapplingCruiser = false; aggroCruiser = null; ExitAggressive(); } private void ExitAggressive() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) aggroPlayer = null; aggroEnemy = null; aggroScrap = null; aggroCruiser = null; actionExecuted = false; isCannonStrafing = false; rescoreTimer = 0f; InitPhaseTraveling(Vector3.zero); } public void InitPhaseLanded() { //IL_0031: 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) phase = "landed"; try { foreach (EnemyType storedEnemy in storedEnemies) { GameObject val = Object.Instantiate(storedEnemy.enemyPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); val.GetComponent().Spawn(false); } storedEnemies.Clear(); } catch (Exception ex) { Debug.LogError((object)ex); } } public void InitPhaseRising() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) captain.PlayRandomPirateVoiceline(); if (Object.op_Implicit((Object)(object)shipTakingOffSound)) { PlayShipTakingOffSoundClientRpc(); } phase = "rising"; targetYLevel = ((Component)this).transform.position.y + Random.Range(lowestHeight, highestHeight); Debug.Log((object)("Moai Pirate Ship: rising to height of: " + targetYLevel)); } public void InitPhaseLowering() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) captain.PlayRandomPirateVoiceline(); phase = "lowering"; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)this).transform.position, ref val, 30f, -1)) { targetYLevel = ((NavMeshHit)(ref val)).position.y; if (Object.op_Implicit((Object)(object)landingBell)) { PlayLandingBellClientRpc(); } } else { Debug.Log((object)"Moai Pirate Ship: Failed to find a raycast point to land on. Navigating elsewhere..."); InitPhaseTraveling(Vector3.zero); } } public GameObject FindDestination() { RoundManager instance = RoundManager.Instance; GameObject[] outsideAINodes = instance.outsideAINodes; return outsideAINodes[Random.Range(0, outsideAINodes.Length)]; } public void InitPhaseTraveling(Vector3 destination) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) phase = "traveling"; ((Behaviour)agent).enabled = true; if (destination == Vector3.zero) { destination = FindDestination().transform.position; } agent.SetDestination(destination); } public void InitPhaseAggressive() { if (Object.op_Implicit((Object)(object)shipHornThreaten)) { PlayShipHornThreatenClientRpc(); } phase = "aggressive"; rescoreTimer = 0f; actionExecuted = false; aggroPlayer = null; aggroEnemy = null; aggroScrap = null; aggroCruiser = null; } [ClientRpc] public void SetCaptainClientRpc(ulong uid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1149009885u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1149009885u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; MoaiPirateAI[] array = Object.FindObjectsOfType(); foreach (MoaiPirateAI moaiPirateAI in array) { if (((NetworkBehaviour)moaiPirateAI).NetworkObjectId == uid) { captain = moaiPirateAI; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2645086074u, new RpcReceiveHandler(__rpc_handler_2645086074), "PlayShipHornThreatenClientRpc"); ((NetworkBehaviour)this).__registerRpc(2793292015u, new RpcReceiveHandler(__rpc_handler_2793292015), "PlayShipHornStealingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3649238099u, new RpcReceiveHandler(__rpc_handler_3649238099), "PlayLandingBellClientRpc"); ((NetworkBehaviour)this).__registerRpc(1124603934u, new RpcReceiveHandler(__rpc_handler_1124603934), "PlayShipTakingOffSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(672072424u, new RpcReceiveHandler(__rpc_handler_672072424), "PlayCannonSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(947693830u, new RpcReceiveHandler(__rpc_handler_947693830), "PlayGrappleFireSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(2836191301u, new RpcReceiveHandler(__rpc_handler_2836191301), "PlayGrappleHitSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(1327127042u, new RpcReceiveHandler(__rpc_handler_1327127042), "PlayGrappleRetractSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(802136555u, new RpcReceiveHandler(__rpc_handler_802136555), "setEnableGrappleClientRpc"); ((NetworkBehaviour)this).__registerRpc(1975718055u, new RpcReceiveHandler(__rpc_handler_1975718055), "DisableGOClientRpc"); ((NetworkBehaviour)this).__registerRpc(2743689654u, new RpcReceiveHandler(__rpc_handler_2743689654), "SetGrabbedGONullClientRpc"); ((NetworkBehaviour)this).__registerRpc(3662367917u, new RpcReceiveHandler(__rpc_handler_3662367917), "PlayVoiceThereBeTreasureClientRpc"); ((NetworkBehaviour)this).__registerRpc(1149009885u, new RpcReceiveHandler(__rpc_handler_1149009885), "SetCaptainClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2645086074(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayShipHornThreatenClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2793292015(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayShipHornStealingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3649238099(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayLandingBellClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1124603934(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayShipTakingOffSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_672072424(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayCannonSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_947693830(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayGrappleFireSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2836191301(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayGrappleHitSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1327127042(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayGrappleRetractSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_802136555(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enableGrappleClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enableGrappleClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).setEnableGrappleClientRpc(enableGrappleClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1975718055(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong uid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref uid); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).DisableGOClientRpc(uid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2743689654(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).SetGrabbedGONullClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3662367917(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).PlayVoiceThereBeTreasureClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1149009885(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong captainClientRpc = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref captainClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateShip)(object)target).SetCaptainClientRpc(captainClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MoaiPirateShip"; } } } namespace MoaiEnemy.src.MoaiOrange { internal class OrangeEnemyAI : MOAIAICORE { private new enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance, Kidnapping, GroundHopping } private float surfaceTime = 13.8f; private float undergroundTime = 16.8f; private float cycleTimer = 0f; private bool isUnderground = false; private int diggingState = 0; private float digStateTimer = 0f; public AudioSource customMoaiDrillSound; public AudioSource customMoaiDigSound; private bool hasPlayedDigAnim = false; private bool hasPlayedUndergroundAnim = false; private float leapAnimationLength = 1f; private float leapPeakHeight = 3f; private float timeBetweenLeaps = 1.1f; public AudioSource leapPrepareSound; public AudioSource[] leapHitSounds; private bool isInLeapSequence = false; private bool doneWithLeaps = false; private float hopMinRange = 12f; private float hopMaxRange = 18f; public AudioSource explosionImpactSound; private float beeSpawnChance = 0.25f; private float impactRange = 5.7f; private int impactDamage = 35; private float impactForce = 4f; public ParticleSystem undergroundParticleSystem; public ParticleSystem emergeParticleSystem; public ParticleSystem explosionParticles; private List spawnedBees; private PlayerControllerB yoinkedPlayer; public Transform playerGrabPoint; private bool sneakingUpOnPlayer = false; private float letGoTimer = 0f; private PlayerControllerB targetToYoink; private List disabledColliders = new List(); private float kidnapImpatienceTimer = 12f; private float kidnapImpatienceDuration = 12f; private float grabRange = 2f; public override void Start() { baseInit(); spawnedBees = new List(); AudioSource obj = leapPrepareSound; obj.volume *= Plugin.moaiGlobalMusicVol.Value / 0.6f; for (int i = 0; i < leapHitSounds.Length; i++) { AudioSource obj2 = leapHitSounds[i]; obj2.volume *= Plugin.moaiGlobalMusicVol.Value / 0.6f; } AudioSource obj3 = explosionImpactSound; obj3.volume *= Plugin.moaiGlobalMusicVol.Value / 0.6f; AudioSource obj4 = customMoaiDrillSound; obj4.volume *= Plugin.moaiGlobalMusicVol.Value / 0.6f; AudioSource obj5 = customMoaiDigSound; obj5.volume *= Plugin.moaiGlobalMusicVol.Value / 0.6f; } public override void setPitches(float pitchAlter) { AudioSource obj = leapPrepareSound; obj.pitch /= pitchAlter; for (int i = 0; i < leapHitSounds.Length; i++) { AudioSource obj2 = leapHitSounds[i]; obj2.pitch /= pitchAlter; } AudioSource obj3 = explosionImpactSound; obj3.pitch /= pitchAlter; AudioSource obj4 = customMoaiDrillSound; obj4.pitch /= pitchAlter; AudioSource obj5 = customMoaiDigSound; obj5.pitch /= pitchAlter; } public override void OnDestroy() { for (int i = 0; i < spawnedBees.Count; i++) { RedLocustBees val = spawnedBees[i]; destroyBeesClientRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId); } spawnedBees.Clear(); if (((NetworkBehaviour)RoundManager.Instance).IsHost && Object.op_Implicit((Object)(object)yoinkedPlayer)) { letGoOfPlayerClientRpc(((NetworkBehaviour)yoinkedPlayer).NetworkObject.NetworkObjectId); } base.OnDestroy(); } [ClientRpc] public void destroyBeesClientRpc(ulong netid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2210511200u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, netid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2210511200u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RedLocustBees[] array = Object.FindObjectsOfType(); RedLocustBees[] array2 = array; foreach (RedLocustBees val3 in array2) { if (Object.op_Implicit((Object)(object)val3) && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid) { if (Object.op_Implicit((Object)(object)val3.hive)) { Object.Destroy((Object)(object)((Component)val3.hive).gameObject); } Object.Destroy((Object)(object)((Component)val3).gameObject); } } } [ClientRpc] public void moveHiveClientRpc(ulong netid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1297456321u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, netid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1297456321u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RedLocustBees[] array = Object.FindObjectsOfType(); RedLocustBees[] array2 = array; foreach (RedLocustBees val3 in array2) { if (Object.op_Implicit((Object)(object)val3) && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid) { GrabbableObject hive = val3.hive; hive.targetFloorPosition = new Vector3(-333f, -333f, -333f); hive.fallTime = 0f; ((EnemyAI)val3).agent.speed = 4.5f; if (Object.op_Implicit((Object)(object)((Component)hive).GetComponent())) { ((Renderer)((Component)hive).GetComponent()).enabled = false; } if (Object.op_Implicit((Object)(object)((Component)hive).GetComponent())) { ((Collider)((Component)hive).GetComponent()).enabled = false; } } } } public override void Update() { //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); baseUpdate(); if (Object.op_Implicit((Object)(object)yoinkedPlayer) && ((NetworkBehaviour)yoinkedPlayer).NetworkObject.NetworkObjectId == ((NetworkBehaviour)RoundManager.Instance.playersManager.localPlayerController).NetworkObject.NetworkObjectId) { StartOfRound.Instance.drowningTimer = (float)(enemyRandom.NextDouble() + 0.10000000149011612); } if (!((Behaviour)animator).enabled) { ((Behaviour)animator).enabled = true; } if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } cycleTimer += Time.deltaTime; if (((EnemyAI)this).currentBehaviourStateIndex == 0 || ((EnemyAI)this).currentBehaviourStateIndex == 1 || ((EnemyAI)this).currentBehaviourStateIndex == 5) { if (isUnderground) { if (cycleTimer > undergroundTime) { cycleTimer = 0f; diggingState = 1; hasPlayedDigAnim = false; hasPlayedUndergroundAnim = false; } } else if (cycleTimer > surfaceTime) { cycleTimer = 0f; diggingState = 2; hasPlayedDigAnim = false; hasPlayedUndergroundAnim = false; } } if ((((EnemyAI)this).currentBehaviourStateIndex == 4 || ((EnemyAI)this).currentBehaviourStateIndex == 2) && isUnderground && (double)cycleTimer > 2.5) { cycleTimer = 0f; diggingState = 1; hasPlayedDigAnim = false; hasPlayedUndergroundAnim = false; } if (((EnemyAI)this).currentBehaviourStateIndex == 7) { animator.speed = 1f; } if (diggingState == 1) { digStateTimer += Time.deltaTime; if (!hasPlayedDigAnim) { orangeEmergeClientRpc(); hasPlayedDigAnim = true; } if (digStateTimer > 1.1f) { diggingState = 0; isUnderground = false; hasPlayedDigAnim = false; digStateTimer = 0f; } } else if (diggingState == 2) { digStateTimer += Time.deltaTime; if (!hasPlayedDigAnim) { orangeDigClientRpc(); hasPlayedDigAnim = true; } if (digStateTimer > 1.1f) { diggingState = 0; isUnderground = true; hasPlayedDigAnim = false; digStateTimer = 0f; } } else { digStateTimer = 0f; } AnimatorStateInfo currentAnimatorStateInfo; if (isUnderground && diggingState == 0) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("RemainUnderground") && !hasPlayedUndergroundAnim) { undergroundActivateClientRpc(); hasPlayedUndergroundAnim = true; } if (!customMoaiDigSound.isPlaying) { playUndergroundSoundClientRpc(active: true); } } else { hasPlayedUndergroundAnim = false; if (customMoaiDigSound.isPlaying) { playUndergroundSoundClientRpc(active: false); } } currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("RemainUnderground")) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("DigUp")) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("DigDown")) { return; } } } if (diggingState == 0 && !isUnderground) { playWalkClientRpc(); } } [ClientRpc] public void playWalkClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2811000729u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2811000729u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("Walk"); } } } public async void summonBees(Vector3 position) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) RedLocustBees[] beeArr = Resources.FindObjectsOfTypeAll(); RedLocustBees beeobj = beeArr[0]; Debug.Log((object)("Orange Moai: spawning bee obj: " + ((Object)beeobj).name + " - " + ((object)beeobj).GetType()?.ToString() + " - " + ((object)beeobj).ToString())); GameObject beebase = ((EnemyAI)beeobj).enemyType.enemyPrefab; GameObject bees = Object.Instantiate(beebase, position, Quaternion.identity, new GameObject().transform); ((Renderer)bees.GetComponentInChildren()).enabled = false; bees.GetComponentInChildren().Spawn(true); bees.SetActive(true); RedLocustBees comp = bees.GetComponent(); spawnedBees.Add(comp); await Task.Delay((int)(enemyRandom.NextDouble() * 5000.0 + 15000.0)); destroyBeesClientRpc(((NetworkBehaviour)comp).NetworkObject.NetworkObjectId); } public static void moaiSpawnExplosion(Vector3 explosionPosition, float killRange = 1f, float damageRange = 1f, int nonLethalDamage = 50, float physicsForce = 0f, GameObject overridePrefab = null, bool goThroughCar = false) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0367: 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_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_049c: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } bool flag = false; Collider[] array = Physics.OverlapSphere(explosionPosition, damageRange, 2621448, (QueryTriggerInteraction)2); RaycastHit val = default(RaycastHit); Vector3 val3; PlayerControllerB component; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, ref val, 1073742080, (QueryTriggerInteraction)1) && ((!goThroughCar && ((Component)((RaycastHit)(ref val)).collider).gameObject.layer == 30) || !(num2 <= 4f))) { continue; } if (((Component)array[i]).gameObject.layer == 3 && !flag) { component = ((Component)array[i]).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && ((NetworkBehaviour)component).IsOwner) { flag = true; if (num2 < killRange) { Vector3 val2 = Vector3.Normalize(((Component)component.gameplayCamera).transform.position - explosionPosition) * 80f / Vector3.Distance(((Component)component.gameplayCamera).transform.position, explosionPosition); PlayerControllerB obj = component; val3 = default(Vector3); obj.KillPlayer(val2, true, (CauseOfDeath)3, 0, val3, false); } else if (num2 < damageRange) { Vector3 val4 = Vector3.Normalize(((Component)component.gameplayCamera).transform.position - explosionPosition) * 80f / Vector3.Distance(((Component)component.gameplayCamera).transform.position, explosionPosition); component.DamagePlayer(nonLethalDamage, true, true, (CauseOfDeath)3, 0, false, val4); } } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && ((NetworkBehaviour)componentInChildren.mainScript).IsOwner && num2 < 4.5f && ((Object)((Component)componentInChildren).gameObject).name.ToLower().Contains("moai")) { EnemyAI mainScript = componentInChildren.mainScript; val3 = default(Vector3); mainScript.HitEnemyOnLocalClient(6, val3, (PlayerControllerB)null, false, -1); componentInChildren.mainScript.HitFromExplosion(num2); } } } component = GameNetworkManager.Instance.localPlayerController; if (physicsForce > 0f && Vector3.Distance(((Component)component).transform.position, explosionPosition) < 35f && !Physics.Linecast(explosionPosition, ((Component)component).transform.position + Vector3.up * 0.3f, ref val, 256, (QueryTriggerInteraction)1)) { float num3 = Vector3.Distance(((Component)component).transform.position, explosionPosition); Vector3 val5 = Vector3.Normalize(((Component)component).transform.position + Vector3.up * num3 - explosionPosition) / (num3 * 0.35f) * physicsForce; if (((Vector3)(ref val5)).magnitude > 2f) { if (((Vector3)(ref val5)).magnitude > 10f) { component.CancelSpecialTriggerAnimations(); } if (component.inVehicleAnimation) { val3 = component.externalForceAutoFade + val5; if (!(((Vector3)(ref val3)).magnitude > 50f)) { goto IL_0408; } } PlayerControllerB obj2 = component; obj2.externalForceAutoFade += val5; } } goto IL_0408; IL_0408: VehicleController val6 = Object.FindObjectOfType(); if ((Object)(object)val6 != (Object)null && !val6.magnetedToShip && physicsForce > 0f && Vector3.Distance(((Component)val6).transform.position, explosionPosition) < 35f) { val6.mainRigidbody.AddExplosionForce(physicsForce * 50f, explosionPosition, 12f, 3f, (ForceMode)1); } int num4 = ~LayerMask.GetMask(new string[1] { "Room" }); num4 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num4); for (int j = 0; j < array.Length; j++) { Rigidbody component2 = ((Component)array[j]).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.AddExplosionForce(70f, explosionPosition, 10f); } } } [ClientRpc] public void explosionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2935351581u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2935351581u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; explosionParticles.Play(); explosionImpactSound.Play(); moaiSpawnExplosion(((Component)this).transform.position, 0f, impactRange, impactDamage, impactForce, null, goThroughCar: true); } } } [ClientRpc] public void playUndergroundSoundClientRpc(bool active) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(889205728u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 889205728u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (active) { customMoaiDigSound.Play(); } else { customMoaiDigSound.Stop(); } } } [ClientRpc] public void playHitSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(262053526u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 262053526u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; leapHitSounds[enemyRandom.Next(0, leapHitSounds.Length)].Play(); } } } [ClientRpc] public void playPrepareSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2241132640u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2241132640u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; leapPrepareSound.Play(); } } } [ClientRpc] public void orangeDigClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3005134860u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3005134860u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("DigDown"); stopAllSound(); customMoaiDrillSound.Play(); } } } [ClientRpc] public void hopAnimationClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(15556307u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 15556307u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("Hop"); stopAllSound(); } } } [ClientRpc] public void orangeEmergeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3073668375u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3073668375u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("DigUp"); stopAllSound(); customMoaiDrillSound.Play(); } } } [ClientRpc] public void undergroundActivateClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(314637701u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 314637701u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("RemainUnderground"); } } } private bool ShouldKidnap(PlayerControllerB target) { //IL_0035: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null || target.isPlayerDead || (Object)(object)yoinkedPlayer != (Object)null) { return false; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)target).transform.position); if (num > 16.5f) { return false; } Vector3 val = ((Component)this).transform.position - ((Component)target.gameplayCamera).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num2 = Vector3.Dot(((Component)target.gameplayCamera).transform.forward, normalized); float num3 = 0.15f; float num4 = Mathf.Clamp01((0f - num2 - 0.1f) / 0.9f); float num5 = Mathf.Lerp(num3, 1f, num4); float num6 = Random.Range(0f, 1f); return num6 < num5; } public override void DoAIInterval() { //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } letGoTimer -= 0.2f; if (((EnemyAI)this).isEnemyDead) { if (customMoaiDigSound.isPlaying) { customMoaiDigSound.Stop(); } if (((NetworkBehaviour)RoundManager.Instance).IsHost && Object.op_Implicit((Object)(object)yoinkedPlayer)) { letGoOfPlayerClientRpc(((NetworkBehaviour)yoinkedPlayer).NetworkObject.NetworkObjectId); } return; } if (isUnderground) { if (!undergroundParticleSystem.isEmitting) { ToggleUndergroundParticlesClientRpc(value: true); } } else if (undergroundParticleSystem.isEmitting) { ToggleUndergroundParticlesClientRpc(value: false); } if (((EnemyAI)this).currentBehaviourStateIndex == 6 && sneakingUpOnPlayer) { customMoaiDrillSound.volume = 0.15f * Plugin.moaiGlobalMusicVol.Value; customMoaiDigSound.volume = 0.1f * Plugin.moaiGlobalMusicVol.Value; } else { customMoaiDrillSound.volume = 0.647f * Plugin.moaiGlobalMusicVol.Value; customMoaiDigSound.volume = 0.208f * Plugin.moaiGlobalMusicVol.Value; } List list = new List(); for (int i = 0; i < spawnedBees.Count; i++) { RedLocustBees val = spawnedBees[i]; if ((Object)(object)val == (Object)null) { list.Add(val); } else if (Object.op_Implicit((Object)(object)val.hive)) { moveHiveClientRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId); } } for (int j = 0; j < list.Count; j++) { RedLocustBees item = list[j]; spawnedBees.Remove(item); } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); if (Object.op_Implicit((Object)(object)yoinkedPlayer) && yoinkedPlayer.isPlayerDead) { yoinkedPlayer = null; } if (((EnemyAI)this).currentBehaviourStateIndex != 7) { isInLeapSequence = false; } if ((letGoTimer < 0f && (Object)(object)yoinkedPlayer != (Object)null) || ((Object)(object)yoinkedPlayer != (Object)null && yoinkedPlayer.isPlayerDead)) { letGoOfPlayerClientRpc(((NetworkBehaviour)yoinkedPlayer).NetworkObject.NetworkObjectId); } ((EnemyAI)this).agent.acceleration = 8f * Plugin.moaiGlobalSpeed.Value; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: baseSearchingForPlayer(); break; case 5: baseHeadingToEntrance(); break; case 1: baseGuard(); break; case 2: baseStickingInFrontOfEnemy(); break; case 3: baseStickingInFrontOfPlayer(); if (Object.op_Implicit((Object)(object)((EnemyAI)this).targetPlayer)) { if (ShouldKidnap(((EnemyAI)this).targetPlayer)) { sneakingUpOnPlayer = true; kidnapImpatienceTimer = kidnapImpatienceDuration; targetToYoink = ((EnemyAI)this).targetPlayer; ((EnemyAI)this).SwitchToBehaviourClientRpc(6); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); } else { ((EnemyAI)this).SwitchToBehaviourClientRpc(7); doneWithLeaps = false; } } break; case 4: baseHeadSwingAttackInProgress(); break; case 7: ((EnemyAI)this).agent.speed = 0f; if (!isInLeapSequence && !doneWithLeaps) { isInLeapSequence = true; ((MonoBehaviour)this).StartCoroutine(DoGroundHopSequence(Random.Range(2, 5))); } else if (doneWithLeaps) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).targetPlayer = null; ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; case 6: stopAllSound(); if (!Object.op_Implicit((Object)(object)targetToYoink) || targetToYoink.isPlayerDead || Vector3.Distance(((Component)this).transform.position, ((Component)targetToYoink).transform.position) > 35f) { ((EnemyAI)this).SwitchToBehaviourClientRpc(0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); break; } ((EnemyAI)this).SetDestinationToPosition(((Component)targetToYoink).transform.position, false); if (sneakingUpOnPlayer) { ((EnemyAI)this).agent.speed = 5.3f * Plugin.moaiGlobalSpeed.Value; kidnapImpatienceTimer -= 0.2f; if (isUnderground) { if (Vector3.Distance(((Component)this).transform.position, ((Component)targetToYoink).transform.position) < grabRange * ((Component)this).transform.localScale.x) { sneakingUpOnPlayer = false; diggingState = 1; } } else { diggingState = 2; } if (kidnapImpatienceTimer <= 0f) { cycleTimer = 0f; diggingState = 1; letGoTimer = (float)(enemyRandom.NextDouble() * 25.0 + 2.0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } else if (isUnderground) { diggingState = 1; } else if (Vector3.Distance(((Component)this).transform.position, ((Component)targetToYoink).transform.position) < grabRange * ((Component)this).transform.localScale.x) { attachPlayerClientRpc(((NetworkBehaviour)targetToYoink).NetworkObject.NetworkObjectId, healPlayer: true); cycleTimer = 0f; diggingState = 2; letGoTimer = (float)(enemyRandom.NextDouble() * 25.0 + 2.0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { letGoTimer = (float)(enemyRandom.NextDouble() * 25.0 + 2.0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; default: LogDebug("This Behavior State doesn't exist!"); break; } } [ClientRpc] public void attachPlayerClientRpc(ulong playerId, bool healPlayer = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3618973511u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref healPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3618973511u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == playerId) { yoinkedPlayer = val3; ((Component)val3).transform.position = playerGrabPoint.position; ((Component)val3).transform.parent = playerGrabPoint; val3.playerCollider.enabled = false; if (healPlayer) { val3.DamagePlayer(-30, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } break; } } } [ClientRpc] public void letGoOfPlayerClientRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(567840958u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 567840958u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = null; RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val4 in allPlayerScripts) { if (((NetworkBehaviour)val4).NetworkObject.NetworkObjectId == playerId) { val3 = val4; } } ((Component)val3).transform.parent = null; val3.playerCollider.enabled = true; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)val3).transform.position, ref val5, 15f, -1)) { ((Component)val3).transform.position = ((NavMeshHit)(ref val5)).position; } yoinkedPlayer = null; } [ClientRpc] public void ToggleUndergroundParticlesClientRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1832729899u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1832729899u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (value) { undergroundParticleSystem.Play(); } else { undergroundParticleSystem.Stop(); } } } [ClientRpc] public void PlayEmergeParticlesClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1817639006u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1817639006u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; emergeParticleSystem.Play(); } } } public IEnumerator DoGroundHopSequence(int amount) { ((Behaviour)((EnemyAI)this).agent).enabled = false; diggingState = 2; orangeDigClientRpc(); yield return (object)new WaitForSeconds(1.1f); ToggleUndergroundParticlesClientRpc(value: true); playPrepareSoundClientRpc(); yield return (object)new WaitForSeconds(0.7f); undergroundParticleSystem.Stop(); diggingState = 0; for (int i = 0; i < amount; i++) { Vector3 dir = Random.insideUnitSphere; dir.y = 0f; ((Vector3)(ref dir)).Normalize(); stamina -= 20f; ToggleUndergroundParticlesClientRpc(value: false); PlayEmergeParticlesClientRpc(); playHitSoundClientRpc(); if ((Object)(object)((EnemyAI)this).targetPlayer == (Object)null) { break; } Vector3 target = GetSmartHopTarget(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position, hopMinRange, hopMaxRange); yield return ((MonoBehaviour)this).StartCoroutine(DoGroundHop(target)); yield return (object)new WaitForSeconds(Random.Range(0.4f, 0.6f)); dir = default(Vector3); } playHitSoundClientRpc(); yield return (object)new WaitForSeconds(1.1f); ((Behaviour)((EnemyAI)this).agent).enabled = true; isInLeapSequence = false; doneWithLeaps = true; if (stamina < 0f) { stamina = 0f; } recovering = true; } private Vector3 GetSmartHopTarget(Vector3 origin, Vector3 playerPos, float minRange, float maxRange) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_005a: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) Vector3 val = playerPos - origin; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < minRange) { return playerPos; } Vector3 result = playerPos; float num = float.MinValue; NavMeshHit val4 = default(NavMeshHit); for (int i = 0; i < 10; i++) { Vector3 insideUnitSphere = Random.insideUnitSphere; insideUnitSphere.y = 0f; Vector3 val2 = ((Vector3)(ref val)).normalized * 0.7f + ((Vector3)(ref insideUnitSphere)).normalized * 0.3f; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num2 = Random.Range(minRange, maxRange); Vector3 val3 = origin + normalized * num2; if (NavMesh.SamplePosition(val3, ref val4, 4f, -1)) { float num3 = 0f - Vector3.Distance(((NavMeshHit)(ref val4)).position, playerPos); if (num3 > num) { num = num3; result = ((NavMeshHit)(ref val4)).position; } } } return result; } public override void OnCollideWithPlayer(Collider other) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (timeSinceHittingLocalPlayer < 0.5f) { return; } PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (!((Object)(object)val != (Object)null)) { return; } timeSinceHittingLocalPlayer = 0f; if (!Object.op_Implicit((Object)(object)((Component)this).transform.Find("Halo")) || !((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf) { if (val.health < 30) { val.KillPlayer(val.velocityLastFrame, true, (CauseOfDeath)6, 0, default(Vector3), false); } else if (!isUnderground && ((EnemyAI)this).currentBehaviourStateIndex != 6) { val.DamagePlayer(30, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } else if (((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf && val.health <= 90) { val.DamagePlayer(-10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } public IEnumerator DoGroundHop(Vector3 targetPos) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) hopAnimationClientRpc(); Vector3 start = ((Component)this).transform.position; float duration = leapAnimationLength; float elapsed = 0f; float arcPeak = leapPeakHeight; while (elapsed < duration) { float t = elapsed / duration; float height = Mathf.Sin(t * MathF.PI) * arcPeak; ((Component)this).transform.position = Vector3.Lerp(start, targetPos, t) + Vector3.up * height; elapsed += Time.deltaTime; yield return null; } explosionClientRpc(); ((Component)this).transform.position = targetPos; if (enemyRandom.NextDouble() < (double)beeSpawnChance) { summonBees(((Component)this).transform.position); } if (Object.op_Implicit((Object)(object)yoinkedPlayer)) { yoinkedPlayer.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } undergroundActivateClientRpc(); isUnderground = true; yield return (object)new WaitForSeconds(timeBetweenLeaps); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2210511200u, new RpcReceiveHandler(__rpc_handler_2210511200), "destroyBeesClientRpc"); ((NetworkBehaviour)this).__registerRpc(1297456321u, new RpcReceiveHandler(__rpc_handler_1297456321), "moveHiveClientRpc"); ((NetworkBehaviour)this).__registerRpc(2811000729u, new RpcReceiveHandler(__rpc_handler_2811000729), "playWalkClientRpc"); ((NetworkBehaviour)this).__registerRpc(2935351581u, new RpcReceiveHandler(__rpc_handler_2935351581), "explosionClientRpc"); ((NetworkBehaviour)this).__registerRpc(889205728u, new RpcReceiveHandler(__rpc_handler_889205728), "playUndergroundSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(262053526u, new RpcReceiveHandler(__rpc_handler_262053526), "playHitSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(2241132640u, new RpcReceiveHandler(__rpc_handler_2241132640), "playPrepareSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(3005134860u, new RpcReceiveHandler(__rpc_handler_3005134860), "orangeDigClientRpc"); ((NetworkBehaviour)this).__registerRpc(15556307u, new RpcReceiveHandler(__rpc_handler_15556307), "hopAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(3073668375u, new RpcReceiveHandler(__rpc_handler_3073668375), "orangeEmergeClientRpc"); ((NetworkBehaviour)this).__registerRpc(314637701u, new RpcReceiveHandler(__rpc_handler_314637701), "undergroundActivateClientRpc"); ((NetworkBehaviour)this).__registerRpc(3618973511u, new RpcReceiveHandler(__rpc_handler_3618973511), "attachPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(567840958u, new RpcReceiveHandler(__rpc_handler_567840958), "letGoOfPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(1832729899u, new RpcReceiveHandler(__rpc_handler_1832729899), "ToggleUndergroundParticlesClientRpc"); ((NetworkBehaviour)this).__registerRpc(1817639006u, new RpcReceiveHandler(__rpc_handler_1817639006), "PlayEmergeParticlesClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2210511200(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong netid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref netid); target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).destroyBeesClientRpc(netid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1297456321(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong netid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref netid); target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).moveHiveClientRpc(netid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2811000729(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).playWalkClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2935351581(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).explosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_889205728(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool active = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref active, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).playUndergroundSoundClientRpc(active); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_262053526(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).playHitSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2241132640(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).playPrepareSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3005134860(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).orangeDigClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_15556307(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).hopAnimationClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3073668375(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).orangeEmergeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_314637701(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).undergroundActivateClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3618973511(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool healPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref healPlayer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).attachPlayerClientRpc(playerId, healPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_567840958(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).letGoOfPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1832729899(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).ToggleUndergroundParticlesClientRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1817639006(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((OrangeEnemyAI)(object)target).PlayEmergeParticlesClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "OrangeEnemyAI"; } } } namespace MoaiEnemy.src.MoaiGreen { public class NavMeshSpaceChecker : MonoBehaviour { public GameObject prefabToPlace; public LayerMask navMeshLayer; public unsafe static bool CanPlacePrefab(string target, Vector3 position, SpawnableOutsideObject obj = null) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) Vector3 prefabSize = GetPrefabSize(target, obj); NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(position, ref val, 1f, -1)) { Debug.LogWarning((object)"Moai: - NavMeshSpaceChecker Position is not on NavMesh."); return false; } Vector3 val2 = prefabSize * 0.5f; Vector3 val3 = position + val2; NavMeshPath val4 = new NavMeshPath(); if (!NavMesh.CalculatePath(((NavMeshHit)(ref val)).position, val3, -1, val4)) { Vector3 val5 = position; Debug.LogWarning((object)("Not enough space to place prefab " + target + " at position: " + ((object)(*(Vector3*)(&val5))/*cast due to .constrained prefix*/).ToString())); return false; } GameObject val6 = GameObject.Find("HangarShip"); if (Object.op_Implicit((Object)(object)val6)) { if (Vector3.Distance(val6.transform.position, position) < 30f) { return false; } } else { Debug.LogWarning((object)"Moai - NavMeshSpaceChecker - Can not find HangarShip"); } return true; } private static Vector3 GetPrefabSize(string prefab, SpawnableOutsideObject obj = null) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(prefab switch { "Turret" => new Vector3(1f, 1.22f, 1f) + new Vector3(0.73f, 0f, 0.36f) * 1.4f, "Mine" => new Vector3(1f, 1.22f, 1f) + new Vector3(0.73f, 0f, 0.36f) * 1.4f, "Circle" => new Vector3(18f, 8f, 18f) + new Vector3(0.73f, 0f, 0.36f) * 1.4f, "MapObject" => new Vector3((float)obj.objectWidth, (float)obj.objectWidth, (float)obj.objectWidth), _ => Vector3.one, }); } public static Vector3 GetRandomNavMeshPoint(float sampleRadius, Vector3 refPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Vector3 result = refPosition; Vector3 val = Random.insideUnitSphere * sampleRadius; val += refPosition; NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val2, sampleRadius, -1)) { result = ((NavMeshHit)(ref val2)).position; } return result; } } } namespace MoaiEnemy.src.MoaiGold { internal class GoldInteract : NetworkBehaviour { public GoldEnemyAI moai; public InteractTrigger triggerLink; public void interactAction() { commandMoaiServerRpc(); } [ServerRpc(RequireOwnership = false)] public void commandMoaiServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3486980499u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3486980499u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; switch (moai.currentCommand) { case "Guard": moai.searchStatus = "Searching"; moai.currentCommand = "Loot"; break; case "Loot": moai.searchStatus = "Searching"; moai.currentCommand = "Guard"; ((EnemyAI)moai).SwitchToBehaviourClientRpc(1); moai.stopAllSoundsClientRpc(); break; case "Done": moai.searchStatus = "Searching"; moai.currentCommand = "Guard"; moai.stopAllSoundsClientRpc(); ((EnemyAI)moai).SwitchToBehaviourClientRpc(1); if (Object.op_Implicit((Object)(object)moai.holdingItem)) { moai.detachItemClientRpc(((NetworkBehaviour)moai.holdingItem).NetworkObject.NetworkObjectId); } break; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3486980499u, new RpcReceiveHandler(__rpc_handler_3486980499), "commandMoaiServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3486980499(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldInteract)(object)target).commandMoaiServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldInteract"; } } } namespace MoaiEnemy.src.MoaiNormal { internal class GoldEnemyAI : MOAIAICORE { private new enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance, Scavenging, PickingUpItem, ReportingToPlayer } public string currentCommand = "Guard"; public string searchStatus = "Searching"; public GrabbableObject holdingItem = null; public PlayerControllerB holdingCorpse = null; public GoldInteract interactNode; public AudioSource creatureUh; public AudioSource creatureInteract; public AudioSource creatureTalk; public override void Start() { baseInit(); creatureUh.volume = Plugin.moaiGlobalMusicVol.Value; creatureInteract.volume = Plugin.moaiGlobalMusicVol.Value; creatureTalk.volume = Plugin.moaiGlobalMusicVol.Value; } public override void setPitches(float pitchAlter) { AudioSource obj = creatureUh; obj.pitch /= pitchAlter; AudioSource obj2 = creatureInteract; obj2.pitch /= pitchAlter; AudioSource obj3 = creatureTalk; obj3.pitch /= pitchAlter; } public override void Update() { ((EnemyAI)this).Update(); baseUpdate(); if (((EnemyAI)this).isEnemyDead) { creatureUh.Stop(); } } [ClientRpc] public void stopAllSoundsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1140894340u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1140894340u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stopAllSound(); } } } public override void DoAIInterval() { //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Invalid comparison between Unknown and I4 //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Invalid comparison between Unknown and I4 //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) if (provokePoints > 0) { goodBoy = 0; } else { goodBoy = 1000; } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); ((EnemyAI)this).agent.speed = 5f * Plugin.moaiGlobalSpeed.Value; if (currentCommand.Equals("Done") && !creatureUh.isPlaying) { playUhSoundClientRpc(); } else if (!currentCommand.Equals("Done")) { stopUhSoundClientRpc(); } if (currentCommand.Equals("Loot")) { if (!interactNode.triggerLink.hoverTip.Equals("Command to Guard: [LMB]")) { updateToolTipClientRpc("Command to Guard: [LMB]"); } } else if (currentCommand.Equals("Done")) { if (!interactNode.triggerLink.hoverTip.Equals("Command to Drop Item [LMB]")) { updateToolTipClientRpc("Command to Drop Item [LMB]"); } } else if (!interactNode.triggerLink.hoverTip.Equals("Command to Loot Factory: [LMB]")) { updateToolTipClientRpc("Command to Loot Factory: [LMB]"); } if (currentCommand.Equals("Guard") && ((EnemyAI)this).isOutside == mostRecentPlayer.isInsideFactory) { ((EnemyAI)this).SwitchToBehaviourClientRpc(5); } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: baseSearchingForPlayer(); break; case 5: if (!((EnemyAI)this).creatureVoice.isPlaying) { moaiSoundPlayClientRpc("creatureVoice"); } if (searchStatus.Equals("Searching") && ((EnemyAI)this).isOutside) { baseHeadingToEntrance(); } else if (searchStatus.Equals("Returning") && ((EnemyAI)this).isOutside == mostRecentPlayer.isInsideFactory) { baseHeadingToEntrance(); } else if (currentCommand.Equals("Done") && ((EnemyAI)this).isOutside == mostRecentPlayer.isInsideFactory) { baseHeadingToEntrance(); } else if (currentCommand.Equals("Guard") && ((EnemyAI)this).isOutside == mostRecentPlayer.isInsideFactory) { baseHeadingToEntrance(); } else { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: if (!((EnemyAI)this).creatureVoice.isPlaying) { moaiSoundPlayClientRpc("creatureVoice"); } if (currentCommand.Equals("Done")) { baseGuard(goldMode: true); } else { baseGuard(); } if (currentCommand.Equals("Loot")) { if (((EnemyAI)this).isOutside) { ((EnemyAI)this).SwitchToBehaviourClientRpc(5); } else { ((EnemyAI)this).SwitchToBehaviourClientRpc(6); } } break; case 6: { if (!((EnemyAI)this).creatureVoice.isPlaying) { moaiSoundPlayClientRpc("creatureVoice"); } ((EnemyAI)this).targetPlayer = null; ((EnemyAI)this).agent.speed = 4f * Plugin.moaiGlobalSpeed.Value; if (guardTarget == Vector3.zero) { impatience = 0f; wait = 10f; guardTarget = pickLootSearchNode().transform.position; } ((EnemyAI)this).SetDestinationToPosition(guardTarget, false); float num = Vector3.Distance(((Component)this).transform.position, guardTarget); Vector3 localScale = ((Component)this).transform.localScale; float magnitude = ((Vector3)(ref localScale)).magnitude; localScale = ((Component)this).transform.localScale; if (num < magnitude + ((Vector3)(ref localScale)).magnitude + impatience) { if (wait <= 0f) { guardTarget = Vector3.zero; } else { wait -= 1f; } } else { impatience += 0.25f; } if ((int)((EnemyAI)this).agent.pathStatus == 1 || (int)((EnemyAI)this).agent.pathStatus == 2) { guardTarget = Vector3.zero; } if (impatience == 10f) { guardTarget = Vector3.zero; } if (Object.op_Implicit((Object)(object)getObj()) || corpseAvailable()) { Debug.Log((object)"MOAI: found item to loot"); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); impatience = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(7); break; } if (!((EnemyAI)this).creatureVoice.isPlaying) { moaiSoundPlayClientRpc("creatureVoice"); } if (goodBoy <= 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); moaiSetHaloClientRpc(value: false); } else if (Object.op_Implicit((Object)(object)ClosestEnemyInRange(5f))) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } break; } case 7: { eatingScrap = false; eatingTimer = -1; if (goodBoy <= 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); moaiSetHaloClientRpc(value: false); break; } if (Object.op_Implicit((Object)(object)ClosestEnemyInRange(5f))) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); break; } if (!creatureFood.isPlaying) { moaiSoundPlayClientRpc("creatureFood"); } baseHeadSwingAttackInProgress(transitionOverride: true); GrabbableObject obj = getObj(); PlayerControllerB playerCorpse = getPlayerCorpse(); impatience += 1f; if (impatience > 100f) { unreachableItems.Add(obj); } if (eatingHuman) { searchStatus = "Returning"; ((EnemyAI)this).SwitchToBehaviourClientRpc(5); currentCommand = "Done"; creatureEat.Stop(); creatureEatHuman.Stop(); holdingCorpse = playerCorpse; eatingScrap = false; eatingTimer = -1; impatience = 0f; } else if (eatingScrap) { attachItemClientRpc(((NetworkBehaviour)obj).NetworkObject.NetworkObjectId); searchStatus = "Returning"; ((EnemyAI)this).SwitchToBehaviourClientRpc(5); currentCommand = "Done"; creatureEat.Stop(); creatureEatHuman.Stop(); holdingItem = obj; eatingScrap = false; eatingTimer = -1; impatience = 0f; } break; } case 2: baseStickingInFrontOfEnemy(); break; case 3: baseStickingInFrontOfPlayer(32f); break; case 4: baseHeadSwingAttackInProgress(); break; default: LogDebug("This Behavior State doesn't exist!"); break; } } [ClientRpc] public void attachItemClientRpc(ulong netid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(777105181u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, netid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 777105181u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabbableObject[] array = Object.FindObjectsOfType(); foreach (GrabbableObject val3 in array) { if ((Object)(object)val3 != (Object)null && ((Object)val3).name != null && (Object)(object)((Component)val3).transform != (Object)null && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid) { val3.isHeldByEnemy = true; val3.isHeld = true; val3.hasBeenHeld = true; val3.EnablePhysics(false); ((Component)val3).transform.parent = ((Component)mouth).transform; ((Component)val3).transform.localPosition = new Vector3(0f, 0f, 0f); } } } [ClientRpc] public void detachItemClientRpc(ulong netid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3121421479u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, netid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3121421479u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GrabbableObject[] array = Object.FindObjectsOfType(); foreach (GrabbableObject val3 in array) { if ((Object)(object)val3 != (Object)null && ((Object)val3).name != null && (Object)(object)((Component)val3).transform != (Object)null && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == netid) { Debug.Log((object)("Detaching item from gold moai: " + ((Object)val3).name)); val3.parentObject = null; ((Component)val3).transform.parent = null; val3.EnablePhysics(true); val3.startFallingPosition = ((Component)val3).transform.position; val3.targetFloorPosition = sampleObjFall(val3); val3.DiscardItemFromEnemy(); val3.isHeldByEnemy = false; val3.isHeld = false; } } } [ClientRpc] public void updateToolTipClientRpc(string tip) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1107404285u, val2, (RpcDelivery)0); bool flag = tip != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(tip, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1107404285u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; interactNode.triggerLink.hoverTip = tip; } } public Vector3 sampleObjFall(GrabbableObject objTarget) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) if (!Object.op_Implicit((Object)(object)objTarget)) { return Vector3.zero; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)objTarget).transform.position, ref val, 15f, -1)) { return ((NavMeshHit)(ref val)).position; } return Vector3.zero; } [ClientRpc] public void playUhSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1120784331u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1120784331u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stopAllSound(); creatureUh.Play(); } } } [ClientRpc] public void stopUhSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(458827924u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 458827924u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureUh.Stop(); } } } public GameObject pickLootSearchNode() { Debug.Log((object)"MOAIGUARD: Picking Loot Node"); return ((EnemyAI)this).allAINodes[Random.RandomRangeInt(0, ((EnemyAI)this).allAINodes.Length)]; } public Vector3 generateFleeingPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position - ((Component)((EnemyAI)this).targetPlayer).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((Component)this).transform.position + normalized * 5f; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val2, ref val3, 15f, -1)) { return ((NavMeshHit)(ref val3)).position; } return ((Component)this).transform.position; } public void facePosition(Vector3 pos) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos - ((Component)this).transform.position; val.y = 0f; if (val != Vector3.zero) { Quaternion val2 = Quaternion.LookRotation(val); ((Component)this).transform.rotation = Quaternion.Euler(0f, ((Quaternion)(ref val2)).eulerAngles.y, 0f); } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { base.HitEnemy(force, playerWhoHit, playHitSFX, -1); if (((EnemyAI)this).isEnemyDead) { return; } ((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force; if ((Object)(object)playerWhoHit != (Object)null) { provokePoints += 40 * force; ((EnemyAI)this).targetPlayer = playerWhoHit; } stamina = 60f; recovering = false; if (((NetworkBehaviour)this).IsOwner) { if (((EnemyAI)this).enemyHP <= 0) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); animator.SetInteger("state", 3); ((EnemyAI)this).isEnemyDead = true; moaiSoundPlayClientRpc("creatureDeath"); } else { moaiSoundPlayClientRpc("creatureHit"); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1140894340u, new RpcReceiveHandler(__rpc_handler_1140894340), "stopAllSoundsClientRpc"); ((NetworkBehaviour)this).__registerRpc(777105181u, new RpcReceiveHandler(__rpc_handler_777105181), "attachItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(3121421479u, new RpcReceiveHandler(__rpc_handler_3121421479), "detachItemClientRpc"); ((NetworkBehaviour)this).__registerRpc(1107404285u, new RpcReceiveHandler(__rpc_handler_1107404285), "updateToolTipClientRpc"); ((NetworkBehaviour)this).__registerRpc(1120784331u, new RpcReceiveHandler(__rpc_handler_1120784331), "playUhSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(458827924u, new RpcReceiveHandler(__rpc_handler_458827924), "stopUhSoundClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1140894340(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldEnemyAI)(object)target).stopAllSoundsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_777105181(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong netid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref netid); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldEnemyAI)(object)target).attachItemClientRpc(netid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3121421479(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong netid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref netid); target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldEnemyAI)(object)target).detachItemClientRpc(netid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1107404285(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string tip = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref tip, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldEnemyAI)(object)target).updateToolTipClientRpc(tip); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1120784331(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldEnemyAI)(object)target).playUhSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_458827924(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GoldEnemyAI)(object)target).stopUhSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GoldEnemyAI"; } } internal class GreenEnemyAI : MOAIAICORE { private struct spawnOption { private float chanceToPick; private bool isOutsideObj; private GameObject gameObject; private SpawnableOutsideObject outsideObject; } private new enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance, Constructing, Archery } public AudioSource creatureConstruct; public AudioSource creatureFinish; public GameObject laserPoint1; public GameObject laserPoint2; public LineRenderer lp1r; public LineRenderer lp2r; public Transform laserTarget1; public Transform laserTarget2; public GameObject consumptionCircle; private static GameObject landminePrefab; private static GameObject turretPrefab; public static SpawnableOutsideObject[] mapObjects; public static int[] mapObjectOptions; private int nextObject = 0; private double scan1 = 0.0; private double scan2 = 0.0; private int buildTimer = 0; private int constructionTimeLeft = 0; private float constructImpatience = 0.5f; private string currentlyBuilding = "None"; private Vector3 constructPosition = Vector3.zero; private Quaternion constructRotation; private int constructId = 0; private PlayerControllerB storedTarget = null; private GameObject storedTargetEnemy = null; protected GameObject consumptionCircleMade = null; private int turretsLeft = 2; private int bodiesToMake = 0; private int p_ticksTillFire = 0; private int p_burstTickRate = 0; private int p_burstFire = 0; private int p_awaitBetweenBursts = 0; private int p_alternatePredict = 0; public AudioSource laserFire; public Collider col1; public Collider col2; public List spawnedHazards; public static void getMapObjects() { } public static void findTraps() { RoundManager instance = RoundManager.Instance; SpawnableMapObject[] spawnableMapObjects = instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { if (((Object)val.prefabToSpawn).name.ToLower().Contains("turret")) { turretPrefab = val.prefabToSpawn; } if (((Object)val.prefabToSpawn).name.ToLower().Contains("mine")) { landminePrefab = val.prefabToSpawn; } } } public override void Start() { baseInit(); findTraps(); creatureConstruct.volume = Plugin.moaiGlobalMusicVol.Value; creatureFinish.volume = Plugin.moaiGlobalMusicVol.Value; laserFire.volume = Plugin.moaiGlobalMusicVol.Value; buildTimer = 200; spawnedHazards = new List(); } public override void OnDestroy() { for (int i = 0; i < spawnedHazards.Count; i++) { if (Object.op_Implicit((Object)(object)spawnedHazards[i])) { Object.Destroy((Object)(object)spawnedHazards[i]); } } base.OnDestroy(); } public override void setPitches(float pitchAlter) { AudioSource obj = creatureConstruct; obj.pitch /= pitchAlter; AudioSource obj2 = creatureFinish; obj2.pitch /= pitchAlter; AudioSource obj3 = laserFire; obj3.pitch /= pitchAlter; } public override void Update() { //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); baseUpdate(); if (((EnemyAI)this).isEnemyDead && (creatureConstruct.isPlaying || creatureFinish.isPlaying)) { creatureConstruct.Stop(); creatureFinish.Stop(); } if (((EnemyAI)this).isEnemyDead) { if (laserPoint1.activeInHierarchy) { laserPoint1.SetActive(false); laserPoint2.SetActive(false); } return; } if ((((EnemyAI)this).currentBehaviourStateIndex == 6 || ((EnemyAI)this).currentBehaviourStateIndex == 3 || ((EnemyAI)this).currentBehaviourStateIndex == 2) && !laserPoint1.activeInHierarchy) { laserPoint1.SetActive(true); laserPoint2.SetActive(true); } if (buildTimer > 0 && ((EnemyAI)this).currentBehaviourStateIndex == 0) { if (!laserPoint1.activeInHierarchy) { laserPoint1.SetActive(true); laserPoint2.SetActive(true); } Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor((float)Math.Sin(scan1) * 4f, 0f, Math.Abs((float)Math.Sin(scan2) * 8f) + 4f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor((float)Math.Cos(scan1) * 4f, 0f, Math.Abs((float)Math.Sin(scan2) * 8f) + 4f); Vector3 val3 = ((Component)this).transform.rotation * val; Vector3 val4 = ((Component)this).transform.rotation * val2; laserTarget1.position = ((Component)this).transform.position + val3; laserTarget2.position = ((Component)this).transform.position + val4; scan1 += enemyRandom.NextDouble() * 0.01 + 0.01; scan2 += enemyRandom.NextDouble() * 0.01 + 0.01; } int[] array = new int[4] { 0, 6, 3, 2 }; if (!array.Contains(((EnemyAI)this).currentBehaviourStateIndex) && laserPoint1.activeInHierarchy) { laserPoint1.SetActive(false); laserPoint2.SetActive(false); lp1r.SetPosition(1, new Vector3(0f, 0f, 4f)); lp2r.SetPosition(1, new Vector3(0f, 0f, 4f)); } if (((NetworkBehaviour)RoundManager.Instance).IsHost) { if (((EnemyAI)this).currentBehaviourStateIndex == 3 && (Object)(object)storedTarget != (Object)null) { setLaserFocusClientRpc(((Component)storedTarget).transform.position); facePosition(((Component)storedTarget).transform.position); } if (((EnemyAI)this).currentBehaviourStateIndex == 2 && (Object)(object)storedTargetEnemy != (Object)null) { setLaserFocusClientRpc(storedTargetEnemy.transform.position); facePosition(storedTargetEnemy.transform.position); } if (buildTimer <= 0 && ((EnemyAI)this).currentBehaviourStateIndex == 0 && provokePoints <= 0) { playConstructSoundClientRpc(); constructId = enemyRandom.Next(0, 3); ((EnemyAI)this).SwitchToBehaviourClientRpc(6); pickConstructPosition(); Debug.Log((object)("MOAI GREEN: CONSTRUCT POSITION -> " + ((object)Unsafe.As(ref constructPosition)/*cast due to .constrained prefix*/).ToString())); Debug.Log((object)("MOAI GREEN: TRANSFORM POSITION -> " + ((object)((Component)this).transform.position/*cast due to .constrained prefix*/).ToString())); Debug.Log((object)("MOAI GREEN: OFFSET GENERATED -> " + ((object)(constructPosition - ((Component)this).transform.position)/*cast due to .constrained prefix*/).ToString())); } else if (buildTimer <= 0 && ((EnemyAI)this).currentBehaviourStateIndex == 6) { setLaserFocusClientRpc(constructPosition); } } } public override void playSoundId(string id) { } [ClientRpc] public void stopAllSoundsClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3011569955u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3011569955u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stopAllSound(); creatureConstruct.Stop(); creatureFinish.Stop(); } } } public void firePlasmaProjectile(Vector3 pos, float spread, bool predictPosition, Vector3 targetVelocity) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (predictPosition) { pos = PredictTargetPosition(pos, targetVelocity, 20f); } Vector3 val = pos - ((Component)mouth).transform.position + new Vector3((float)((double)(spread / 2f) - enemyRandom.NextDouble() * (double)spread), spread / 2f - (float)(enemyRandom.NextDouble() * (double)spread), spread / 2f - (float)(enemyRandom.NextDouble() * (double)spread)); Quaternion val2 = Quaternion.identity; if (val != Vector3.zero) { Quaternion val3 = Quaternion.LookRotation(val); val2 = Quaternion.Euler(((Quaternion)(ref val3)).eulerAngles.x, ((Quaternion)(ref val3)).eulerAngles.y, ((Quaternion)(ref val3)).eulerAngles.z); } GameObject val4 = Object.Instantiate(Plugin.plasmaProjectile, mouth.position + ((Component)this).transform.forward * 2f, val2); val4.SetActive(true); val4.GetComponent().Spawn(false); val4.GetComponent().owner = ((Object)this).GetInstanceID(); playLaserFireClientRpc(); Physics.IgnoreCollision(col1, (Collider)(object)val4.GetComponent()); Physics.IgnoreCollision(col2, (Collider)(object)val4.GetComponent()); } [ClientRpc] private void playLaserFireClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2482996465u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2482996465u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; laserFire.Play(); } } } [ClientRpc] private void playConstructFinishClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1958367089u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1958367089u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureConstruct.Stop(); creatureFinish.Play(); } } } [ClientRpc] private void playConstructSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(911361584u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 911361584u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureConstruct.Play(); } } } private Vector3 PredictTargetPosition(Vector3 targetPosition, Vector3 targetVelocity, float projectileSpeed) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector3 val = targetPosition - ((Component)this).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; float num = magnitude / projectileSpeed; return targetPosition + targetVelocity * num; } public override void DoAIInterval() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_0840: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08d2: Unknown result type (might be due to invalid IL or missing references) //IL_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09e7: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)consumptionCircleMade) && bodiesToMake > 0 && enemyRandom.NextDouble() < 0.1) { createDummyClientRpc(consumptionCircleMade.transform.position, MOAIAICORE.bdyInc, enemyRandom.Next(0, 11)); MOAIAICORE.bdyInc++; bodiesToMake--; } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); buildTimer--; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: baseSearchingForPlayer(); setLaserColorClientRpc(1f, 1f, 1f); ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; break; case 6: ((EnemyAI)this).agent.speed = 0f * Plugin.moaiGlobalSpeed.Value; if (currentlyBuilding.Equals("None")) { switch (constructId) { case 0: setLaserColorClientRpc(1f, 0f, 0f); if (turretsLeft > 0) { if (NavMeshSpaceChecker.CanPlacePrefab("Turret", constructPosition)) { currentlyBuilding = "Turret"; constructionTimeLeft = 50; constructImpatience = 0.5f; } else { constructPosition = NavMeshSpaceChecker.GetRandomNavMeshPoint(constructImpatience, constructPosition); constructImpatience += 0.1f; facePosition(constructPosition); } } else { constructId = enemyRandom.Next(0, 3); } break; case 1: setLaserColorClientRpc(1f, 1f, 0f); if (NavMeshSpaceChecker.CanPlacePrefab("Mine", constructPosition)) { currentlyBuilding = "Mine"; constructionTimeLeft = 25; constructImpatience = 0.5f; } else { constructPosition = NavMeshSpaceChecker.GetRandomNavMeshPoint(constructImpatience, constructPosition); constructImpatience += 0.1f; facePosition(constructPosition); } break; case 2: if (!Object.op_Implicit((Object)(object)consumptionCircleMade)) { setLaserColorClientRpc(0f, 0f, 1f); if (NavMeshSpaceChecker.CanPlacePrefab("Circle", constructPosition)) { currentlyBuilding = "Circle"; constructionTimeLeft = 75; constructImpatience = 0.5f; } else { constructPosition = NavMeshSpaceChecker.GetRandomNavMeshPoint(constructImpatience, constructPosition); constructImpatience += 0.1f; facePosition(constructPosition); } } else { constructId = enemyRandom.Next(0, 3); } break; case 3: setLaserColorClientRpc(1f, 0f, 64f / 85f); if (NavMeshSpaceChecker.CanPlacePrefab("MapObject", constructPosition, mapObjects[enemyRandom.Next(0, mapObjects.Length)])) { currentlyBuilding = "MapObject"; constructionTimeLeft = 25; constructImpatience = 0.5f; } else { constructPosition = NavMeshSpaceChecker.GetRandomNavMeshPoint(constructImpatience, constructPosition); constructImpatience += 0.1f; facePosition(constructPosition); } break; } if (constructImpatience >= 20f) { setLaserColorClientRpc(1f, 1f, 1f); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); buildTimer = 100; currentlyBuilding = "None"; creatureConstruct.Stop(); } break; } constructionTimeLeft--; Debug.Log((object)("MOAI GREEN: currently building - " + currentlyBuilding)); if (constructionTimeLeft <= 0) { switch (currentlyBuilding) { case "Turret": spawnTurret(); break; case "Mine": spawnMine(); break; case "Circle": spawnCircle(); break; } setLaserColorClientRpc(1f, 1f, 1f); currentlyBuilding = "None"; buildTimer = 200; playConstructFinishClientRpc(); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } facePosition(constructPosition); break; case 5: baseHeadingToEntrance(); ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; break; case 1: baseGuard(); ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; break; case 2: baseStickingInFrontOfEnemy(); ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; storedTargetEnemy = ((Component)ClosestEnemyInRange(28f)).gameObject; if (!Object.op_Implicit((Object)(object)storedTargetEnemy)) { break; } setLaserColorClientRpc(31f / 85f, 8f / 85f, 28f / 51f); if (Vector3.Distance(((Component)this).transform.position, storedTargetEnemy.transform.position) < 19f) { ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; StalkPos = generateFleeingPosition(); ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } else if (Vector3.Distance(((Component)this).transform.position, storedTargetEnemy.transform.position) < 22f) { ((EnemyAI)this).agent.speed = 0f; } else { ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; } if (p_burstFire <= 0) { p_awaitBetweenBursts = enemyRandom.Next(20, 24); p_burstTickRate = enemyRandom.Next(0, 2); p_burstFire = enemyRandom.Next(3, 11); p_alternatePredict++; } if (p_awaitBetweenBursts <= 0) { p_ticksTillFire--; if (p_ticksTillFire <= 0 && p_burstFire > 0) { firePlasmaProjectile(storedTargetEnemy.transform.position, p_burstFire * 2 - 1, predictPosition: false, Vector3.zero); p_burstFire--; p_ticksTillFire = p_burstTickRate; } } else { p_awaitBetweenBursts--; } ((EnemyAI)this).targetPlayer = null; break; case 3: buildTimer = 0; baseStickingInFrontOfPlayer(32f); setLaserColorClientRpc(31f / 85f, 8f / 85f, 28f / 51f); if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { storedTarget = ((EnemyAI)this).targetPlayer; } else { stamina -= 10f; } if ((Object)(object)storedTarget == (Object)null) { ((EnemyAI)this).targetPlayer = null; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (Vector3.Distance(((Component)this).transform.position, ((Component)storedTarget).transform.position) < 14f) { ((EnemyAI)this).agent.speed = 2f * Plugin.moaiGlobalSpeed.Value; StalkPos = generateFleeingPosition(); ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } else if (Vector3.Distance(((Component)this).transform.position, ((Component)storedTarget).transform.position) < 18f) { ((EnemyAI)this).agent.speed = 0f; } else { ((EnemyAI)this).agent.speed = 4f * Plugin.moaiGlobalSpeed.Value; } if (p_burstFire <= 0) { p_awaitBetweenBursts = enemyRandom.Next(20, 24); p_burstTickRate = enemyRandom.Next(0, 2); p_burstFire = enemyRandom.Next(3, 11); p_alternatePredict++; } if (p_awaitBetweenBursts <= 0) { p_ticksTillFire--; if (p_ticksTillFire <= 0 && p_burstFire > 0) { firePlasmaProjectile(((Component)storedTarget).transform.position, p_burstFire * 2 - 1, predictPosition: true, ((Component)storedTarget).gameObject.GetComponent().velocity); p_burstFire--; p_ticksTillFire = p_burstTickRate; } } else { p_awaitBetweenBursts--; } ((EnemyAI)this).targetPlayer = null; break; case 4: baseHeadSwingAttackInProgress(); ((EnemyAI)this).agent.speed = 4.2f * Plugin.moaiGlobalSpeed.Value; break; default: LogDebug("This Behavior State doesn't exist!"); break; } } public Vector3 generateFleeingPosition() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position - ((Component)((EnemyAI)this).targetPlayer).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((Component)this).transform.position + normalized * 5f; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val2, ref val3, 15f, -1)) { return ((NavMeshHit)(ref val3)).position; } return ((Component)this).transform.position; } public void facePosition(Vector3 pos) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos - ((Component)this).transform.position; val.y = 0f; if (val != Vector3.zero) { Quaternion val2 = Quaternion.LookRotation(val); ((Component)this).transform.rotation = Quaternion.Euler(0f, ((Quaternion)(ref val2)).eulerAngles.y, 0f); } } public unsafe bool pickConstructPosition() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) int num = enemyRandom.Next(0, 2); Vector3 zero = Vector3.zero; zero = ((num != 1) ? laserTarget2.position : laserTarget1.position); NavMeshHit val = default(NavMeshHit); bool flag = NavMesh.SamplePosition(zero, ref val, 20f, -1); if (flag) { constructPosition = ((NavMeshHit)(ref val)).position; constructRotation = Quaternion.FromToRotation(Vector3.up, ((NavMeshHit)(ref val)).normal); Vector3 val2 = constructPosition; Debug.Log((object)("MOAI GREEN: selected position -> " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString())); } else { Vector3 val2 = constructPosition; Debug.Log((object)("MOAI GREEN: construct position select fail. position is still -> " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString())); } return flag; } [ClientRpc] public void setLaserColorClientRpc(float r, float g, float b) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1512900675u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref r, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref g, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref b, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1512900675u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((Renderer)((Component)lp1r).GetComponent()).material.SetColor("_EmissiveColor", new Color(r, g, b, 1f) * 150f); ((Renderer)((Component)lp2r).GetComponent()).material.SetColor("_EmissiveColor", new Color(r, g, b, 1f) * 150f); } } } [ClientRpc] public void setLaserFocusClientRpc(Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(862051090u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 862051090u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; laserTarget1.position = pos; laserTarget2.position = pos; } } } public void spawnMine() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) RoundManager instance = RoundManager.Instance; GameObject val = Object.Instantiate(landminePrefab, constructPosition, constructRotation); val.GetComponent().Spawn(true); Debug.Log((object)("MOAI GREEN: Spawned Mine at: " + ((object)Unsafe.As(ref constructPosition)/*cast due to .constrained prefix*/).ToString())); spawnedHazards.Add(val); } public void spawnTurret() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) turretsLeft--; RoundManager instance = RoundManager.Instance; GameObject val = Object.Instantiate(turretPrefab, constructPosition, constructRotation); val.GetComponent().Spawn(true); Debug.Log((object)("MOAI GREEN: Spawned Turret at: " + ((object)Unsafe.As(ref constructPosition)/*cast due to .constrained prefix*/).ToString())); spawnedHazards.Add(val); } public void spawnCircle() { //IL_0028: 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) if ((Object)(object)consumptionCircleMade == (Object)null && ((NetworkBehaviour)RoundManager.Instance).IsHost) { consumptionCircleMade = Object.Instantiate(Plugin.consumptionCircle, constructPosition, constructRotation); consumptionCircleMade.GetComponent().Spawn(true); bodiesToMake = enemyRandom.Next(3, 15); Debug.Log((object)("MOAI GREEN: Spawned Circle at: " + ((object)Unsafe.As(ref constructPosition)/*cast due to .constrained prefix*/).ToString())); spawnedHazards.Add(consumptionCircleMade); } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_00c7: 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) base.HitEnemy(force, playerWhoHit, playHitSFX, -1); if (((EnemyAI)this).isEnemyDead) { ((EnemyAI)this).agent.speed = 4f; stopAllSound(); stopAllSoundsClientRpc(); } else if ((Object)(object)playerWhoHit != (Object)null && ((EnemyAI)this).currentBehaviourStateIndex != 3) { stopAllSound(); stopAllSoundsClientRpc(); provokePoints += 5 * force; stamina = 60f; recovering = false; buildTimer = 100; ((EnemyAI)this).targetPlayer = playerWhoHit; storedTarget = ((EnemyAI)this).targetPlayer; constructionTimeLeft = 0; constructImpatience = 0.5f; currentlyBuilding = "None"; constructPosition = Vector3.zero; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); p_awaitBetweenBursts = enemyRandom.Next(10, 16); p_burstTickRate = enemyRandom.Next(0, 2); p_burstFire = enemyRandom.Next(3, 11); p_alternatePredict++; ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3011569955u, new RpcReceiveHandler(__rpc_handler_3011569955), "stopAllSoundsClientRpc"); ((NetworkBehaviour)this).__registerRpc(2482996465u, new RpcReceiveHandler(__rpc_handler_2482996465), "playLaserFireClientRpc"); ((NetworkBehaviour)this).__registerRpc(1958367089u, new RpcReceiveHandler(__rpc_handler_1958367089), "playConstructFinishClientRpc"); ((NetworkBehaviour)this).__registerRpc(911361584u, new RpcReceiveHandler(__rpc_handler_911361584), "playConstructSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(1512900675u, new RpcReceiveHandler(__rpc_handler_1512900675), "setLaserColorClientRpc"); ((NetworkBehaviour)this).__registerRpc(862051090u, new RpcReceiveHandler(__rpc_handler_862051090), "setLaserFocusClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3011569955(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GreenEnemyAI)(object)target).stopAllSoundsClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2482996465(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GreenEnemyAI)(object)target).playLaserFireClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1958367089(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GreenEnemyAI)(object)target).playConstructFinishClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_911361584(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((GreenEnemyAI)(object)target).playConstructSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1512900675(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float r = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref r, default(ForPrimitives)); float g = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref g, default(ForPrimitives)); float b = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref b, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((GreenEnemyAI)(object)target).setLaserColorClientRpc(r, g, b); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_862051090(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 laserFocusClientRpc = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref laserFocusClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((GreenEnemyAI)(object)target).setLaserFocusClientRpc(laserFocusClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "GreenEnemyAI"; } } public class PlasmaBall : NetworkBehaviour { public Gradient ballColor; public Gradient trailColor; public float speed; [Range(0f, 10f)] public float moveDelay; public GameObject explosionEffect; private bool canMove = false; private Animator anim; private List ballPS; private List trailPS; private float creationTime = -1f; private float explosionTime = -1f; public AudioSource laserHit; private List explosions; public int owner; private void Start() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) GetRequiredComponents(); SetParticleColors(); if ((Object)(object)anim != (Object)null) { anim.SetFloat("speedMultiplier", speed); } ((MonoBehaviour)this).Invoke("MovementStatus", moveDelay); laserHit.volume = Plugin.moaiGlobalMusicVol.Value; creationTime = Time.time; explosions = new List(); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { ((Component)this).GetComponent().velocity = ((Component)this).transform.forward * speed; } } private void FixedUpdate() { if (((NetworkBehaviour)RoundManager.Instance).IsHost && ((explosionTime != -1f && Time.time - explosionTime > 3f) || Time.time - creationTime > 30f)) { for (int i = 0; i < explosions.Count; i++) { Object.Destroy((Object)(object)explosions[i]); } Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnCollisionEnter(Collision collision) { if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } GameObject gameObject = collision.gameObject; if (Object.op_Implicit((Object)(object)collision.gameObject)) { spawnExplosionClientRpc(); EnemyAI val = enemyParentWalk(gameObject); if (Object.op_Implicit((Object)(object)val) && ((Object)val).GetInstanceID() != owner) { val.HitEnemy(1, (PlayerControllerB)null, true, -1); } PlayerControllerB val2 = playerParentWalk(gameObject); if (Object.op_Implicit((Object)(object)val2)) { dmgPlayerClientRpc(((NetworkBehaviour)val2).NetworkObjectId); } } else if (Object.op_Implicit((Object)(object)collision.collider)) { spawnExplosionClientRpc(); } } [ClientRpc] private void dmgPlayerClientRpc(ulong nid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4094462944u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, nid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4094462944u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (((NetworkBehaviour)val3).NetworkObjectId == nid) { val3.DamagePlayer(20, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } } [ClientRpc] private void spawnExplosionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2247435036u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2247435036u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; canMove = false; explosionTime = Time.time; GameObject val3 = Object.Instantiate(explosionEffect); val3.transform.position = ((Component)this).transform.position; if (((NetworkBehaviour)RoundManager.Instance).IsHost) { explosions.Add(val3); } laserHit.Play(); } } public PlayerControllerB playerParentWalk(GameObject leaf) { while ((Object)(object)leaf != (Object)null && (Object)(object)leaf.GetComponent() == (Object)null) { leaf = ((!Object.op_Implicit((Object)(object)leaf.transform.parent) || !Object.op_Implicit((Object)(object)((Component)leaf.transform.parent).gameObject)) ? null : ((Component)leaf.transform.parent).gameObject); } if (Object.op_Implicit((Object)(object)leaf) && Object.op_Implicit((Object)(object)leaf.GetComponent())) { return leaf.GetComponent(); } return null; } public EnemyAI enemyParentWalk(GameObject leaf) { while ((Object)(object)leaf != (Object)null && (Object)(object)leaf.GetComponent() == (Object)null) { leaf = ((!Object.op_Implicit((Object)(object)leaf.transform.parent) || !Object.op_Implicit((Object)(object)((Component)leaf.transform.parent).gameObject)) ? null : ((Component)leaf.transform.parent).gameObject); } if (Object.op_Implicit((Object)(object)leaf) && Object.op_Implicit((Object)(object)leaf.GetComponent())) { return leaf.GetComponent(); } return null; } private void GetRequiredComponents() { ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); anim = ((Component)this).GetComponentInChildren(); if (componentsInChildren == null) { Debug.LogError((object)("Missing Particle System: No Particle System was found inside" + ((object)((Component)this).gameObject).ToString())); return; } ballPS = new List(); trailPS = new List(); for (int i = 0; i < componentsInChildren.Length; i++) { if (((Object)((Component)componentsInChildren[i]).gameObject).name == "Ball") { ballPS.Add(componentsInChildren[i]); } else if (((Object)((Component)componentsInChildren[i]).gameObject).name == "Trail") { trailPS.Add(componentsInChildren[i]); } } } private void SetParticleColors() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0062: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < ballPS.Count; i++) { ColorOverLifetimeModule colorOverLifetime = ballPS[i].colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(ballColor); } for (int j = 0; j < trailPS.Count; j++) { ColorOverLifetimeModule colorOverLifetime2 = trailPS[j].colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = new MinMaxGradient(trailColor); } } private void MovementStatus() { canMove = true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4094462944u, new RpcReceiveHandler(__rpc_handler_4094462944), "dmgPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(2247435036u, new RpcReceiveHandler(__rpc_handler_2247435036), "spawnExplosionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_4094462944(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong nid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref nid); target.__rpc_exec_stage = (__RpcExecStage)1; ((PlasmaBall)(object)target).dmgPlayerClientRpc(nid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2247435036(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PlasmaBall)(object)target).spawnExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PlasmaBall"; } } internal class EngineAudioController : NetworkBehaviour { public MoaiEnemyAI moai; public AudioSource runningSound; public float runningMinVolume = 0.3f; public float runningMaxVolume = 1f; public float runningMaxPitch = 3f; public float runningMinPitch = 0.3f; public AudioSource idleSound; public float idleMinVolume = 0.1f; public float idleMaxVolume = 1f; public float idleMaxPitch = 3f; private void Start() { } private void Update() { if (Object.op_Implicit((Object)(object)moai.vehicleController.currentlyRiding)) { if (!runningSound.isPlaying) { runningSound.Play(); } if (!idleSound.isPlaying) { idleSound.Play(); } moai.speedRatio = getSpeedRatio(); idleSound.volume = Mathf.Lerp(idleMinVolume, idleMaxVolume, moai.speedRatio) * Plugin.moaiGlobalMusicVol.Value; runningSound.volume = Mathf.Lerp(runningMinVolume, runningMaxVolume, moai.speedRatio) * Plugin.moaiGlobalMusicVol.Value; runningSound.pitch = Mathf.Lerp(runningSound.pitch, Mathf.Lerp(runningMinPitch, runningMaxPitch, moai.speedRatio), Time.deltaTime); } else { if (runningSound.isPlaying) { runningSound.Stop(); } if (idleSound.isPlaying) { idleSound.Stop(); } } } public float getSpeedRatio() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) VehicleInteract vehicleController = moai.vehicleController; double num = Math.Clamp((vehicleController.currentlyRiding.moveInputVector * 5f).y, 0.5, 1.0); return (float)((double)moai.speedClamped * num / (double)moai.vehicleMaxSpeed); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } protected internal override string __getTypeName() { return "EngineAudioController"; } } internal abstract class MOAIAICORE : EnemyAI { public enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance } protected Animator animator; protected float ticksTillThunder = 5f; public int goodBoy = -1; protected Vector3 guardTarget = Vector3.zero; protected float impatience = 0f; protected float wait = 20f; protected EntranceTeleport nearestEntrance = null; public Vector3 nearestEntranceNavPosition = Vector3.zero; protected PlayerControllerB mostRecentPlayer = null; protected int entranceDelay = 0; protected float chanceToLocateEntrancePlayerBonus = 0f; protected float chanceToLocateEntrance = 0f; protected GrabbableObject[] source; public List unreachableItems = new List(); public List unreachableEnemies = new List(); public Vector3 itemNavmeshPosition = Vector3.zero; protected static List dummyBodies = new List(); protected static List targetedBodies = new List(); protected static int bdyInc = 0; protected int sourcecycle = 75; public AudioSource creatureFood; public AudioSource creatureEat; public AudioSource creatureEatHuman; public AudioSource creatureHit; public AudioSource creatureDeath; public AudioSource creatureBelch; public AudioSource slidingBasic; public AudioSource slidingWood; public AudioSource slidingSnow; public AudioSource slidingMetal; public AudioSource slidingGravel; public AudioSource creatureDig; public bool isSliding = false; public Transform mouth; protected bool eatingScrap = false; protected bool eatingHuman = false; protected int eatingTimer = -1; protected float stamina = 0f; protected bool recovering = false; public int provokePoints = 0; public Transform turnCompass; public Transform attackArea; protected float timeSinceHittingLocalPlayer; protected float timeSinceNewRandPos; protected Vector3 positionRandomness; protected Vector3 StalkPos; protected Random enemyRandom; protected bool isDeadAnimationDone; public void LogDebug(string text) { Plugin.Logger.LogInfo((object)text); } public void LogProduction(string text) { Plugin.Logger.LogInfo((object)text); } public virtual void setPitches(float pitchAlter) { } public void destroyAllDummies() { for (int i = 0; i < dummyBodies.Count; i++) { destroyDummyClientRpc(getDummyId(dummyBodies[i])); } dummyBodies.Clear(); } public override void OnDestroy() { destroyAllDummies(); ((EnemyAI)this).OnDestroy(); } public void setHalo(bool active) { Transform val = ((Component)this).transform.Find("Halo"); if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.SetActive(active); } else { Debug.LogError((object)"MOAI: failed to find Halo!"); } } public PlayerControllerB moaiGetNearestPlayer() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; PlayerControllerB result = null; float num = 1E+09f; foreach (PlayerControllerB val in allPlayerScripts) { if (Object.op_Implicit((Object)(object)val) && !val.isPlayerDead && val.isPlayerControlled && Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) < num) { num = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); result = val; } } return result; } public void baseInit() { //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) source = Object.FindObjectsOfType(); EntityWarp.mapEntrances = Object.FindObjectsOfType(false); mostRecentPlayer = moaiGetNearestPlayer(); animator = ((Component)this).gameObject.GetComponent(); if (enemyRandom == null) { enemyRandom = new Random(); } ((EnemyAI)this).Start(); if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(0); } else { ((Behaviour)animator).enabled = false; } if (Random.Range(0f, 1f) < Plugin.moaiAngelChance.Value) { goodBoy = Random.RandomRangeInt(0, 7000); base.enemyHP += 4; moaiSetHaloClientRpc(value: true); } else { moaiSetHaloClientRpc(value: false); } if (((NetworkBehaviour)RoundManager.Instance).IsHost && Random.Range(0f, 1f) <= Plugin.moaiGlobalSizeVar.Value) { float num = 1f; num = ((!(Random.Range(0f, 1f) < 0.5f)) ? (1f + Random.Range(0f, 5f)) : (1f - Random.Range(0f, 0.95f))); if (num > Plugin.moaiSizeCap.Value) { num = Plugin.moaiSizeCap.Value; } if (num < 1f) { double x = num; setSizeClientRpc(num, (float)Math.Pow(x, 0.3)); } else { setSizeClientRpc(num, num); } } base.creatureVoice.volume = Plugin.moaiGlobalMusicVol.Value; base.creatureSFX.volume = Plugin.moaiGlobalMusicVol.Value / 1.3f; creatureFood.volume = Plugin.moaiGlobalMusicVol.Value; creatureEat.volume = Plugin.moaiGlobalMusicVol.Value; creatureDeath.volume = Plugin.moaiGlobalMusicVol.Value; creatureHit.volume = Plugin.moaiGlobalMusicVol.Value; creatureEatHuman.volume = Plugin.moaiGlobalMusicVol.Value; creatureBelch.volume = Plugin.moaiGlobalMusicVol.Value; slidingBasic.volume = Plugin.moaiGlobalMusicVol.Value; slidingGravel.volume = Plugin.moaiGlobalMusicVol.Value; slidingMetal.volume = Plugin.moaiGlobalMusicVol.Value; slidingSnow.volume = Plugin.moaiGlobalMusicVol.Value; slidingWood.volume = Plugin.moaiGlobalMusicVol.Value / 1.3f; timeSinceHittingLocalPlayer = 0f; timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); moaiSoundPlayClientRpc("creatureBelch"); moaiSoundPlayClientRpc("creatureVoice"); } public void baseUpdate() { //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_022d: 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) if (base.isEnemyDead && base.enemyHP > 0) { animator.speed = 1f; ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); animator.SetInteger("state", 3); base.isEnemyDead = true; base.enemyHP = 0; moaiSoundPlayClientRpc("creatureDeath"); } if (base.isEnemyDead) { if (!isDeadAnimationDone) { animator.speed = 1f; isDeadAnimationDone = true; stopAllSound(); base.creatureVoice.PlayOneShot(base.dieSFX); } return; } if ((Object)(object)base.targetPlayer != (Object)null && base.targetPlayer.isPlayerDead) { base.targetPlayer = null; } base.movingTowardsTargetPlayer = (Object)(object)base.targetPlayer != (Object)null; timeSinceHittingLocalPlayer += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; if ((Object)(object)base.targetPlayer != (Object)null && ((EnemyAI)this).PlayerIsTargetable(base.targetPlayer, false, false, true)) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); } if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; } if (base.isEnemyDead) { return; } if (eatingTimer > 0) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(2); } animator.speed = 1.5f; return; } Vector3 velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude > base.agent.speed / 4f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(1); } Animator obj = animator; velocity = base.agent.velocity; obj.speed = ((Vector3)(ref velocity)).magnitude / 3f; return; } velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude <= base.agent.speed / 4f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(0); } animator.speed = 1f; } } public void baseAIInterval() { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) goodBoy--; if (provokePoints > 0) { goodBoy = 0; provokePoints--; } if (entranceDelay > 0) { entranceDelay--; } slidingSoundTickClientRpc(); if (sourcecycle > 0) { sourcecycle--; } else { source = Object.FindObjectsOfType(); sourcecycle = 75; unreachableItems.Clear(); unreachableEnemies.Clear(); } if (stamina <= 0f) { recovering = true; } else if (stamina > 60f) { recovering = false; } if (sourcecycle % 5 == 0) { EntityWarp.entrancePack entrancePack = EntityWarp.findNearestEntrance((EnemyAI)(object)this); nearestEntrance = entrancePack.tele; nearestEntranceNavPosition = entrancePack.navPosition; if (stamina < 120f) { stamina += 3f; } if (base.currentBehaviourStateIndex == 1 || base.currentBehaviourStateIndex == 2) { mostRecentPlayer = moaiGetNearestPlayer(); } } if (((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf && goodBoy <= 0) { moaiSetHaloClientRpc(value: false); } if ((Object)(object)base.targetPlayer != (Object)null) { mostRecentPlayer = base.targetPlayer; } } public void baseSearchingForPlayer() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) base.agent.speed = 3f * Plugin.moaiGlobalSpeed.Value; if (!base.creatureVoice.isPlaying) { moaiSoundPlayClientRpc("creatureVoice"); moaiSoundPlayClientRpc("creatureBelch"); } if (goodBoy > 0) { ((EnemyAI)this).StopSearch(base.currentSearch, true); guardTarget = Vector3.zero; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); moaiSetHaloClientRpc(value: true); return; } updateEntranceChance(); if (enemyRandom.NextDouble() < (double)chanceToLocateEntrance && ((Component)this).gameObject.transform.localScale.x <= 2.2f) { Debug.Log((object)"MOAI: entrance state switch"); ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(5); } if (FoundClosestPlayerInRange(28f, needLineOfSight: true) || provokePoints > 0) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(3); return; } if (Object.op_Implicit((Object)(object)getObj()) && !unreachableItems.Contains(getObj())) { ((EnemyAI)this).SwitchToBehaviourClientRpc(4); } if (corpseAvailable()) { ((EnemyAI)this).SwitchToBehaviourClientRpc(4); } } public void baseHeadingToEntrance() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Invalid comparison between Unknown and I4 //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) base.targetPlayer = null; ((EnemyAI)this).SetDestinationToPosition(nearestEntranceNavPosition, false); if (base.isOutside != nearestEntrance.isEntranceToBuilding || (int)base.agent.pathStatus == 1) { if (goodBoy <= 0) { entranceDelay = 150; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { entranceDelay = 20; ((EnemyAI)this).StopSearch(base.currentSearch, true); guardTarget = Vector3.zero; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } if ((double)Vector3.Distance(((Component)this).transform.position, nearestEntranceNavPosition) < 2.0 + (double)((Component)this).gameObject.transform.localScale.x) { if (nearestEntrance.isEntranceToBuilding) { Debug.Log((object)"MOAI: Warp in"); EntityWarp.SendEnemyInside((EnemyAI)(object)this); nearestEntrance.PlayAudioAtTeleportPositions(); } else { Debug.Log((object)"MOAI: Warp out"); EntityWarp.SendEnemyOutside((EnemyAI)(object)this); nearestEntrance.PlayAudioAtTeleportPositions(); } if (goodBoy <= 0) { entranceDelay = 150; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { entranceDelay = 20; ((EnemyAI)this).StopSearch(base.currentSearch, true); guardTarget = Vector3.zero; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } if (provokePoints > 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } public void baseGuard(bool goldMode = false) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Invalid comparison between Unknown and I4 //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Invalid comparison between Unknown and I4 //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) base.targetPlayer = null; base.agent.speed = 4f * Plugin.moaiGlobalSpeed.Value; if (guardTarget == Vector3.zero) { impatience = 0f; wait = 20f; guardTarget = pickGuardNode(); } ((EnemyAI)this).SetDestinationToPosition(guardTarget, false); float num = Vector3.Distance(((Component)this).transform.position, guardTarget); Vector3 localScale = ((Component)this).transform.localScale; float magnitude = ((Vector3)(ref localScale)).magnitude; localScale = ((Component)this).transform.localScale; if (num < magnitude + ((Vector3)(ref localScale)).magnitude + impatience) { if (wait <= 0f) { guardTarget = Vector3.zero; } else { wait -= 1f; } } else { impatience += 0.1f; } if ((int)base.agent.pathStatus == 1 || (int)base.agent.pathStatus == 2) { guardTarget = Vector3.zero; } if (impatience == 10f) { guardTarget = Vector3.zero; } if (Object.op_Implicit((Object)(object)mostRecentPlayer) && mostRecentPlayer.isInsideFactory == base.isOutside && (goldMode || entranceDelay <= 0)) { Debug.Log((object)"MOAI: entrance state switch"); ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(5); } if (!base.creatureVoice.isPlaying && !goldMode) { moaiSoundPlayClientRpc("creatureVoice"); } if (goodBoy <= 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); moaiSetHaloClientRpc(value: false); } if (Object.op_Implicit((Object)(object)ClosestEnemyInRange(28f)) && !goldMode) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } } public void baseStickingInFrontOfEnemy(float maxRange = 28f) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Invalid comparison between Unknown and I4 //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) base.targetPlayer = null; base.agent.speed = 7f * Plugin.moaiGlobalSpeed.Value; EnemyAI val = ClosestEnemyInRange(maxRange); stamina -= 1.5f; if (!base.creatureSFX.isPlaying) { moaiSoundPlayClientRpc("creatureSFX"); } if ((int)base.agent.pathStatus == 1 || (int)base.agent.pathStatus == 2) { unreachableEnemies.Add(val); } if (goodBoy <= 0) { moaiSetHaloClientRpc(value: false); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (!Object.op_Implicit((Object)(object)val)) { ((EnemyAI)this).StopSearch(base.currentSearch, true); guardTarget = Vector3.zero; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } else { StalkPos = ((Component)val).transform.position; ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } public void baseStickingInFrontOfPlayer(float maxRange = 22f) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) base.agent.speed = 5.3f * Plugin.moaiGlobalSpeed.Value; updateEntranceChance(); stamina -= 1.5f; if (!base.creatureSFX.isPlaying) { moaiSoundPlayClientRpc("creatureSFX"); } if (goodBoy > 0) { ((EnemyAI)this).StopSearch(base.currentSearch, true); guardTarget = Vector3.zero; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); moaiSetHaloClientRpc(value: true); } if (!FoundClosestPlayerInRange(maxRange, needLineOfSight: false) && !FoundClosestPlayerInRange(maxRange + 6f, needLineOfSight: true) && provokePoints <= 0) { base.targetPlayer = null; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { StickingInFrontOfPlayer(); } } public Vector3 objNavPos(GrabbableObject objTarget) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) if (!Object.op_Implicit((Object)(object)objTarget)) { return Vector3.zero; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)objTarget).transform.position, ref val, 5f, -1)) { return ((NavMeshHit)(ref val)).position; } return Vector3.zero; } public void baseHeadSwingAttackInProgress(bool transitionOverride = false) { //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Invalid comparison between Unknown and I4 //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Invalid comparison between Unknown and I4 //IL_02fd: 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_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0406: 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_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_060e: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) if (!eatingHuman && !eatingScrap) { if (!creatureFood.isPlaying) { moaiSoundPlayClientRpc("creatureFood"); } } else { if (!creatureEat.isPlaying && eatingScrap) { moaiSoundPlayClientRpc("creatureEat"); } if (!creatureEatHuman.isPlaying && eatingHuman) { moaiSoundPlayClientRpc("creatureEatHuman"); } if (eatingTimer > 0) { eatingTimer--; } else if (eatingTimer == 0) { GrabbableObject obj = getObj(); if (Object.op_Implicit((Object)(object)obj)) { goodBoy = (int)Math.Pow((double)obj.scrapValue * 1.5, 1.8); base.enemyHP += obj.scrapValue / 10; if (((Object)((Component)obj).gameObject).name.ToLower().Contains("redlocust")) { RedLocustBees[] array = Object.FindObjectsOfType(); RedLocustBees[] array2 = array; foreach (RedLocustBees val in array2) { if (((NetworkBehaviour)val.hive).NetworkObjectId == ((NetworkBehaviour)obj).NetworkObjectId) { ((NetworkBehaviour)val).OnNetworkDespawn(); Object.Destroy((Object)(object)((Component)val).gameObject); } } } ((NetworkBehaviour)obj).OnNetworkDespawn(); Object.Destroy((Object)(object)((NetworkBehaviour)obj).NetworkObject); Object.Destroy((Object)(object)obj.propBody); Object.Destroy((Object)(object)((Component)obj).gameObject); Object.Destroy((Object)(object)obj); } PlayerControllerB playerCorpse = getPlayerCorpse(); if (Object.op_Implicit((Object)(object)playerCorpse)) { if (enemyRandom.NextDouble() < 0.5 * (double)Plugin.soulRarity.Value) { respawnEvent(); } destroyBodyClientRpc(((NetworkBehaviour)playerCorpse).NetworkObject.NetworkObjectId); } DeadBodyInfo dummyCorpse = getDummyCorpse(); if (Object.op_Implicit((Object)(object)dummyCorpse)) { if (enemyRandom.NextDouble() < 0.1 * (double)Plugin.soulRarity.Value) { respawnEvent(); } destroyDummyClientRpc(getDummyId(dummyCorpse)); moaiSoundPlayClientRpc("stopEatHuman"); } } } GrabbableObject obj2 = getObj(); PlayerControllerB playerCorpse2 = getPlayerCorpse(); DeadBodyInfo dummyCorpse2 = getDummyCorpse(); if ((int)base.agent.pathStatus == 1 || (int)base.agent.pathStatus == 2) { unreachableItems.Add(obj2); eatingHuman = false; eatingScrap = false; eatingTimer = -1; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); return; } Vector3 localScale; if (((Object)(object)obj2 == (Object)null && (Object)(object)playerCorpse2 == (Object)null && (Object)(object)dummyCorpse2 == (Object)null) || (!transitionOverride && goodBoy > 0) || provokePoints > 0) { eatingHuman = false; eatingScrap = false; eatingTimer = -1; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else if (Object.op_Implicit((Object)(object)playerCorpse2)) { base.targetPlayer = null; base.targetNode = ((Component)playerCorpse2.deadBody).transform; ((EnemyAI)this).SetDestinationToPosition(((Component)playerCorpse2.deadBody).transform.position, false); float num = Vector3.Distance(((Component)this).transform.position, ((Component)playerCorpse2.deadBody).transform.position); localScale = ((Component)playerCorpse2.deadBody).transform.localScale; float magnitude = ((Vector3)(ref localScale)).magnitude; localScale = ((Component)this).transform.localScale; if (num < magnitude + ((Vector3)(ref localScale)).magnitude) { if (!eatingHuman) { Debug.Log((object)"MOAI: Attaching Body to Mouth"); if (eatingTimer <= 0) { eatingTimer = 150; } attachBodyClientRpc(((NetworkBehaviour)playerCorpse2).NetworkObject.NetworkObjectId); moaiSoundPlayClientRpc("creatureEatHuman"); } eatingHuman = true; } else { eatingHuman = false; } } else if (Object.op_Implicit((Object)(object)dummyCorpse2)) { base.targetPlayer = null; base.targetNode = ((Component)dummyCorpse2).transform; base.agent.speed = Math.Min(8f * Plugin.moaiGlobalSpeed.Value, base.agent.speed); ((EnemyAI)this).SetDestinationToPosition(((Component)dummyCorpse2).transform.position, false); float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)dummyCorpse2).transform.position); localScale = ((Component)dummyCorpse2).transform.localScale; float magnitude2 = ((Vector3)(ref localScale)).magnitude; localScale = ((Component)this).transform.localScale; if (num2 < magnitude2 + ((Vector3)(ref localScale)).magnitude) { if (!eatingHuman) { Debug.Log((object)"MOAI: Attaching Dummy to Mouth"); if (eatingTimer <= 0) { eatingTimer = 150; } attachDummyClientRpc(getDummyId(dummyCorpse2)); moaiSoundPlayClientRpc("creatureEatHuman"); } eatingHuman = true; } else { eatingHuman = false; } } else if (Object.op_Implicit((Object)(object)obj2)) { base.targetPlayer = null; base.targetNode = ((Component)obj2).transform; Vector3 val2 = objNavPos(obj2); ((EnemyAI)this).SetDestinationToPosition(val2, false); float num3 = Vector3.Distance(((Component)this).transform.position, val2); localScale = ((Component)obj2).transform.localScale; float magnitude3 = ((Vector3)(ref localScale)).magnitude; localScale = ((Component)this).transform.localScale; if (num3 < magnitude3 + ((Vector3)(ref localScale)).magnitude) { if (((NetworkBehaviour)obj2).IsLocalPlayer) { if (!eatingHuman) { Debug.Log((object)"MOAI: Attaching Body to Mouth"); eatingTimer = 150; attachBodyClientRpc(((NetworkBehaviour)playerCorpse2).NetworkObject.NetworkObjectId); moaiSoundPlayClientRpc("creatureEatHuman"); } eatingHuman = true; } else if (!eatingScrap) { eatingTimer = (int)((double)obj2.scrapValue / 1.8) + 15; moaiSoundPlayClientRpc("creatureEat"); } eatingScrap = true; } else { eatingScrap = false; } } if (!eatingHuman && !eatingScrap) { eatingTimer = -1; } } public void updateEntranceChance() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)nearestEntrance)) { return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)nearestEntrance).transform.position); chanceToLocateEntrancePlayerBonus = 1f; if (Object.op_Implicit((Object)(object)mostRecentPlayer)) { if (Object.op_Implicit((Object)(object)mostRecentPlayer) == base.isOutside) { chanceToLocateEntrancePlayerBonus = 1f; } else { chanceToLocateEntrancePlayerBonus = 1.5f; } } int num2 = 1; if (num < 20f) { num2 = 4; } if (num < 15f) { num2 = 6; } if (num < 10f) { num2 = 7; } if (num < 5f) { num2 = 10; } if (Object.op_Implicit((Object)(object)nearestEntrance)) { chanceToLocateEntrance = (float)(1.0 / Math.Pow(num, 2.0)) * (float)num2 * chanceToLocateEntrancePlayerBonus - (float)entranceDelay; } } public bool corpseAvailable() { return Object.op_Implicit((Object)(object)getPlayerCorpse()) || Object.op_Implicit((Object)(object)getDummyCorpse()); } public DeadBodyInfo getDummyCorpse() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) try { List list = new List(); for (int i = 0; i < dummyBodies.Count; i++) { GameObject gameObject = ((Component)dummyBodies[i]).gameObject; float num = 1000f; if ((Object)(object)gameObject != (Object)null && gameObject.activeInHierarchy && (Object)(object)gameObject.transform != (Object)null) { num = Vector3.Distance(((Component)this).transform.position, gameObject.transform.position); } if (num < 200f) { list.Add(dummyBodies[i]); } } if (list.Count > 0) { for (int j = 0; j < list.Count; j++) { if (targetedBodies[j] == -1 || targetedBodies[j] == ((Object)this).GetInstanceID()) { targetedBodies[j] = ((Object)this).GetInstanceID(); return list[j]; } } return list[enemyRandom.Next(0, list.Count)]; } } catch (Exception) { Debug.Log((object)"MOAI: Exception searching for dummy body. Not an error."); } return null; } public PlayerControllerB getPlayerCorpse() { //IL_0082: 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) for (int i = 0; i < RoundManager.Instance.playersManager.allPlayerScripts.Length; i++) { PlayerControllerB val = RoundManager.Instance.playersManager.allPlayerScripts[i]; if ((Object)(object)val != (Object)null && ((Object)val).name != null && (Object)(object)((Component)val).transform != (Object)null) { float num = 1000f; if ((Object)(object)val.deadBody != (Object)null && ((Behaviour)val.deadBody).isActiveAndEnabled && !val.deadBody.isInShip) { num = Vector3.Distance(((Component)this).transform.position, ((Component)val.deadBody).transform.position); } if (num < 20f && (Object)(object)val.deadBody != (Object)null && ((Behaviour)val.deadBody).isActiveAndEnabled && !val.deadBody.isInShip) { return val; } } } return null; } public GrabbableObject getObj() { //IL_0058: 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_014c: 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) if (!Plugin.moaiConsumeScrap.Value && !((Object)((Component)this).gameObject).name.ToLower().Contains("gold")) { return null; } List list = new List(); try { for (int i = 0; i < source.Length; i++) { GrabbableObject val = source[i]; if (Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) < 20f && !val.heldByPlayerOnServer && !val.isInShipRoom && !unreachableItems.Contains(val) && !((Object)val).name.ToLower().Contains("gold") && !((Object)val).name.ToLower().Contains("quantum") && !((Object)val).name.ToLower().Contains("shotgun")) { list.Add(val); } } if (list.Count > 0) { float num = 0f; GrabbableObject result = list[0]; for (int j = 0; j < list.Count; j++) { float num2 = 1f / Vector3.Distance(((Component)this).transform.position, ((Component)list[j]).transform.position) * (float)list[j].scrapValue; if (num2 > num) { result = list[j]; num = num2; } } return result; } } catch (IndexOutOfRangeException) { source = Object.FindObjectsOfType(); } catch (NullReferenceException) { return null; } return null; } public Vector3 pickGuardNode() { //IL_003d: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) List list = new List(); GameObject[] allAINodes = base.allAINodes; foreach (GameObject val in allAINodes) { for (int j = 0; j < StartOfRound.Instance.allPlayerScripts.Length; j++) { Vector3 position = ((Component)StartOfRound.Instance.allPlayerScripts[j]).gameObject.transform.position; float num = Vector3.Distance(val.transform.position, position); if (num < 13f + ((Component)this).transform.localScale.x && !StartOfRound.Instance.allPlayerScripts[j].isPlayerDead) { list.Add(val); } } } GameObject val2 = null; val2 = ((list.Count <= 0) ? base.allAINodes[Random.RandomRangeInt(0, base.allAINodes.Length)] : list[Random.RandomRangeInt(0, list.Count)]); Vector3 val3 = default(Vector3); ((Vector3)(ref val3))..ctor((float)(8.0 - enemyRandom.NextDouble() * 16.0), 0f, (float)(8.0 - enemyRandom.NextDouble() * 16.0)); Vector3 val4 = val2.transform.position + val3; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(val4, ref val5, 24f, -1)) { return ((NavMeshHit)(ref val5)).position; } return list[Random.RandomRangeInt(0, list.Count)].transform.position; } public bool FoundClosestPlayerInRange(float r, bool needLineOfSight) { if (recovering) { return false; } moaiTargetClosestPlayer(r, needLineOfSight); if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return (Object)(object)base.targetPlayer != (Object)null; } public bool moaiTargetClosestPlayer(float range, bool requireLineOfSight) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (recovering) { return false; } base.mostOptimalDistance = range; PlayerControllerB targetPlayer = base.targetPlayer; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { if (((EnemyAI)this).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false, true) && (!requireLineOfSight || ((EnemyAI)this).CheckLineOfSightForPosition(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, 100f, 80, -1f, (Transform)null))) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } } if ((Object)(object)base.targetPlayer != (Object)null && (Object)(object)targetPlayer != (Object)null) { base.targetPlayer = targetPlayer; } return (Object)(object)base.targetPlayer != (Object)null; } protected EnemyAI ClosestEnemyInRange(float range) { //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (recovering) { return null; } List spawnedEnemies = RoundManager.Instance.SpawnedEnemies; float num = range; EnemyAI val = null; for (int i = 0; i < spawnedEnemies.Count; i++) { EnemyAI val2 = spawnedEnemies[i]; if (((Object)((Component)val2).gameObject).name.ToLower().Contains("moai")) { if (Object.op_Implicit((Object)(object)((Component)val2).transform.Find("Halo")) && !((Component)((Component)val2).transform.Find("Halo")).gameObject.activeSelf) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num2 < num && val2.enemyHP > 0 && !val2.isEnemyDead && ((Object)val2).GetInstanceID() != ((Object)this).GetInstanceID() && !unreachableEnemies.Contains(val2)) { num = num2; val = val2; } } } else { float num3 = Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position); if (num3 < num && val2.enemyHP > 0 && !val2.isEnemyDead && !unreachableEnemies.Contains(val2) && !enemyIsFriend(val2)) { num = num3; val = val2; } } } if ((Object)(object)val != (Object)null && !val.isEnemyDead && val.enemyHP > 0 && val.enemyType.canDie && ((Component)val).gameObject.activeSelf) { return val; } return null; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, -1); if (base.isEnemyDead) { return; } base.enemyHP -= force; if ((Object)(object)playerWhoHit != (Object)null) { provokePoints += 20 * force; base.targetPlayer = playerWhoHit; } stamina = 60f; recovering = false; if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); animator.SetInteger("state", 3); base.isEnemyDead = true; moaiSoundPlayClientRpc("creatureDeath"); } else { moaiSoundPlayClientRpc("creatureHit"); } } } private void StickingInFrontOfPlayer() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner) { StalkPos = ((Component)base.targetPlayer).transform.position; ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null) { if (!(timeSinceHittingLocalPlayer < 0.5f) && !collidedEnemy.isEnemyDead && !base.isEnemyDead && (!((Object)((Component)collidedEnemy).gameObject).name.ToLower().Contains("moai") || ((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf != ((Component)((Component)collidedEnemy).transform.Find("Halo")).gameObject.activeSelf)) { timeSinceHittingLocalPlayer = 0f; if (!enemyIsFriend(collidedEnemy)) { collidedEnemy.HitEnemy(1, (PlayerControllerB)null, true, -1); } } } public override void OnCollideWithPlayer(Collider other) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) if (timeSinceHittingLocalPlayer < 0.5f) { return; } PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (!((Object)(object)val != (Object)null)) { return; } timeSinceHittingLocalPlayer = 0f; if (!Object.op_Implicit((Object)(object)((Component)this).transform.Find("Halo")) || !((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf) { if (val.health < 30) { val.KillPlayer(val.velocityLastFrame, true, (CauseOfDeath)6, 0, default(Vector3), false); } else { val.DamagePlayer(30, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } else if (((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf && val.health <= 90) { val.DamagePlayer(-10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } public virtual void playSoundId(string id) { } public void stopAllSound() { base.creatureSFX.Stop(); base.creatureVoice.Stop(); creatureEat.Stop(); creatureEatHuman.Stop(); creatureFood.Stop(); creatureDig.Stop(); } [ClientRpc] public void moaiSoundPlayClientRpc(string soundName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1970953629u, val2, (RpcDelivery)0); bool flag = soundName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(soundName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1970953629u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; switch (soundName) { case "creatureSFX": stopAllSound(); base.creatureSFX.Play(); break; case "creatureVoice": { stopAllSound(); double[] array = new double[10] { 0.0, 0.8244, 11.564, 29.11, 34.491, 37.84, 48.689, 64.518, 89.535, 92.111 }; int num = Random.Range(0, array.Length); base.creatureVoice.Play(); base.creatureVoice.SetScheduledStartTime(array[num]); base.creatureVoice.time = (float)array[num]; break; } case "creatureFood": base.creatureSFX.Stop(); base.creatureVoice.Stop(); creatureFood.Play(); break; case "creatureEat": base.creatureSFX.Stop(); base.creatureVoice.Stop(); creatureEat.Play(); break; case "creatureEatHuman": base.creatureSFX.Stop(); base.creatureVoice.Stop(); creatureEatHuman.Play(); break; case "stopEatHuman": creatureEatHuman.Stop(); break; case "creatureHit": creatureHit.Play(); break; case "creatureDeath": stopAllSound(); creatureDeath.Play(); break; case "creatureBelch": creatureBelch.Play(); break; case "creatureBlitz": playSoundId("creatureBlitz"); break; case "creaturePrepare": playSoundId("creaturePrepare"); break; case "creatureKidnap": playSoundId("creatureKidnap"); break; } } } [ClientRpc] public void slidingSoundTickClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3560529355u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3560529355u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!base.isEnemyDead) { Vector3 velocity = base.agent.velocity; if (!(((Vector3)(ref velocity)).magnitude < base.agent.speed / 8f + 1f)) { switch (getCurrentMaterialSittingOn()) { default: if (!slidingBasic.isPlaying) { stopSlideSounds(); isSliding = true; slidingBasic.Play(); } break; case "Gravel": if (!slidingGravel.isPlaying) { stopSlideSounds(); isSliding = true; slidingGravel.Play(); } break; case "CatWalk": if (!slidingMetal.isPlaying) { stopSlideSounds(); isSliding = true; slidingMetal.Play(); } break; case "Aluminum": if (!slidingMetal.isPlaying) { stopSlideSounds(); isSliding = true; slidingMetal.Play(); } break; case "Dirt": if (!slidingGravel.isPlaying) { stopSlideSounds(); isSliding = true; slidingGravel.Play(); } break; case "Snow": if (!slidingSnow.isPlaying) { stopSlideSounds(); isSliding = true; slidingSnow.Play(); } break; case "Carpet": if (!slidingSnow.isPlaying) { stopSlideSounds(); isSliding = true; slidingSnow.Play(); } break; case "Wood": if (!slidingWood.isPlaying) { stopSlideSounds(); isSliding = true; slidingWood.Play(); } break; case "None": stopSlideSounds(); isSliding = false; break; } return; } } if (isSliding) { stopSlideSounds(); isSliding = false; } } public void stopSlideSounds() { slidingBasic.Stop(); slidingGravel.Stop(); slidingMetal.Stop(); slidingSnow.Stop(); slidingWood.Stop(); } public string getCurrentMaterialSittingOn() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) string result = "None"; Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)this).transform.position + Vector3.up, -Vector3.up); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 6f, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1)) { for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (((Component)((RaycastHit)(ref val2)).collider).CompareTag(StartOfRound.Instance.footstepSurfaces[i].surfaceTag)) { result = StartOfRound.Instance.footstepSurfaces[i].surfaceTag; } } } return result; } public static int getDummyId(DeadBodyInfo dmy) { return int.Parse(((Object)dmy).name.Split("-")[1]); } [ClientRpc] public void createDummyClientRpc(Vector3 targetPos, int dummyId, int attachedLimbTarget) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3289480924u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref targetPos); BytePacker.WriteValueBitPacked(val, dummyId); BytePacker.WriteValueBitPacked(val, attachedLimbTarget); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3289480924u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = StartOfRound.Instance.playerRagdolls[0]; GameObject val4 = Object.Instantiate(val3, targetPos, Quaternion.identity); DeadBodyInfo component = val4.GetComponent(); component.overrideSpawnPosition = true; component.attachedLimb = component.bodyParts[attachedLimbTarget]; ((Object)((Component)component).gameObject).name = "moaidummybody-" + dummyId; if (((NetworkBehaviour)RoundManager.Instance).IsHost) { dummyBodies.Add(component); targetedBodies.Add(-1); } } } [ClientRpc] public void destroyDummyClientRpc(int dummyId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1083471976u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, dummyId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1083471976u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = GameObject.Find("moaidummybody-" + dummyId); DeadBodyInfo component = val3.GetComponent(); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { for (int i = 0; i < dummyBodies.Count; i++) { if (((Object)dummyBodies[i]).GetInstanceID() == ((Object)component).GetInstanceID()) { dummyBodies.RemoveAt(i); targetedBodies.RemoveAt(i); } } } Object.Destroy((Object)(object)((Component)component).gameObject); } [ClientRpc] public void attachDummyClientRpc(int dummyId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2390224465u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, dummyId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2390224465u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = GameObject.Find("moaidummybody-" + dummyId); DeadBodyInfo component = val3.GetComponent(); component.attachedTo = ((Component)mouth).transform; } } } public async void respawnEvent() { if (!((NetworkBehaviour)RoundManager.Instance).IsServer) { return; } beginDiggingClientRpc(); int timeout = 20; AnimatorStateInfo currentAnimatorStateInfo; while (true) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Transformation")) { timeout--; if (timeout <= 0) { return; } await Task.Delay(100); continue; } break; } while (true) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Transformation")) { break; } await Task.Delay(500); } if (base.isEnemyDead && isDeadAnimationDone) { await Task.Delay(500); replaceWithSoulDevourer(); } } [ClientRpc] public void beginDiggingClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3634777473u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3634777473u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("Transformation"); stopAllSound(); creatureDig.Play(); base.enemyHP = 0; base.isEnemyDead = true; isDeadAnimationDone = true; } } } public void replaceWithSoulDevourer() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)RoundManager.Instance).IsServer) { GameObject val = Object.Instantiate(Plugin.SoulDevourer.enemyPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); val.GetComponent().Spawn(true); Debug.Log((object)("MOAI: Spawned Soul Devourer at: " + ((object)((Component)this).transform).ToString())); RoundManager.Instance.SpawnedEnemies.Add(val.GetComponent()); Object.Destroy((Object)(object)((Component)this).gameObject); } } [ClientRpc] public void DoAnimationClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3605032466u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3605032466u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)RoundManager.Instance).IsServer && Object.op_Implicit((Object)(object)animator)) { animator.SetInteger("state", index); } } } [ClientRpc] public void moaiSetHaloClientRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1647385022u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1647385022u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; setHalo(value); } } } [ClientRpc] public void destroyBodyClientRpc(ulong playernetid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2506155845u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playernetid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2506155845u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; for (int i = 0; i < RoundManager.Instance.playersManager.allPlayerScripts.Length; i++) { PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[i]; if ((Object)(object)val3 != (Object)null && ((Object)val3).name != null && (Object)(object)((Component)val3).transform != (Object)null && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == playernetid) { Debug.Log((object)("MOAI: Successfully destroyed body with id = " + playernetid)); val3.deadBody.DeactivateBody(false); } } } [ClientRpc] public void attachBodyClientRpc(ulong playerid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2731172394u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2731172394u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; for (int i = 0; i < RoundManager.Instance.playersManager.allPlayerScripts.Length; i++) { PlayerControllerB val3 = RoundManager.Instance.playersManager.allPlayerScripts[i]; if ((Object)(object)val3 != (Object)null && ((Object)val3).name != null && (Object)(object)((Component)val3).transform != (Object)null && ((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == playerid) { val3.deadBody.attachedLimb = val3.deadBody.bodyParts[5]; if (Object.op_Implicit((Object)(object)mouth)) { Debug.Log((object)("MOAI: Successfully attached body to mouth with id = " + playerid)); val3.deadBody.attachedTo = ((Component)mouth).transform; } else { Debug.Log((object)("MOAI: Successfully attached body to eye with id = " + playerid)); val3.deadBody.attachedTo = ((Component)base.eye).transform; } val3.deadBody.canBeGrabbedBackByPlayers = true; } } } [ClientRpc] public void setSizeClientRpc(float size, float pitchAlter) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(377007397u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref size, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pitchAlter, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 377007397u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Transform transform = ((Component)this).gameObject.transform; transform.localScale *= size * Plugin.moaiGlobalSize.Value; NavMeshAgent component = ((Component)this).gameObject.GetComponent(); component.height *= size; AudioSource creatureSFX = base.creatureSFX; creatureSFX.pitch /= pitchAlter; AudioSource creatureVoice = base.creatureVoice; creatureVoice.pitch /= pitchAlter; AudioSource obj = creatureFood; obj.pitch /= pitchAlter; AudioSource obj2 = creatureEat; obj2.pitch /= pitchAlter; AudioSource obj3 = creatureEatHuman; obj3.pitch /= pitchAlter; AudioSource obj4 = creatureHit; obj4.pitch /= pitchAlter; AudioSource obj5 = creatureDeath; obj5.pitch /= pitchAlter; AudioSource obj6 = creatureBelch; obj6.pitch /= pitchAlter; setPitches(pitchAlter); } } } [ClientRpc] public void enableStrikerClientRpc(bool pkg) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2429707420u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pkg, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2429707420u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Debug.Log((object)"MOAI: Enabling LightningStriker Obj."); GameObject val3 = GameObject.Find("TimeAndWeather"); if ((Object)(object)val3 == (Object)null) { Debug.LogError((object)"MOAI: Not enabling LightningStriker Obj for Blue Moai: TimeAndWeather not found!"); } GameObject val4 = null; for (int i = 0; i < val3.transform.GetChildCount(); i++) { GameObject gameObject = ((Component)val3.transform.GetChild(i)).gameObject; if (((Object)gameObject).name.Equals("Stormy")) { val4 = gameObject; } } val4.SetActive(true); Debug.Log((object)"MOAI: striker successfully enabled."); } public bool enemyIsFriend(EnemyAI EAI) { if (Object.op_Implicit((Object)(object)EAI) && Object.op_Implicit((Object)(object)EAI.enemyType) && !EAI.enemyType.canDie) { return true; } try { string value = Plugin.moaiTargetBlacklist.Value; if (value.Length == 0 || value.Equals("")) { return false; } string[] array = value.Split(","); string[] array2 = array; foreach (string text in array2) { string value2 = text.ToLower().Trim(); if (!Object.op_Implicit((Object)(object)EAI) || !Object.op_Implicit((Object)(object)((Component)EAI).gameObject)) { continue; } ScanNodeProperties componentInChildren = ((Component)EAI).GetComponentInChildren(); ScanNodeProperties component = ((Component)EAI).GetComponent(); if (Object.op_Implicit((Object)(object)componentInChildren)) { if (componentInChildren.headerText.ToLower().Trim().Contains(value2)) { return true; } } else if (Object.op_Implicit((Object)(object)component) && component.headerText.ToLower().Trim().Contains(value2)) { return true; } } return false; } catch (Exception ex) { Debug.LogError((object)ex); } return false; } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1970953629u, new RpcReceiveHandler(__rpc_handler_1970953629), "moaiSoundPlayClientRpc"); ((NetworkBehaviour)this).__registerRpc(3560529355u, new RpcReceiveHandler(__rpc_handler_3560529355), "slidingSoundTickClientRpc"); ((NetworkBehaviour)this).__registerRpc(3289480924u, new RpcReceiveHandler(__rpc_handler_3289480924), "createDummyClientRpc"); ((NetworkBehaviour)this).__registerRpc(1083471976u, new RpcReceiveHandler(__rpc_handler_1083471976), "destroyDummyClientRpc"); ((NetworkBehaviour)this).__registerRpc(2390224465u, new RpcReceiveHandler(__rpc_handler_2390224465), "attachDummyClientRpc"); ((NetworkBehaviour)this).__registerRpc(3634777473u, new RpcReceiveHandler(__rpc_handler_3634777473), "beginDiggingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3605032466u, new RpcReceiveHandler(__rpc_handler_3605032466), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(1647385022u, new RpcReceiveHandler(__rpc_handler_1647385022), "moaiSetHaloClientRpc"); ((NetworkBehaviour)this).__registerRpc(2506155845u, new RpcReceiveHandler(__rpc_handler_2506155845), "destroyBodyClientRpc"); ((NetworkBehaviour)this).__registerRpc(2731172394u, new RpcReceiveHandler(__rpc_handler_2731172394), "attachBodyClientRpc"); ((NetworkBehaviour)this).__registerRpc(377007397u, new RpcReceiveHandler(__rpc_handler_377007397), "setSizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2429707420u, new RpcReceiveHandler(__rpc_handler_2429707420), "enableStrikerClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1970953629(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string soundName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref soundName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).moaiSoundPlayClientRpc(soundName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3560529355(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).slidingSoundTickClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3289480924(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 targetPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPos); int dummyId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref dummyId); int attachedLimbTarget = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref attachedLimbTarget); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).createDummyClientRpc(targetPos, dummyId, attachedLimbTarget); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1083471976(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int dummyId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref dummyId); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).destroyDummyClientRpc(dummyId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2390224465(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int dummyId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref dummyId); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).attachDummyClientRpc(dummyId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3634777473(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).beginDiggingClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3605032466(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).DoAnimationClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1647385022(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).moaiSetHaloClientRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2506155845(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playernetid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playernetid); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).destroyBodyClientRpc(playernetid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2731172394(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).attachBodyClientRpc(playerid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_377007397(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float size = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref size, default(ForPrimitives)); float pitchAlter = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pitchAlter, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).setSizeClientRpc(size, pitchAlter); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2429707420(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool pkg = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pkg, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MOAIAICORE)(object)target).enableStrikerClientRpc(pkg); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MOAIAICORE"; } } internal class MoaiEnemyAI : MOAIAICORE { public string currentCommand = "Untamed"; public GameObject triggerLinkGameObject; public VehicleInteract vehicleController; public AudioSource VehicleIgnition; public AudioSource moaiInteract; public ParticleSystem vehicleSmoke; public float acceleration = 4f; public float decceleration = 4.5f; public float vehicleSpeed = 20f; public float vehicleMaxSpeed; public float speedRatio = 0f; public float vehicleForwardDest = 0.7f; public float vehicleHorizontalDest = 0.3f; public float speedClamped; public Vector3 vehicleInputFeed; public double nextVehicleInputSendTime = 0.0; public Vector3 meshLinkVector = Vector3.zero; public bool meshLinkLock = false; public float meshLinkThreshold = 5f; public float meshLinkOuterThreshold = 7f; public float meshLinkFinishedThreshold = 0.1f; public float navigationHeightThreshold = 2f; public OffMeshLink[] offMeshLinks; public override void Start() { baseInit(); } public override void Update() { //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); baseUpdate(); if (Object.op_Implicit((Object)(object)triggerLinkGameObject) && ((NetworkBehaviour)RoundManager.Instance).IsHost) { if (goodBoy > 0) { if (!triggerLinkGameObject.activeInHierarchy) { triggerLinkEnableClientRpc(); } } else if (triggerLinkGameObject.activeInHierarchy) { triggerLinkDisableClientRpc(); } } if (Object.op_Implicit((Object)(object)vehicleController) && Object.op_Implicit((Object)(object)vehicleController.currentlyRiding)) { updateVehicleSpeed(); animator.speed = 0f; } if (Object.op_Implicit((Object)(object)vehicleController)) { if (currentCommand.Equals("Drive")) { if (creatureFood.isPlaying) { creatureFood.Stop(); } if (((EnemyAI)this).creatureSFX.isPlaying) { ((EnemyAI)this).creatureSFX.Stop(); } if (creatureEat.isPlaying) { creatureEat.Stop(); } if (creatureEatHuman.isPlaying) { creatureEatHuman.Stop(); } PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; ((Component)vehicleController.currentlyRiding).transform.position = ((Component)mouth).transform.position; if ((Object)(object)vehicleController.currentlyRiding == (Object)(object)localPlayerController && (double)Time.time > nextVehicleInputSendTime) { nextVehicleInputSendTime = Time.time + 0.15f; vehicleInputFeedServerRpc(Vector2.op_Implicit(localPlayerController.moveInputVector * 3f), vehicleSpeed, speedClamped); if (((NetworkBehaviour)localPlayerController).IsHost) { vehicleInputFeedClientRpc(vehicleSpeed, speedClamped); } } } if (goodBoy <= 0 && (Object)(object)vehicleController.currentlyRiding != (Object)null) { vehicleController.detachPlayerToMouthClientRpc(((NetworkBehaviour)vehicleController.currentlyRiding).NetworkObjectId); } } int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; int num = currentBehaviourStateIndex; if (num != 0 && num == 3 && !((EnemyAI)this).isEnemyDead && ((EnemyAI)this).enemyHP > 0) { thunderTick(); } } [ServerRpc(RequireOwnership = false)] public void vehicleInputFeedServerRpc(Vector3 movementVector, float _vehicleSpeed, float _speedClamped) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3467173328u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref movementVector); ((FastBufferWriter)(ref val)).WriteValueSafe(ref _vehicleSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref _speedClamped, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3467173328u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; vehicleInputFeed = movementVector; vehicleSpeed = _vehicleSpeed; speedClamped = _speedClamped; } } } [ClientRpc] public void vehicleInputFeedClientRpc(float _vehicleSpeed, float _speedClamped) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2841847756u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref _vehicleSpeed, default(ForPrimitives)); ((FastBufferWriter)(ref val)).WriteValueSafe(ref _speedClamped, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2841847756u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; vehicleSpeed = _vehicleSpeed; speedClamped = _speedClamped; } } } [ClientRpc] public void triggerLinkEnableClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3234410416u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3234410416u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; triggerLinkGameObject.SetActive(true); } } } [ClientRpc] public void triggerLinkDisableClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3703433665u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3703433665u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; triggerLinkGameObject.SetActive(false); } } } public void updateVehicleSpeed() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) float num = Math.Clamp((vehicleController.currentlyRiding.moveInputVector * 5f).y, -1f, 1f); if (num < 0f) { vehicleSpeed = Math.Clamp(vehicleSpeed - decceleration * 3f * Time.deltaTime, 0f, vehicleMaxSpeed); } if ((double)num < 0.5) { vehicleSpeed = Math.Clamp(vehicleSpeed - decceleration * Time.deltaTime, 0f, vehicleMaxSpeed); } else { vehicleSpeed = Math.Clamp(vehicleSpeed + acceleration * num * Time.deltaTime, 0f, vehicleMaxSpeed); } speedClamped = Mathf.Lerp(speedClamped, vehicleSpeed, Time.deltaTime); } public override void setPitches(float pitchAlter) { if ((Object)(object)moaiInteract != (Object)null) { AudioSource obj = moaiInteract; obj.pitch /= pitchAlter; } } [ClientRpc] public void smokeDisableClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2757054050u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2757054050u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; vehicleSmoke.Stop(); } } } [ClientRpc] public void smokeEnableClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(819658113u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 819658113u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; vehicleSmoke.Play(); } } } public OffMeshLink findValidMeshLink(float distance) { //IL_0015: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < offMeshLinks.Length; i++) { OffMeshLink val = offMeshLinks[i]; if (Vector3.Distance(((Component)this).transform.position, val.startTransform.position) < distance || Vector3.Distance(((Component)this).transform.position, val.endTransform.position) < distance) { return val; } } return null; } public unsafe Vector3 sampleVehicleVector(Vector3 targetPos, Vector3 v, Vector3 m, float heightThreshold) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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) Plugin.LogDebug("sampleVehicleVector"); int num = 5; Vector3 val = v + ((Component)this).transform.forward * vehicleForwardDest * vehicleSpeed + ((Component)this).transform.right * (float)Math.Sign(m.x) * vehicleHorizontalDest * vehicleSpeed; Vector3 val2 = val; int num2 = 2; while (Math.Abs(sampleHit(val2).y - val2.y) > heightThreshold && num != 0) { Plugin.LogDebug("Sample = " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString() + " - attempt " + (5 - num)); val2 = v + ((Component)this).transform.forward * vehicleForwardDest * vehicleSpeed / (float)num2 + ((Component)this).transform.right * (float)Math.Sign(m.x) * vehicleHorizontalDest * vehicleSpeed / (float)num2; num--; num2++; } if (num == 0) { Plugin.LogDebug("Returning Base Sample: " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString()); return val; } Plugin.LogDebug("Returning Sample: " + ((object)(*(Vector3*)(&val2))/*cast due to .constrained prefix*/).ToString()); return val2; } public Vector3 sampleHit(Vector3 position) { //IL_0001: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val, 20f, -1)) { return ((NavMeshHit)(ref val)).position; } return Vector3.zero; } public override void DoAIInterval() { //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).isEnemyDead) { return; } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); if (Object.op_Implicit((Object)(object)vehicleController) && Object.op_Implicit((Object)(object)vehicleController.currentlyRiding)) { if (offMeshLinks == null) { offMeshLinks = Object.FindObjectsOfType(); } if (offMeshLinks != null && offMeshLinks.Length == 0) { offMeshLinks = Object.FindObjectsOfType(); } ((EnemyAI)this).agent.speed = vehicleSpeed * Plugin.moaiGlobalSpeed.Value; ((EnemyAI)this).agent.acceleration = vehicleSpeed * Plugin.moaiGlobalSpeed.Value; Vector3 position = ((Component)this).transform.position; Vector2 val = Vector2.op_Implicit(vehicleInputFeed * 3f); Vector3 zero = Vector3.zero; OffMeshLink val2 = findValidMeshLink(meshLinkThreshold); if (!Object.op_Implicit((Object)(object)findValidMeshLink(meshLinkOuterThreshold))) { meshLinkLock = false; } if (Object.op_Implicit((Object)(object)val2) && meshLinkVector == Vector3.zero && !meshLinkLock) { OffMeshLink val3 = val2; zero = (meshLinkVector = ((!(Vector3.Distance(val3.startTransform.position, ((Component)this).transform.position) > Vector3.Distance(val3.endTransform.position, ((Component)this).transform.position))) ? val3.endTransform.position : val3.startTransform.position)); } else if (meshLinkVector != Vector3.zero) { zero = meshLinkVector; if (((EnemyAI)this).agent.remainingDistance < meshLinkFinishedThreshold) { meshLinkVector = Vector3.zero; meshLinkLock = true; } } else { zero = sampleVehicleVector(zero, position, Vector2.op_Implicit(val), navigationHeightThreshold); } ((EnemyAI)this).SetDestinationToPosition(zero, false); if (!vehicleSmoke.isPlaying) { smokeEnableClientRpc(); } return; } meshLinkVector = Vector3.zero; if (meshLinkLock) { OffMeshLink val4 = findValidMeshLink(meshLinkOuterThreshold); if (!Object.op_Implicit((Object)(object)val4)) { meshLinkLock = false; } } if (Object.op_Implicit((Object)(object)vehicleSmoke) && vehicleSmoke.isPlaying) { smokeDisableClientRpc(); } ((EnemyAI)this).agent.acceleration = 8f * Plugin.moaiGlobalSpeed.Value; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: baseSearchingForPlayer(); break; case 5: baseHeadingToEntrance(); break; case 1: if (goodBoy > 0 && currentCommand.Equals("Tamed")) { ((EnemyAI)this).agent.speed = 0f; } else { baseGuard(); } break; case 2: baseStickingInFrontOfEnemy(); break; case 3: baseStickingInFrontOfPlayer(); break; case 4: baseHeadSwingAttackInProgress(); break; default: LogDebug("This Behavior State doesn't exist!"); break; } } public void thunderReset() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) RoundManager instance = RoundManager.Instance; if (!((Object)((Component)this).gameObject).name.Contains("Blue") || ((EnemyAI)this).isEnemyDead || (Object)(object)((EnemyAI)this).targetPlayer == (Object)null || ticksTillThunder > 0f) { return; } ticksTillThunder = 10f + Math.Min((float)Math.Pow(Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position), 1.75), 180f); if (ticksTillThunder < 35f) { ticksTillThunder = 35f; } Vector3 serverPosition = ((EnemyAI)this).serverPosition; serverPosition.y += (float)(enemyRandom.NextDouble() * (double)ticksTillThunder * 0.2 + (double)(4f * ((Component)this).gameObject.transform.localScale.x)) * (float)Math.Sign(enemyRandom.Next(-100, 100)); serverPosition.x += (float)(enemyRandom.NextDouble() * (double)ticksTillThunder * 0.2 + (double)(4f * ((Component)this).gameObject.transform.localScale.x)) * (float)Math.Sign(enemyRandom.Next(-100, 100)); GameObject val = GameObject.Find("TimeAndWeather"); GameObject val2 = null; for (int i = 0; i < val.transform.GetChildCount(); i++) { GameObject gameObject = ((Component)val.transform.GetChild(i)).gameObject; if (((Object)gameObject).name.Equals("Stormy")) { val2 = gameObject; } } if ((Object)(object)val2 != (Object)null) { if (!val2.activeSelf) { enableStrikerClientRpc(pkg: true); } instance.LightningStrikeServerRpc(serverPosition); } else { Debug.LogError((object)"Lethal Chaos: Failed to find Stormy Weather container (LBolt)!"); } } public void thunderTick() { if (((EnemyAI)this).currentBehaviourStateIndex == 3) { ticksTillThunder -= 1f; if (ticksTillThunder <= 0f) { thunderReset(); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3467173328u, new RpcReceiveHandler(__rpc_handler_3467173328), "vehicleInputFeedServerRpc"); ((NetworkBehaviour)this).__registerRpc(2841847756u, new RpcReceiveHandler(__rpc_handler_2841847756), "vehicleInputFeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(3234410416u, new RpcReceiveHandler(__rpc_handler_3234410416), "triggerLinkEnableClientRpc"); ((NetworkBehaviour)this).__registerRpc(3703433665u, new RpcReceiveHandler(__rpc_handler_3703433665), "triggerLinkDisableClientRpc"); ((NetworkBehaviour)this).__registerRpc(2757054050u, new RpcReceiveHandler(__rpc_handler_2757054050), "smokeDisableClientRpc"); ((NetworkBehaviour)this).__registerRpc(819658113u, new RpcReceiveHandler(__rpc_handler_819658113), "smokeEnableClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3467173328(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 movementVector = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref movementVector); float num = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num, default(ForPrimitives)); float num2 = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num2, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiEnemyAI)(object)target).vehicleInputFeedServerRpc(movementVector, num, num2); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2841847756(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float num = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num, default(ForPrimitives)); float num2 = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref num2, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiEnemyAI)(object)target).vehicleInputFeedClientRpc(num, num2); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3234410416(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiEnemyAI)(object)target).triggerLinkEnableClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3703433665(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiEnemyAI)(object)target).triggerLinkDisableClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2757054050(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiEnemyAI)(object)target).smokeDisableClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_819658113(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiEnemyAI)(object)target).smokeEnableClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MoaiEnemyAI"; } } public class MoaiNormalNet { } internal class VehicleInteract : NetworkBehaviour { public MoaiEnemyAI moai; public InteractTrigger triggerLink; public PlayerControllerB currentlyRiding; public void interactAction(PlayerControllerB playerTarget) { commandMoaiServerRpc(((NetworkBehaviour)playerTarget).NetworkObjectId); } [ServerRpc(RequireOwnership = false)] public void commandMoaiServerRpc(ulong playerid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1229135521u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerid); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 1229135521u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (((Object)((Component)this).gameObject).name.Contains("Blue")) { return; } PlayerControllerB player = getPlayer(playerid); if ((Object)(object)player == (Object)null) { Debug.LogError((object)"Moai Enemy: Could not find target player for interaction! Cancelling interaction."); return; } switch (moai.currentCommand) { case "Untamed": if (yoinkItem(player)) { changeToTamedClientRpc(); } break; case "Tamed": attachPlayerToMouthClientRpc(((NetworkBehaviour)player).NetworkObjectId); break; case "Drive": detachPlayerToMouthClientRpc(((NetworkBehaviour)player).NetworkObjectId); break; } } [ClientRpc] public void changeToTamedClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3056757464u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3056757464u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; moai.currentCommand = "Tamed"; triggerLink.hoverTip = "Drive Moai"; } } } [ClientRpc] public void attachPlayerToMouthClientRpc(ulong playerid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2975040759u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2975040759u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB player = getPlayer(playerid); if (Object.op_Implicit((Object)(object)player)) { currentlyRiding = player; ((Component)player).transform.parent = moai.mouth; moai.currentCommand = "Drive"; triggerLink.hoverTip = "Dismount Moai"; player.playerCollider.enabled = false; moai.VehicleIgnition.Play(); } } } [ClientRpc] public void detachPlayerToMouthClientRpc(ulong playerid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2151003718u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2151003718u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB player = getPlayer(playerid); if (Object.op_Implicit((Object)(object)player)) { currentlyRiding = null; ((Component)player).transform.parent = null; moai.currentCommand = "Tamed"; triggerLink.hoverTip = "Drive Moai"; player.playerCollider.enabled = true; moai.VehicleIgnition.Stop(); } } } public PlayerControllerB getPlayer(ulong playerid) { PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; PlayerControllerB result = null; foreach (PlayerControllerB val in allPlayerScripts) { if (((NetworkBehaviour)val).NetworkObjectId == playerid) { result = val; } } return result; } public bool yoinkItem(PlayerControllerB player) { GrabbableObject[] itemSlots = player.ItemSlots; GrabbableObject val = null; GrabbableObject[] array = itemSlots; foreach (GrabbableObject val2 in array) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Component)val2).gameObject) && (((Object)((Component)val2).gameObject).name.ToLower().Contains("key") || ((Object)val2).name.ToLower().Contains("key"))) { if (!Object.op_Implicit((Object)(object)val)) { val = val2; } else if (!val2.isPocketed) { val = val2; } } } if (Object.op_Implicit((Object)(object)val)) { takeItemClientRpc(((NetworkBehaviour)player).NetworkObjectId, ((NetworkBehaviour)val).NetworkObjectId); return true; } return false; } [ClientRpc] public void takeItemClientRpc(ulong playerid, ulong itemid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1091710890u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerid); BytePacker.WriteValueBitPacked(val, itemid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1091710890u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB player = getPlayer(playerid); if (!Object.op_Implicit((Object)(object)player)) { Debug.LogError((object)"Moai Enemy: Could not find target player for item removal! Cancelling item removal."); return; } GrabbableObject[] itemSlots = player.ItemSlots; for (int i = 0; i < itemSlots.Length; i++) { GrabbableObject val3 = itemSlots[i]; if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)((Component)val3).gameObject) && ((NetworkBehaviour)val3).NetworkObjectId == itemid) { if (!val3.isPocketed) { Debug.Log((object)"Moai Enemy: Despawned Held Object (Key)"); player.DespawnHeldObject(); } else { Debug.Log((object)"Moai Enemy: Despawned Object in Slot (Key)"); player.DestroyItemInSlotAndSync(i); ((Behaviour)HUDManager.Instance.itemSlotIcons[i]).enabled = false; } return; } } Debug.LogError((object)"Moai Enemy: Could not find target item for removal (player was found)! Cancelling item removal."); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1229135521u, new RpcReceiveHandler(__rpc_handler_1229135521), "commandMoaiServerRpc"); ((NetworkBehaviour)this).__registerRpc(3056757464u, new RpcReceiveHandler(__rpc_handler_3056757464), "changeToTamedClientRpc"); ((NetworkBehaviour)this).__registerRpc(2975040759u, new RpcReceiveHandler(__rpc_handler_2975040759), "attachPlayerToMouthClientRpc"); ((NetworkBehaviour)this).__registerRpc(2151003718u, new RpcReceiveHandler(__rpc_handler_2151003718), "detachPlayerToMouthClientRpc"); ((NetworkBehaviour)this).__registerRpc(1091710890u, new RpcReceiveHandler(__rpc_handler_1091710890), "takeItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1229135521(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); target.__rpc_exec_stage = (__RpcExecStage)1; ((VehicleInteract)(object)target).commandMoaiServerRpc(playerid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3056757464(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((VehicleInteract)(object)target).changeToTamedClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2975040759(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); target.__rpc_exec_stage = (__RpcExecStage)1; ((VehicleInteract)(object)target).attachPlayerToMouthClientRpc(playerid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2151003718(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); target.__rpc_exec_stage = (__RpcExecStage)1; ((VehicleInteract)(object)target).detachPlayerToMouthClientRpc(playerid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1091710890(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerid); ulong itemid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref itemid); target.__rpc_exec_stage = (__RpcExecStage)1; ((VehicleInteract)(object)target).takeItemClientRpc(playerid, itemid); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "VehicleInteract"; } } public class CannonBall : NetworkBehaviour { public float speed; [Range(0f, 10f)] public float moveDelay; private float creationTime = -1f; private float explosionTime = -1f; private MoaiPirateAI owner; private bool moving = false; private void Start() { creationTime = Time.time; ((MonoBehaviour)this).Invoke("StartMoving", moveDelay); } private void StartMoving() { moving = true; } private void Update() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0097: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)RoundManager.Instance).IsHost) { if ((explosionTime != -1f && Time.time - explosionTime > 3f) || Time.time - creationTime > 10f) { Object.Destroy((Object)(object)((Component)this).gameObject); } else if (moving) { Transform transform = ((Component)this).transform; transform.position += ((Component)this).transform.forward * speed * Time.deltaTime; } } } public void SetOwner(GameObject pirGO) { owner = pirGO.GetComponent(); } private void OnCollisionEnter(Collision collision) { if (((NetworkBehaviour)RoundManager.Instance).IsHost && Object.op_Implicit((Object)(object)collision.collider) && !shipWalk(collision.gameObject)) { explosionTime = Time.time; spawnExplosionClientRpc(); } } public bool shipWalk(GameObject leaf) { //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) while ((Object)(object)leaf != (Object)null && (Object)(object)leaf.GetComponent() == (Object)null && (Object)(object)leaf.GetComponent() == (Object)null) { leaf = ((!Object.op_Implicit((Object)(object)leaf.transform.parent) || !Object.op_Implicit((Object)(object)((Component)leaf.transform.parent).gameObject)) ? null : ((Component)leaf.transform.parent).gameObject); } if (Object.op_Implicit((Object)(object)leaf) && Object.op_Implicit((Object)(object)leaf.GetComponent())) { return true; } if (Object.op_Implicit((Object)(object)leaf) && Object.op_Implicit((Object)(object)leaf.GetComponent())) { return true; } if (Object.op_Implicit((Object)(object)owner) && Vector3.Distance(((Component)owner).transform.position, ((Component)this).transform.position) <= 6.6f) { return true; } return false; } [ClientRpc] private void spawnExplosionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1334890028u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1334890028u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position, true, 3.3f, 5.5f, 33, 30f, (GameObject)null, false); Object.Destroy((Object)(object)((Component)this).gameObject); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1334890028u, new RpcReceiveHandler(__rpc_handler_1334890028), "spawnExplosionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1334890028(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((CannonBall)(object)target).spawnExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CannonBall"; } } internal class MoaiPirateAI : MOAIAICORE { private new enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance, ShipPatrolling, ShipAggressive, ShipPlundering, HeadingToShip } public string currentCommand = "Untamed"; public GameObject triggerLinkGameObject; public MoaiPirateShip ship; public Transform shotgunMount; private ShotgunItem mountedShotgun; private bool notifiedClientsOfShip = false; private float randomVoicelineTimer = 4f; public static float voicelineDelayLower = 1f; public static float voicelineDelayUpper = 16f; public float reqCooldownShotgun = 0.2f; private bool firingGun = false; public Animator ShotgunAnimator; public AudioSource[] PirateVoicelines; public AudioSource ShotgunPrepareSound; public AudioSource ShotgunReloadSound; public static int burstShotsMin = 2; public static int burstShotsMax = 4; public static float burstInterval = 1.8f; public static float burstCooldownMin = 4f; public static float burstCooldownMax = 11f; private float burstCooldownTimer = 0f; private bool inBurstRoutine = false; private float timeLeftPatrollingOffShip = 0f; public static float shipSightRange = 60f; private bool boardedShip = false; public override void Start() { //IL_0028: 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_004d: 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) baseInit(); stamina = 100f; if (((NetworkBehaviour)RoundManager.Instance).IsHost) { NavMeshHit val = default(NavMeshHit); NavMesh.SamplePosition(((Component)this).transform.position, ref val, 20f, -1); GameObject val2 = Object.Instantiate(Plugin.PirateShip, ((NavMeshHit)(ref val)).position, ((Component)this).transform.rotation); val2.transform.localScale = ((Component)this).transform.localScale; val2.GetComponent().Spawn(false); ship = val2.GetComponent(); SetupInvisShotgun(); } goodBoy = -1; try { ShotgunPrepareSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; ShotgunReloadSound.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; AudioSource[] pirateVoicelines = PirateVoicelines; foreach (AudioSource val3 in pirateVoicelines) { if (Object.op_Implicit((Object)(object)val3)) { val3.volume = Plugin.moaiGlobalMusicVol.Value / 0.6f; } } } catch (Exception ex) { Debug.LogError((object)ex); } } public void SetupInvisShotgun() { //IL_0070: 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) Item[] array = Resources.FindObjectsOfTypeAll(); Item[] array2 = array; Rigidbody val3 = default(Rigidbody); foreach (Item val in array2) { if (val.itemName.ToLower().Contains("shotgun") && Object.op_Implicit((Object)(object)val.spawnPrefab.GetComponent())) { Debug.Log((object)("Moai Pirate: Found shotgun prefab to mount to blunderbuss model. spawning... " + val.itemName)); GameObject spawnPrefab = val.spawnPrefab; GameObject val2 = Object.Instantiate(spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); mountedShotgun = val2.GetComponent(); val2.GetComponent().Spawn(false); if (((Component)mountedShotgun).TryGetComponent(ref val3)) { val3.isKinematic = true; } ((GrabbableObject)mountedShotgun).isHeld = true; ((GrabbableObject)mountedShotgun).isHeldByEnemy = Object.op_Implicit((Object)(object)this); ((GrabbableObject)mountedShotgun).hasHitGround = true; ((GrabbableObject)mountedShotgun).reachedFloorTarget = true; ((GrabbableObject)mountedShotgun).scrapValue = 0; return; } } Debug.LogError((object)"Moai Pirate: failed to find shotgun prefab to use as blunderbuss. Blunderbuss will not fire!"); } [ServerRpc(RequireOwnership = false)] public void RequestForShotgunServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(197566479u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 197566479u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Object.op_Implicit((Object)(object)mountedShotgun)) { ClientShotgunSetupClientRpc(((NetworkBehaviour)mountedShotgun).NetworkObjectId); } } } [ClientRpc] public void ClientShotgunSetupClientRpc(ulong uid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1692792536u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1692792536u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShotgunItem[] array = Object.FindObjectsOfType(); ShotgunItem[] array2 = array; Rigidbody val4 = default(Rigidbody); foreach (ShotgunItem val3 in array2) { if (((NetworkBehaviour)val3).NetworkObjectId != uid) { continue; } mountedShotgun = val3; if (((Component)mountedShotgun).TryGetComponent(ref val4)) { val4.isKinematic = true; } ((GrabbableObject)mountedShotgun).isHeld = true; ((GrabbableObject)mountedShotgun).isHeldByEnemy = Object.op_Implicit((Object)(object)this); ((GrabbableObject)mountedShotgun).hasHitGround = true; ((GrabbableObject)mountedShotgun).reachedFloorTarget = true; ((GrabbableObject)mountedShotgun).scrapValue = 0; MeshRenderer[] componentsInChildren = ((Component)mountedShotgun).gameObject.GetComponentsInChildren(); MeshRenderer[] array3 = componentsInChildren; foreach (MeshRenderer val5 in array3) { if (Object.op_Implicit((Object)(object)val5)) { ((Renderer)val5).enabled = false; } } MeshRenderer component = ((Component)mountedShotgun).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { ((Renderer)component).enabled = false; } Debug.Log((object)("Moai Pirate: Shotgun set up for client successful -> " + ((object)mountedShotgun)?.ToString() + " - >" + ((NetworkBehaviour)mountedShotgun).NetworkObjectId)); } } public override void Update() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); baseUpdate(); if (!((NetworkBehaviour)RoundManager.Instance).IsHost && !Object.op_Implicit((Object)(object)mountedShotgun) && reqCooldownShotgun < 0f) { RequestForShotgunServerRpc(); reqCooldownShotgun = 0.2f; } reqCooldownShotgun -= Time.deltaTime; if (Object.op_Implicit((Object)(object)mountedShotgun)) { ((Component)mountedShotgun).gameObject.transform.position = ((Component)shotgunMount).transform.position; ((Component)mountedShotgun).gameObject.transform.rotation = ((Component)shotgunMount).transform.rotation; } if (Object.op_Implicit((Object)(object)triggerLinkGameObject) && ((NetworkBehaviour)RoundManager.Instance).IsHost) { if (goodBoy > 0) { if (!triggerLinkGameObject.activeInHierarchy) { triggerLinkEnableClientRpc(); } } else if (triggerLinkGameObject.activeInHierarchy) { triggerLinkDisableClientRpc(); } } switch (((EnemyAI)this).currentBehaviourStateIndex) { } if (((NetworkBehaviour)RoundManager.Instance).IsHost && Object.op_Implicit((Object)(object)ship) && Object.op_Implicit((Object)(object)((NetworkBehaviour)ship).NetworkObject) && ((NetworkBehaviour)ship).NetworkObject.IsSpawned && !notifiedClientsOfShip) { notifiedClientsOfShip = true; ship.SetCaptainClientRpc(((NetworkBehaviour)this).NetworkObjectId); NotifyShipClientRpc(((NetworkBehaviour)ship).NetworkObjectId); } if (boardedShip) { ((Component)this).transform.position = ((Component)ship.WheelPoint).transform.position; ((Component)this).transform.rotation = ((Component)ship.WheelPoint).transform.rotation; } if (((EnemyAI)this).currentBehaviourStateIndex == 3) { UpdateBurstFire(); } randomVoicelineTimer -= Time.deltaTime; if (randomVoicelineTimer <= 0f) { PlayRandomPirateVoiceline(); randomVoicelineTimer = Random.Range(voicelineDelayLower, voicelineDelayUpper); } } public void PlayRandomPirateVoiceline() { if (!((EnemyAI)this).isEnemyDead && PirateVoicelines != null && PirateVoicelines.Length != 0) { PlayVoicelineClientRpc(Random.Range(0, PirateVoicelines.Length)); } } [ClientRpc] public void PlayVoicelineClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1805517574u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1805517574u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PirateVoicelines[index].Play(); } } } [ClientRpc] public void PlayShotgunPrepareClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1226036578u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1226036578u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShotgunPrepareSound.Play(); } } } [ClientRpc] public void PlayShotgunReloadClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(307228437u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 307228437u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShotgunReloadSound.Play(); } } } [ClientRpc] public void ShotgunAnimatorPlayClientRpc(string id) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2498152332u, val2, (RpcDelivery)0); bool flag = id != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(id, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2498152332u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ShotgunAnimator.Play(id); } } public IEnumerator FireShotgun() { if (((NetworkBehaviour)RoundManager.Instance).IsHost && !firingGun && !((EnemyAI)this).isEnemyDead) { firingGun = true; PlayRandomPirateVoiceline(); yield return (object)new WaitForSeconds(0.5f); if (Object.op_Implicit((Object)(object)ShotgunPrepareSound)) { PlayShotgunPrepareClientRpc(); } ShotgunAnimatorPlayClientRpc("Reload"); int tempHealth = ((EnemyAI)this).enemyHP; TempHpClientRpc(9999); yield return (object)new WaitForSeconds(1.14f); ShotgunAnimatorPlayClientRpc("Fire"); if (((EnemyAI)this).currentBehaviourStateIndex == 3) { mountedShotgun.shellsLoaded = 2; mountedShotgun.isReloading = false; mountedShotgun.safetyOn = false; mountedShotgun.ShootGunAndSync(false); } yield return (object)new WaitForSeconds(0.3f); TempHpClientRpc(tempHealth); firingGun = false; } } [ClientRpc] public void TempHpClientRpc(int val) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val3 = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1334591477u, val3, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, val); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1334591477u, val3, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).enemyHP = val; } } } public void UpdateBurstFire() { if (!firingGun && ((NetworkBehaviour)RoundManager.Instance).IsHost) { burstCooldownTimer -= Time.deltaTime; if (burstCooldownTimer <= 0f) { burstCooldownTimer = Random.Range(burstCooldownMin, burstCooldownMax); ((MonoBehaviour)this).StartCoroutine(BurstFireRoutine()); } } } private IEnumerator BurstFireRoutine() { int shots = Random.Range(burstShotsMin, burstShotsMax + 1); for (int i = 0; i < shots; i++) { yield return ((MonoBehaviour)this).StartCoroutine(FireShotgun()); yield return (object)new WaitForSeconds(burstInterval); } stamina = 0f; } [ClientRpc] public void triggerLinkEnableClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4030215880u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4030215880u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; triggerLinkGameObject.SetActive(true); } } } [ClientRpc] public void triggerLinkDisableClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2278283497u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2278283497u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; triggerLinkGameObject.SetActive(false); } } } public override void DoAIInterval() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).isEnemyDead || !((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); if (((Component)this).transform.localScale.y > 2.1f) { ((Component)this).transform.localScale = new Vector3(2f, 2f, 2f); } ((EnemyAI)this).agent.acceleration = 8f * Plugin.moaiGlobalSpeed.Value; switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: baseSearchingForPlayer(); if (timeLeftPatrollingOffShip <= 0f) { timeLeftPatrollingOffShip = Random.Range(10f, 35f); ((EnemyAI)this).SwitchToBehaviourClientRpc(9); ((EnemyAI)this).targetPlayer = null; ((EnemyAI)this).SetDestinationToPosition(GetWheelDestination(), false); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); } else { timeLeftPatrollingOffShip -= 0.2f; } break; case 5: ((EnemyAI)this).SwitchToBehaviourClientRpc(0); break; case 1: if (goodBoy > 0 && currentCommand.Equals("Tamed")) { ((EnemyAI)this).agent.speed = 0f; } else { baseGuard(); } break; case 2: baseStickingInFrontOfEnemy(); break; case 3: baseStickingInFrontOfPlayer(); ((EnemyAI)this).agent.speed = 4.85f * Plugin.moaiGlobalSpeed.Value; break; case 4: baseHeadSwingAttackInProgress(); break; case 9: if (provokePoints > 0) { ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } if (((EnemyAI)this).agent.destination == Vector3.zero || !((EnemyAI)this).agent.hasPath) { ((EnemyAI)this).SetDestinationToPosition(GetWheelDestination(), false); try { if (((EnemyAI)this).currentSearch != null) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); } } catch (Exception ex) { Debug.LogError((object)ex); } } if (((EnemyAI)this).agent.remainingDistance <= 2f) { SnapToWheelClientRpc(attach: true); ((EnemyAI)this).SwitchToBehaviourClientRpc(6); ship.InitPhaseRising(); timeLeftPatrollingOffShip = Random.Range(5f, 20f); } break; case 6: if (ship.phase.Equals("landed")) { Debug.Log((object)"Pirate Moai: De ship has completed the trip. Looking for vitums yaaarg"); SnapToWheelClientRpc(attach: false); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } else if (FoundClosestPlayerInRange(shipSightRange, needLineOfSight: true)) { Debug.Log((object)"Pirate Moai: Target spotted! Entering aggressive phase yaaarg"); ship.InitPhaseAggressive(); ((EnemyAI)this).SwitchToBehaviourClientRpc(7); } break; case 7: if (!ship.isGrappling) { if (ship.phase.Equals("traveling") || ship.phase.Equals("rising")) { Debug.Log((object)"Pirate Moai: Aggressive phase complete, resuming patrol."); ((EnemyAI)this).SwitchToBehaviourClientRpc(6); } else if (ship.phase.Equals("landed")) { Debug.Log((object)"Pirate Moai: Ship landed aggressively, dismounting."); SnapToWheelClientRpc(attach: false); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } } break; default: LogDebug("This Behavior State doesn't exist!"); break; } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { base.HitEnemy(force, playerWhoHit, playHitSFX, -1); if (((EnemyAI)this).isEnemyDead) { return; } ((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - force; if ((Object)(object)playerWhoHit != (Object)null) { provokePoints += 20 * force; ((EnemyAI)this).targetPlayer = playerWhoHit; stamina = 60f; } recovering = false; if (((NetworkBehaviour)this).IsOwner) { if (((EnemyAI)this).enemyHP <= 0) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); animator.SetInteger("state", 3); ((EnemyAI)this).isEnemyDead = true; moaiSoundPlayClientRpc("creatureDeath"); } else { moaiSoundPlayClientRpc("creatureHit"); } } } public new void OnDestroy() { if (Object.op_Implicit((Object)(object)mountedShotgun) && Object.op_Implicit((Object)(object)((Component)mountedShotgun).gameObject)) { Object.Destroy((Object)(object)((Component)mountedShotgun).gameObject); } if (Object.op_Implicit((Object)(object)ship) && Object.op_Implicit((Object)(object)((Component)ship).gameObject)) { Object.Destroy((Object)(object)((Component)ship).gameObject); } } public Vector3 GetWheelDestination() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); NavMesh.SamplePosition(((Component)ship.WheelPoint).transform.position, ref val, 30f, -1); return ((NavMeshHit)(ref val)).position; } [ClientRpc] public void SnapToWheelClientRpc(bool attach) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4085600339u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref attach, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4085600339u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (attach) { ((EnemyAI)this).agent.updatePosition = false; boardedShip = true; return; } ((EnemyAI)this).agent.updatePosition = true; NavMeshHit val3 = default(NavMeshHit); NavMesh.SamplePosition(((Component)ship).transform.position, ref val3, 20f, -1); ((Component)this).transform.position = ((NavMeshHit)(ref val3)).position; boardedShip = false; } } [ClientRpc] public void NotifyShipClientRpc(ulong uid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3316751872u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3316751872u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; MoaiPirateShip[] array = Object.FindObjectsOfType(); foreach (MoaiPirateShip moaiPirateShip in array) { if (((NetworkBehaviour)moaiPirateShip).NetworkObjectId == uid) { ship = moaiPirateShip; } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(197566479u, new RpcReceiveHandler(__rpc_handler_197566479), "RequestForShotgunServerRpc"); ((NetworkBehaviour)this).__registerRpc(1692792536u, new RpcReceiveHandler(__rpc_handler_1692792536), "ClientShotgunSetupClientRpc"); ((NetworkBehaviour)this).__registerRpc(1805517574u, new RpcReceiveHandler(__rpc_handler_1805517574), "PlayVoicelineClientRpc"); ((NetworkBehaviour)this).__registerRpc(1226036578u, new RpcReceiveHandler(__rpc_handler_1226036578), "PlayShotgunPrepareClientRpc"); ((NetworkBehaviour)this).__registerRpc(307228437u, new RpcReceiveHandler(__rpc_handler_307228437), "PlayShotgunReloadClientRpc"); ((NetworkBehaviour)this).__registerRpc(2498152332u, new RpcReceiveHandler(__rpc_handler_2498152332), "ShotgunAnimatorPlayClientRpc"); ((NetworkBehaviour)this).__registerRpc(1334591477u, new RpcReceiveHandler(__rpc_handler_1334591477), "TempHpClientRpc"); ((NetworkBehaviour)this).__registerRpc(4030215880u, new RpcReceiveHandler(__rpc_handler_4030215880), "triggerLinkEnableClientRpc"); ((NetworkBehaviour)this).__registerRpc(2278283497u, new RpcReceiveHandler(__rpc_handler_2278283497), "triggerLinkDisableClientRpc"); ((NetworkBehaviour)this).__registerRpc(4085600339u, new RpcReceiveHandler(__rpc_handler_4085600339), "SnapToWheelClientRpc"); ((NetworkBehaviour)this).__registerRpc(3316751872u, new RpcReceiveHandler(__rpc_handler_3316751872), "NotifyShipClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_197566479(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).RequestForShotgunServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1692792536(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong uid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref uid); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).ClientShotgunSetupClientRpc(uid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1805517574(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).PlayVoicelineClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1226036578(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).PlayShotgunPrepareClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_307228437(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).PlayShotgunReloadClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2498152332(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string id = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref id, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).ShotgunAnimatorPlayClientRpc(id); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1334591477(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int val = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).TempHpClientRpc(val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4030215880(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).triggerLinkEnableClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2278283497(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).triggerLinkDisableClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4085600339(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool attach = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref attach, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).SnapToWheelClientRpc(attach); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3316751872(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong uid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref uid); target.__rpc_exec_stage = (__RpcExecStage)1; ((MoaiPirateAI)(object)target).NotifyShipClientRpc(uid); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MoaiPirateAI"; } } internal class PurpleEnemyAI : MOAIAICORE { private new enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance, Grabbing, Throwing, Teleporting } public AudioSource creatureGrab; public AudioSource creatureHold; public AudioSource creatureThrow; public AudioSource creatureTeleportOut; public AudioSource creatureTeleportIn; protected float teleportCooldownSetRoaming = 8f; protected float teleportCooldownSetPlayer = 2f; protected float teleportCooldown = 8f; protected PlayerControllerB playerTeleAnchor = null; protected float playerGrabTime = 0f; protected float playerGrabDuration = 0f; protected float playerThrowMin = 60f; protected float playerThrowMax = 150f; protected float playerGrabStamina = 0f; public GameObject teleportEffect; protected float padSpawnChance = 0.1f; protected int tempHp = 0; protected int tempHpCD = 0; public GameObject holdEffect; protected int scanRate = 25; public Transform throwPoint; private float sightRange = 20f; protected EnemyAI currentEnemyHeld = null; protected PlayerControllerB currentPlayerHeld = null; protected GameObject currentTrapHeld = null; protected GameObject currentTrapThrowing = null; protected EnemyAI currentEnemyThrowing = null; private Vector3 throwTarget = Vector3.zero; protected int healthBeforeGrab = 0; public float enemyGrabTime = 0f; public float enemyReleaseTime = 0f; public float enemyGrabDuration = 0f; public float enemyReleaseDuration = 0f; public float enemyAngerTime = 0f; protected float startThrowTime = 0f; protected float throwTravelDuration = 0.5f; protected float throwArcHeight = 3f; public static EnemyAI[] managedEnemies; public override void Start() { baseInit(); holdEffect.SetActive(false); creatureGrab.volume = Plugin.moaiGlobalMusicVol.Value * 1.35f; creatureHold.volume = Plugin.moaiGlobalMusicVol.Value; creatureThrow.volume = Plugin.moaiGlobalMusicVol.Value * 1.45f; creatureTeleportOut.volume = Plugin.moaiGlobalMusicVol.Value; creatureTeleportIn.volume = Plugin.moaiGlobalMusicVol.Value; } public override void setPitches(float pitchAlter) { AudioSource obj = creatureGrab; obj.pitch /= pitchAlter; AudioSource obj2 = creatureHold; obj2.pitch /= pitchAlter; AudioSource obj3 = creatureThrow; obj3.pitch /= pitchAlter; AudioSource obj4 = creatureTeleportOut; obj4.pitch /= pitchAlter; AudioSource obj5 = creatureTeleportIn; obj5.pitch /= pitchAlter; } public void grabEnemy(EnemyAI ai) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((Component)ai).transform.parent = ((Component)this).transform; ((Component)ai).transform.localPosition = ((Component)throwPoint).transform.localPosition; ((Behaviour)ai).enabled = false; ((Behaviour)ai.agent).enabled = false; ai.isEnemyDead = true; ((Behaviour)ai.creatureAnimator).enabled = false; healthBeforeGrab = ai.enemyHP; currentEnemyHeld = ai; AudioSource[] componentsInChildren = ((Component)ai).gameObject.GetComponentsInChildren(); foreach (AudioSource val in componentsInChildren) { val.Stop(); } AudioSource[] componentsInParent = ((Component)ai).gameObject.GetComponentsInParent(); foreach (AudioSource val2 in componentsInParent) { val2.Stop(); } playGrabSoundClientRpc(); enemyGrabTime = Time.time; enemyGrabDuration = (float)(enemyRandom.NextDouble() * 60.0); } public void grabTrap(GameObject trap) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) trap.transform.parent = ((Component)this).transform; trap.transform.localPosition = ((Component)throwPoint).transform.localPosition; currentTrapHeld = trap; playGrabSoundClientRpc(); } public void letGoOfTrap(GameObject trap) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) trap.transform.parent = null; currentTrapHeld = null; NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(trap.transform.position, ref val, 15f, -1)) { trap.transform.position = ((NavMeshHit)(ref val)).position; } stopGrabSoundClientRpc(); } public bool notHoldingSomething() { return !Object.op_Implicit((Object)(object)currentEnemyHeld) && !Object.op_Implicit((Object)(object)currentPlayerHeld) && !Object.op_Implicit((Object)(object)currentTrapHeld); } [ClientRpc] public void grabPlayerClientRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1095100152u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1095100152u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == playerId) { ((Component)val3).transform.position = ((Component)throwPoint).transform.position; ((Component)val3).transform.parent = ((Component)throwPoint).transform; val3.playerCollider.enabled = false; currentPlayerHeld = val3; playGrabSoundClientRpc(); playerGrabTime = Time.time; double num = enemyRandom.NextDouble(); if (num < 0.75) { playerGrabDuration = (float)enemyRandom.NextDouble() * 3f; } else if (num < 0.949999988079071) { playerGrabDuration = (float)enemyRandom.NextDouble() * 9f + 3f; } else { playerGrabDuration = (float)enemyRandom.NextDouble() * 18f + 5f; } playerGrabStamina = stamina; stamina = 0f; } } } [ClientRpc] public void letGoOfPlayerClientRpc(ulong playerId, float launch = 0f) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_0219: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2541607301u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref launch, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2541607301u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 val3 = Vector3.zero; NavMeshHit val4 = default(NavMeshHit); if (NavMesh.SamplePosition(mouth.position, ref val4, 15f, -1)) { val3 = ((NavMeshHit)(ref val4)).position; } RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; RaycastHit val6 = default(RaycastHit); foreach (PlayerControllerB val5 in allPlayerScripts) { if (((NetworkBehaviour)val5).NetworkObject.NetworkObjectId != playerId) { continue; } ((Component)val5).transform.parent = null; val5.playerCollider.enabled = true; Vector3 position = ((Component)val5).transform.position; Vector3 down = Vector3.down; Vector3 localScale = ((Component)this).transform.localScale; if (Physics.Raycast(position, down, ref val6, 7f * ((Vector3)(ref localScale)).magnitude)) { val3 = Vector3.zero; } if (val3 != Vector3.zero) { ((Component)val5).transform.position = val3; } currentPlayerHeld = null; if (launch != 0f) { tempHp = ((EnemyAI)this).enemyHP; ((EnemyAI)this).enemyHP = 9999; if (val3 != Vector3.zero) { Landmine.SpawnExplosion(val3, false, 0f, 0f, 0, launch, (GameObject)null, false); } else { Landmine.SpawnExplosion(mouth.position, false, 0f, 0f, 0, launch, (GameObject)null, false); } tempHpCD = 6; playThrowSoundClientRpc(); stamina = playerGrabStamina; } stopGrabSoundClientRpc(); } } public void letGoOfEnemy(EnemyAI ai) { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) ((Component)ai).transform.parent = null; ((Behaviour)ai).enabled = true; ((Behaviour)ai.agent).enabled = true; ai.isEnemyDead = false; ((Behaviour)ai.creatureAnimator).enabled = true; if (healthBeforeGrab < 0) { ai.enemyHP = 2; } else { healthBeforeGrab = ai.enemyHP; } if (((Object)ai).name.ToLower().Contains("moai")) { try { MOAIAICORE mOAIAICORE = (MOAIAICORE)(object)ai; mOAIAICORE.goodBoy = -42; } catch (Exception) { } if (((Object)ai).name.ToLower().Contains("red")) { try { RedEnemyAI redEnemyAI = (RedEnemyAI)(object)ai; redEnemyAI.angerMoai(); } catch (Exception) { } } } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)ai).transform.position, ref val, 15f, -1)) { ai.agent.Warp(((NavMeshHit)(ref val)).position); } enemyReleaseTime = Time.time; stopGrabSoundClientRpc(); if (Time.time - enemyAngerTime < 8f) { enemyReleaseDuration = 0f; } else { enemyReleaseDuration = (float)(enemyRandom.NextDouble() * 10.0) + 5f; } currentEnemyHeld = null; } [ClientRpc] public void playGrabSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3029374574u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3029374574u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureGrab.Play(); creatureHold.Play(); holdEffect.SetActive(true); } } } [ClientRpc] public void stopGrabSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1687636284u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1687636284u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureHold.Stop(); holdEffect.SetActive(false); } } } [ClientRpc] public void playThrowSoundClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(605330739u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 605330739u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureThrow.Play(); } } } protected EnemyAI ClosestEnemyInRangePurple(float range) { //IL_0034: 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) EnemyAI[] array = managedEnemies; float num = range; EnemyAI result = null; EnemyAI[] array2 = array; foreach (EnemyAI val in array2) { if (!((Object)(object)val == (Object)null)) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); if (num2 < num && val.enemyHP > 0 && !val.isEnemyDead && !unreachableEnemies.Contains(val) && ((Object)val).GetInstanceID() != ((Object)this).GetInstanceID()) { num = num2; result = val; } } } return result; } public Vector3 pickThrowTargetAI() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((EnemyAI)this).targetPlayer)) { return Vector3.zero; } NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)((EnemyAI)this).targetPlayer).transform.position + ((EnemyAI)this).targetPlayer.velocityLastFrame, ref val, 20f, -1)) { return ((NavMeshHit)(ref val)).position; } return Vector3.zero; } [ClientRpc] public void updateThrowPositionClientRpc(Vector3 position, Quaternion rotation, ulong uid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3015904210u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rotation); BytePacker.WriteValueBitPacked(val, uid); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3015904210u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; EnemyAI[] array = managedEnemies; EnemyAI val3 = null; EnemyAI[] array2 = array; foreach (EnemyAI val4 in array2) { if (!((Object)(object)val4 == (Object)null) && ((NetworkBehaviour)val4).NetworkObject.NetworkObjectId == uid) { val3 = val4; break; } } if (Object.op_Implicit((Object)(object)val3)) { if (rotation != Quaternion.identity) { ((Component)val3).transform.rotation = rotation; } ((Component)val3).transform.position = position; } } public override void Update() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); baseUpdate(); teleportCooldown -= Time.deltaTime; if (Object.op_Implicit((Object)(object)currentEnemyThrowing) && throwTarget != Vector3.zero) { float num = Time.time - startThrowTime; float num2 = num / throwTravelDuration; Vector3 val = Vector3.Lerp(((Component)throwPoint).transform.position, throwTarget, num2); float num3 = -4f * throwArcHeight * num2 * num2 + 4f * throwArcHeight * num2; Quaternion rotation = ((Component)currentEnemyThrowing).transform.rotation; if (((Object)currentEnemyThrowing).name.ToLower().Contains("moai")) { ((Quaternion)(ref rotation))..ctor(rotation.x, ((Component)this).transform.rotation.y, rotation.z, rotation.w); } updateThrowPositionClientRpc(new Vector3(val.x, val.y + num3, val.z), rotation, ((NetworkBehaviour)currentEnemyThrowing).NetworkObject.NetworkObjectId); if (num >= throwTravelDuration) { letGoOfEnemy(currentEnemyThrowing); currentEnemyHeld = null; currentEnemyThrowing = null; throwTarget = Vector3.zero; } } if (Object.op_Implicit((Object)(object)currentTrapThrowing) && throwTarget != Vector3.zero) { float num4 = Time.time - startThrowTime; float num5 = num4 / throwTravelDuration; Vector3 val2 = Vector3.Lerp(((Component)throwPoint).transform.position, throwTarget, num5); float num6 = -4f * throwArcHeight * num5 * num5 + 4f * throwArcHeight * num5; currentTrapThrowing.transform.position = new Vector3(val2.x, val2.y + num6, val2.z); Quaternion rotation2 = currentTrapThrowing.transform.rotation; if (((Object)currentTrapThrowing).name.ToLower().Contains("moai")) { Quaternion rotation3 = currentTrapThrowing.transform.rotation; ((Quaternion)(ref rotation3)).Set(rotation2.x, ((Component)this).transform.rotation.y, rotation2.z, rotation2.w); } if (num4 >= throwTravelDuration) { letGoOfTrap(currentTrapThrowing); currentTrapHeld = null; currentTrapThrowing = null; throwTarget = Vector3.zero; } } if (((EnemyAI)this).isEnemyDead || ((EnemyAI)this).enemyHP <= 0) { if (Object.op_Implicit((Object)(object)currentEnemyHeld)) { letGoOfEnemy(currentEnemyHeld); currentEnemyHeld = null; } if (Object.op_Implicit((Object)(object)currentPlayerHeld)) { letGoOfPlayerClientRpc(((NetworkBehaviour)currentPlayerHeld).NetworkObject.NetworkObjectId); currentPlayerHeld = null; } if (creatureHold.isPlaying) { creatureHold.Stop(); } } if (Object.op_Implicit((Object)(object)currentEnemyHeld) && Time.time - enemyGrabTime > enemyGrabDuration && Time.time - enemyAngerTime > 8f) { letGoOfEnemy(currentEnemyHeld); } if (creatureTeleportOut.isPlaying) { if (!teleportEffect.activeInHierarchy) { teleportEffect.SetActive(true); } if (creatureTeleportOut.time >= 0.58f && Object.op_Implicit((Object)(object)playerTeleAnchor) && teleportCooldown <= 0f) { teleportMoaiAroundPlayer(); playerTeleAnchor = null; teleportCooldown = teleportCooldownSetPlayer; } } else if (teleportEffect.activeInHierarchy) { teleportEffect.SetActive(false); } } public void teleportMoaiAroundPlayer() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val4 = default(NavMeshHit); for (int i = 0; i < 5; i++) { Vector3 zero = Vector3.zero; if (Object.op_Implicit((Object)(object)playerTeleAnchor)) { Vector3 position = ((Component)playerTeleAnchor).transform.position; Vector3 val = ((Component)playerTeleAnchor).transform.forward; Vector3 val2 = -((Vector3)(ref val)).normalized; float num = (float)(enemyRandom.NextDouble() * 210.0 - 105.0); Vector3 val3 = Quaternion.Euler(0f, num, 0f) * val2; float num2 = 0f; num2 = ((!(enemyRandom.NextDouble() > 0.5)) ? 5f : 1.5f); double num3 = enemyRandom.NextDouble() * (double)num2 + 2.0; val = ((Component)this).transform.localScale; zero = position + val3 * (float)(num3 + (double)(((Vector3)(ref val)).magnitude * 2f)); if (zero != Vector3.zero && NavMesh.SamplePosition(zero, ref val4, 25f, -1)) { ((Component)this).transform.position = ((NavMeshHit)(ref val4)).position; break; } continue; } randomTeleport(); break; } } public void randomTeleport() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) Vector3 zero = Vector3.zero; float x = ((Component)this).transform.position.x; float y = ((Component)this).transform.position.y; float z = ((Component)this).transform.position.z; float num = (float)enemyRandom.NextDouble() * 40f - 20f; float y2 = ((Component)this).transform.position.y; float num2 = (float)enemyRandom.NextDouble() * 40f - 20f; ((Vector3)(ref zero))..ctor(x + num, y + y2, z + num2); NavMeshHit val = default(NavMeshHit); if (zero != Vector3.zero && NavMesh.SamplePosition(zero, ref val, 25f, -1)) { ((Component)this).transform.position = ((NavMeshHit)(ref val)).position; } } [ClientRpc] public void stopSFXClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3545795872u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3545795872u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).creatureSFX.Stop(); } } } [ClientRpc] public void updateEnemiesClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(341061936u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 341061936u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; managedEnemies = Object.FindObjectsOfType(); } } } public override void DoAIInterval() { //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Invalid comparison between Unknown and I4 //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Invalid comparison between Unknown and I4 //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).isEnemyDead) { return; } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); if (sourcecycle % scanRate == 0) { updateEnemiesClientRpc(); } if (Time.time - playerGrabTime > playerGrabDuration && Object.op_Implicit((Object)(object)currentPlayerHeld)) { float launch = (float)((double)playerThrowMin + enemyRandom.NextDouble() * (double)(playerThrowMax - playerThrowMin) * enemyRandom.NextDouble()); letGoOfPlayerClientRpc(((NetworkBehaviour)currentPlayerHeld).NetworkObject.NetworkObjectId, launch); } if (tempHpCD > 0) { tempHpCD--; if (tempHpCD == 1) { ((EnemyAI)this).enemyHP = tempHp; } } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: if (((EnemyAI)this).creatureSFX.isPlaying) { stopSFXClientRpc(); } if (Object.op_Implicit((Object)(object)ClosestEnemyInRangePurple(sightRange)) && goodBoy <= 0 && notHoldingSomething() && Time.time - enemyReleaseTime > enemyReleaseDuration) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } baseSearchingForPlayer(); break; case 5: baseHeadingToEntrance(); break; case 1: baseGuard(); break; case 7: ((EnemyAI)this).agent.speed = 1.5f * Plugin.moaiGlobalSpeed.Value; if (Object.op_Implicit((Object)(object)currentEnemyHeld) && !Object.op_Implicit((Object)(object)currentEnemyThrowing)) { currentEnemyThrowing = currentEnemyHeld; throwTarget = pickThrowTargetAI(); startThrowTime = Time.time; if (throwTarget != Vector3.zero) { playThrowSoundClientRpc(); } } if (Object.op_Implicit((Object)(object)currentEnemyThrowing) && throwTarget == Vector3.zero) { letGoOfEnemy(currentEnemyThrowing); currentEnemyHeld = null; currentEnemyThrowing = null; throwTarget = Vector3.zero; ((EnemyAI)this).creatureVoice.Play(); voicePlayClientRpc(); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (Object.op_Implicit((Object)(object)currentTrapHeld) && !Object.op_Implicit((Object)(object)currentTrapThrowing)) { currentEnemyThrowing = currentEnemyHeld; throwTarget = pickThrowTargetAI(); startThrowTime = Time.time; if (throwTarget != Vector3.zero) { playThrowSoundClientRpc(); } } if (Object.op_Implicit((Object)(object)currentTrapThrowing) && throwTarget == Vector3.zero) { letGoOfTrap(currentTrapThrowing); currentTrapHeld = null; currentTrapThrowing = null; throwTarget = Vector3.zero; ((EnemyAI)this).creatureVoice.Play(); voicePlayClientRpc(); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (notHoldingSomething()) { ((EnemyAI)this).creatureVoice.Play(); voicePlayClientRpc(); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; case 2: { if (goodBoy >= 0) { baseStickingInFrontOfEnemy(); break; } ((EnemyAI)this).targetPlayer = null; ((EnemyAI)this).agent.speed = 7f * Plugin.moaiGlobalSpeed.Value; EnemyAI val = ClosestEnemyInRangePurple(sightRange); stamina -= 1.5f; if (!((EnemyAI)this).creatureSFX.isPlaying) { moaiSoundPlayClientRpc("creatureSFX"); } if ((int)((EnemyAI)this).agent.pathStatus == 1 || (int)((EnemyAI)this).agent.pathStatus == 2) { unreachableEnemies.Add(val); } if (!Object.op_Implicit((Object)(object)val) || Time.time - enemyReleaseTime < enemyReleaseDuration) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (!notHoldingSomething()) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } StalkPos = ((Component)val).transform.position; ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); break; } case 3: enemyAngerTime = Time.time; if (Object.op_Implicit((Object)(object)currentEnemyHeld) || Object.op_Implicit((Object)(object)currentTrapHeld)) { ((EnemyAI)this).SwitchToBehaviourClientRpc(7); } if (notHoldingSomething() && teleportCooldown <= 0f && enemyRandom.NextDouble() <= 0.09000000357627869) { stopAllSound(); creatureTeleportOut.Stop(); creatureTeleportOut.time = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(8); } if (notHoldingSomething() && enemyRandom.NextDouble() <= (double)padSpawnChance) { spawnPad(); } baseStickingInFrontOfPlayer(); break; case 8: ((EnemyAI)this).agent.speed = 1.5f * Plugin.moaiGlobalSpeed.Value; if (Object.op_Implicit((Object)(object)((EnemyAI)this).targetPlayer)) { playerTeleAnchor = ((EnemyAI)this).targetPlayer; if (!creatureTeleportOut.isPlaying) { creatureTeleportOutPlayClientRpc(); } ((EnemyAI)this).targetPlayer = null; } if (!Object.op_Implicit((Object)(object)((EnemyAI)this).targetPlayer) && !Object.op_Implicit((Object)(object)playerTeleAnchor)) { ((EnemyAI)this).creatureVoice.Play(); voicePlayClientRpc(); ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } break; case 4: baseHeadSwingAttackInProgress(); break; default: LogDebug("This Behavior State doesn't exist!"); break; } } [ClientRpc] public void creatureTeleportOutPlayClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2444722880u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2444722880u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; creatureTeleportOut.Play(); } } } public void spawnPad() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)RoundManager.Instance).IsHost) { Vector3 val = selectPadSpawnPosition(); if (!(val == Vector3.zero)) { GameObject val2 = Object.Instantiate(Plugin.PlasmaPad, val, Plugin.PlasmaPad.transform.rotation); val2.transform.parent = null; val2.transform.position = val; val2.SetActive(true); val2.GetComponent().Spawn(false); val2.GetComponent().owner = (EnemyAI)(object)this; } } } public Vector3 selectPadSpawnPosition() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((EnemyAI)this).targetPlayer)) { return Vector3.zero; } Vector3 position = ((Component)((EnemyAI)this).targetPlayer).transform.position; Vector3 forward = ((Component)((EnemyAI)this).targetPlayer).transform.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; float num = (float)(enemyRandom.NextDouble() * 360.0); Vector3 val = Quaternion.Euler(0f, num, 0f) * normalized; Vector3 val2 = position + val * (float)(enemyRandom.NextDouble() * 10.0 + 1.5); NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(val2, ref val3, 20f, -1)) { return ((NavMeshHit)(ref val3)).position; } return Vector3.zero; } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (timeSinceHittingLocalPlayer < 0.5f || collidedEnemy.isEnemyDead || ((EnemyAI)this).isEnemyDead) { return; } timeSinceHittingLocalPlayer = 0f; if (notHoldingSomething() && Time.time - enemyReleaseTime > enemyReleaseDuration) { grabEnemy(collidedEnemy); if (((EnemyAI)this).currentBehaviourStateIndex == 3) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } } else if (!((Object)((Component)collidedEnemy).gameObject).name.ToLower().Contains("moai") || ((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf != ((Component)((Component)collidedEnemy).transform.Find("Halo")).gameObject.activeSelf) { collidedEnemy.HitEnemy(1, (PlayerControllerB)null, true, -1); } } private void OnCollisionEnter(Collision collision) { if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } GameObject gameObject = collision.gameObject; if (!Object.op_Implicit((Object)(object)collision.gameObject)) { return; } SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; SpawnableMapObject[] array = spawnableMapObjects; foreach (SpawnableMapObject val in array) { if (isTrapGO(gameObject)) { grabTrap(gameObject); } } } public bool isTrapGO(GameObject GO) { SpawnableMapObject[] spawnableMapObjects = RoundManager.Instance.currentLevel.spawnableMapObjects; SpawnableMapObject[] array = spawnableMapObjects; foreach (SpawnableMapObject val in array) { if (((Object)val.prefabToSpawn).name.Equals(((Object)GO).name)) { return true; } } return false; } public override void OnCollideWithPlayer(Collider other) { //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) if (timeSinceHittingLocalPlayer < 0.5f) { return; } PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (!((Object)(object)val != (Object)null)) { return; } timeSinceHittingLocalPlayer = 0f; if (!Object.op_Implicit((Object)(object)((Component)this).transform.Find("Halo")) || !((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf) { if (notHoldingSomething() && goodBoy <= 0) { val.DamagePlayer(10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { grabPlayerClientRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId); } else { grabPlayerServerRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId); } } else if (val.health < 30) { val.KillPlayer(val.velocityLastFrame, true, (CauseOfDeath)6, 0, default(Vector3), false); } else { val.DamagePlayer(30, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } else if (((Component)((Component)this).transform.Find("Halo")).gameObject.activeSelf && val.health <= 90) { val.DamagePlayer(-10, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } } [ServerRpc(RequireOwnership = false)] public void grabPlayerServerRpc(ulong netid) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2507565426u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, netid); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2507565426u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; grabPlayerClientRpc(netid); } } } [ClientRpc] public void voicePlayClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1170205326u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1170205326u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((EnemyAI)this).creatureVoice.isPlaying) { ((EnemyAI)this).creatureVoice.Play(); } } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { base.HitEnemy(force, playerWhoHit, playHitSFX, -1); if (!((EnemyAI)this).isEnemyDead && (Object)(object)playerWhoHit != (Object)null) { provokePoints += 20 * force; stamina = 60f; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1095100152u, new RpcReceiveHandler(__rpc_handler_1095100152), "grabPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(2541607301u, new RpcReceiveHandler(__rpc_handler_2541607301), "letGoOfPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(3029374574u, new RpcReceiveHandler(__rpc_handler_3029374574), "playGrabSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(1687636284u, new RpcReceiveHandler(__rpc_handler_1687636284), "stopGrabSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(605330739u, new RpcReceiveHandler(__rpc_handler_605330739), "playThrowSoundClientRpc"); ((NetworkBehaviour)this).__registerRpc(3015904210u, new RpcReceiveHandler(__rpc_handler_3015904210), "updateThrowPositionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3545795872u, new RpcReceiveHandler(__rpc_handler_3545795872), "stopSFXClientRpc"); ((NetworkBehaviour)this).__registerRpc(341061936u, new RpcReceiveHandler(__rpc_handler_341061936), "updateEnemiesClientRpc"); ((NetworkBehaviour)this).__registerRpc(2444722880u, new RpcReceiveHandler(__rpc_handler_2444722880), "creatureTeleportOutPlayClientRpc"); ((NetworkBehaviour)this).__registerRpc(2507565426u, new RpcReceiveHandler(__rpc_handler_2507565426), "grabPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1170205326u, new RpcReceiveHandler(__rpc_handler_1170205326), "voicePlayClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1095100152(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).grabPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2541607301(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); float launch = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref launch, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).letGoOfPlayerClientRpc(playerId, launch); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3029374574(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).playGrabSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1687636284(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).stopGrabSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_605330739(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).playThrowSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3015904210(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); ulong uid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref uid); target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).updateThrowPositionClientRpc(position, rotation, uid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3545795872(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).stopSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_341061936(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).updateEnemiesClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2444722880(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).creatureTeleportOutPlayClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2507565426(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong netid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref netid); target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).grabPlayerServerRpc(netid); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1170205326(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((PurpleEnemyAI)(object)target).voicePlayClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PurpleEnemyAI"; } } public class QuantumPad : NetworkBehaviour { public EnemyAI owner; public AudioSource padChargingSound; public AudioSource padActivatedSound; public GameObject PadParticles; public GameObject PadExplosion; protected float timer = 10f; protected float spawnTime = 0f; private void Start() { if (!padChargingSound.isPlaying) { padChargingSound.Play(); } spawnTime = Time.time; AudioSource obj = padActivatedSound; obj.volume *= Plugin.moaiGlobalMusicVol.Value * 1.6f; AudioSource obj2 = padChargingSound; obj2.volume *= Plugin.moaiGlobalMusicVol.Value * 1.6f; } private void FixedUpdate() { if (((NetworkBehaviour)RoundManager.Instance).IsHost && Time.time - spawnTime > 2.3f && PadParticles.activeInHierarchy) { padExplosionClientRpc(); teleportPlayersInRing(); endCycle(); } } [ClientRpc] public void padExplosionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2018753540u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2018753540u, val2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PadParticles.SetActive(false); PadExplosion.SetActive(true); padActivatedSound.Play(); } } } public async void endCycle() { await Task.Delay(4000); Object.Destroy((Object)(object)((Component)this).gameObject); } public void teleportPlayersInRing() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)RoundManager.Instance).IsHost) { return; } RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; List list = new List(); foreach (PlayerControllerB val in allPlayerScripts) { Vector3 position = ((Component)val).transform.position; Vector3 position2 = ((Component)this).transform.position; if (Vector3.Distance(position, position2) < 8f) { list.Add(val); } } if (list.Count > 0) { Random random = new Random(); PlayerControllerB val2 = list[random.Next(0, list.Count)]; PurpleEnemyAI purpleEnemyAI = (PurpleEnemyAI)(object)owner; if (purpleEnemyAI.notHoldingSomething()) { purpleEnemyAI.grabPlayerClientRpc(((NetworkBehaviour)val2).NetworkObject.NetworkObjectId); } Landmine.SpawnExplosion(((Component)this).transform.position, false, 0f, 0f, 0, 20f, (GameObject)null, true); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2018753540u, new RpcReceiveHandler(__rpc_handler_2018753540), "padExplosionClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2018753540(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((QuantumPad)(object)target).padExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "QuantumPad"; } } internal class RedEnemyAI : MOAIAICORE { private new enum State { SearchingForPlayer, Guard, StickingInFrontOfEnemy, StickingInFrontOfPlayer, HeadSwingAttackInProgress, HeadingToEntrance, Preparing, Blitz, Kidnapping } private bool preparing = false; private float anger = 0f; private Vector3 blitzTarget = Vector3.zero; private Vector3 startPosFromTarget = Vector3.zero; private int playerTargetSteps = 0; private int tempHp = 0; private PlayerControllerB playerHeld = null; private bool afterEntranceTransport = false; private GameObject kidnapNode = null; private int invalidCounter = 0; public Transform playerGrabPoint; public AudioSource creaturePrepare; public AudioSource creatureBlitz; public AudioSource creatureKidnap; public GameObject flameEffect; public GameObject swirlEffect; public override void Start() { baseInit(); creatureBlitz.volume = Plugin.moaiGlobalMusicVol.Value; creaturePrepare.volume = Plugin.moaiGlobalMusicVol.Value; creatureKidnap.volume = Plugin.moaiGlobalMusicVol.Value; flameEffect.SetActive(false); } public override void setPitches(float pitchAlter) { AudioSource obj = creatureBlitz; obj.pitch /= pitchAlter; AudioSource obj2 = creaturePrepare; obj2.pitch /= pitchAlter; AudioSource obj3 = creatureKidnap; obj3.pitch /= pitchAlter; } public override void Update() { ((EnemyAI)this).Update(); baseUpdate(); if (((EnemyAI)this).isEnemyDead && Object.op_Implicit((Object)(object)playerHeld)) { letGoOfPlayerClientRpc(((NetworkBehaviour)playerHeld).NetworkObject.NetworkObjectId); kidnapNode = null; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 6: if (!flameEffect.activeInHierarchy) { flameEffect.SetActive(true); } break; case 7: if (!flameEffect.activeInHierarchy) { flameEffect.SetActive(true); } break; default: if (flameEffect.activeInHierarchy) { flameEffect.SetActive(false); } break; } } public override void playSoundId(string id) { switch (id) { case "creatureBlitz": stopAllSound(); creatureBlitz.Play(); break; case "creaturePrepare": stopAllSound(); creaturePrepare.Play(); break; case "creatureKidnap": stopAllSound(); creatureKidnap.Play(); break; } } public bool playerIsAlone(PlayerControllerB player) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.playerClientId != player.playerClientId && Vector3.Distance(((Component)val).transform.position, ((Component)player).transform.position) < 30f) { return false; } } return true; } public bool playerOnRock(PlayerControllerB player) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) string text = "None"; Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)player).transform.position + Vector3.up, -Vector3.up); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, ref val2, 6f, StartOfRound.Instance.walkableSurfacesMask, (QueryTriggerInteraction)1)) { for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (((Component)((RaycastHit)(ref val2)).collider).CompareTag(StartOfRound.Instance.footstepSurfaces[i].surfaceTag)) { text = StartOfRound.Instance.footstepSurfaces[i].surfaceTag; } } } string text2 = text; string text3 = text2; if (!(text3 == "Rock")) { if (!(text3 == "Concrete")) { return false; } return true; } return true; } public bool playerIsDefenseless(PlayerControllerB player) { GrabbableObject[] itemSlots = player.ItemSlots; foreach (GrabbableObject val in itemSlots) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.itemProperties) && val.itemProperties.isDefensiveWeapon) { return false; } } return true; } public void angerMoai() { anger = 100f; } public unsafe override void DoAIInterval() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_09bd: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: 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_0a1e: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Unknown result type (might be due to invalid IL or missing references) //IL_0878: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_087c: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_0889: Unknown result type (might be due to invalid IL or missing references) //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_0969: 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_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Unknown result type (might be due to invalid IL or missing references) //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) if (((EnemyAI)this).isEnemyDead) { return; } ((EnemyAI)this).DoAIInterval(); baseAIInterval(); if (((EnemyAI)this).currentBehaviourStateIndex == 4 && Object.op_Implicit((Object)(object)playerHeld)) { letGoOfPlayerClientRpc(((NetworkBehaviour)playerHeld).NetworkObject.NetworkObjectId); } Vector3 val = ((EnemyAI)this).agent.velocity; if (((Vector3)(ref val)).magnitude < 1f && Object.op_Implicit((Object)(object)playerHeld)) { invalidCounter++; if (invalidCounter > 30 && Object.op_Implicit((Object)(object)playerHeld)) { letGoOfPlayerClientRpc(((NetworkBehaviour)playerHeld).NetworkObject.NetworkObjectId); } } else if (invalidCounter > 0) { invalidCounter--; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: if (Object.op_Implicit((Object)(object)playerHeld)) { Debug.Log((object)"RED MOAI: Switching back to kidnapping state -> continuation:: "); afterEntranceTransport = true; kidnapNode = ((EnemyAI)this).allAINodes[Random.RandomRangeInt(0, ((EnemyAI)this).allAINodes.Length)]; ((EnemyAI)this).SwitchToBehaviourClientRpc(8); break; } if (FoundClosestPlayerInRange(40f, needLineOfSight: true) || provokePoints > 0) { if (anger < 100f) { if (!swirlEffect.activeInHierarchy) { toggleSwirlEffectClientRpc(value: true); } ((EnemyAI)this).agent.speed = 0.01f; if (playerOnRock(((EnemyAI)this).targetPlayer)) { anger += 20f; break; } float num4 = (float)Math.Log(60f / Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position), 1.3); if (num4 > 2f) { anger += num4; } else { anger += 2f; } break; } if (swirlEffect.activeInHierarchy) { toggleSwirlEffectClientRpc(value: false); } if (anger >= 100f && playerIsAlone(((EnemyAI)this).targetPlayer) && playerIsDefenseless(((EnemyAI)this).targetPlayer) && !playerOnRock(((EnemyAI)this).targetPlayer) && (double)((Component)this).transform.localScale.x > 0.3 && (double)((Component)this).transform.localScale.x < 2.5) { Debug.Log((object)"Swithing to Kidnap State"); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(8); anger = 0f; moaiSoundPlayClientRpc("creatureKidnap"); break; } if (anger >= 100f) { Debug.Log((object)"Swithing to Preparing State"); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); tempHp = ((EnemyAI)this).enemyHP; ((EnemyAI)this).SwitchToBehaviourClientRpc(6); anger = 0f; break; } } else { if (swirlEffect.activeInHierarchy) { toggleSwirlEffectClientRpc(value: false); } if (anger > 0f) { anger -= 1.3f; } } baseSearchingForPlayer(); break; case 8: ((EnemyAI)this).agent.speed = 20f * Plugin.moaiGlobalSpeed.Value; ((EnemyAI)this).agent.acceleration = 80f; ((EnemyAI)this).agent.angularSpeed = 1200f; if (!Object.op_Implicit((Object)(object)playerHeld)) { Debug.Log((object)"Transporting Player"); if (!FoundClosestPlayerInRange(40f, needLineOfSight: true)) { tempHp = ((EnemyAI)this).enemyHP; blitzReset(); break; } float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position); val = ((Component)((EnemyAI)this).targetPlayer).transform.localScale; float magnitude2 = ((Vector3)(ref val)).magnitude; val = ((Component)this).transform.localScale; if (num2 < magnitude2 + Math.Max(((Vector3)(ref val)).magnitude, 1f)) { playerHeld = ((EnemyAI)this).targetPlayer; Debug.Log((object)"RED MOAI: Attaching living player to mouth."); attachPlayerClientRpc(((NetworkBehaviour)playerHeld).NetworkObject.NetworkObjectId, healPlayer: true); } break; } Debug.Log((object)("RED MOAI: PlayerHeld -> " + !playerHeld.isInsideFactory)); attachPlayerClientRpc(((NetworkBehaviour)playerHeld).NetworkObject.NetworkObjectId); if (!afterEntranceTransport) { Debug.Log((object)"RED MOAI: Transporting to Factory..."); baseHeadingToEntrance(); } else if (Object.op_Implicit((Object)(object)kidnapNode) && !((EnemyAI)this).agent.isPathStale) { Debug.Log((object)("RED MOAI: searching for kidnapNode -> " + (object)kidnapNode)); ((EnemyAI)this).agent.speed = 10f * Plugin.moaiGlobalSpeed.Value; ((EnemyAI)this).agent.acceleration = 80f; ((EnemyAI)this).agent.angularSpeed = 1200f; ((EnemyAI)this).SetDestinationToPosition(kidnapNode.transform.position, false); float num3 = Vector3.Distance(((Component)this).transform.position, kidnapNode.transform.position); val = ((Component)this).transform.localScale; if (num3 < 2f + ((Vector3)(ref val)).magnitude) { kidnapNode = null; } } else { Debug.Log((object)("RED MOAI: Let go of player -> " + ((EnemyAI)this).agent.isPathStale + " -- " + (object)kidnapNode)); letGoOfPlayerClientRpc(((NetworkBehaviour)playerHeld).NetworkObject.NetworkObjectId); } break; case 5: baseHeadingToEntrance(); break; case 1: baseGuard(); break; case 2: baseStickingInFrontOfEnemy(); break; case 3: baseStickingInFrontOfPlayer(); break; case 4: baseHeadSwingAttackInProgress(); break; case 6: ((EnemyAI)this).agent.speed = 0f; if ((double)creaturePrepare.time > 3.7) { LogDebug("MOAIRED: Blitz Activated"); preparing = false; playerTargetSteps = 0; impatience = 0f; ((EnemyAI)this).SwitchToBehaviourClientRpc(7); tempHp = ((EnemyAI)this).enemyHP; } else if (!preparing) { moaiSoundPlayClientRpc("creaturePrepare"); preparing = true; } break; case 7: { ((EnemyAI)this).agent.speed = 35f * Plugin.moaiGlobalSpeed.Value; ((EnemyAI)this).agent.acceleration = 80f; ((EnemyAI)this).agent.angularSpeed = 1200f; ((EnemyAI)this).enemyHP = 500; if (blitzTarget == Vector3.zero) { impatience = 0f; PlayerControllerB closestPlayer = ((EnemyAI)this).GetClosestPlayer(false, true, false); if (!Object.op_Implicit((Object)(object)closestPlayer)) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); blitzReset(); break; } Vector3 position = ((Component)closestPlayer).gameObject.transform.position; Vector3 val2 = ((Component)this).transform.position - position; Vector3 val3 = Vector3.Normalize(val2) * Math.Min(Vector3.Distance(position, ((Component)this).transform.position), Random.Range(7f, 9f)); NavMeshHit val4 = default(NavMeshHit); if (!NavMesh.SamplePosition(position - val3, ref val4, 10f, -1)) { val = position; string? text = ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString(); val = val2; Debug.Log((object)("MOAI RED: Position Sample Failure -> " + text + " -- " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString())); blitzReset(); break; } val = ((NavMeshHit)(ref val4)).position; Debug.Log((object)("MOAI RED: Position Sample Success -> " + ((object)(*(Vector3*)(&val))/*cast due to .constrained prefix*/).ToString())); blitzTarget = ((NavMeshHit)(ref val4)).position; moaiSoundPlayClientRpc("creatureBlitz"); spawnExplosionClientRpc(); startPosFromTarget = ((Component)this).transform.position; if (playerTargetSteps >= 3) { Debug.Log((object)"red: target end"); blitzReset(); break; } playerTargetSteps++; Debug.Log((object)"red: target player"); } ((EnemyAI)this).targetPlayer = null; ((EnemyAI)this).SetDestinationToPosition(blitzTarget, false); float num = Vector3.Distance(((Component)this).transform.position, blitzTarget); val = ((Component)this).transform.localScale; float magnitude = ((Vector3)(ref val)).magnitude; val = ((Component)this).transform.localScale; if (num < magnitude + ((Vector3)(ref val)).magnitude + impatience) { blitzTarget = Vector3.zero; } else { impatience += 0.1f; } break; } default: LogDebug("This Behavior State doesn't exist!"); break; } } public void blitzReset() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); stamina = 0f; ((EnemyAI)this).enemyHP = tempHp; blitzTarget = Vector3.zero; } [ClientRpc] public void spawnExplosionClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1652677549u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1652677549u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 5.7f, 6.4f, 50, 0f, (GameObject)null, false); } } } [ClientRpc] public void attachPlayerClientRpc(ulong playerId, bool healPlayer = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3107220931u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((FastBufferWriter)(ref val)).WriteValueSafe(ref healPlayer, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3107220931u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == playerId) { ((Component)val3).transform.position = playerGrabPoint.position; ((Component)val3).transform.parent = playerGrabPoint; val3.playerCollider.enabled = false; if (healPlayer) { val3.DamagePlayer(-30, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); } break; } } } [ClientRpc] public void letGoOfPlayerClientRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4022963640u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4022963640u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = null; RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val4 in allPlayerScripts) { if (((NetworkBehaviour)val4).NetworkObject.NetworkObjectId == playerId) { val3 = val4; } } ((Component)val3).transform.parent = null; val3.playerCollider.enabled = true; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)val3).transform.position, ref val5, 15f, -1)) { ((Component)val3).transform.position = ((NavMeshHit)(ref val5)).position; } if (((NetworkBehaviour)RoundManager.Instance).IsServer) { blitzReset(); tempHp = ((EnemyAI)this).enemyHP; afterEntranceTransport = false; playerHeld = null; } } [ClientRpc] public void toggleSwirlEffectClientRpc(bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2737356807u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2737356807u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; swirlEffect.SetActive(value); } } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { base.HitEnemy(force, playerWhoHit, playHitSFX, -1); if (!((EnemyAI)this).isEnemyDead && (Object)(object)playerWhoHit != (Object)null) { provokePoints += 20 * force; stamina = 60f; anger = Math.Max(100f, anger + (float)(force * 50)); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1652677549u, new RpcReceiveHandler(__rpc_handler_1652677549), "spawnExplosionClientRpc"); ((NetworkBehaviour)this).__registerRpc(3107220931u, new RpcReceiveHandler(__rpc_handler_3107220931), "attachPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(4022963640u, new RpcReceiveHandler(__rpc_handler_4022963640), "letGoOfPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(2737356807u, new RpcReceiveHandler(__rpc_handler_2737356807), "toggleSwirlEffectClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1652677549(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RedEnemyAI)(object)target).spawnExplosionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3107220931(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool healPlayer = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref healPlayer, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedEnemyAI)(object)target).attachPlayerClientRpc(playerId, healPlayer); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4022963640(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedEnemyAI)(object)target).letGoOfPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2737356807(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RedEnemyAI)(object)target).toggleSwirlEffectClientRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RedEnemyAI"; } } internal class SoulDevourerAI : EnemyAI { public enum State { SearchingForPlayer, Staring, HeadingToEntrance, Attacking, Shredding, Leaping, Fleeing, HeadingToMusic, Crying } protected Animator animator; protected float starePoints = 0f; protected float angerRate = 110f; protected int attackState = 0; private bool proccedRoar = false; private bool proccedCrouch = false; private bool proccedRun = false; private bool proceedShred = false; private bool proceedLeap = false; private PlayerControllerB shreddedPlayer = null; public Collider uprightCollider; public Collider foursCollider; public Transform mouth; protected bool thrashingCorpse = false; protected PlayerControllerB attachedPlayer = null; private float attachTime = 0f; private bool isOutSwitch = false; private float lastThrashTime = 0f; public Transform legCastPoint; protected float baseLeapChance = 100f; protected float leaptime = 0f; protected Vector3 leapPos; protected EntranceTeleport nearestEntrance = null; public Vector3 nearestEntranceNavPosition = Vector3.zero; protected PlayerControllerB mostRecentPlayer = null; protected int entranceDelay = 0; protected float chanceToLocateEntrancePlayerBonus = 0f; protected float chanceToLocateEntrance = 0f; public List unreachableEnemies = new List(); public Vector3 itemNavmeshPosition = Vector3.zero; protected int sourcecycle = 75; protected float stamina = 0f; protected bool recovering = false; public int provokePoints = 0; public Transform turnCompass; protected float timeSinceHittingLocalPlayer; protected float timeSinceNewRandPos; protected Vector3 positionRandomness; protected Vector3 StalkPos; protected Random enemyRandom; protected bool isDeadAnimationDone; private float timeSinceFleeStart = 0f; private Vector3 fleeDestination = Vector3.zero; public ParticleSystem shadowParticles; private bool awaitingShadowMode = false; private bool shadowEnable = false; private bool isVisible = true; public GameObject meshRenderRoot; private float timeControl = 1f; public AudioSource creatureRoar; public AudioSource creatureHit1; public AudioSource creatureHit2; private int hitRotation = 1; public AudioSource creatureStare; public AudioSource creatureExtract; public AudioSource creatureLeap; public AudioSource creatureDeath; public AudioSource creatureFlee; private bool markDead = false; public Volume postProcessVolume; protected float processScalar = 0.2f; protected float runAnimationCoefficient = 14f; protected float walkAnimationCoefficient = 3f; private bool musicPresent = false; private Vector3 musicDest = Vector3.zero; private float musicDist = 9999f; private int musicDelay = 0; public AudioSource creatureCrying; public float cryTime = 0f; public void LogDebug(string text) { Plugin.Logger.LogInfo((object)text); } public void facePosition(Vector3 pos) { //IL_0001: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0052: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos - ((Component)this).transform.position; val.y = 0f; if (val != Vector3.zero) { Quaternion val2 = Quaternion.LookRotation(val); ((Component)this).transform.rotation = Quaternion.Euler(0f, ((Quaternion)(ref val2)).eulerAngles.y, 0f); } } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); } public PlayerControllerB getNearestPlayer() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = RoundManager.Instance.playersManager.allPlayerScripts; PlayerControllerB result = null; float num = 1E+09f; foreach (PlayerControllerB val in allPlayerScripts) { if (Object.op_Implicit((Object)(object)val) && !val.isPlayerDead && val.isPlayerControlled && Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) < num) { num = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); result = val; } } return result; } public void listenForMusic() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = GameObject.Find("ItemShip"); musicPresent = false; if ((Object)(object)val != (Object)null) { if (base.currentBehaviourStateIndex == 8) { if (Vector3.Distance(val.transform.position, ((Component)this).transform.position) < 9f) { musicPresent = true; musicDest = val.transform.position; musicDist = Vector3.Distance(val.transform.position, ((Component)this).transform.position); return; } } else if (Vector3.Distance(val.transform.position, ((Component)this).transform.position) < 90f) { musicPresent = true; musicDest = val.transform.position; musicDist = Vector3.Distance(val.transform.position, ((Component)this).transform.position); return; } } BoomboxItem[] array = Object.FindObjectsOfType(); foreach (BoomboxItem val2 in array) { if (base.currentBehaviourStateIndex == 8) { if (Vector3.Distance(((Component)val2).transform.position, ((Component)this).transform.position) < 9f && val2.isPlayingMusic) { musicPresent = true; musicDest = ((Component)val2).transform.position; musicDist = Vector3.Distance(((Component)val2).transform.position, ((Component)this).transform.position); break; } } else if (Vector3.Distance(((Component)val2).transform.position, ((Component)this).transform.position) < 34f && val2.isPlayingMusic) { musicPresent = true; musicDest = ((Component)val2).transform.position; musicDist = Vector3.Distance(((Component)val2).transform.position, ((Component)this).transform.position); break; } } } catch (Exception ex) { Debug.Log((object)ex); } } public void baseHeadingToMusic() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Invalid comparison between Unknown and I4 //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) base.targetPlayer = null; Vector3 velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude > base.agent.speed / 4f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(1); } velocity = base.agent.velocity; setAnimationSpeedClientRpc(((Vector3)(ref velocity)).magnitude / walkAnimationCoefficient); } else { velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude <= base.agent.speed / 8f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(0); } setAnimationSpeedClientRpc(1f); } } ((EnemyAI)this).SetDestinationToPosition(musicDest, false); if ((int)base.agent.pathStatus == 1) { musicDelay = 300; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if ((double)Vector3.Distance(((Component)this).transform.position, musicDest) < 7.0 + (double)((Component)this).gameObject.transform.localScale.x) { musicDelay = 300; cryTime = (float)(enemyRandom.NextDouble() * 60.0 + 15.0); ((EnemyAI)this).SwitchToBehaviourClientRpc(8); } if (provokePoints > 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (!musicPresent) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } public override void Start() { //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); EntityWarp.mapEntrances = Object.FindObjectsOfType(false); mostRecentPlayer = getNearestPlayer(); animator = ((Component)this).gameObject.GetComponent(); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { DoAnimationClientRpc(0); } stamina += 60f; base.creatureVoice.volume = Plugin.moaiGlobalMusicVol.Value; base.creatureSFX.volume = Plugin.moaiGlobalMusicVol.Value; creatureRoar.volume = Plugin.moaiGlobalMusicVol.Value; creatureDeath.volume = Plugin.moaiGlobalMusicVol.Value; creatureExtract.volume = Plugin.moaiGlobalMusicVol.Value; creatureFlee.volume = Plugin.moaiGlobalMusicVol.Value; creatureHit1.volume = Plugin.moaiGlobalMusicVol.Value; creatureHit2.volume = Plugin.moaiGlobalMusicVol.Value; creatureStare.volume = Plugin.moaiGlobalMusicVol.Value; creatureCrying.volume = Plugin.moaiGlobalMusicVol.Value; timeSinceHittingLocalPlayer = 0f; timeSinceNewRandPos = 0f; positionRandomness = new Vector3(0f, 0f, 0f); enemyRandom = new Random(StartOfRound.Instance.randomMapSeed + base.thisEnemyIndex); isDeadAnimationDone = false; base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); moaiSoundPlayClientRpc("creatureVoice"); base.enemyHP = 6; float num = Plugin.moaiGlobalSize.Value; if (enemyRandom.NextDouble() <= (double)Plugin.moaiGlobalSizeVar.Value) { num = ((!(Random.Range(0f, 1f) < 0.5f)) ? ((1f + Random.Range(0f, 2f)) * num) : ((1f - Random.Range(0f, 0.95f)) * num)); } modifySizeClientRpc(num); } [ClientRpc] public void modifySizeClientRpc(float size) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1523863751u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref size, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1523863751u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; float num = (float)Math.Pow(size, 0.3); Transform transform = ((Component)this).gameObject.transform; transform.localScale *= size * Plugin.moaiGlobalSize.Value; NavMeshAgent component = ((Component)this).gameObject.GetComponent(); component.height *= size; AudioSource creatureVoice = base.creatureVoice; creatureVoice.pitch /= num; AudioSource creatureSFX = base.creatureSFX; creatureSFX.pitch /= num; AudioSource obj = creatureRoar; obj.pitch /= num; AudioSource obj2 = creatureHit1; obj2.pitch /= num; AudioSource obj3 = creatureHit2; obj3.pitch /= num; AudioSource obj4 = creatureStare; obj4.pitch /= num; AudioSource obj5 = creatureExtract; obj5.pitch /= num; AudioSource obj6 = creatureLeap; obj6.pitch /= num; AudioSource obj7 = creatureDeath; obj7.pitch /= num; AudioSource obj8 = creatureFlee; obj8.pitch /= num; AudioSource obj9 = creatureCrying; obj9.pitch /= num; timeControl /= num; } } } public void LateUpdate() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = RoundManager.Instance.playersManager.localPlayerController; float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayerController).transform.position); if (num > 40f) { postProcessVolume.weight = 0f; } else { Volume obj = postProcessVolume; obj.weight /= 1f + 0.2f * num * processScalar; } if (Object.op_Implicit((Object)(object)attachedPlayer) && Math.Abs(Time.time - attachTime) > 1.2f && ((NetworkBehaviour)RoundManager.Instance).IsHost) { letGoOfPlayerClientRpc(((NetworkBehaviour)attachedPlayer).NetworkObject.NetworkObjectId); } if (Object.op_Implicit((Object)(object)attachedPlayer) && !thrashingCorpse) { ((Component)attachedPlayer).transform.position = mouth.position; if ((float)enemyRandom.Next() < 0.25f) { attachedPlayer.DropBlood(default(Vector3), true, false); attachedPlayer.AddBloodToBody(); attachedPlayer.bloodParticle.Play(); attachedPlayer.deadBody.bloodSplashParticle.Play(); } } if (Object.op_Implicit((Object)(object)attachedPlayer) && thrashingCorpse) { ((Component)attachedPlayer.deadBody).transform.position = mouth.position; if ((float)enemyRandom.Next() < 0.25f) { attachedPlayer.deadBody.bloodSplashParticle.Play(); attachedPlayer.deadBody.MakeCorpseBloody(); } } } public override void Update() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (!base.isEnemyDead && base.enemyHP <= 0 && !markDead) { animator.speed = 1f; ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Death")) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Exit")) { animator.Play("Death"); } } base.isEnemyDead = true; base.enemyHP = 0; moaiSoundPlayClientRpc("creatureDeath"); deadEventClientRpc(); markDead = true; } if (base.isEnemyDead) { if (!isDeadAnimationDone) { animator.speed = 1f; isDeadAnimationDone = true; stopAllSound(); base.creatureVoice.PlayOneShot(base.dieSFX); } return; } if ((Object)(object)base.targetPlayer != (Object)null && base.targetPlayer.isPlayerDead) { base.targetPlayer = null; } base.movingTowardsTargetPlayer = (Object)(object)base.targetPlayer != (Object)null; timeSinceHittingLocalPlayer += Time.deltaTime; timeSinceNewRandPos += Time.deltaTime; if ((Object)(object)base.targetPlayer != (Object)null && ((EnemyAI)this).PlayerIsTargetable(base.targetPlayer, false, false, true)) { turnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); } if (base.stunNormalizedTimer > 0f && ((NetworkBehaviour)RoundManager.Instance).IsHost) { base.stunNormalizedTimer = 0f; moaiSoundPlayClientRpc("creatureFlee"); base.agent.speed = 0f; timeSinceFleeStart = Time.time; shadowEnable = false; awaitingShadowMode = true; fleeDestination = Vector3.zero; ((EnemyAI)this).StopSearch(base.currentSearch, true); setAnimationSpeedClientRpc(1f * timeControl); animPlayClientRpc("StandingStun"); ((EnemyAI)this).SwitchToBehaviourClientRpc(6); } if (awaitingShadowMode && !shadowEnable && ((NetworkBehaviour)RoundManager.Instance).IsHost) { base.agent.speed = 0f; setAnimationSpeedClientRpc(1f * timeControl); if (creatureFlee.time > 2.41f) { SetVisibleClientRpc(visible: false); shadowEnable = true; } } else if (base.currentBehaviourStateIndex != 6) { shadowEnable = false; awaitingShadowMode = false; } if (base.currentBehaviourStateIndex == 2 && base.isOutside && !isOutSwitch) { ((Component)this).transform.localScale = new Vector3(1f, 1f, 1f); isOutSwitch = true; } if (!base.isOutside && isOutSwitch) { ((Component)this).transform.localScale = new Vector3(0.4f, 0.4f, 0.4f); isOutSwitch = false; } if (base.currentBehaviourStateIndex == 5) { if (((Component)foursCollider).gameObject.activeInHierarchy) { ((Component)foursCollider).gameObject.SetActive(false); } if (((Component)uprightCollider).gameObject.activeInHierarchy) { ((Component)uprightCollider).gameObject.SetActive(false); } } else if (base.currentBehaviourStateIndex == 4) { if (((Component)foursCollider).gameObject.activeInHierarchy) { ((Component)foursCollider).gameObject.SetActive(false); } if (((Component)uprightCollider).gameObject.activeInHierarchy) { ((Component)uprightCollider).gameObject.SetActive(false); } } else if (base.currentBehaviourStateIndex == 3) { if (!((Component)foursCollider).gameObject.activeInHierarchy) { ((Component)foursCollider).gameObject.SetActive(true); } if (((Component)uprightCollider).gameObject.activeInHierarchy) { ((Component)uprightCollider).gameObject.SetActive(false); } } else { if (((Component)foursCollider).gameObject.activeInHierarchy) { ((Component)foursCollider).gameObject.SetActive(false); } if (!((Component)uprightCollider).gameObject.activeInHierarchy) { ((Component)uprightCollider).gameObject.SetActive(true); } } } public override void DoAIInterval() { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (provokePoints > 0) { provokePoints--; } if (entranceDelay > 0) { entranceDelay--; } if (musicDelay > 0) { musicDelay--; } if (sourcecycle > 0) { sourcecycle--; } else { sourcecycle = 75; unreachableEnemies.Clear(); } if (stamina <= 0f) { recovering = true; } else if (stamina > 60f) { recovering = false; } if (sourcecycle % 5 == 0) { EntityWarp.entrancePack entrancePack = EntityWarp.findNearestEntrance((EnemyAI)(object)this); listenForMusic(); nearestEntrance = entrancePack.tele; nearestEntranceNavPosition = entrancePack.navPosition; if (stamina < 120f) { stamina += 8f; } mostRecentPlayer = getNearestPlayer(); } if ((Object)(object)base.targetPlayer != (Object)null) { mostRecentPlayer = base.targetPlayer; } if (!isVisible && base.currentBehaviourStateIndex != 6) { SetVisibleClientRpc(visible: true); } AIInterval(); } public void AIInterval() { switch (base.currentBehaviourStateIndex) { case 0: baseSearchingForPlayer(); break; case 2: baseHeadingToEntrance(); break; case 1: baseStaring(); break; case 3: baseAttacking(32f); break; case 4: baseShredding(); break; case 6: baseFleeing(); break; case 7: baseHeadingToMusic(); break; case 8: baseCrying(); break; default: LogDebug("This Behavior State doesn't exist!"); break; } } public void baseFleeing() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) if (!shadowEnable) { base.agent.speed = 0f; return; } base.agent.speed = 15f * Plugin.moaiGlobalSpeed.Value; if (fleeDestination == Vector3.zero) { fleeDestination = pickFleeDestination(); return; } base.targetPlayer = null; ((EnemyAI)this).SetDestinationToPosition(fleeDestination, false); if ((double)Vector3.Distance(fleeDestination, ((Component)this).transform.position) < 2.0 + (double)((Component)this).gameObject.transform.localScale.x || Time.time - timeSinceFleeStart > 9f) { stamina = 120f; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); shadowParticles.Stop(); shadowEnable = false; awaitingShadowMode = false; base.targetPlayer = null; SetVisibleClientRpc(visible: true); animPlayClientRpc("Walk"); DoAnimationClientRpc(1); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } [ClientRpc] private void SetVisibleClientRpc(bool visible) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4245068544u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref visible, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4245068544u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Renderer[] componentsInChildren = meshRenderRoot.GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren) { val3.enabled = visible; } isVisible = visible; if (!visible) { shadowParticles.Play(); } else { shadowParticles.Stop(); } } } public Vector3 pickFleeDestination() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode"); if (!base.isOutside) { array = GameObject.FindGameObjectsWithTag("AINode"); } List list = new List(); GameObject[] array2 = array; foreach (GameObject val in array2) { if (Vector3.Distance(val.transform.position, ((Component)this).transform.position) > 60f) { list.Add(val); } } if (list.Count > 0) { return list[enemyRandom.Next(0, list.Count)].transform.position; } return array[enemyRandom.Next(0, array.Length)].transform.position; } public void baseShredding() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) if (!creatureHit1.isPlaying && !creatureHit2.isPlaying) { if (hitRotation == 1) { moaiSoundPlayClientRpc("creatureHit1"); hitRotation = 2; } else { moaiSoundPlayClientRpc("creatureHit2"); hitRotation = 1; } } AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Thrash") && !proceedShred) { animPlayClientRpc("Thrash"); DoAnimationClientRpc(6); proceedShred = true; } setAnimationSpeedClientRpc(1f); currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if ((double)((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime >= 0.8) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Thrash")) { attackState = 2; DoAnimationClientRpc(5); animPlayClientRpc("Run"); ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } } } public void baseStaring() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) base.agent.speed = 0f; setAnimationSpeedClientRpc(1f); if (animator.GetInteger("state") != 2) { starePoints = 0f; DoAnimationClientRpc(2); animPlayClientRpc("Stare"); if (!creatureStare.isPlaying) { moaiSoundPlayClientRpc("creatureStare"); } } if (FoundClosestPlayerInRange(stamina, needLineOfSight: true)) { starePoints += angerRate / Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position); facePosition(((Component)base.targetPlayer).transform.position); } else { starePoints -= 2f; } AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Stare")) { return; } currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime >= 1f) { if ((double)starePoints > enemyRandom.NextDouble() * 100.0) { attackState = 0; ((EnemyAI)this).StopSearch(base.currentSearch, true); proccedRoar = false; proccedCrouch = false; proccedRun = false; ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } else { stamina -= 80f; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } } public void baseCrying() { //IL_003d: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) base.agent.speed = 0f * Plugin.moaiGlobalSpeed.Value; animator.speed = 1f; DoAnimationClientRpc(7); AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Cry")) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Walk")) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Stand")) { animPlayClientRpc("Cry"); } } } if (!creatureCrying.isPlaying) { moaiSoundPlayClientRpc("creatureCrying"); } cryTime -= 0.2f; if (cryTime <= 0f) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (provokePoints > 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (musicPresent) { return; } PlayerControllerB nearestPlayer = getNearestPlayer(); if (Vector3.Distance(((Component)nearestPlayer).transform.position, musicDest) > 6f) { base.stunNormalizedTimer = 0f; moaiSoundPlayClientRpc("creatureFlee"); base.agent.speed = 0f; timeSinceFleeStart = Time.time; shadowEnable = false; awaitingShadowMode = true; fleeDestination = Vector3.zero; ((EnemyAI)this).StopSearch(base.currentSearch, true); setAnimationSpeedClientRpc(1f * timeControl); animPlayClientRpc("StandingStun"); ((EnemyAI)this).SwitchToBehaviourClientRpc(6); return; } provokePoints += 100; base.targetPlayer = nearestPlayer; stamina = 100f; recovering = false; ((EnemyAI)this).SwitchToBehaviourClientRpc(3); if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0 && !markDead) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); base.isEnemyDead = true; moaiSoundPlayClientRpc("creatureDeath"); deadEventClientRpc(); markDead = true; } else { moaiSoundPlayClientRpc("creatureHit"); } } } public void baseSearchingForPlayer(float lineOfSightRange = 28f) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) base.agent.speed = 6f * Plugin.moaiGlobalSpeed.Value; base.agent.angularSpeed = 120f; Vector3 velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude > base.agent.speed / 4f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(1); } velocity = base.agent.velocity; setAnimationSpeedClientRpc(((Vector3)(ref velocity)).magnitude / walkAnimationCoefficient); } else { velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude <= base.agent.speed / 8f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(0); } setAnimationSpeedClientRpc(1f); } } if (!base.creatureVoice.isPlaying) { moaiSoundPlayClientRpc("creatureVoice"); } updateEntranceChance(); if (enemyRandom.NextDouble() < (double)chanceToLocateEntrance && ((Component)this).gameObject.transform.localScale.x <= 2.2f) { Debug.Log((object)"Soul Devourer: entrance state switch"); ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } if ((FoundClosestPlayerInRange(lineOfSightRange, needLineOfSight: true) && stamina >= 120f) || provokePoints > 0) { ((EnemyAI)this).StopSearch(base.currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); return; } if (stamina < 100f) { base.targetPlayer = null; } if (musicPresent && musicDelay <= 0) { ((EnemyAI)this).SwitchToBehaviourClientRpc(7); } } public void baseHeadingToEntrance() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Invalid comparison between Unknown and I4 //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: 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) base.targetPlayer = null; Vector3 velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude > base.agent.speed / 4f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(1); } velocity = base.agent.velocity; setAnimationSpeedClientRpc(((Vector3)(ref velocity)).magnitude / walkAnimationCoefficient); } else { velocity = base.agent.velocity; if (((Vector3)(ref velocity)).magnitude <= base.agent.speed / 8f) { if (((NetworkBehaviour)RoundManager.Instance).IsServer) { DoAnimationClientRpc(0); } setAnimationSpeedClientRpc(1f); } } ((EnemyAI)this).SetDestinationToPosition(nearestEntranceNavPosition, false); if (base.isOutside != nearestEntrance.isEntranceToBuilding || (int)base.agent.pathStatus == 1) { entranceDelay = 150; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if ((double)Vector3.Distance(((Component)this).transform.position, nearestEntranceNavPosition) < 2.0 + (double)((Component)this).gameObject.transform.localScale.x) { if (nearestEntrance.isEntranceToBuilding) { Debug.Log((object)"SoulDev: Warp in"); EntityWarp.SendEnemyInside((EnemyAI)(object)this); nearestEntrance.PlayAudioAtTeleportPositions(); } else { Debug.Log((object)"SoulDev: Warp out"); EntityWarp.SendEnemyOutside((EnemyAI)(object)this); nearestEntrance.PlayAudioAtTeleportPositions(); } entranceDelay = 150; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } if (provokePoints > 0) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } } public void baseLeaping() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).SetDestinationToPosition(leapPos, false); if (!creatureLeap.isPlaying && !proceedLeap) { moaiSoundPlayClientRpc("creatureLeap"); } setAnimationSpeedClientRpc(1f); if (Time.time - leaptime >= 1f) { attackState = 2; proccedRun = false; if (stamina < 10f) { stamina = 10f; } DoAnimationClientRpc(5); animPlayClientRpc("Run"); attackState = 2; proccedRun = false; base.agent.acceleration = 14.5f * Plugin.moaiGlobalSpeed.Value; base.agent.speed = 14f * Plugin.moaiGlobalSpeed.Value; base.agent.angularSpeed = 145f; ((EnemyAI)this).SwitchToBehaviourClientRpc(3); } } public Vector3 getLeapPos() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)base.targetPlayer).transform.position; Vector3 val = default(Vector3); NavMeshHit val2 = default(NavMeshHit); for (int i = 0; i < 10; i++) { int num = enemyRandom.Next(-10, 10); int num2 = enemyRandom.Next(-35, 35); int num3 = enemyRandom.Next(-35, 35); ((Vector3)(ref val))..ctor(position.x + (float)num2, position.y + (float)num, position.z + (float)num3); bool flag = NavMesh.SamplePosition(val, ref val2, 60f, -1); float num4 = Vector3.Distance(position, ((NavMeshHit)(ref val2)).position); if (flag && num4 > 13f) { return ((NavMeshHit)(ref val2)).position; } } return ((Component)base.targetPlayer).transform.position; } public void baseAttacking(float range = 22f, float noLOSDivisor = 1.8f) { //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo; if (attackState == 0) { if (!creatureRoar.isPlaying) { moaiSoundPlayClientRpc("creatureRoar"); } currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Roar") && !proccedRoar) { animPlayClientRpc("Roar"); DoAnimationClientRpc(3); proccedRoar = true; } setAnimationSpeedClientRpc(1f); currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if ((double)((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime >= 0.8) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Roar")) { attackState = 1; } } } if (attackState == 1) { DoAnimationClientRpc(4); setAnimationSpeedClientRpc(2.5f); currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Prepare") && !proccedCrouch) { animPlayClientRpc("Prepare"); DoAnimationClientRpc(3); proccedCrouch = true; } currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if ((double)((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime >= 0.8) { currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Prepare")) { attackState = 2; } } } if (attackState == 2) { if (!base.creatureSFX.isPlaying) { moaiSoundPlayClientRpc("creatureSFX"); } base.agent.speed = 20f * Plugin.moaiGlobalSpeed.Value; base.agent.acceleration = 14.5f * Plugin.moaiGlobalSpeed.Value; base.agent.angularSpeed = 140f; Vector3 velocity = base.agent.velocity; setAnimationSpeedClientRpc(((Vector3)(ref velocity)).magnitude / runAnimationCoefficient); DoAnimationClientRpc(5); currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0); if (!((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Run") && !proccedRun) { animPlayClientRpc("Run"); DoAnimationClientRpc(5); proccedRun = true; } } else { base.agent.speed = 0f * Plugin.moaiGlobalSpeed.Value; } updateEntranceChance(); stamina -= 2.8f; if (!FoundClosestPlayerInRange(stamina / noLOSDivisor, needLineOfSight: false) && !FoundClosestPlayerInRange(stamina, needLineOfSight: true)) { base.targetPlayer = null; starePoints = 0f; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); base.agent.acceleration = 14.5f * Plugin.moaiGlobalSpeed.Value; } else { StickingInFrontOfPlayer(); } } public void updateEntranceChance() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)nearestEntrance)) { return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)nearestEntrance).transform.position); chanceToLocateEntrancePlayerBonus = 1f; if (Object.op_Implicit((Object)(object)mostRecentPlayer)) { if (Object.op_Implicit((Object)(object)mostRecentPlayer) == base.isOutside) { chanceToLocateEntrancePlayerBonus = 1f; } else { chanceToLocateEntrancePlayerBonus = 1.5f; } } int num2 = 1; if (num < 20f) { num2 = 4; } if (num < 15f) { num2 = 6; } if (num < 10f) { num2 = 7; } if (num < 5f) { num2 = 10; } if (Object.op_Implicit((Object)(object)nearestEntrance)) { chanceToLocateEntrance = (float)(1.0 / Math.Pow(num, 2.0)) * (float)num2 * chanceToLocateEntrancePlayerBonus - (float)entranceDelay; } } public bool FoundClosestPlayerInRange(float r, bool needLineOfSight) { if (recovering) { return false; } moaiTargetClosestPlayer(r, needLineOfSight); if ((Object)(object)base.targetPlayer == (Object)null) { return false; } return (Object)(object)base.targetPlayer != (Object)null; } public bool moaiTargetClosestPlayer(float range, bool requireLineOfSight) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (recovering) { return false; } base.mostOptimalDistance = range; PlayerControllerB targetPlayer = base.targetPlayer; base.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { if (((EnemyAI)this).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false, true) && (!requireLineOfSight || ((EnemyAI)this).CheckLineOfSightForPosition(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, 100f, 80, -1f, (Transform)null))) { base.tempDist = Vector3.Distance(((Component)this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (base.tempDist < base.mostOptimalDistance) { base.mostOptimalDistance = base.tempDist; base.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } } if ((Object)(object)base.targetPlayer != (Object)null && (Object)(object)targetPlayer != (Object)null) { base.targetPlayer = targetPlayer; } return (Object)(object)base.targetPlayer != (Object)null; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, -1); if (base.isEnemyDead || (hitID == -1 && (Object)(object)playerWhoHit == (Object)null)) { return; } base.enemyHP -= force; if ((Object)(object)playerWhoHit != (Object)null) { provokePoints += 20 * force; base.targetPlayer = playerWhoHit; } stamina = 60f; recovering = false; ((EnemyAI)this).SwitchToBehaviourClientRpc(3); if (((NetworkBehaviour)this).IsOwner) { if (base.enemyHP <= 0 && !markDead) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); stopAllSound(); base.isEnemyDead = true; moaiSoundPlayClientRpc("creatureDeath"); deadEventClientRpc(); markDead = true; } else { moaiSoundPlayClientRpc("creatureHit"); } } } [ClientRpc] public void deadEventClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3010481878u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3010481878u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play("Death"); base.isEnemyDead = true; } } } [ServerRpc(RequireOwnership = false)] public void letGoOfPlayerServerRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(2768085601u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 2768085601u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; letGoOfPlayerClientRpc(playerId); } } } [ClientRpc] public void letGoOfPlayerClientRpc(ulong playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3233075642u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3233075642u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = null; RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val4 in allPlayerScripts) { if (((NetworkBehaviour)val4).NetworkObject.NetworkObjectId == playerId) { val3 = val4; } } val3.playerCollider.enabled = true; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(((Component)val3).transform.position, ref val5, 15f, -1)) { ((Component)val3).transform.position = ((NavMeshHit)(ref val5)).position; } attachedPlayer = null; } private void StickingInFrontOfPlayer() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)base.targetPlayer == (Object)null) && ((NetworkBehaviour)this).IsOwner) { StalkPos = ((Component)base.targetPlayer).transform.position; ((EnemyAI)this).SetDestinationToPosition(StalkPos, false); } } public override void OnCollideWithEnemy(Collider other, EnemyAI collidedEnemy = null) { if (!(timeSinceHittingLocalPlayer < 0.5f) && !collidedEnemy.isEnemyDead && !base.isEnemyDead && !((Object)(object)collidedEnemy.enemyType == (Object)(object)base.enemyType)) { string text = ((Object)collidedEnemy.enemyType).name.ToLower(); if ((!text.Contains("mouth") || !text.Contains("dog")) && !collidedEnemy.enemyType.enemyName.ToLower().Contains("soul")) { timeSinceHittingLocalPlayer = 0f; collidedEnemy.HitEnemy(1, (PlayerControllerB)null, true, -1); } } } public override void OnCollideWithPlayer(Collider other) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) if (timeSinceHittingLocalPlayer < 1.7f) { return; } PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (lastThrashTime > Time.time + 0.75f || !((Object)(object)val != (Object)null)) { return; } Vector3 position = ((Component)this).transform.position; Vector3 val2 = ((Component)val).transform.position + Vector3.up * 0.5f; Debug.Log((object)"LOSCHECK"); RaycastHit val3 = default(RaycastHit); if (Physics.Linecast(position, val2, ref val3, LayerMask.GetMask(new string[3] { "Default", "Room", "Terrain" })) && !((Component)((RaycastHit)(ref val3)).collider).transform.IsChildOf(((Component)val).transform)) { return; } timeSinceHittingLocalPlayer = 0f; if (val.health <= 45) { val.KillPlayer(val.velocityLastFrame, true, (CauseOfDeath)6, 0, default(Vector3), false); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { attachPlayerClientRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId, lastHit: true, 20); lastThrashTime = Time.time; } else { attachPlayerServerRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId, lastHit: true, 20); lastThrashTime = Time.time; } } else { val.DamagePlayer(45, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); if (((NetworkBehaviour)RoundManager.Instance).IsHost) { attachPlayerClientRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId, lastHit: false, 10); lastThrashTime = Time.time; } else { attachPlayerServerRpc(((NetworkBehaviour)val).NetworkObject.NetworkObjectId, lastHit: false, 10); lastThrashTime = Time.time; } } } [ServerRpc(RequireOwnership = false)] public void attachPlayerServerRpc(ulong uid, bool lastHit, int staminaGrant) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(252112642u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uid); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lastHit, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, staminaGrant); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 252112642u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; attachPlayerClientRpc(uid, lastHit, staminaGrant); } } } [ClientRpc] public void attachPlayerClientRpc(ulong uid, bool lastHit, int staminaGrant) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1068200901u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, uid); ((FastBufferWriter)(ref val)).WriteValueSafe(ref lastHit, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val, staminaGrant); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1068200901u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stamina += staminaGrant; proceedShred = false; attachTime = Time.time; if (((NetworkBehaviour)RoundManager.Instance).IsHost) { ((EnemyAI)this).SwitchToBehaviourClientRpc(4); } RoundManager instance = RoundManager.Instance; PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts; foreach (PlayerControllerB val3 in allPlayerScripts) { if (((NetworkBehaviour)val3).NetworkObject.NetworkObjectId == uid) { shreddedPlayer = val3; if (!lastHit) { ((Component)val3).transform.position = mouth.position; val3.playerCollider.enabled = false; attachedPlayer = val3; thrashingCorpse = false; } else { ((Component)val3.deadBody).transform.position = mouth.position; attachedPlayer = val3; thrashingCorpse = true; } break; } } } public virtual void playSoundId(string id) { } public void stopAllSound() { base.creatureSFX.Stop(); base.creatureVoice.Stop(); creatureRoar.Stop(); creatureStare.Stop(); creatureFlee.Stop(); } [ClientRpc] public void moaiSoundPlayClientRpc(string soundName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2203331217u, val2, (RpcDelivery)0); bool flag = soundName != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(soundName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2203331217u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; switch (soundName) { case "creatureSFX": stopAllSound(); base.creatureSFX.Play(); break; case "creatureVoice": { stopAllSound(); double[] array = new double[10] { 0.0, 0.8244, 11.564, 29.11, 34.491, 37.84, 48.689, 64.518, 89.535, 92.111 }; int num = Random.Range(0, array.Length); base.creatureVoice.Play(); base.creatureVoice.SetScheduledStartTime(array[num]); base.creatureVoice.time = (float)array[num]; break; } case "creatureRoar": stopAllSound(); creatureRoar.Play(); break; case "creatureHit1": creatureHit1.Play(); break; case "creatureHit2": creatureHit2.Play(); break; case "creatureStare": creatureStare.Play(); break; case "creatureLeap": creatureLeap.Play(); break; case "creatureDeath": creatureDeath.Play(); break; case "creatureFlee": stopAllSound(); creatureFlee.Play(); break; case "creatureCrying": stopAllSound(); creatureCrying.Play(); break; } } } [ClientRpc] public void setAnimationSpeedClientRpc(float speed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3407220545u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe(ref speed, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3407220545u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.speed = speed; } } } [ClientRpc] public void DoAnimationClientRpc(int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(4205551591u, val2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 4205551591u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (Object.op_Implicit((Object)(object)animator)) { animator.SetInteger("state", index); } } } [ClientRpc] public void animPlayClientRpc(string name) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(2148773446u, val2, (RpcDelivery)0); bool flag = name != null; ((FastBufferWriter)(ref val)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val)).WriteValueSafe(name, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val, 2148773446u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.Play(name); } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1523863751u, new RpcReceiveHandler(__rpc_handler_1523863751), "modifySizeClientRpc"); ((NetworkBehaviour)this).__registerRpc(4245068544u, new RpcReceiveHandler(__rpc_handler_4245068544), "SetVisibleClientRpc"); ((NetworkBehaviour)this).__registerRpc(3010481878u, new RpcReceiveHandler(__rpc_handler_3010481878), "deadEventClientRpc"); ((NetworkBehaviour)this).__registerRpc(2768085601u, new RpcReceiveHandler(__rpc_handler_2768085601), "letGoOfPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3233075642u, new RpcReceiveHandler(__rpc_handler_3233075642), "letGoOfPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(252112642u, new RpcReceiveHandler(__rpc_handler_252112642), "attachPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1068200901u, new RpcReceiveHandler(__rpc_handler_1068200901), "attachPlayerClientRpc"); ((NetworkBehaviour)this).__registerRpc(2203331217u, new RpcReceiveHandler(__rpc_handler_2203331217), "moaiSoundPlayClientRpc"); ((NetworkBehaviour)this).__registerRpc(3407220545u, new RpcReceiveHandler(__rpc_handler_3407220545), "setAnimationSpeedClientRpc"); ((NetworkBehaviour)this).__registerRpc(4205551591u, new RpcReceiveHandler(__rpc_handler_4205551591), "DoAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(2148773446u, new RpcReceiveHandler(__rpc_handler_2148773446), "animPlayClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1523863751(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float size = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref size, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).modifySizeClientRpc(size); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4245068544(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool visibleClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref visibleClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).SetVisibleClientRpc(visibleClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3010481878(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).deadEventClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2768085601(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).letGoOfPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3233075642(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong playerId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).letGoOfPlayerClientRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_252112642(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong uid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref uid); bool lastHit = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lastHit, default(ForPrimitives)); int staminaGrant = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref staminaGrant); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).attachPlayerServerRpc(uid, lastHit, staminaGrant); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1068200901(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong uid = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref uid); bool lastHit = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lastHit, default(ForPrimitives)); int staminaGrant = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref staminaGrant); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).attachPlayerClientRpc(uid, lastHit, staminaGrant); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2203331217(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string soundName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref soundName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).moaiSoundPlayClientRpc(soundName); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3407220545(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float animationSpeedClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationSpeedClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).setAnimationSpeedClientRpc(animationSpeedClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4205551591(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).DoAnimationClientRpc(index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2148773446(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: 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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string name = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref name, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SoulDevourerAI)(object)target).animPlayClientRpc(name); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SoulDevourerAI"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace MoaiEnemy.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }