Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Moai Enemy v2.8.2
MoaiEnemy.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.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<float> moaiGlobalSize; public static ConfigEntry<float> moaiGlobalMusicVol; public static ConfigEntry<float> moaiGlobalRarity; public static ConfigEntry<float> 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<float> obj = moaiGlobalSize; FloatSliderOptions val = new FloatSliderOptions(); ((BaseRangeOptions<float>)val).Min = 0.05f; ((BaseRangeOptions<float>)val).Max = 5f; FloatSliderConfigItem val2 = new FloatSliderConfigItem(obj, val); ConfigEntry<float> obj2 = moaiGlobalMusicVol; FloatSliderOptions val3 = new FloatSliderOptions(); ((BaseRangeOptions<float>)val3).Min = 0f; ((BaseRangeOptions<float>)val3).Max = 2f; FloatSliderConfigItem val4 = new FloatSliderConfigItem(obj2, val3); ConfigEntry<float> obj3 = moaiGlobalRarity; FloatSliderOptions val5 = new FloatSliderOptions(); ((BaseRangeOptions<float>)val5).Min = 0f; ((BaseRangeOptions<float>)val5).Max = 10f; FloatSliderConfigItem val6 = new FloatSliderConfigItem(obj3, val5); ConfigEntry<float> obj4 = moaiGlobalSpeed; FloatSliderOptions val7 = new FloatSliderOptions(); ((BaseRangeOptions<float>)val7).Min = 0f; ((BaseRangeOptions<float>)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 <Awake>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<RawspawnHandler.enemyRarityPkg>()); } 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<EntranceTeleport>(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<float> moaiGlobalSize; public static ConfigEntry<float> moaiGlobalSizeVar; public static ConfigEntry<float> moaiAngelChance; public static ConfigEntry<float> moaiSizeCap; public static ConfigEntry<float> moaiGlobalMusicVol; public static ConfigEntry<float> moaiGlobalSpeed; public static ConfigEntry<bool> moaiConsumeScrap; public static ConfigEntry<string> moaiSpawnDistribution; public static ConfigEntry<float> baseRarity; public static ConfigEntry<float> blueRarity; public static ConfigEntry<float> redRarity; public static ConfigEntry<float> greenRarity; public static ConfigEntry<float> purpleRarity; public static ConfigEntry<float> goldRarity; public static ConfigEntry<float> orangeRarity; public static ConfigEntry<float> pirateRarity; public static ConfigEntry<float> soulRarity; public static ConfigEntry<float> simpleSpawnMultiplier; public static ConfigEntry<string> 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<EnemyType>("MoaiEnemy"); tlTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiEnemyTN"); tlTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiEnemyTK"); MoaiBlue = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiBlue"); MoaiBlueTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiBlueTN"); MoaiBlueTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiBlueTK"); MoaiRed = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiRed"); MoaiRedTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiRedTN"); MoaiRedTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiRedTK"); MoaiGreen = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiGreen"); MoaiGreenTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiGreenTN"); MoaiGreenTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiGreenTK"); MoaiPurple = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiPurple"); MoaiPurpleTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiGoldTN"); MoaiPurpleTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiGoldTK"); PlasmaPad = Assets.MainAssetBundle.LoadAsset<GameObject>("PlasmaPadPrefab"); MoaiGold = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiGold"); MoaiGoldTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiGoldTN"); MoaiGoldTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiGoldTK"); MoaiOrange = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiOrange"); MoaiOrangeTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiOrangeTN"); MoaiOrangeTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiOrangeTK"); MoaiPirate = Assets.MainAssetBundle.LoadAsset<EnemyType>("MoaiPirate"); MoaiPirateTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("MoaiPirateTN"); MoaiPirateTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("MoaiPirateTK"); PirateShip = Assets.MainAssetBundle.LoadAsset<GameObject>("MoaiEnemyShip"); CannonProjectile = Assets.MainAssetBundle.LoadAsset<GameObject>("CannonBall"); SoulDevourer = Assets.MainAssetBundle.LoadAsset<EnemyType>("SoulDev"); SoulDevourerTerminalNode = Assets.MainAssetBundle.LoadAsset<TerminalNode>("SoulDevTN"); SoulDevourerTerminalKeyword = Assets.MainAssetBundle.LoadAsset<TerminalKeyword>("SoulDevTK"); plasmaProjectile = Assets.MainAssetBundle.LoadAsset<GameObject>("PlasmaBall01"); consumptionCircle = Assets.MainAssetBundle.LoadAsset<GameObject>("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<RawspawnHandler.enemyRarityPkg>()); } 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<EntranceTeleport>(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<float>("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<float>("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<float>("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<float>("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<float>("Global", "Size Multiplier", 1f, "Changes the size of all moai models. Scales pretty violently. Affects SFX pitch."); moaiSizeCap = ((BaseUnityPlugin)this).Config.Bind<float>("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<float>("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<bool>("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<string>("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<float>("Variants", "Basic Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); blueRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Blue Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); redRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Red Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); greenRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Green Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); purpleRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Purple Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); goldRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Gold Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); orangeRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Orange Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); pirateRarity = ((BaseUnityPlugin)this).Config.Bind<float>("Variants", "Pirate Moai Spawnrate", 1f, "Changes the spawnrate of the variant."); soulRarity = ((BaseUnityPlugin)this).Config.Bind<float>("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<string>("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<float> obj = moaiAngelChance; FloatSliderOptions val = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val).Min = 0f; ((BaseRangeOptions<float>)val).Max = 1f; FloatSliderConfigItem val2 = new FloatSliderConfigItem(obj, val); ConfigEntry<float> obj2 = moaiGlobalSize; FloatSliderOptions val3 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val3).Min = 0.05f; ((BaseRangeOptions<float>)val3).Max = 5f; FloatSliderConfigItem val4 = new FloatSliderConfigItem(obj2, val3); ConfigEntry<float> obj3 = moaiGlobalSizeVar; FloatSliderOptions val5 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val5).Min = 0f; ((BaseRangeOptions<float>)val5).Max = 1f; FloatSliderConfigItem val6 = new FloatSliderConfigItem(obj3, val5); ConfigEntry<float> obj4 = moaiSizeCap; FloatInputFieldOptions val7 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val7).Min = 0.01f; ((BaseRangeOptions<float>)val7).Max = 100f; FloatInputFieldConfigItem val8 = new FloatInputFieldConfigItem(obj4, val7); ConfigEntry<float> obj5 = moaiGlobalMusicVol; FloatSliderOptions val9 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val9).Min = 0f; ((BaseRangeOptions<float>)val9).Max = 1f; FloatSliderConfigItem val10 = new FloatSliderConfigItem(obj5, val9); ConfigEntry<float> obj6 = moaiGlobalSpeed; FloatSliderOptions val11 = new FloatSliderOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val11).Min = 0f; ((BaseRangeOptions<float>)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<float> obj7 = baseRarity; FloatInputFieldOptions val15 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val15).Min = 0f; ((BaseRangeOptions<float>)val15).Max = 10000f; FloatInputFieldConfigItem val16 = new FloatInputFieldConfigItem(obj7, val15); ConfigEntry<float> obj8 = greenRarity; FloatInputFieldOptions val17 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val17).Min = 0f; ((BaseRangeOptions<float>)val17).Max = 10000f; FloatInputFieldConfigItem val18 = new FloatInputFieldConfigItem(obj8, val17); ConfigEntry<float> obj9 = purpleRarity; FloatInputFieldOptions val19 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val19).Min = 0f; ((BaseRangeOptions<float>)val19).Max = 10000f; FloatInputFieldConfigItem val20 = new FloatInputFieldConfigItem(obj9, val19); ConfigEntry<float> obj10 = redRarity; FloatInputFieldOptions val21 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val21).Min = 0f; ((BaseRangeOptions<float>)val21).Max = 10000f; FloatInputFieldConfigItem val22 = new FloatInputFieldConfigItem(obj10, val21); ConfigEntry<float> obj11 = blueRarity; FloatInputFieldOptions val23 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val23).Min = 0f; ((BaseRangeOptions<float>)val23).Max = 10000f; FloatInputFieldConfigItem val24 = new FloatInputFieldConfigItem(obj11, val23); ConfigEntry<float> obj12 = goldRarity; FloatInputFieldOptions val25 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val25).Min = 0f; ((BaseRangeOptions<float>)val25).Max = 10000f; FloatInputFieldConfigItem val26 = new FloatInputFieldConfigItem(obj12, val25); ConfigEntry<float> obj13 = orangeRarity; FloatInputFieldOptions val27 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val27).Min = 0f; ((BaseRangeOptions<float>)val27).Max = 10000f; FloatInputFieldConfigItem val28 = new FloatInputFieldConfigItem(obj13, val27); ConfigEntry<float> obj14 = pirateRarity; FloatInputFieldOptions val29 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val29).Min = 0f; ((BaseRangeOptions<float>)val29).Max = 10000f; FloatInputFieldConfigItem val30 = new FloatInputFieldConfigItem(obj14, val29); ConfigEntry<float> obj15 = soulRarity; FloatInputFieldOptions val31 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val31).Min = 0f; ((BaseRangeOptions<float>)val31).Max = 10000f; FloatInputFieldConfigItem val32 = new FloatInputFieldConfigItem(obj15, val31); ConfigEntry<float> obj16 = simpleSpawnMultiplier; FloatInputFieldOptions val33 = new FloatInputFieldOptions { RequiresRestart = false }; ((BaseRangeOptions<float>)val33).Min = 0f; ((BaseRangeOptions<float>)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<float> list = new List<float>(); List<float> list2 = new List<float>(); 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<LineRenderer>(); 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<EnemyType> 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<EnemyType>(); 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<PlayerControllerB>(); 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<EnemyAI>(); 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<GrabbableObject>(); 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<VehicleController>(); 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<GameObject>(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<NetworkObject>().Spawn(false); ball.GetComponent<CannonBall>().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<bool>(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 (m