using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.FalseSonBoss;
using Microsoft.CodeAnalysis;
using On.EntityStates.FalseSonBoss;
using RoR2;
using RoR2.ContentManagement;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("FS_Freeze_Fix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+74353171ea9838388b72ce15c9e7072e822f77b7")]
[assembly: AssemblyProduct("FS_Freeze_Fix")]
[assembly: AssemblyTitle("FS_Freeze_Fix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[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;
}
}
}
namespace FS_Freeze_Fix
{
[BepInPlugin("Onyx.FS_Freeze_Fix", "FS_Freeze_Fix", "1.0.0")]
public class FS_Arena_Fix : BaseUnityPlugin
{
public const string PluginGUID = "Onyx.FS_Freeze_Fix";
public const string PluginAuthor = "Onyx";
public const string PluginName = "FS_Freeze_Fix";
public const string PluginVersion = "1.0.0";
public void Awake()
{
//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_0048: 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_0082: 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_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Expected O, but got Unknown
AssetReferenceT<GameObject> val = new AssetReferenceT<GameObject>(RoR2_DLC2_FalseSonBoss.FalseSonBossBody_prefab);
AsyncOperationHandle<GameObject> val2 = AssetAsyncReferenceManager<GameObject>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
val2.Completed += delegate(AsyncOperationHandle<GameObject> x)
{
x.Result.AddComponent<FreezeFix>();
};
val = new AssetReferenceT<GameObject>(RoR2_DLC2_FalseSonBoss.FalseSonBossBodyLunarShard_prefab);
val2 = AssetAsyncReferenceManager<GameObject>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
val2.Completed += delegate(AsyncOperationHandle<GameObject> x)
{
x.Result.AddComponent<FreezeFix>();
};
val = new AssetReferenceT<GameObject>(RoR2_DLC2_FalseSonBoss.FalseSonBossBodyBrokenLunarShard_prefab);
val2 = AssetAsyncReferenceManager<GameObject>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2);
val2.Completed += delegate(AsyncOperationHandle<GameObject> x)
{
x.Result.AddComponent<FreezeFix>();
};
LunarGazeLeap.OnExit += new hook_OnExit(leapStart);
}
private void leapStart(orig_OnExit orig, LunarGazeLeap self)
{
orig.Invoke(self);
Animator modelAnimator = ((EntityState)self).GetModelAnimator();
if (Object.op_Implicit((Object)(object)modelAnimator) && !((Behaviour)modelAnimator).isActiveAndEnabled)
{
GameObject colossusHead = MeridianEventTriggerInteraction.instance.colossusHead;
colossusHead.GetComponent<EntityStateMachine>().SetNextStateToMain();
((EntityState)self).characterMotor.walkSpeedPenaltyCoefficient = 1f;
}
}
}
public class FreezeFix : MonoBehaviour
{
private EntityStateMachine _stateMachine;
private Animator _modelAnimator;
private void Start()
{
_stateMachine = ((Component)this).GetComponent<EntityStateMachine>();
_modelAnimator = ((Component)((Component)this).GetComponent<ModelLocator>().modelTransform).GetComponent<Animator>();
}
private void FixedUpdate()
{
if (_stateMachine.state is FrozenState)
{
int layerIndex = _modelAnimator.GetLayerIndex("FullBody, Override");
_modelAnimator.speed = 1f;
_modelAnimator.Update(0f);
_modelAnimator.CrossFadeInFixedTime("Empty", 0.1f, layerIndex);
}
}
}
}