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 BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.LemurianBruiserMonster;
using EntityStates.LemurianMonster;
using HarmonyLib;
using IL.RoR2;
using KinematicCharacterController;
using LemurFusion;
using LemurFusion.Compat;
using LemurFusion.Config;
using LemurFusion.Devotion;
using LemurFusion.Devotion.Components;
using LemurianNames;
using Microsoft.CodeAnalysis;
using MiscFixes.Modules;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using Newtonsoft.Json.Utilities;
using On;
using On.EntityStates.LemurianBruiserMonster;
using On.EntityStates.LemurianMonster;
using On.RoR2;
using On.RoR2.Projectile;
using On.RoR2.UI;
using R2API;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LemurFusion")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8cba9483959df8fb44ed32be751125e4926143bb")]
[assembly: AssemblyProduct("LemurFusion")]
[assembly: AssemblyTitle("LemurFusion")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.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;
}
}
}
public class BetterLemurController : DevotedLemurianController
{
public BetterInventoryController BetterInventoryController => base._devotionInventoryController as BetterInventoryController;
public Inventory LemurianInventory
{
get
{
if (!Object.op_Implicit((Object)(object)base._lemurianMaster))
{
return null;
}
return base._lemurianMaster.inventory;
}
}
public CharacterBody LemurianBody
{
get
{
if (!Object.op_Implicit((Object)(object)base._lemurianMaster))
{
return null;
}
return base._lemurianMaster.GetBody();
}
}
public Inventory PersonalInventory { get; set; }
public int FusionCount
{
get
{
Inventory lemurianInventory = LemurianInventory;
if (lemurianInventory == null)
{
return 0;
}
return lemurianInventory.GetItemCount(Items.LemurianHarness);
}
}
public void InitializeDevotedLemurian()
{
//IL_007b: 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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
base._leashDistSq = PluginConfig.teleportDistance.Value * PluginConfig.teleportDistance.Value;
if (!Object.op_Implicit((Object)(object)PersonalInventory))
{
PersonalInventory = ((Component)base._lemurianMaster).GetComponents<Inventory>().Last();
}
if (Object.op_Implicit((Object)(object)LemurianInventory))
{
Inventory inventory = base._lemurianMaster.inventory;
if (FusionCount == 0)
{
inventory.AddItemsFrom(((DevotionInventoryController)BetterInventoryController)._devotionMinionInventory, ConfigExtended.Blacklist_Filter);
}
ShareItem(((DevotedLemurianController)this).DevotionItem);
inventory.GiveItem(((DevotedLemurianController)this).DevotionItem, 1);
inventory.GiveItem(Items.LemurianHarness.itemIndex, 1);
inventory.ResetItem(Items.MinionLeash.itemIndex, 1);
inventory.ResetItem(Items.UseAmbientLevel.itemIndex, 1);
inventory.ResetItem(Items.TeleportWhenOob.itemIndex, 1);
}
}
public void ShareItem(ItemIndex item)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)PersonalInventory))
{
PersonalInventory.GiveItem(item, 1);
}
if (!PluginConfig.enableSharedInventory.Value)
{
return;
}
foreach (BetterLemurController friend in BetterInventoryController.GetFriends(this))
{
friend.LemurianInventory.GiveItem(item, 1);
}
}
public void KillYourSelf()
{
//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_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Expected O, but got Unknown
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Expected O, but got Unknown
//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Expected O, but got Unknown
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: 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_0095: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: 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)
bool flag = DevotionTweaks.instance.EnableSharedInventory && Object.op_Implicit((Object)(object)BetterInventoryController);
List<BetterLemurController> list = (flag ? BetterInventoryController.GetFriends() : new List<BetterLemurController>());
if (Object.op_Implicit((Object)(object)PersonalInventory))
{
foreach (ItemIndex item in PersonalInventory.itemAcquisitionOrder.ToList())
{
int itemCount = PersonalInventory.GetItemCount(item);
if (itemCount <= 0)
{
continue;
}
if (flag)
{
((DevotionInventoryController)BetterInventoryController).RemoveItem(item, Math.Min(itemCount, ((DevotionInventoryController)BetterInventoryController)._devotionMinionInventory.GetItemCount(item)));
foreach (BetterLemurController item2 in list)
{
item2.LemurianInventory.RemoveItem(item, Math.Min(itemCount, item2.LemurianInventory.GetItemCount(item)));
}
}
PickupIndex val = FindPickupIndex(item);
if (val != PickupIndex.none)
{
int num = ((!ConfigExtended.DeathDrop_DropAll.Value) ? 1 : itemCount);
for (int i = 0; i < num; i++)
{
PickupDropletController.CreatePickupDroplet(new UniquePickup(val), LemurianBody.corePosition, Vector2.op_Implicit(Random.insideUnitCircle * 15f), false);
}
}
}
}
RaycastHit val2 = default(RaycastHit);
if (ConfigExtended.DeathDrop_DropEgg.Value && Object.op_Implicit((Object)(object)LemurianBody) && Physics.Raycast(LemurianBody.corePosition, Vector3.down, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
{
DirectorPlacementRule val3 = new DirectorPlacementRule
{
placementMode = (PlacementMode)0,
position = ((RaycastHit)(ref val2)).point
};
DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/CU8/LemurianEgg/iscLemurianEgg.asset").WaitForCompletion(), val3, new Xoroshiro128Plus(0uL)));
}
if (Object.op_Implicit((Object)(object)base._lemurianMaster))
{
Object.Destroy((Object)(object)((Component)base._lemurianMaster).gameObject, 1f);
}
}
public PickupIndex FindPickupIndex(ItemIndex itemIndex)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Invalid comparison between Unknown and I4
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected I4, but got Unknown
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: 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_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Invalid comparison between Unknown and I4
//IL_00cf: 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)
if ((int)itemIndex != -1 && Object.op_Implicit((Object)(object)LemurianBody))
{
switch (ConfigExtended.DeathDrop_ItemType.Value)
{
case DevotionTweaks.DeathItem.Scrap:
{
ItemTier tier = ItemCatalog.GetItemDef(itemIndex).tier;
return (PickupIndex)((int)tier switch
{
0 => PickupCatalog.FindPickupIndex("ItemIndex.ScrapWhite"),
1 => PickupCatalog.FindPickupIndex("ItemIndex.ScrapGreen"),
2 => PickupCatalog.FindPickupIndex("ItemIndex.ScrapRed"),
4 => PickupCatalog.FindPickupIndex("ItemIndex.ScrapYellow"),
_ => PickupIndex.none,
});
}
case DevotionTweaks.DeathItem.Original:
return PickupCatalog.FindPickupIndex(itemIndex);
case DevotionTweaks.DeathItem.Custom:
{
ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
if (Object.op_Implicit((Object)(object)itemDef) && ConfigExtended.DeathDrops_TierToItem_Map.TryGetValue(itemDef.tier, out var value) && (int)value != -1)
{
return PickupCatalog.FindPickupIndex(value);
}
break;
}
}
}
return PickupIndex.none;
}
}
namespace LemurFusion
{
public static class FuckMyAss
{
public static bool FuckingNullCheckNetId(CharacterMaster master, out NetworkUserId netId)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
netId = default(NetworkUserId);
MinionOwnership minionOwnership = master.minionOwnership;
if (!Object.op_Implicit((Object)(object)minionOwnership))
{
return false;
}
CharacterMaster ownerMaster = minionOwnership.ownerMaster;
if (!Object.op_Implicit((Object)(object)ownerMaster))
{
return false;
}
PlayerCharacterMasterController playerCharacterMasterController = ownerMaster.playerCharacterMasterController;
if (!Object.op_Implicit((Object)(object)playerCharacterMasterController))
{
return false;
}
NetworkUser networkUser = playerCharacterMasterController.networkUser;
if (!Object.op_Implicit((Object)(object)networkUser))
{
return false;
}
netId = networkUser.id;
return true;
}
public static bool FuckingNullCheckPing(CharacterMaster master, out GameObject target)
{
target = null;
if (!Object.op_Implicit((Object)(object)master))
{
return false;
}
MinionOwnership minionOwnership = master.minionOwnership;
if (!Object.op_Implicit((Object)(object)minionOwnership))
{
return false;
}
CharacterMaster ownerMaster = minionOwnership.ownerMaster;
if (!Object.op_Implicit((Object)(object)ownerMaster))
{
return false;
}
PlayerCharacterMasterController playerCharacterMasterController = ownerMaster.playerCharacterMasterController;
if (!Object.op_Implicit((Object)(object)playerCharacterMasterController))
{
return false;
}
PingerController pingerController = playerCharacterMasterController.pingerController;
if (!Object.op_Implicit((Object)(object)pingerController))
{
return false;
}
target = ((PingInfo)(ref pingerController.currentPing)).targetGameObject;
if (pingerController.currentPing.active)
{
return Object.op_Implicit((Object)(object)target);
}
return false;
}
public static bool FuckingNullCheckHurtBox(HurtBox hurtBox, out CharacterBody body, out Vector3 position)
{
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
body = null;
position = Vector3.zero;
if (!Object.op_Implicit((Object)(object)hurtBox))
{
return false;
}
HealthComponent healthComponent = hurtBox.healthComponent;
if (!Object.op_Implicit((Object)(object)healthComponent))
{
return false;
}
body = healthComponent.body;
if (!Object.op_Implicit((Object)(object)body))
{
return false;
}
position = ((Component)hurtBox).transform.position;
if (Object.op_Implicit((Object)(object)body.characterMotor))
{
return !body.hasCloakBuff;
}
return false;
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.score.LemurFusion", "LemurFusion", "1.9.0")]
public class LemurFusionPlugin : BaseUnityPlugin
{
public const string PluginGUID = "com.score.LemurFusion";
public const string PluginName = "LemurFusion";
public const string PluginVersion = "1.9.0";
private static ManualLogSource _logger;
public static LemurFusionPlugin instance { get; private set; }
public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
public static bool lemNamesInstalled => Chainloader.PluginInfos.ContainsKey("bouncyshield.LemurianNames");
public static bool properSaveInstalled => Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ProperSave");
public static bool riskyInstalled => Chainloader.PluginInfos.ContainsKey("com.RiskyLives.RiskyMod");
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
public void Awake()
{
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
instance = this;
_logger = ((BaseUnityPlugin)this).Logger;
PluginConfig.myConfig = ((BaseUnityPlugin)this).Config;
ConfigReader.Init();
DevotionTweaks.Init();
DevotedInventoryTweaks.Init();
LemurControllerTweaks.Init();
AITweaks.Init();
RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(MechaLemur.Init));
ContentAddition.AddMaster(DevotionTweaks.instance.bruiserMasterPrefab);
Harmony harmony = new Harmony("com.score.LemurFusion");
if (lemNamesInstalled)
{
CreateLemNameCompat(harmony);
}
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private static void CreateLemNameCompat(Harmony harmony)
{
harmony.CreateClassProcessor(typeof(LemurianUpdateNameFriend)).Patch();
}
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
private static void CreateProperSaveCompat(Harmony harmony)
{
}
public static void LogDebug(string message)
{
}
public static void LogInfo(string message)
{
Log((LogLevel)16, message);
}
public static void LogMessage(string message)
{
Log((LogLevel)8, message);
}
public static void LogWarning(string message)
{
Log((LogLevel)4, message);
}
public static void LogError(string message)
{
Log((LogLevel)2, message);
}
public static void LogFatal(string message)
{
Log((LogLevel)1, message);
}
public static void Log(LogLevel logLevel, string message)
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
if (PluginConfig.enableDetailedLogs.Value)
{
_logger.Log(logLevel, (object)message);
}
}
}
public static class Utils
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsDevoted(CharacterBody body, out BetterLemurController lemCtrl)
{
return IsDevoted(Object.op_Implicit((Object)(object)body) ? body.master : null, out lemCtrl);
}
public static bool IsDevoted(CharacterMaster master, out BetterLemurController lemCtrl)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Invalid comparison between Unknown and I4
lemCtrl = null;
if (Object.op_Implicit((Object)(object)master) && (int)master.teamIndex == 1 && master.hasBody)
{
lemCtrl = ((Component)master).GetComponent<BetterLemurController>();
}
if (Object.op_Implicit((Object)(object)lemCtrl))
{
return Object.op_Implicit((Object)(object)lemCtrl.LemurianInventory);
}
return false;
}
public static void ResetItem(this Inventory self, ItemIndex itemIndex, int target)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
int itemCountPermanent = self.GetItemCountPermanent(itemIndex);
if (itemCountPermanent != target)
{
self.GiveItem(itemIndex, target - itemCountPermanent);
}
}
public static float GetVanillaStatModifier(int configValue, int meldCount, int evolutionCount)
{
int num;
switch (evolutionCount)
{
case 0:
case 2:
num = 10;
break;
case 1:
num = 20;
break;
default:
num = 17 + evolutionCount;
break;
}
int num2 = num;
return (float)meldCount * ((float)configValue * 0.01f) + (float)num2 * 0.1f;
}
public static float GetFusionStatMultiplier(int configValue, int meldCount, int evolutionCount)
{
int num = Mathf.Clamp(evolutionCount, 0, 4);
float num2 = (float)PluginConfig.statMultEvo.Value * 0.01f;
return (float)meldCount * ((float)configValue * 0.01f) + (float)num * num2 * 0.1f;
}
public static float GetLevelModifier(int evolutionCount)
{
if (!Object.op_Implicit((Object)(object)Run.instance))
{
return 0f;
}
int num = Mathf.Clamp(Run.instance.stageClearCount + 1, 1, 4);
int num2 = Mathf.Clamp(evolutionCount, 0, 4);
float num3 = (float)PluginConfig.statMultEvo.Value * 0.01f;
return (float)num * num3 + (float)num2 * num3;
}
public static Vector3 ClosestPointOnCollider(Collider collider, Vector3 worldPoint, out float distance)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_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_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = collider.ClosestPoint(worldPoint);
Vector3 val2 = val - worldPoint;
if (((Vector3)(ref val2)).sqrMagnitude < 0.01f)
{
return ClosestPointOnTransform(((Component)collider).transform, worldPoint, out distance);
}
val2 = val - worldPoint;
distance = ((Vector3)(ref val2)).sqrMagnitude;
return val;
}
public static Vector3 ClosestPointOnTransform(Transform transform, Vector3 worldPoint, out float distance)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0039: Unknown result type (might be due to invalid IL or missing references)
Vector3 otherPoint = transform.InverseTransformPoint(worldPoint);
Vector3 val = transform.TransformPoint(ClosestPointOnBounds(Vector3.zero, Vector3.one, otherPoint, out distance));
float num = Mathf.Sign(distance);
Vector3 val2 = val - worldPoint;
distance = num * ((Vector3)(ref val2)).sqrMagnitude;
return val;
}
public static Vector3 ClosestPointOnBounds(Vector3 position, Vector3 size, Vector3 otherPoint, out float distance)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
Bounds bounds = default(Bounds);
((Bounds)(ref bounds))..ctor(position, size);
return bounds.ClosestPointOnBounds(ref otherPoint, out distance);
}
public static Vector3 ClosestPointOnBounds(this ref Bounds bounds, ref Vector3 otherPoint, out float distance)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: 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)
Vector3 val;
Vector3 val2;
if (((Bounds)(ref bounds)).Contains(otherPoint))
{
val = bounds.ClosestPointInternal(otherPoint);
val2 = val - otherPoint;
distance = 0f - ((Vector3)(ref val2)).sqrMagnitude;
}
else
{
val = ((Bounds)(ref bounds)).ClosestPoint(otherPoint);
val2 = val - otherPoint;
distance = ((Vector3)(ref val2)).sqrMagnitude;
}
return val;
}
private static Vector3 ClosestPointInternal(this ref Bounds bounds, Vector3 localPoint)
{
//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_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: 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_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: 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_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: 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_00b7: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: 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_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: 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_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: 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_0148: 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_012c: 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_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
Vector3 max = ((Bounds)(ref bounds)).max;
Vector3 min = ((Bounds)(ref bounds)).min;
Plane val = default(Plane);
((Plane)(ref val))..ctor(Vector3.right, max.x);
Vector3 val2 = ((Plane)(ref val)).ClosestPointOnPlane(localPoint);
Vector3 val3 = val2 - localPoint;
float num = ((Vector3)(ref val3)).sqrMagnitude;
((Plane)(ref val)).distance = min.x;
Vector3 val4 = ((Plane)(ref val)).ClosestPointOnPlane(localPoint);
val3 = val4 - localPoint;
float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
if (sqrMagnitude < num)
{
num = sqrMagnitude;
val2 = val4;
}
((Plane)(ref val)).distance = max.y;
((Plane)(ref val)).normal = Vector3.up;
val4 = ((Plane)(ref val)).ClosestPointOnPlane(localPoint);
val3 = val4 - localPoint;
sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
if (sqrMagnitude < num)
{
num = sqrMagnitude;
val2 = val4;
}
((Plane)(ref val)).distance = min.y;
val4 = ((Plane)(ref val)).ClosestPointOnPlane(localPoint);
val3 = val4 - localPoint;
sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
if (sqrMagnitude < num)
{
num = sqrMagnitude;
val2 = val4;
}
((Plane)(ref val)).distance = max.z;
((Plane)(ref val)).normal = Vector3.forward;
val4 = ((Plane)(ref val)).ClosestPointOnPlane(localPoint);
val3 = val4 - localPoint;
sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
if (sqrMagnitude < num)
{
num = sqrMagnitude;
val2 = val4;
}
((Plane)(ref val)).distance = min.z;
val4 = ((Plane)(ref val)).ClosestPointOnPlane(localPoint);
val3 = val4 - localPoint;
sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude;
if (sqrMagnitude < num)
{
num = sqrMagnitude;
val2 = val4;
}
return Vector3.MoveTowards(localPoint, val2, 0f - num);
}
}
}
namespace LemurFusion.Devotion
{
public class AITweaks
{
public static ConfigEntry<bool> disableFallDamage;
public static ConfigEntry<bool> immuneToVoidDeath;
public static ConfigEntry<bool> improveAI;
public static ConfigEntry<bool> enableProjectileTracking;
public static ConfigEntry<bool> visualizeProjectileTracking;
public static ConfigEntry<float> updateFrequency;
public static ConfigEntry<int> detectionRadius;
public const string SKILL_STRAFE_NAME = "StrafeAroundExplosion";
public const string SKILL_ESCAPE_NAME = "BackUpFromExplosion";
public static AITweaks instance { get; private set; }
public static void Init()
{
if (instance == null)
{
instance = new AITweaks();
}
}
private AITweaks()
{
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: 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_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
if (!improveAI.Value)
{
return;
}
LemHitboxGroupRevealer.Init();
GameObject masterPrefab = DevotionTweaks.instance.masterPrefab;
masterPrefab.AddComponent<MatrixDodgingController>();
masterPrefab.AddComponent<LineRenderer>();
BaseAI component = masterPrefab.GetComponent<BaseAI>();
component.fullVision = true;
component.aimVectorDampTime = 0.05f;
component.aimVectorMaxSpeed = 200f;
AISkillDriver obj = masterPrefab.AddComponent<AISkillDriver>();
obj.customName = "BackUpFromExplosion";
obj.skillSlot = (SkillSlot)0;
obj.maxDistance = (float)detectionRadius.Value * 0.5f;
obj.minDistance = 0f;
obj.aimType = (AimType)2;
obj.moveTargetType = (TargetType)3;
obj.movementType = (MovementType)3;
obj.ignoreNodeGraph = true;
obj.shouldSprint = true;
obj.driverUpdateTimerOverride = Mathf.Clamp(updateFrequency.Value * 1.5f, 0.3f, 1f);
AISkillDriver obj2 = masterPrefab.AddComponent<AISkillDriver>();
obj2.customName = "StrafeAroundExplosion";
obj2.skillSlot = (SkillSlot)0;
obj2.maxDistance = detectionRadius.Value;
obj2.minDistance = (float)detectionRadius.Value * 0.5f;
obj2.aimType = (AimType)2;
obj2.moveTargetType = (TargetType)3;
obj2.movementType = (MovementType)2;
obj2.ignoreNodeGraph = true;
obj2.shouldSprint = true;
obj2.driverUpdateTimerOverride = Mathf.Clamp(updateFrequency.Value * 1.5f, 0.3f, 1f);
AISkillDriver[] components = masterPrefab.GetComponents<AISkillDriver>();
foreach (AISkillDriver val in components)
{
switch (val.customName)
{
case "DevotedSecondarySkill":
val.minUserHealthFraction = 0.6f;
val.shouldSprint = false;
val.activationRequiresAimConfirmation = true;
val.maxDistance = 10f;
break;
case "StrafeAndShoot":
val.maxDistance = 100f;
val.activationRequiresAimTargetLoS = true;
val.shouldSprint = false;
break;
case "ReturnToLeaderDefault":
val.driverUpdateTimerOverride = 0.2f;
val.shouldSprint = true;
val.resetCurrentEnemyOnNextDriverSelection = true;
break;
case "WaitNearLeaderDefault":
val.driverUpdateTimerOverride = 0.2f;
val.resetCurrentEnemyOnNextDriverSelection = true;
break;
case "StrafeNearbyEnemies":
val.shouldSprint = true;
break;
}
}
}
}
public class DevotedInventoryTweaks
{
[CompilerGenerated]
private static class <>O
{
public static Manipulator <0>__EvolveDevotedLumerian;
public static hook_Init <1>__DevotionInventoryController_Init;
public static Func<Func<bool>, bool> <2>__DevotionInventoryController_isDevotionEnable;
public static ArtifactStateChangeDelegate <3>__OnDevotionArtifactDisabled;
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Action<Run> <>9__6_0;
public static ArtifactStateChangeDelegate <>9__6_1;
public static Func<Instruction, bool> <>9__8_0;
public static Action<DevotedLemurianController> <>9__8_1;
internal void <DevotionInventoryController_Init>b__6_0(Run _)
{
BetterInventoryController.OnRunStartGlobal();
}
internal void <DevotionInventoryController_Init>b__6_1(RunArtifactManager _, ArtifactDef _)
{
BetterInventoryController.OnRunStartGlobal();
}
internal bool <EvolveDevotedLumerian>b__8_0(Instruction x)
{
ILLabel[] array = default(ILLabel[]);
return ILPatternMatchingExt.MatchSwitch(x, ref array);
}
internal void <EvolveDevotedLumerian>b__8_1(DevotedLemurianController lem)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
List<EquipmentIndex> list = (PluginConfig.highTierElitesOnly.Value ? BetterInventoryController.gigaChadLvl : DevotionInventoryController.highLevelEliteBuffs);
if (list.Any())
{
lem.LemurianInventory.SetEquipmentIndex(list[Random.Range(0, list.Count)]);
}
}
}
public static DevotedInventoryTweaks instance { get; private set; }
public static void Init()
{
if (instance == null)
{
instance = new DevotedInventoryTweaks();
}
}
private DevotedInventoryTweaks()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Expected O, but got Unknown
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
object obj = <>O.<0>__EvolveDevotedLumerian;
if (obj == null)
{
Manipulator val = EvolveDevotedLumerian;
<>O.<0>__EvolveDevotedLumerian = val;
obj = (object)val;
}
DevotionInventoryController.EvolveDevotedLumerian += (Manipulator)obj;
object obj2 = <>O.<1>__DevotionInventoryController_Init;
if (obj2 == null)
{
hook_Init val2 = DevotionInventoryController_Init;
<>O.<1>__DevotionInventoryController_Init = val2;
obj2 = (object)val2;
}
DevotionInventoryController.Init += (hook_Init)obj2;
DevotionInventoryController.UpdateMinionInventory += new hook_UpdateMinionInventory(UpdateMinionInventory);
DevotionInventoryController.UpdateAllMinions += new hook_UpdateAllMinions(UpdateAllMinions);
new Hook((MethodBase)AccessTools.PropertyGetter(typeof(DevotionInventoryController), "isDevotionEnable"), (Delegate)new Func<Func<bool>, bool>(DevotionInventoryController_isDevotionEnable));
}
private static void DevotionInventoryController_Init(orig_Init orig)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected O, but got Unknown
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected O, but got Unknown
Run.onRunStartGlobal += delegate
{
BetterInventoryController.OnRunStartGlobal();
};
object obj = <>c.<>9__6_1;
if (obj == null)
{
ArtifactStateChangeDelegate val = delegate
{
BetterInventoryController.OnRunStartGlobal();
};
<>c.<>9__6_1 = val;
obj = (object)val;
}
RunArtifactManager.onArtifactEnabledGlobal += (ArtifactStateChangeDelegate)obj;
object obj2 = <>O.<3>__OnDevotionArtifactDisabled;
if (obj2 == null)
{
ArtifactStateChangeDelegate val2 = BetterInventoryController.OnDevotionArtifactDisabled;
<>O.<3>__OnDevotionArtifactDisabled = val2;
obj2 = (object)val2;
}
RunArtifactManager.onArtifactDisabledGlobal += (ArtifactStateChangeDelegate)obj2;
}
private static bool DevotionInventoryController_isDevotionEnable(Func<bool> orig)
{
if (!orig())
{
return PluginConfig.permaDevotion.Value;
}
return true;
}
private static void EvolveDevotedLumerian(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
ILLabel[] array = default(ILLabel[]);
if (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchSwitch(x, ref array)
}))
{
val.Emit(OpCodes.Ldarg_1);
val.EmitDelegate<Action<DevotedLemurianController>>((Action<DevotedLemurianController>)delegate(DevotedLemurianController lem)
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
List<EquipmentIndex> list = (PluginConfig.highTierElitesOnly.Value ? BetterInventoryController.gigaChadLvl : DevotionInventoryController.highLevelEliteBuffs);
if (list.Any())
{
lem.LemurianInventory.SetEquipmentIndex(list[Random.Range(0, list.Count)]);
}
});
}
else
{
LemurFusionPlugin.LogError("Hook failed for DevotionInventoryController_EvolveDevotedLumerian #2");
}
}
private void UpdateAllMinions(orig_UpdateAllMinions orig, DevotionInventoryController self, bool shouldEvolve)
{
if (shouldEvolve)
{
orig.Invoke(self, shouldEvolve);
}
}
private void UpdateMinionInventory(orig_UpdateMinionInventory orig, DevotionInventoryController self, DevotedLemurianController lem, bool shouldEvolve)
{
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkServer.active || !(lem is BetterLemurController betterLemurController) || !Object.op_Implicit((Object)(object)betterLemurController) || !Object.op_Implicit((Object)(object)((DevotedLemurianController)betterLemurController)._lemurianMaster))
{
return;
}
if (Object.op_Implicit((Object)(object)betterLemurController.PersonalInventory))
{
foreach (ItemIndex item in betterLemurController.PersonalInventory.itemAcquisitionOrder.ToList())
{
if (Object.op_Implicit((Object)(object)betterLemurController.BetterInventoryController))
{
((DevotionInventoryController)betterLemurController.BetterInventoryController).GiveItem(item, 1);
}
if (Object.op_Implicit((Object)(object)betterLemurController.LemurianInventory))
{
betterLemurController.LemurianInventory.GiveItem(item, 1);
}
betterLemurController.ShareItem(item);
}
}
if (Object.op_Implicit((Object)(object)DevotionInventoryController.activationSoundEventDef))
{
EffectManager.SimpleSoundEffect(DevotionInventoryController.activationSoundEventDef.index, betterLemurController.LemurianBody.transform.position, true);
}
int devotedEvolutionLevel = ((DevotedLemurianController)betterLemurController).DevotedEvolutionLevel;
((DevotedLemurianController)betterLemurController).DevotedEvolutionLevel = devotedEvolutionLevel + 1;
self.EvolveDevotedLumerian((DevotedLemurianController)(object)betterLemurController);
}
}
public class DevotionTweaks
{
public enum DeathItem
{
None,
Scrap,
Original,
Custom
}
[CompilerGenerated]
private static class <>O
{
public static Manipulator <0>__PopulateScene;
public static hook_OnServerDamageDealt <1>__AffixAurelioniteBehavior_OnServerDamageDealt;
public static hook_OnEnter <2>__Bite_OnEnter;
public static hook_FireFlame <3>__Flamebreath_FireFlame;
public static hook_DefaultFilterCallbackImplementation <4>__BulletAttack_DefaultFilterCallbackImplementation;
public static hook_IgnoreCollisionsWithOwner <5>__ProjectileController_IgnoreCollisionsWithOwner;
}
public GameObject masterPrefab;
public GameObject bruiserMasterPrefab;
public GameObject bodyPrefab;
public GameObject bigBodyPrefab;
public const string devotedPrefix = "Devoted";
public const string devotedMasterName = "DevotedLemurianMaster";
public const string devotedBruiserMasterName = "DevotedLemurianBruiserMaster";
public const string devotedLemBodyName = "DevotedLemurianBody";
public const string devotedBigLemBodyName = "DevotedLemurianBruiserBody";
public readonly bool EnableSharedInventory;
public static DevotionTweaks instance { get; private set; }
public static void Init()
{
if (instance == null)
{
instance = new DevotionTweaks();
}
}
private DevotionTweaks()
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Expected O, but got Unknown
//IL_0089: 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_0094: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Expected O, but got Unknown
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Expected O, but got Unknown
EnableSharedInventory = PluginConfig.enableSharedInventory.Value;
LoadAssets();
if (ConfigExtended.Blacklist_Enable.Value)
{
PickupPickerController.SetOptionsFromInteractor += new hook_SetOptionsFromInteractor(PickupPickerController_SetOptionsFromInteractor);
}
object obj = <>O.<0>__PopulateScene;
if (obj == null)
{
Manipulator val = PopulateScene;
<>O.<0>__PopulateScene = val;
obj = (object)val;
}
SceneDirector.PopulateScene += (Manipulator)obj;
object obj2 = <>O.<1>__AffixAurelioniteBehavior_OnServerDamageDealt;
if (obj2 == null)
{
hook_OnServerDamageDealt val2 = AffixAurelioniteBehavior_OnServerDamageDealt;
<>O.<1>__AffixAurelioniteBehavior_OnServerDamageDealt = val2;
obj2 = (object)val2;
}
AffixAurelioniteBehavior.OnServerDamageDealt += (hook_OnServerDamageDealt)obj2;
object obj3 = <>O.<2>__Bite_OnEnter;
if (obj3 == null)
{
hook_OnEnter val3 = Bite_OnEnter;
<>O.<2>__Bite_OnEnter = val3;
obj3 = (object)val3;
}
Bite.OnEnter += (hook_OnEnter)obj3;
object obj4 = <>O.<3>__Flamebreath_FireFlame;
if (obj4 == null)
{
hook_FireFlame val4 = Flamebreath_FireFlame;
<>O.<3>__Flamebreath_FireFlame = val4;
obj4 = (object)val4;
}
Flamebreath.FireFlame += (hook_FireFlame)obj4;
if (PluginConfig.disableTeamCollision.Value)
{
object obj5 = <>O.<4>__BulletAttack_DefaultFilterCallbackImplementation;
if (obj5 == null)
{
hook_DefaultFilterCallbackImplementation val5 = BulletAttack_DefaultFilterCallbackImplementation;
<>O.<4>__BulletAttack_DefaultFilterCallbackImplementation = val5;
obj5 = (object)val5;
}
BulletAttack.DefaultFilterCallbackImplementation += (hook_DefaultFilterCallbackImplementation)obj5;
object obj6 = <>O.<5>__ProjectileController_IgnoreCollisionsWithOwner;
if (obj6 == null)
{
hook_IgnoreCollisionsWithOwner val6 = ProjectileController_IgnoreCollisionsWithOwner;
<>O.<5>__ProjectileController_IgnoreCollisionsWithOwner = val6;
obj6 = (object)val6;
}
ProjectileController.IgnoreCollisionsWithOwner += (hook_IgnoreCollisionsWithOwner)obj6;
}
}
private static void Flamebreath_FireFlame(orig_FireFlame orig, Flamebreath self, string muzzleString)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
if (self.bulletAttack != null)
{
self.bulletAttack.damageType.damageSource = (DamageSource)2;
}
orig.Invoke(self, muzzleString);
}
private static void Bite_OnEnter(orig_OnEnter orig, Bite self)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
self.attack.damageType.damageSource = (DamageSource)2;
}
private static void AffixAurelioniteBehavior_OnServerDamageDealt(orig_OnServerDamageDealt orig, AffixAurelioniteBehavior self, DamageReport damageReport)
{
if (!Utils.IsDevoted(damageReport.attackerBody, out var _) || ((DamageTypeCombo)(ref damageReport.damageInfo.damageType)).IsDamageSourceSkillBased)
{
orig.Invoke(self, damageReport);
}
}
private static bool BulletAttack_DefaultFilterCallbackImplementation(orig_DefaultFilterCallbackImplementation orig, BulletAttack bulletAttack, ref BulletHit hitInfo)
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Invalid comparison between Unknown and I4
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
if (orig.Invoke(bulletAttack, ref hitInfo))
{
TeamComponent val = default(TeamComponent);
if (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) && Object.op_Implicit((Object)(object)hitInfo.hitHurtBox.healthComponent) && Object.op_Implicit((Object)(object)bulletAttack.owner) && bulletAttack.owner.TryGetComponent<TeamComponent>(ref val) && (int)val.teamIndex == 1)
{
return FriendlyFireManager.ShouldDirectHitProceed(hitInfo.hitHurtBox.healthComponent, val.teamIndex);
}
return true;
}
return false;
}
private static void ProjectileController_IgnoreCollisionsWithOwner(orig_IgnoreCollisionsWithOwner orig, ProjectileController self, bool shouldIgnore)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Invalid comparison between Unknown and I4
orig.Invoke(self, shouldIgnore);
if (!shouldIgnore || (int)FriendlyFireManager.friendlyFireMode != 0 || (int)self.teamFilter.teamIndex != 1 || self.myColliders.Length == 0 || !Object.op_Implicit((Object)(object)self.owner))
{
return;
}
foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers((TeamIndex)1))
{
if (!Utils.IsDevoted(teamMember.body, out var _) || !Object.op_Implicit((Object)(object)teamMember.body.hurtBoxGroup) || !((Object)(object)((Component)teamMember).gameObject != (Object)(object)self.owner))
{
continue;
}
HurtBox[] hurtBoxes = teamMember.body.hurtBoxGroup.hurtBoxes;
for (int i = 0; i < hurtBoxes.Length; i++)
{
for (int j = 0; j < self.myColliders.Length; j++)
{
Physics.IgnoreCollision(hurtBoxes[i].collider, self.myColliders[j], shouldIgnore);
}
}
}
}
private void LoadAssets()
{
//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_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
bodyPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_CU8.DevotedLemurianBody_prefab).WaitForCompletion();
CharacterBody component = bodyPrefab.GetComponent<CharacterBody>();
component.bodyFlags = (BodyFlags)(component.bodyFlags | 0xA002);
component.baseMaxHealth = 360f;
component.levelMaxHealth = 11f;
component.baseMoveSpeed = 7f;
bigBodyPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_CU8.DevotedLemurianBruiserBody_prefab).WaitForCompletion();
CharacterBody component2 = bigBodyPrefab.GetComponent<CharacterBody>();
component2.bodyFlags = (BodyFlags)(component2.bodyFlags | 0xA002);
component2.baseMaxHealth = 720f;
component2.levelMaxHealth = 11f;
component2.baseMoveSpeed = 10f;
component2.baseArmor = 0f;
component2.levelArmor = 0.5f;
masterPrefab = Addressables.LoadAssetAsync<GameObject>((object)RoR2_CU8_LemurianEgg.DevotedLemurianMaster_prefab).WaitForCompletion();
Object.DestroyImmediate((Object)(object)masterPrefab.GetComponent<DevotedLemurianController>());
masterPrefab.AddComponent<BetterLemurController>();
masterPrefab.AddComponent<Inventory>();
masterPrefab.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab;
bruiserMasterPrefab = PrefabAPI.InstantiateClone(masterPrefab, "DevotedLemurianBruiserMaster", true);
bruiserMasterPrefab.GetComponent<CharacterMaster>().bodyPrefab = bigBodyPrefab;
LegacyResourcesAPI.LoadAsyncCallback<GameObject>("Prefabs/NetworkedObjects/DevotionMinionInventory", (Action<GameObject>)delegate(GameObject asset)
{
Object.DestroyImmediate((Object)(object)asset.GetComponent<DevotionInventoryController>());
((DevotionInventoryController)asset.AddComponent<BetterInventoryController>()).sfxLocator = asset.GetComponent<SfxLocator>();
});
LegacyResourcesAPI.LoadAsyncCallback<GameObject>("Prefabs/Effects/OrbEffects/ItemTakenOrbEffect", (Action<GameObject>)delegate(GameObject asset)
{
DevotionInventoryController.s_effectPrefab = asset;
});
LegacyResourcesAPI.LoadAsyncCallback<NetworkSoundEventDef>("NetworkSoundEventDefs/nseNullifiedBuffApplied", (Action<NetworkSoundEventDef>)delegate(NetworkSoundEventDef asset)
{
DevotionInventoryController.activationSoundEventDef = asset;
});
AsyncOperationHandle<SkillDef> val = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_LemurianBruiser.LemurianBruiserBodyPrimary_asset);
val.Completed += delegate(AsyncOperationHandle<SkillDef> task)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
task.Result.interruptPriority = (InterruptPriority)0;
};
val = Addressables.LoadAssetAsync<SkillDef>((object)RoR2_Base_LemurianBruiser.LemurianBruiserBodySecondary_asset);
val.Completed += delegate(AsyncOperationHandle<SkillDef> task)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
task.Result.interruptPriority = (InterruptPriority)0;
};
AsyncOperationHandle<ItemDef> val2 = Addressables.LoadAssetAsync<ItemDef>((object)RoR2_CU8_Harness.LemurianHarness_asset);
val2.Completed += delegate(AsyncOperationHandle<ItemDef> task)
{
task.Result.tags = task.Result.tags.Concat(new <>z__ReadOnlyArray<ItemTag>((ItemTag[])(object)new ItemTag[2]
{
(ItemTag)11,
(ItemTag)12
})).Distinct().ToArray();
};
AsyncOperationHandle<GameObject> val3 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_Lemurian.Fireball_prefab);
val3.Completed += delegate(AsyncOperationHandle<GameObject> task)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
task.Result.GetComponent<ProjectileDamage>().damageType.damageSource = (DamageSource)1;
};
val3 = Addressables.LoadAssetAsync<GameObject>((object)RoR2_Base_LemurianBruiser.LemurianBigFireball_prefab);
val3.Completed += delegate(AsyncOperationHandle<GameObject> task)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
task.Result.GetComponent<ProjectileDamage>().damageType.damageSource = (DamageSource)1;
};
}
private void PickupPickerController_SetOptionsFromInteractor(orig_SetOptionsFromInteractor orig, PickupPickerController self, Interactor activator)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: 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_008c: 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_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
CharacterBody val = default(CharacterBody);
if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<LemurianEggController>()) || !Object.op_Implicit((Object)(object)activator) || !((Component)activator).TryGetComponent<CharacterBody>(ref val) || !Object.op_Implicit((Object)(object)val.inventory))
{
orig.Invoke(self, activator);
return;
}
List<Option> list = new List<Option>();
foreach (ItemIndex item in val.inventory.itemAcquisitionOrder)
{
if (ConfigExtended.Blacklist_Filter(item))
{
PickupIndex val2 = PickupCatalog.FindPickupIndex(item);
if (val2 != PickupIndex.none)
{
list.Add(new Option
{
available = true,
pickup = new UniquePickup(val2)
});
}
}
}
self.SetOptionsServer(list.ToArray());
}
public CharacterMaster MasterSummon_Perform(orig_Perform orig, MasterSummon self)
{
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
CharacterBody val = default(CharacterBody);
if (Object.op_Implicit((Object)(object)self.masterPrefab) && (Object)(object)self.masterPrefab == (Object)(object)masterPrefab && Object.op_Implicit((Object)(object)self.summonerBodyObject) && self.summonerBodyObject.TryGetComponent<CharacterBody>(ref val) && val.isPlayerControlled)
{
CharacterMaster val2 = null;
int num = int.MaxValue;
int num2 = 0;
MinionGroup val3 = MinionGroup.FindGroup(val.masterObjectId);
if (val3 != null)
{
MinionOwnership[] members = val3.members;
BetterLemurController betterLemurController = default(BetterLemurController);
foreach (MinionOwnership val4 in members)
{
if (Object.op_Implicit((Object)(object)val4) && ((Component)val4).TryGetComponent<BetterLemurController>(ref betterLemurController) && Object.op_Implicit((Object)(object)betterLemurController.LemurianInventory))
{
num2++;
int fusionCount = betterLemurController.FusionCount;
if (fusionCount < num)
{
num = fusionCount;
val2 = ((DevotedLemurianController)betterLemurController)._lemurianMaster;
}
}
}
}
if (Object.op_Implicit((Object)(object)val2) && num2 >= PluginConfig.maxLemurs.Value)
{
return val2;
}
}
return orig.Invoke(self);
}
private static void PopulateScene(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int loc = 0;
if (val.TryGotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdfld<SceneDirector>(x, "lumerianEgg"),
(Instruction i) => ILPatternMatchingExt.MatchStloc(i, ref loc)
}))
{
int index = val.Index;
val.Index = index + 1;
val.Emit(OpCodes.Pop);
val.Emit(OpCodes.Ldloc, loc);
}
else
{
LemurFusionPlugin.LogError("IL Hook failed for SceneDirector_PopulateScene 1");
}
if (val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction i) => ILPatternMatchingExt.MatchNewobj(i, typeof(DirectorPlacementRule))
}) && val.TryGotoNext(new Func<Instruction, bool>[1]
{
(Instruction i) => ILPatternMatchingExt.MatchNewobj(i, typeof(DirectorSpawnRequest))
}) && val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<DirectorCard>(x, "GetSpawnCard")
}))
{
val.Emit(OpCodes.Ldarg_0);
val.EmitDelegate<Func<SpawnCard, SceneDirector, SpawnCard>>((Func<SpawnCard, SceneDirector, SpawnCard>)delegate(SpawnCard originalCard, SceneDirector self)
{
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
if (!DevotionInventoryController.isDevotionEnable)
{
return originalCard;
}
InteractableSpawnCard val2 = (InteractableSpawnCard)(object)((originalCard is InteractableSpawnCard) ? originalCard : null);
return (val2 != null && val2.skipSpawnWhenDevotionArtifactEnabled && self.rng.RangeInt(0, 100) < Math.Clamp(PluginConfig.eggSpawnChance.Value, 0, 100)) ? (self.lumerianEgg?.spawnCard ?? Addressables.LoadAssetAsync<SpawnCard>((object)RoR2_CU8_LemurianEgg.iscLemurianEgg_asset).WaitForCompletion()) : originalCard;
});
}
else
{
LemurFusionPlugin.LogError("IL Hook failed for SceneDirector_PopulateScene 2");
}
}
}
internal class LemurControllerTweaks
{
[CompilerGenerated]
private static class <>O
{
public static hook_InitializeDevotedLemurian <0>__DevotedLemurianController_InitializeDevotedLemurian;
public static hook_OnDevotedBodyDead <1>__DevotedLemurianController_OnDevotedBodyDead;
}
public static LemurControllerTweaks Instance { get; private set; }
public static void Init()
{
if (Instance == null)
{
Instance = new LemurControllerTweaks();
}
}
private LemurControllerTweaks()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
object obj = <>O.<0>__DevotedLemurianController_InitializeDevotedLemurian;
if (obj == null)
{
hook_InitializeDevotedLemurian val = DevotedLemurianController_InitializeDevotedLemurian;
<>O.<0>__DevotedLemurianController_InitializeDevotedLemurian = val;
obj = (object)val;
}
DevotedLemurianController.InitializeDevotedLemurian += (hook_InitializeDevotedLemurian)obj;
object obj2 = <>O.<1>__DevotedLemurianController_OnDevotedBodyDead;
if (obj2 == null)
{
hook_OnDevotedBodyDead val2 = DevotedLemurianController_OnDevotedBodyDead;
<>O.<1>__DevotedLemurianController_OnDevotedBodyDead = val2;
obj2 = (object)val2;
}
DevotedLemurianController.OnDevotedBodyDead += (hook_OnDevotedBodyDead)obj2;
}
private static void DevotedLemurianController_InitializeDevotedLemurian(orig_InitializeDevotedLemurian orig, DevotedLemurianController self, ItemIndex itemIndex, DevotionInventoryController devInvCtrl)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self, itemIndex, devInvCtrl);
if (self is BetterLemurController betterLemurController && Object.op_Implicit((Object)(object)betterLemurController))
{
betterLemurController.InitializeDevotedLemurian();
}
}
private static void DevotedLemurianController_OnDevotedBodyDead(orig_OnDevotedBodyDead orig, DevotedLemurianController self)
{
if (self is BetterLemurController betterLemurController && Object.op_Implicit((Object)(object)betterLemurController) && Object.op_Implicit((Object)(object)((DevotedLemurianController)betterLemurController)._lemurianMaster) && !((MonoBehaviour)((DevotedLemurianController)betterLemurController)._lemurianMaster).IsInvoking("RespawnExtraLife") && !((MonoBehaviour)((DevotedLemurianController)betterLemurController)._lemurianMaster).IsInvoking("RespawnExtraLifeShrine") && !((MonoBehaviour)((DevotedLemurianController)betterLemurController)._lemurianMaster).IsInvoking("RespawnExtraLifeVoid"))
{
betterLemurController.KillYourSelf();
}
}
}
public static class StatTweaks
{
[CompilerGenerated]
private static class <>O
{
public static hook_GetBestMasterName <0>__Util_GetBestMasterName;
public static hook_GetDisplayName <1>__CharacterBody_GetDisplayName;
public static hook_Rebuild <2>__ScoreboardController_Rebuild;
public static StatHookEventHandler <3>__RecalculateStatsAPI_GetStatCoefficients;
public static Action<CharacterBody> <4>__CharacterBody_onBodyStartGlobal;
}
public static void InitHooks()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
object obj = <>O.<0>__Util_GetBestMasterName;
if (obj == null)
{
hook_GetBestMasterName val = Util_GetBestMasterName;
<>O.<0>__Util_GetBestMasterName = val;
obj = (object)val;
}
Util.GetBestMasterName += (hook_GetBestMasterName)obj;
object obj2 = <>O.<1>__CharacterBody_GetDisplayName;
if (obj2 == null)
{
hook_GetDisplayName val2 = CharacterBody_GetDisplayName;
<>O.<1>__CharacterBody_GetDisplayName = val2;
obj2 = (object)val2;
}
CharacterBody.GetDisplayName += (hook_GetDisplayName)obj2;
object obj3 = <>O.<2>__ScoreboardController_Rebuild;
if (obj3 == null)
{
hook_Rebuild val3 = ScoreboardController_Rebuild;
<>O.<2>__ScoreboardController_Rebuild = val3;
obj3 = (object)val3;
}
ScoreboardController.Rebuild += (hook_Rebuild)obj3;
object obj4 = <>O.<3>__RecalculateStatsAPI_GetStatCoefficients;
if (obj4 == null)
{
StatHookEventHandler val4 = RecalculateStatsAPI_GetStatCoefficients;
<>O.<3>__RecalculateStatsAPI_GetStatCoefficients = val4;
obj4 = (object)val4;
}
RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj4;
CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
}
public static void RemoveHooks()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
object obj = <>O.<0>__Util_GetBestMasterName;
if (obj == null)
{
hook_GetBestMasterName val = Util_GetBestMasterName;
<>O.<0>__Util_GetBestMasterName = val;
obj = (object)val;
}
Util.GetBestMasterName -= (hook_GetBestMasterName)obj;
object obj2 = <>O.<1>__CharacterBody_GetDisplayName;
if (obj2 == null)
{
hook_GetDisplayName val2 = CharacterBody_GetDisplayName;
<>O.<1>__CharacterBody_GetDisplayName = val2;
obj2 = (object)val2;
}
CharacterBody.GetDisplayName -= (hook_GetDisplayName)obj2;
object obj3 = <>O.<2>__ScoreboardController_Rebuild;
if (obj3 == null)
{
hook_Rebuild val3 = ScoreboardController_Rebuild;
<>O.<2>__ScoreboardController_Rebuild = val3;
obj3 = (object)val3;
}
ScoreboardController.Rebuild -= (hook_Rebuild)obj3;
object obj4 = <>O.<3>__RecalculateStatsAPI_GetStatCoefficients;
if (obj4 == null)
{
StatHookEventHandler val4 = RecalculateStatsAPI_GetStatCoefficients;
<>O.<3>__RecalculateStatsAPI_GetStatCoefficients = val4;
obj4 = (object)val4;
}
RecalculateStatsAPI.GetStatCoefficients -= (StatHookEventHandler)obj4;
CharacterBody.onBodyStartGlobal -= CharacterBody_onBodyStartGlobal;
}
private static string Util_GetBestMasterName(orig_GetBestMasterName orig, CharacterMaster characterMaster)
{
if (!Utils.IsDevoted(characterMaster, out var _))
{
return orig.Invoke(characterMaster);
}
CharacterBody body = characterMaster.GetBody();
if (body == null)
{
return null;
}
return body.GetDisplayName();
}
private static string CharacterBody_GetDisplayName(orig_GetDisplayName orig, CharacterBody self)
{
string text = orig.Invoke(self);
if (!string.IsNullOrEmpty(text) && Utils.IsDevoted(self, out var lemCtrl))
{
int fusionCount = lemCtrl.FusionCount;
if (fusionCount > 0)
{
return $"{text} <style=cStack>x{fusionCount}</style>";
}
}
return text;
}
private static void ScoreboardController_Rebuild(orig_Rebuild orig, ScoreboardController self)
{
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
orig.Invoke(self);
if (!PluginConfig.enableMinionScoreboard.Value)
{
return;
}
List<BetterLemurController> list = new List<BetterLemurController>();
BetterLemurController betterLemurController = default(BetterLemurController);
foreach (PlayerCharacterMasterController item in PlayerCharacterMasterController.instances.Where((PlayerCharacterMasterController m) => m.hasEffectiveAuthority))
{
MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)item).netId);
if (val == null)
{
continue;
}
MinionOwnership[] members = val.members;
foreach (MinionOwnership val2 in members)
{
if (Object.op_Implicit((Object)(object)val2) && ((Component)val2).TryGetComponent<BetterLemurController>(ref betterLemurController) && Object.op_Implicit((Object)(object)betterLemurController.LemurianInventory))
{
list.Add(betterLemurController);
}
}
}
if (!list.Any())
{
return;
}
int count = self.stripAllocator.elements.Count;
self.SetStripCount(count + list.Count);
for (int j = 0; j < list.Count; j++)
{
self.stripAllocator.elements[count + j].SetMaster(((DevotedLemurianController)list[j])._lemurianMaster);
if (PluginConfig.showPersonalInventory.Value)
{
self.stripAllocator.elements[count + j].itemInventoryDisplay.SetSubscribedInventory(list[j].PersonalInventory);
}
}
}
private static void CharacterBody_onBodyStartGlobal(CharacterBody lemBody)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
if (!Utils.IsDevoted(lemBody, out var lemCtrl))
{
return;
}
if (AITweaks.disableFallDamage.Value)
{
lemBody.bodyFlags = (BodyFlags)(lemBody.bodyFlags | 1);
}
if (AITweaks.immuneToVoidDeath.Value)
{
lemBody.bodyFlags = (BodyFlags)(lemBody.bodyFlags | 0xA40);
}
if (PluginConfig.disableTeamCollision.Value)
{
((Component)lemBody).gameObject.layer = LayerIndex.fakeActor.intVal;
if (Object.op_Implicit((Object)(object)lemBody.characterMotor))
{
((BaseCharacterController)lemBody.characterMotor).Motor.RebuildCollidableLayers();
}
}
if (!NetworkClient.active)
{
return;
}
Transform val = (Object.op_Implicit((Object)(object)lemBody.modelLocator) ? lemBody.modelLocator.modelTransform : null);
if (Object.op_Implicit((Object)(object)val))
{
if (PluginConfig.miniElders.Value && lemBody.bodyIndex == BodyCatalog.FindBodyIndex("DevotedLemurianBruiserBody"))
{
float num = Mathf.Max(0.01f, (float)PluginConfig.initScaleValue.Value * 0.01f);
float num2 = (float)PluginConfig.scaleValue.Value * 0.01f;
val.localScale = Vector3.one * (num + num2 * (float)lemCtrl.FusionCount);
}
FootstepHandler val2 = default(FootstepHandler);
if (((Component)val).TryGetComponent<FootstepHandler>(ref val2))
{
val2.baseFootstepString = "";
}
}
}
private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
if (Utils.IsDevoted(sender, out var lemCtrl))
{
int fusionCount = lemCtrl.FusionCount;
if (PluginConfig.rebalanceStatScaling.Value)
{
float num = sender.level * sender.levelMaxHealth * Utils.GetLevelModifier(((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
args.baseHealthAdd += num;
args.baseRegenAdd += num * 0.005f * Utils.GetLevelModifier(((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
args.healthMultAdd += Utils.GetFusionStatMultiplier(PluginConfig.statMultHealth.Value, fusionCount, ((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
args.damageMultAdd += Utils.GetFusionStatMultiplier(PluginConfig.statMultDamage.Value, fusionCount, ((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
args.attackSpeedMultAdd += Utils.GetFusionStatMultiplier(PluginConfig.statMultAttackSpeed.Value, fusionCount, ((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
}
else
{
args.healthMultAdd += Utils.GetVanillaStatModifier(PluginConfig.statMultHealth.Value, fusionCount, ((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
args.damageMultAdd += Utils.GetVanillaStatModifier(PluginConfig.statMultDamage.Value, fusionCount, ((DevotedLemurianController)lemCtrl).DevotedEvolutionLevel);
}
}
}
}
}
namespace LemurFusion.Devotion.Components
{
public class BetterInventoryController : DevotionInventoryController
{
public static List<EquipmentIndex> gigaChadLvl = new List<EquipmentIndex>();
public static bool initialized { get; set; }
public static void CreateEliteLists()
{
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Invalid comparison between Unknown and I4
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
HashSet<EquipmentIndex> hashSet = new HashSet<EquipmentIndex>();
HashSet<EquipmentIndex> hashSet2 = new HashSet<EquipmentIndex>();
HashSet<EquipmentIndex> hashSet3 = new HashSet<EquipmentIndex>();
foreach (EliteTierDef item in (EliteAPI.GetCombatDirectorEliteTiers() ?? Array.Empty<EliteTierDef>()).ToList())
{
if (item == null || item.eliteTypes.Length == 0 || item.eliteTypes.Any((EliteDef ed) => (Object)(object)ed != (Object)null && ((Object)ed).name.Contains("Honor")))
{
continue;
}
bool flag = false;
bool flag2 = false;
EliteDef[] eliteTypes = item.eliteTypes;
foreach (EliteDef val in eliteTypes)
{
if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.eliteEquipmentDef))
{
if ((Object)(object)val.eliteEquipmentDef == (Object)(object)Equipment.AffixPoison || (Object)(object)val.eliteEquipmentDef == (Object)(object)Equipment.AffixLunar)
{
flag = true;
break;
}
if ((Object)(object)val.eliteEquipmentDef == (Object)(object)Equipment.AffixBlue)
{
flag2 = true;
break;
}
}
}
if (!(flag2 || flag))
{
continue;
}
eliteTypes = item.eliteTypes;
foreach (EliteDef val2 in eliteTypes)
{
if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.eliteEquipmentDef) && (int)val2.eliteEquipmentDef.equipmentIndex != -1 && Object.op_Implicit((Object)(object)val2.eliteEquipmentDef.passiveBuffDef) && val2.eliteEquipmentDef.passiveBuffDef.isElite)
{
if (flag2)
{
hashSet.Add(val2.eliteEquipmentDef.equipmentIndex);
hashSet2.Add(val2.eliteEquipmentDef.equipmentIndex);
}
if (flag)
{
hashSet2.Add(val2.eliteEquipmentDef.equipmentIndex);
hashSet3.Add(val2.eliteEquipmentDef.equipmentIndex);
}
}
}
}
DevotionInventoryController.lowLevelEliteBuffs = hashSet.ToList();
DevotionInventoryController.highLevelEliteBuffs = hashSet2.ToList();
gigaChadLvl = hashSet3.ToList();
}
public static void ClearEliteLists()
{
gigaChadLvl.Clear();
DevotionInventoryController.lowLevelEliteBuffs.Clear();
DevotionInventoryController.highLevelEliteBuffs.Clear();
}
public static void OnRunStartGlobal()
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Expected O, but got Unknown
if (!initialized && (PluginConfig.permaDevotion.Value || RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Devotion)))
{
initialized = true;
Run.onRunDestroyGlobal += DevotionInventoryController.OnRunDestroy;
BossGroup.onBossGroupDefeatedServer += DevotionInventoryController.OnBossGroupDefeatedServer;
MasterSummon.Perform += new hook_Perform(DevotionTweaks.instance.MasterSummon_Perform);
StatTweaks.InitHooks();
CreateEliteLists();
}
}
public static void OnDevotionArtifactDisabled(RunArtifactManager runArtifactManager, ArtifactDef artifactDef)
{
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
if (initialized && !PluginConfig.permaDevotion.Value && (Object)(object)artifactDef == (Object)(object)Artifacts.Devotion)
{
initialized = false;
Run.onRunDestroyGlobal -= DevotionInventoryController.OnRunDestroy;
BossGroup.onBossGroupDefeatedServer -= DevotionInventoryController.OnBossGroupDefeatedServer;
MasterSummon.Perform -= new hook_Perform(DevotionTweaks.instance.MasterSummon_Perform);
StatTweaks.RemoveHooks();
ClearEliteLists();
}
}
public List<BetterLemurController> GetFriends(BetterLemurController self = null)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
List<BetterLemurController> list = new List<BetterLemurController>();
if (Object.op_Implicit((Object)(object)((DevotionInventoryController)this).SummonerMaster))
{
MinionGroup val = MinionGroup.FindGroup(((NetworkBehaviour)((DevotionInventoryController)this).SummonerMaster).netId);
if (val != null)
{
MinionOwnership[] members = val.members;
BetterLemurController betterLemurController = default(BetterLemurController);
foreach (MinionOwnership val2 in members)
{
if (Object.op_Implicit((Object)(object)val2) && ((Component)val2).TryGetComponent<BetterLemurController>(ref betterLemurController) && Object.op_Implicit((Object)(object)betterLemurController) && (Object)(object)betterLemurController != (Object)(object)self && Object.op_Implicit((Object)(object)betterLemurController.LemurianInventory))
{
list.Add(betterLemurController);
}
}
}
}
return list;
}
public static List<BetterLemurController> GetFriends(NetworkInstanceId masterID)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
List<BetterLemurController> list = new List<BetterLemurController>();
MinionGroup val = MinionGroup.FindGroup(masterID);
if (val != null)
{
MinionOwnership[] members = val.members;
BetterLemurController betterLemurController = default(BetterLemurController);
foreach (MinionOwnership val2 in members)
{
if (Object.op_Implicit((Object)(object)val2) && ((Component)val2).TryGetComponent<BetterLemurController>(ref betterLemurController) && Object.op_Implicit((Object)(object)betterLemurController) && Object.op_Implicit((Object)(object)betterLemurController.PersonalInventory))
{
list.Add(betterLemurController);
}
}
}
return list;
}
}
public class LemHitboxGroupRevealer : MonoBehaviour
{
public static GameObject prefab;
public LemHitboxRevealer[] _revealers = Array.Empty<LemHitboxRevealer>();
private bool _revealed;
public static void Init()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: 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_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
prefab = PrefabAPI.InstantiateClone(new GameObject(), "RevealerPrefab", false);
prefab.AddComponent<MeshFilter>().sharedMesh = Addressables.LoadAssetAsync<Mesh>((object)"Decalicious/DecalCube.asset").WaitForCompletion();
((Renderer)prefab.AddComponent<MeshRenderer>()).material = new Material(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Engi/matBlueprintsOk.mat").WaitForCompletion());
((Renderer)prefab.GetComponent<MeshRenderer>()).enabled = false;
prefab.AddComponent<LemHitboxRevealer>();
prefab.transform.localPosition = Vector3.zero;
prefab.transform.localRotation = Quaternion.identity;
prefab.transform.localScale = Vector3.one;
}
public void Start()
{
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
HitBoxGroup val = default(HitBoxGroup);
ProjectileController val2 = default(ProjectileController);
ProjectileExplosion val3 = default(ProjectileExplosion);
if (((Component)this).TryGetComponent<HitBoxGroup>(ref val))
{
_revealers = new LemHitboxRevealer[val.hitBoxes.Length];
for (int i = 0; i < val.hitBoxes.Length; i++)
{
_revealers[i] = Object.Instantiate<GameObject>(prefab, ((Component)val.hitBoxes[i]).transform).GetComponent<LemHitboxRevealer>();
}
}
else if (((Component)this).TryGetComponent<ProjectileController>(ref val2) && val2.myColliders.Length != 0)
{
_revealers = new LemHitboxRevealer[val2.myColliders.Length];
for (int j = 0; j < _revealers.Length; j++)
{
_revealers[j] = Object.Instantiate<GameObject>(prefab, ((Component)val2.myColliders[j]).transform).GetComponent<LemHitboxRevealer>();
}
}
else if (((Component)this).TryGetComponent<ProjectileExplosion>(ref val3))
{
_revealers = new LemHitboxRevealer[1] { Object.Instantiate<GameObject>(prefab, ((Component)this).transform).GetComponent<LemHitboxRevealer>() };
((Component)_revealers[0]).transform.localScale = Vector3.one * val3.blastRadius;
}
else
{
_revealers = new LemHitboxRevealer[1] { Object.Instantiate<GameObject>(prefab, ((Component)this).transform).GetComponent<LemHitboxRevealer>() };
}
Reveal(active: true);
}
public void Reveal(bool active)
{
_revealed = active;
for (int i = 0; i < _revealers.Length; i++)
{
if (Object.op_Implicit((Object)(object)_revealers[i]))
{
((Behaviour)_revealers[i]).enabled = active;
}
}
}
private void OnDestroy()
{
Reveal(active: false);
for (int i = 0; i < _revealers.Length; i++)
{
if (Object.op_Implicit((Object)(object)_revealers[i]))
{
Object.Destroy((Object)(object)((Component)_revealers[i]).gameObject);
}
}
}
}
public class LemHitboxRevealer : MonoBehaviour
{
private MeshFilter meshFilter;
public MeshRenderer renderer;
private void Awake()
{
renderer = ((Component)this).GetComponent<MeshRenderer>();
meshFilter = ((Component)this).GetComponent<MeshFilter>();
((Renderer)renderer).enabled = false;
((Behaviour)this).enabled = false;
}
private void OnEnable()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Expected O, but got Unknown
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
MaterialPropertyBlock val = new MaterialPropertyBlock();
((Renderer)renderer).GetPropertyBlock(val);
Color val2 = Random.ColorHSV(0f, 1f, 0.5f, 0.5f, 0.3f, 0.6f, 0.3f, 0.6f);
val.SetColor("_Color", val2);
((Renderer)renderer).SetPropertyBlock(val);
((Renderer)renderer).enabled = true;
}
private void OnDisable()
{
if (Object.op_Implicit((Object)(object)renderer))
{
((Renderer)renderer).enabled = false;
}
}
}
public class MatrixDodgingController : MonoBehaviour
{
[CompilerGenerated]
private sealed class <UpdateSkillDrivers>d__9 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public MatrixDodgingController <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <UpdateSkillDrivers>d__9(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Expected O, but got Unknown
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Expected O, but got Unknown
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Expected O, but got Unknown
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Expected O, but got Unknown
int num = <>1__state;
MatrixDodgingController matrixDodgingController = <>4__this;
float distance;
bool shouldJump;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
goto IL_0216;
case 1:
<>1__state = -1;
if (Object.op_Implicit((Object)(object)matrixDodgingController.master))
{
matrixDodgingController.body = matrixDodgingController.master.GetBody();
goto IL_0074;
}
goto IL_008d;
case 2:
<>1__state = -1;
<>2__current = (object)new WaitForFixedUpdate();
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
goto IL_008d;
case 4:
{
<>1__state = -1;
goto IL_0216;
}
IL_0216:
if (!Object.op_Implicit((Object)(object)matrixDodgingController.master))
{
return false;
}
goto IL_0074;
IL_008d:
if (matrixDodgingController.FindProjectiles(out distance, out shouldJump))
{
AISkillDriver val = ((distance < matrixDodgingController.escapeDistance) ? matrixDodgingController.ai.skillDrivers[matrixDodgingController.escapeSkillIndex] : matrixDodgingController.ai.skillDrivers[matrixDodgingController.strafeSkillIndex]);
if (val.customName != matrixDodgingController.ai.selectedSkilldriverName || matrixDodgingController.ai.skillDriverUpdateTimer > 0.2f)
{
val.driverUpdateTimerOverride = Mathf.Clamp(AITweaks.updateFrequency.Value * 1.5f, 0.3f, 1f);
matrixDodgingController.ai.BeginSkillDriver(new SkillDriverEvaluation
{
target = matrixDodgingController.ai.customTarget,
aimTarget = matrixDodgingController.ai.currentEnemy,
dominantSkillDriver = val,
separationSqrMagnitude = distance
});
}
if (matrixDodgingController.body.characterMotor.isGrounded && shouldJump)
{
matrixDodgingController.body.characterMotor.airControl = 1f;
matrixDodgingController.body.characterMotor.Jump(0.75f, 0.75f, false);
}
<>2__current = (object)new WaitForSeconds(AITweaks.updateFrequency.Value);
<>1__state = 2;
return true;
}
<>2__current = (object)new WaitForSeconds(AITweaks.updateFrequency.Value);
<>1__state = 4;
return true;
IL_0074:
if (!Object.op_Implicit((Object)(object)matrixDodgingController.body) || !AITweaks.enableProjectileTracking.Value)
{
<>2__current = (object)new WaitForSeconds(2f);
<>1__state = 1;
return true;
}
goto IL_008d;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private int escapeSkillIndex;
private int strafeSkillIndex;
private float escapeDistance;
private float safeDistance;
private BaseAI ai;
private CharacterMaster master;
private CharacterBody body;
private LineRenderer laserLineComponent;
private void OnEnable()
{
ai = ((Component)this).GetComponent<BaseAI>();
master = ((Component)this).GetComponent<CharacterMaster>();
laserLineComponent = ((Component)this).GetComponent<LineRenderer>() ?? ((Component)this).gameObject.AddComponent<LineRenderer>();
DisableLaser();
escapeSkillIndex = CollectionUtils.IndexOf<AISkillDriver>((IEnumerable<AISkillDriver>)ai.skillDrivers, (Func<AISkillDriver, bool>)((AISkillDriver s) => s.customName == "BackUpFromExplosion"));
strafeSkillIndex = CollectionUtils.IndexOf<AISkillDriver>((IEnumerable<AISkillDriver>)ai.skillDrivers, (Func<AISkillDriver, bool>)((AISkillDriver s) => s.customName == "StrafeAroundExplosion"));
((MonoBehaviour)this).StartCoroutine(UpdateSkillDrivers());
}
[IteratorStateMachine(typeof(<UpdateSkillDrivers>d__9))]
private IEnumerator UpdateSkillDrivers()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <UpdateSkillDrivers>d__9(0)
{
<>4__this = this
};
}
private bool FindProjectiles(out float distance, out bool shouldJump)
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_020a: 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_0212: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: 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_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_021e: Unknown r