Decompiled source of HealMode v1.0.0
Mods/HealMode.dll
Decompiled 11 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BoneLib; using BoneLib.BoneMenu; using HarmonyLib; using HealMode; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Marrow; using Il2CppSLZ.Marrow.AI; using Il2CppSLZ.Marrow.Combat; using Il2CppSLZ.Marrow.Interaction; using LabFusion.Entities; using LabFusion.Network; using LabFusion.Player; using MelonLoader; using MelonLoader.Preferences; using Microsoft.CodeAnalysis; using TimeStopPublic; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(HealModeMod), "Heal Mode", "1.0.0", "Tapochnik", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace HealMode { public sealed class HealModeMod : MelonMod { internal static HealModeMod Instance; private bool _active; private bool _bothDown; private int _gripTaps; private float _lastGrip = -10f; private float _nextContact; private float _nextHands; private float _nextSound; private MelonPreferences_Category _preferences; private MelonPreferences_Entry<float> _rate; private readonly Dictionary<byte, float> _lastStrike = new Dictionary<byte, float>(); private readonly HashSet<byte> _contacts = new HashSet<byte>(); public override void OnInitializeMelon() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) Instance = this; TimeStopPublicMod.HealOnlyClient = true; _preferences = MelonPreferences.CreateCategory("PublicHealMode"); _rate = _preferences.CreateEntry<float>("HealingPercentPerSecond", 5f, (string)null, (string)null, false, false, (ValueValidator)null, (string)null); Page obj = Page.Root.CreatePage("Heal Mode", Color.yellow, 0, true); obj.CreateBool("Healing enabled", Color.yellow, false, (Action<bool>)SetActive); obj.CreateFloat("Contact healing (% / second)", Color.yellow, Mathf.Clamp(_rate.Value, 0.1f, 20f), 0.5f, 0.1f, 20f, (Action<float>)delegate(float value) { _rate.Value = value; _preferences.SaveToFile(false); }); ((MelonBase)this).LoggerInstance.Msg("Heal Mode: three simultaneous Grip taps toggle healing. Touch/hold other players; punches heal up to 30% per hit."); } private void SetActive(bool value) { _active = value && !TimeStopPublicMod.PrivateAbilityOwner; _nextHands = (_nextContact = 0f); TimeStopPublicMod instance = TimeStopPublicMod.Instance; if (instance != null) { instance.SetHealHands(PlayerIDManager.LocalSmallID, _active); } TimeStopPublicBridge.SendPublicHealing((TimeStopPublicAction)37, byte.MaxValue, _active ? 1f : 0f); } public override void OnUpdate() { if (TimeStopPublicMod.PrivateAbilityOwner) { if (_active) { SetActive(value: false); } } else { if (!Player.ControllersExist || (Object)(object)Player.RigManager == (Object)null) { return; } float realtimeSinceStartup = Time.realtimeSinceStartup; bool flag = Player.LeftController.GetGripForce() >= 0.78f && Player.RightController.GetGripForce() >= 0.78f; if (flag && !_bothDown) { if (realtimeSinceStartup - _lastGrip > 1.4f) { _gripTaps = 0; } _lastGrip = realtimeSinceStartup; if (++_gripTaps >= 3) { _gripTaps = 0; SetActive(!_active); } } _bothDown = flag; if (!_active) { return; } if (realtimeSinceStartup >= _nextHands) { _nextHands = realtimeSinceStartup + 0.8f; TimeStopPublicMod instance = TimeStopPublicMod.Instance; if (instance != null) { instance.SetHealHands(PlayerIDManager.LocalSmallID, true); } TimeStopPublicBridge.SendPublicHealing((TimeStopPublicAction)37, byte.MaxValue, 1f); } if (!NetworkInfo.HasServer || realtimeSinceStartup < _nextContact) { return; } _nextContact = realtimeSinceStartup + 0.1f; _contacts.Clear(); FindContacts(Player.LeftHand); FindContacts(Player.RightHand); foreach (byte contact in _contacts) { TimeStopPublicBridge.SendPublicHealing((TimeStopPublicAction)36, contact, Mathf.Clamp(_rate.Value, 0.1f, 20f) * 0.001f); } if (_contacts.Count > 0) { PlayCue(); } } } private void FindContacts(Hand hand) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) if ((Object)(object)hand == (Object)null) { return; } GameObject objectInHand = Player.GetObjectInHand(hand); if ((Object)(object)objectInHand != (Object)null && ResolvePlayer((Component)(object)objectInHand.transform, out var player)) { _contacts.Add(player.PlayerID.SmallID); } Vector3 val = (((Object)(object)hand.rb != (Object)null) ? hand.rb.position : ((Component)hand).transform.position); foreach (NetworkPlayer player2 in NetworkPlayer.Players) { if (player2 == null || player2.NetworkEntity.IsOwner || !player2.HasRig) { continue; } MarrowEntity marrowEntity = player2.MarrowEntity; if (((marrowEntity != null) ? marrowEntity.Bodies : null) == null) { continue; } bool flag = false; foreach (MarrowBody item in (Il2CppArrayBase<MarrowBody>)(object)player2.MarrowEntity.Bodies) { if ((Object)(object)item == (Object)null) { continue; } foreach (Collider componentsInChild in ((Component)item).GetComponentsInChildren<Collider>(true)) { if ((Object)(object)componentsInChild != (Object)null && componentsInChild.enabled && !componentsInChild.isTrigger) { Vector3 val2 = componentsInChild.ClosestPoint(val) - val; if (((Vector3)(ref val2)).sqrMagnitude <= 0.018f) { flag = true; break; } } } if (flag) { break; } } if (flag) { _contacts.Add(player2.PlayerID.SmallID); } } } private static bool ResolvePlayer(Component source, out NetworkPlayer player) { player = null; if ((Object)(object)source == (Object)null) { return false; } MarrowBody componentInParent = source.GetComponentInParent<MarrowBody>(); MarrowEntity val = ((componentInParent != null) ? componentInParent.Entity : null) ?? source.GetComponentInParent<MarrowEntity>(); if ((Object)(object)val != (Object)null && NetworkPlayerManager.TryGetPlayer(val, ref player)) { if (player != null) { return !player.NetworkEntity.IsOwner; } return false; } RigManager componentInParent2 = source.GetComponentInParent<RigManager>(); if ((Object)(object)componentInParent2 != (Object)null && NetworkPlayerManager.TryGetPlayer(componentInParent2, ref player) && player != null) { return !player.NetworkEntity.IsOwner; } return false; } private void PlayCue() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!(Time.realtimeSinceStartup < _nextSound)) { _nextSound = Time.realtimeSinceStartup + 2f; TimeStopPublicBridge.SendPublicHealing((TimeStopPublicAction)38, byte.MaxValue, 0f); TimeStopPublicMod instance = TimeStopPublicMod.Instance; if (instance != null) { instance.PlayHealingCue(Player.Head.position, false); } } } internal bool ConvertPlayerPunch(Health health, Attack attack) { if (!_active || TimeStopPublicMod.PrivateAbilityOwner || attack == null || (Object)(object)health == (Object)null) { return false; } TriggerRefProxy proxy = attack.proxy; object obj; if (proxy == null) { obj = null; } else { GameObject root = proxy.root; obj = ((root != null) ? root.transform : null); } if (obj == null) { Collider collider = attack.collider; obj = ((collider != null) ? ((Component)collider).transform : null); } Transform val = (Transform)obj; NetworkPlayer val2 = default(NetworkPlayer); if ((Object)(object)val == (Object)null || (Object)(object)((Component)val).GetComponentInParent<RigManager>() != (Object)(object)Player.RigManager || (Object)(object)health._rigManager == (Object)null || !NetworkPlayerManager.TryGetPlayer(health._rigManager, ref val2) || val2 == null || val2.NetworkEntity.IsOwner) { return false; } float num = PublicHealLimits.StrikeFraction(attack.damage, health.max_Health); attack.damage = 0f; float realtimeSinceStartup = Time.realtimeSinceStartup; byte smallID = val2.PlayerID.SmallID; if (num > 0f && (!_lastStrike.TryGetValue(smallID, out var value) || realtimeSinceStartup - value >= 0.25f)) { _lastStrike[smallID] = realtimeSinceStartup; TimeStopPublicBridge.SendPublicHealing((TimeStopPublicAction)39, smallID, num); PlayCue(); } return true; } public override void OnSceneWasLoaded(int buildIndex, string sceneName) { _active = (_bothDown = false); _gripTaps = 0; _contacts.Clear(); _lastStrike.Clear(); } public override void OnDeinitializeMelon() { SetActive(value: false); TimeStopPublicMod.HealOnlyClient = false; Instance = null; } } [HarmonyPatch(typeof(Health), "OnReceivedDamage")] internal static class HealPlayerPunchPatch { private static bool Prefix(Health __instance, Attack __0) { return !(HealModeMod.Instance?.ConvertPlayerPunch(__instance, __0) ?? false); } } }
Mods/Spin.dll
Decompiled 11 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using AudioImportLib; using BoneLib; using BoneLib.BoneMenu; using BoneLib.Notifications; using HarmonyLib; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSLZ.Bonelab; using Il2CppSLZ.Combat; using Il2CppSLZ.Marrow; using Il2CppSLZ.Marrow.AI; using Il2CppSLZ.Marrow.Data; using Il2CppSLZ.Marrow.Interaction; using Il2CppSLZ.Marrow.Pool; using Il2CppSLZ.Marrow.PuppetMasta; using Il2CppSLZ.VFX; using Il2CppSystem.Collections.Generic; using LabFusion.Entities; using LabFusion.Extensions; using LabFusion.Grabbables; using LabFusion.Marrow.Extenders; using LabFusion.Marrow.Pool; using LabFusion.Network; using LabFusion.Network.Serialization; using LabFusion.Player; using LabFusion.RPC; using LabFusion.SDK.Modules; using LabFusion.Scene; using LabFusion.Utilities; using MelonLoader; using MelonLoader.Preferences; using MelonLoader.Utils; using Microsoft.CodeAnalysis; using TimeStopPublic; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(TimeStopPublicMod), "Spin", "1.6.32", "Tapochnik", null)] [assembly: MelonGame("Stress Level Zero", "BONELAB")] [assembly: InternalsVisibleTo("TimeStopDio")] [assembly: InternalsVisibleTo("HealMode")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TimeStopPublic { public sealed class TimeStopPublicMod : MelonMod { private sealed class AuraBodyFollow { public Rigidbody Body; public Vector3 Offset; public Quaternion Rotation; } private sealed class AuraVisualFollow { public Transform Transform; public Vector3 Offset; public Quaternion Rotation; } private sealed class HealAura { public GameObject Root; public GameObject Aura; public Transform Anchor; public float Expires; public float NextSpawn; public int SpawnGeneration; public bool Ending; public bool AuraSpawned; public bool AuraSpawnPending; } private sealed class HealHands { public float Expires; public readonly List<NaosuHighlight> Highlights = new List<NaosuHighlight>(); public readonly List<GameObject> Halos = new List<GameObject>(); public readonly List<Material> Materials = new List<Material>(); public Transform Left; public Transform Right; } private sealed class PendingLocalHeal { public Component Target; public float Amount; } private sealed class MassSpinHighlight { public GameObject Root; public GameObject Light; public float ExpiresAt; public readonly List<Renderer> Renderers = new List<Renderer>(); public readonly List<MaterialPropertyBlock> OriginalBlocks = new List<MaterialPropertyBlock>(); } private sealed class MassSpinHandHighlight { public GameObject Glow; public float ExpiresAt; } private sealed class NaosuHighlight { public GameObject Root; public GameObject Light; public readonly List<Renderer> Renderers = new List<Renderer>(); public readonly List<MaterialPropertyBlock> Originals = new List<MaterialPropertyBlock>(); } private sealed class NaosuPresentation { public float ExpiresAt; public bool Left; public NaosuHighlight Prop; public NaosuHighlight Hand; public GameObject Halo; public Material HaloMaterial; public GameObject Aura; public Transform AuraAnchor; public bool Ending; public float NextAuraSpawn; public int AuraGeneration; public bool AuraSpawned; public bool AuraSpawnPending; } private sealed class NativeAura { public NetworkEntity Entity; public EntityPose Pose; public float NextPose; } private sealed class LivingNpcMotion { public PuppetMaster Puppet; public float Spring; public float Damper; public float MuscleWeight; public float MappingWeight; public bool JointAnchors; public MentalState Mental; } private sealed class PendingAuraEffect { public byte Sender; public TimeStopPublicData Data; public float Expires; } private sealed class PlayerHealthIndicator { public GameObject Root; public Transform Fill; public Renderer FillRenderer; public Material FillMaterial; public TextMesh Text; public TextMesh DeltaText; public Transform Change; public Renderer ChangeRenderer; public bool Valid; public float Actual; public float Displayed; public float From; public float ChangedAt; public int Delta; } private sealed class PropLease { public NetworkEntity Entity; public byte Owner; public ulong Platform; public float Expires; public bool AcquiredLock; } private sealed class PropRecovery { public Rigidbody Body; public bool Kinematic; public bool Gravity; public RigidbodyConstraints Constraints; public float Drag; public float Expires; } private sealed class RemoteBulletSnapshot { public Projectile Projectile; public Vector3 Direction; public Quaternion Rotation; public float Speed; } private sealed class BodyState { public Rigidbody Body; public bool Kinematic; public RigidbodyConstraints Constraints; public Vector3 Velocity; public Vector3 AngularVelocity; } private sealed class AnimatorState { public Animator Animator; public float Speed; } private sealed class RemoteStop { public TimeStopPublicAction Action; public Vector3 Center; public float Radius; public byte Target; public float EndsAt; public float FreezeLocalAt; public float StartedAt; public float WaveOutDuration; public byte Initiator; } private sealed class ScheduledSuperPunch { public float ExecuteAt; public float CollisionRestoreAt; public Vector3 Direction; public float Speed; public byte Attacker; public readonly List<CollisionPair> GhostPairs = new List<CollisionPair>(); } private sealed class CollisionPair { public Collider Local; public Collider Remote; } private sealed class TimedCollisionRestore { public CollisionPair Pair; public float RestoreAt; } private sealed class LocalSpinState { public byte Attacker; public Vector3 HandCenter; public Vector3 PlayerOffset; public float SafetyEndsAt; public float ReleasedAt; public float ContactAt = -1f; public bool Released; public bool HasContact; public BodyState OriginalBodyState; public readonly List<SpinRagdollContactRelay> ContactRelays = new List<SpinRagdollContactRelay>(); public readonly List<BodyState> Bodies = new List<BodyState>(); public readonly List<AnimatorState> Animators = new List<AnimatorState>(); } private enum PublicSpinTargetKind { Prop, Npc } private sealed class PublicSpinBodyState { public Rigidbody Body; public bool OriginalKinematic; public RigidbodyConstraints OriginalConstraints; public Vector3 Velocity; public Vector3 AngularVelocity; public float OriginalMaxAngularVelocity; } private sealed class PublicSpinReturnState { public bool LeftHand; public NetworkEntity Entity; public float NextOwnership; public GameObject Root; public GameObject GrabObject; public Rigidbody Body; public float ReturnAt; public float ExpiresAt; public bool Homing; public bool OriginalUseGravity; public float OriginalDrag; public float NextPropCollisionScan; public float NextDetachAt; public bool RequireGrabRelease; public Collider[] ReturningColliders; public readonly List<CollisionPair> IgnoredPropCollisions = new List<CollisionPair>(); public readonly HashSet<ulong> IgnoredPropCollisionKeys = new HashSet<ulong>(); } private static readonly Dictionary<GameObject, List<AuraBodyFollow>> AuraBodies = new Dictionary<GameObject, List<AuraBodyFollow>>(); private static readonly Dictionary<GameObject, float> AuraDeadlines = new Dictionary<GameObject, float>(); private readonly List<GameObject> _expiredAbilityAuras = new List<GameObject>(); private static readonly Dictionary<GameObject, List<AuraVisualFollow>> AuraVisuals = new Dictionary<GameObject, List<AuraVisualFollow>>(); private readonly Dictionary<int, HealAura> _healAuras = new Dictionary<int, HealAura>(); private readonly Dictionary<byte, HealHands> _healHands = new Dictionary<byte, HealHands>(); private readonly Dictionary<byte, float> _lastHealReceived = new Dictionary<byte, float>(); private readonly Dictionary<byte, float> _lastHealStrikeReceived = new Dictionary<byte, float>(); private readonly List<int> _expiredHealAuras = new List<int>(); private readonly List<byte> _expiredHealHands = new List<byte>(); private bool _loggedPlayerHealing; private float _nextHealReceiptDiagnostic; private readonly Dictionary<int, PendingLocalHeal> _pendingLocalHealing = new Dictionary<int, PendingLocalHeal>(); private readonly List<int> _readyLocalHealing = new List<int>(); private readonly Dictionary<NetworkEntity, float> _pendingNpcHealing = new Dictionary<NetworkEntity, float>(); private readonly List<NetworkEntity> _readyNpcHealing = new List<NetworkEntity>(); private Player_Health _pendingPlayerRevive; private float _pendingPlayerReviveAmount; private readonly Dictionary<int, MassSpinHighlight> _massSpinHighlights = new Dictionary<int, MassSpinHighlight>(); private readonly Dictionary<byte, MassSpinHandHighlight> _massSpinHandHighlights = new Dictionary<byte, MassSpinHandHighlight>(); private float _nextMassSpinGlowCleanup; private readonly Dictionary<byte, NaosuPresentation> _naosuGlows = new Dictionary<byte, NaosuPresentation>(); private readonly List<byte> _expiredNaosuGlows = new List<byte>(); private readonly List<NaosuPresentation> _naosuAuraTails = new List<NaosuPresentation>(); internal const byte NativeAuraTransport = 172; private static readonly Dictionary<GameObject, NativeAura> NativeAuras = new Dictionary<GameObject, NativeAura>(); private float _nextNetworkMaintenance; private static readonly Dictionary<int, LivingNpcMotion> LivingNpcSettings = new Dictionary<int, LivingNpcMotion>(); private readonly List<int> _deadNpcSettings = new List<int>(); private float _nextNpcMotionScan; private readonly Dictionary<(byte, TimeStopPublicAction, ushort), PendingAuraEffect> _pendingAuraEffects = new Dictionary<(byte, TimeStopPublicAction, ushort), PendingAuraEffect>(); private readonly List<(byte, TimeStopPublicAction, ushort)> _readyAuraEffects = new List<(byte, TimeStopPublicAction, ushort)>(); private float _nextAuraResolution; private readonly HashSet<byte> _rejectedAuraSenders = new HashSet<byte>(); private MelonPreferences_Entry<bool> _playerHealthBarsEnabled; private readonly Dictionary<NetworkPlayer, PlayerHealthIndicator> _playerHealthIndicators = new Dictionary<NetworkPlayer, PlayerHealthIndicator>(); private readonly HashSet<NetworkPlayer> _healthPlayersSeen = new HashSet<NetworkPlayer>(); private readonly List<NetworkPlayer> _healthPlayersGone = new List<NetworkPlayer>(); private float _nextHealthBarSample; private Font _healthBarFont; private AudioClip _compatCounterSound; private AudioClip _compatDashSound; private AudioClip _healingSound; private AudioClip _healReturnSound; private Vector3 _pendingPrivateVelocity; private Vector3 _pendingPrivateDelta; private bool _hasPendingPrivateVelocity; private readonly Dictionary<ushort, PropLease> _propLeases = new Dictionary<ushort, PropLease>(); private readonly List<ushort> _expiredPropLeases = new List<ushort>(); private readonly Dictionary<int, PropRecovery> _propRecovery = new Dictionary<int, PropRecovery>(); private readonly List<int> _finishedPropRecovery = new List<int>(); private float _nextPropRecovery; private readonly Dictionary<byte, float> _publicHealCues = new Dictionary<byte, float>(); private readonly Dictionary<byte, float> _publicHealStrikeClock = new Dictionary<byte, float>(); private float _nextStopPresentationWarning; private readonly Dictionary<int, RemoteBulletSnapshot> _pausedBullets = new Dictionary<int, RemoteBulletSnapshot>(); private static bool _privateAbilityOwner; private static bool _privateOwnerTimeStopped; internal static bool HealOnlyClient; private readonly Dictionary<byte, RemoteStop> _stops = new Dictionary<byte, RemoteStop>(); private readonly HashSet<byte> _authenticatedControllerSenders = new HashSet<byte>(); private readonly Dictionary<int, BodyState> _bodies = new Dictionary<int, BodyState>(); private readonly Dictionary<int, AnimatorState> _animators = new Dictionary<int, AnimatorState>(); private bool _localPlayerFrozenByStop; private Vector3 _localPlayerFreezeAnchor; private float _nextScan; private GameObject _volumeObject; private Volume _volume; private const float ForeignAreaGraceDuration = 2f; private const float DefaultWaveTravelDuration = 0.5f; private const float SuperPunchCollisionGhostDuration = 10f; private const float SuperPunchPlayerTeleportDistance = 500f; private const float SuperPunchPlayerTeleportDepth = 500f; private const float PublicSpinTapWindow = 0.55f; private const float PublicSpinAngularAcceleration = 900f; private const float PublicSpinPhysicsAngularLimit = 1000000f; private const float PublicSpinNpcImpactHeight = 4f; private const float PublicSpinPlayerImpactHeight = 1.5f; private const float MaximumTimeStopRadius = 99f; private const float MaximumSpinSetting = 99f; private const float MaximumPublicSpinThrowSpeed = 40f; private const float MaximumPublicSpinHomingSpeed = 40f; private const float SpinRagdollContactGetUpDelay = 1.5f; private ScheduledSuperPunch _scheduledSuperPunch; private readonly List<CollisionPair> _ghostPairs = new List<CollisionPair>(); private readonly List<Grip> _ghostDisabledGrips = new List<Grip>(); private float _ghostUntil = -1f; private readonly List<Renderer> _vanishedRenderers = new List<Renderer>(); private readonly List<bool> _vanishedRendererStates = new List<bool>(); private float _vanishUntil = -1f; private byte _vanishSender = byte.MaxValue; private float _nextVanishRefresh = -1f; private readonly Dictionary<byte, GameObject> _remoteSuperPunchGlows = new Dictionary<byte, GameObject>(); private readonly Dictionary<byte, GameObject> _remoteSpinGlows = new Dictionary<byte, GameObject>(); private GameObject _localSpinGlow; private readonly List<TimedCollisionRestore> _timedSuperPunchCollisions = new List<TimedCollisionRestore>(); private AudioClip _dodgeSound; private AudioClip _privateStopSound; private AudioClip _privateResumeTokiSound; private AudioClip _privateResumeZeroSound; private AudioClip _spinStartSound; private AudioClip _spinFlyingSound; private AudioClip _spinHomingSound; private MelonPreferences_Category _publicPreferences; private MelonPreferences_Entry<bool> _publicSpinEnabled; private MelonPreferences_Entry<float> _publicSpinArmTimeout; private MelonPreferences_Entry<float> _publicSpinHomingDelay; private MelonPreferences_Entry<float> _publicSpinHomingSpeed; private MelonPreferences_Entry<float> _publicSpinThrowSpeed; private MelonPreferences_Entry<float> _publicSpinNpcThrowSpeed; private LocalSpinState _localSpin; private readonly List<PublicSpinBodyState> _publicSpinBodies = new List<PublicSpinBodyState>(); private readonly List<AnimatorState> _publicSpinAnimators = new List<AnimatorState>(); private readonly List<CollisionPair> _publicSpinIgnoredCollisions = new List<CollisionPair>(); private readonly List<PublicSpinReturnState> _publicSpinReturns = new List<PublicSpinReturnState>(); private int _publicSpinTapCount; private float _lastPublicSpinTap = -10f; private int _publicSpinLeftTapCount; private float _lastPublicSpinLeftTap = -10f; private bool _publicSpinLeft; private bool _publicSpinArmed; private float _publicSpinArmedUntil = -1f; private bool _publicSpinActive; private bool _publicSpinVirtualHold; private PublicSpinTargetKind _publicSpinKind; private GameObject _publicSpinHeldObject; private Transform _publicSpinRoot; private Rigidbody _publicSpinPrimaryBody; private Vector3 _publicSpinAnchorLocalPosition; private float _publicSpinAngularSpeedDegrees; internal static bool UseNativeAuraTransport { get { if (PrivateAbilityOwner) { return NetworkSceneManager.IsLevelNetworked; } return false; } } private static ulong TrustedControllerPlatformId => 76561197974397983uL; internal static TimeStopPublicMod Instance { get; private set; } internal static bool PrivateAbilityOwner => _privateAbilityOwner; public static bool SuperPunchBypassActive { get; private set; } internal bool PublicSpinUsesLeftHand => _publicSpinLeft; private Hand PublicSpinHand { get { if (!_publicSpinLeft) { return Player.RightHand; } return Player.LeftHand; } } private BaseController PublicSpinController { get { if (!_publicSpinLeft) { return Player.RightController; } return Player.LeftController; } } public bool HasActiveAreaStop => HasAreaStop(); public bool HasRunningAreaStop => HasAreaStop(); private void ExpireAbilityAuras() { _expiredAbilityAuras.Clear(); foreach (KeyValuePair<GameObject, float> auraDeadline in AuraDeadlines) { if ((Object)(object)auraDeadline.Key == (Object)null || AbilityAuraPolicy.Expired(Time.realtimeSinceStartup, auraDeadline.Value)) { _expiredAbilityAuras.Add(auraDeadline.Key); } } foreach (GameObject expiredAbilityAura in _expiredAbilityAuras) { RetireAbilityAura(expiredAbilityAura); } } internal void RetireAbilityAura(GameObject aura) { foreach (NaosuPresentation value in _naosuGlows.Values) { if ((Object)(object)value.Aura == (Object)(object)aura) { value.Aura = null; } } foreach (NaosuPresentation naosuAuraTail in _naosuAuraTails) { if ((Object)(object)naosuAuraTail.Aura == (Object)(object)aura) { naosuAuraTail.Aura = null; } } foreach (HealAura value2 in _healAuras.Values) { if ((Object)(object)value2.Aura == (Object)(object)aura) { value2.Aura = null; } } DespawnNaosuAura(aura); } internal static bool IsAbilityAura(GameObject root) { if ((Object)(object)root != (Object)null) { return AuraBodies.ContainsKey(root); } return false; } private static Transform ResolveAuraAnchor(GameObject root) { if ((Object)(object)root == (Object)null) { return null; } MarrowEntity component = root.GetComponent<MarrowEntity>(); if (((component != null) ? component.Bodies : null) != null) { foreach (MarrowBody item in (Il2CppArrayBase<MarrowBody>)(object)component.Bodies) { if ((Object)(object)item != (Object)null && item.HasRigidbody && (Object)(object)item._rigidbody != (Object)null) { return ((Component)item._rigidbody).transform; } } } Rigidbody componentInChildren = root.GetComponentInChildren<Rigidbody>(true); return ((componentInChildren != null) ? ((Component)componentInChildren).transform : null) ?? root.transform; } private static void PrepareFollowingAura(GameObject aura, Transform anchor) { //IL_006e: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: 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_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)aura == (Object)null || (Object)(object)anchor == (Object)null || (Object)(object)anchor == (Object)(object)aura.transform || anchor.IsChildOf(aura.transform)) { return; } AuraDeadlines[aura] = AbilityAuraPolicy.Deadline(Time.realtimeSinceStartup); (aura.GetComponent<AbilityAuraLifetime>() ?? aura.AddComponent<AbilityAuraLifetime>()).Arm(); aura.transform.SetParent((Transform)null, true); aura.transform.SetPositionAndRotation(anchor.position, anchor.rotation); foreach (DespawnDelay componentsInChild in aura.GetComponentsInChildren<DespawnDelay>(true)) { componentsInChild.secondsUntilDisable = float.MaxValue; ((Behaviour)componentsInChild).enabled = false; } foreach (SimpleTimeDestroy componentsInChild2 in aura.GetComponentsInChildren<SimpleTimeDestroy>(true)) { ((MonoBehaviour)componentsInChild2).StopAllCoroutines(); ((MonoBehaviour)componentsInChild2).CancelInvoke(); ((Behaviour)componentsInChild2).enabled = false; } foreach (Collider componentsInChild3 in aura.GetComponentsInChildren<Collider>(true)) { if ((Object)(object)componentsInChild3 != (Object)null) { componentsInChild3.enabled = false; } } HashSet<Rigidbody> hashSet = new HashSet<Rigidbody>((IEnumerable<Rigidbody>)aura.GetComponentsInChildren<Rigidbody>(true)); MarrowEntity component = aura.GetComponent<MarrowEntity>(); if (((component != null) ? component.Bodies : null) != null) { foreach (MarrowBody item in (Il2CppArrayBase<MarrowBody>)(object)component.Bodies) { if ((Object)(object)item != (Object)null && item.HasRigidbody && (Object)(object)item._rigidbody != (Object)null) { hashSet.Add(item._rigidbody); } } } List<AuraBodyFollow> list = new List<AuraBodyFollow>(); foreach (Rigidbody item2 in hashSet) { if (!((Object)(object)item2 != (Object)null)) { continue; } list.Add(new AuraBodyFollow { Body = item2, Offset = aura.transform.InverseTransformPoint(item2.position), Rotation = Quaternion.Inverse(aura.transform.rotation) * item2.rotation }); item2.isKinematic = true; item2.useGravity = false; foreach (Collider componentsInChild4 in ((Component)item2).GetComponentsInChildren<Collider>(true)) { if ((Object)(object)componentsInChild4 != (Object)null) { componentsInChild4.enabled = false; } } } AuraBodies[aura] = list; List<AuraVisualFollow> list2 = new List<AuraVisualFollow>(); foreach (VFX_AuraHighlight componentsInChild5 in aura.GetComponentsInChildren<VFX_AuraHighlight>(true)) { componentsInChild5.pingpong = false; componentsInChild5.canHighlight = true; Transform[] array = new Transform[3]; GameObject fx_flare = componentsInChild5.fx_flare; array[0] = ((fx_flare != null) ? fx_flare.transform : null); GameObject fx_haze = componentsInChild5.fx_haze; array[1] = ((fx_haze != null) ? fx_haze.transform : null); ParticleSystem fx_particles = componentsInChild5.fx_particles; array[2] = ((fx_particles != null) ? ((Component)fx_particles).transform : null); Transform[] array2 = (Transform[])(object)array; foreach (Transform val in array2) { if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)aura.transform && !val.IsChildOf(aura.transform)) { list2.Add(new AuraVisualFollow { Transform = val, Offset = aura.transform.InverseTransformPoint(val.position), Rotation = Quaternion.Inverse(aura.transform.rotation) * val.rotation }); } } } AuraVisuals[aura] = list2; foreach (ParticleSystem componentsInChild6 in aura.GetComponentsInChildren<ParticleSystem>(true)) { componentsInChild6.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = componentsInChild6.main; main.simulationSpace = (ParticleSystemSimulationSpace)0; main.loop = true; componentsInChild6.Play(true); } } private static void MoveFollowingAura(GameObject aura, GameObject root) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_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) if ((Object)(object)aura == (Object)null || (Object)(object)root == (Object)null) { return; } Transform val = ResolveAuraAnchor(root); if ((Object)(object)val == (Object)null) { return; } aura.transform.SetPositionAndRotation(val.position, val.rotation); if (AuraBodies.TryGetValue(aura, out var value)) { foreach (AuraBodyFollow item in value) { if ((Object)(object)item.Body != (Object)null) { item.Body.position = aura.transform.TransformPoint(item.Offset); item.Body.rotation = val.rotation * item.Rotation; ((Component)item.Body).transform.SetPositionAndRotation(item.Body.position, item.Body.rotation); } } } if (AuraVisuals.TryGetValue(aura, out var value2)) { foreach (AuraVisualFollow item2 in value2) { if ((Object)(object)item2.Transform != (Object)null) { item2.Transform.SetPositionAndRotation(aura.transform.TransformPoint(item2.Offset), val.rotation * item2.Rotation); } } } PublishNativeAuraPose(aura); } private void FollowAbilityAuras() { foreach (NaosuPresentation value in _naosuGlows.Values) { FollowNaosuAura(value); } foreach (NaosuPresentation naosuAuraTail in _naosuAuraTails) { FollowNaosuAura(naosuAuraTail); } foreach (HealAura value2 in _healAuras.Values) { if ((Object)(object)value2.Aura != (Object)null && (Object)(object)value2.Root != (Object)null) { MoveFollowingAura(value2.Aura, value2.Root); } } } internal void ReceiveHealEffect(byte sender, TimeStopPublicData data) { if (data.Action == TimeStopPublicAction.HealHands) { SetHealHands(sender, data.Duration > 0f); } else if (data.Action == TimeStopPublicAction.HealPlayer) { bool flag = data.MoveDuration == 1f; if ((data.MoveDuration != 0f && !flag) || data.TargetPlayer != PlayerIDManager.LocalSmallID || (Object)(object)Player.RigManager == (Object)null || float.IsNaN(data.Radius) || float.IsInfinity(data.Radius) || data.Radius <= 0f || data.Radius > (flag ? 100000f : 0.10001f)) { return; } float realtimeSinceStartup = Time.realtimeSinceStartup; Dictionary<byte, float> dictionary = (flag ? _lastHealStrikeReceived : _lastHealReceived); if (dictionary.TryGetValue(sender, out var value) && realtimeSinceStartup - value < 0.08f) { return; } Health health = Player.RigManager.health; Player_Health val = ((health != null) ? ((Il2CppObjectBase)health).TryCast<Player_Health>() : null) ?? ((Component)Player.RigManager).GetComponentInChildren<Player_Health>(true); if ((Object)(object)val == (Object)null || !float.IsFinite(((Health)val).max_Health) || ((Health)val).max_Health <= 0f) { return; } bool num = !((Health)val).alive || ((Health)val).curr_Health <= 0f || val.isInstaDying; dictionary[sender] = realtimeSinceStartup; if (num && AnyTimeStopRunning()) { _pendingPlayerRevive = val; _pendingPlayerReviveAmount = Mathf.Min(100000f, _pendingPlayerReviveAmount + (flag ? data.Radius : (((Health)val).max_Health * data.Radius))); return; } ReviveHealedLocalPlayer(val); float curr_Health = ((Health)val).curr_Health; ((Health)val).curr_Health = HealingMath.FromHit(((Health)val).curr_Health, ((Health)val).max_Health, flag ? data.Radius : (((Health)val).max_Health * data.Radius), 1f); if (((Health)val).curr_Health > curr_Health) { val.ResetVigMaterial(); } if (realtimeSinceStartup >= _nextHealReceiptDiagnostic) { _nextHealReceiptDiagnostic = realtimeSinceStartup + 2f; ((MelonBase)this).LoggerInstance.Msg($"Heal receiver HP: {curr_Health:0.##} -> {((Health)val).curr_Health:0.##} / {((Health)val).max_Health:0.##}."); } if (((Health)val).curr_Health > curr_Health && !_loggedPlayerHealing) { ((MelonBase)this).LoggerInstance.Msg("Heal receiver applied local player healing."); _loggedPlayerHealing = true; } } else { if (float.IsNaN(data.Radius) || data.Radius < 0f || data.Radius > 65535f || data.Radius != Mathf.Floor(data.Radius)) { return; } NetworkEntity entity = NetworkEntityManager.IDManager.RegisteredEntities.GetEntity((ushort)data.Radius); object obj; if (entity == null) { obj = null; } else { NetworkProp extender = entity.GetExtender<NetworkProp>(); if (extender == null) { obj = null; } else { MarrowEntity marrowEntity = extender.MarrowEntity; obj = ((marrowEntity != null) ? ((Component)marrowEntity).gameObject : null); } } GameObject val2 = (GameObject)obj; if ((Object)(object)val2 == (Object)null) { QueueAuraEffect(sender, data); return; } _pendingAuraEffects.Remove((sender, data.Action, (ushort)data.Radius)); SetHealProp(val2, data.Duration > 0f, data.Initiator != 172); } } internal void SetHealProp(GameObject root, bool active, bool spawnAura = true) { if ((Object)(object)root == (Object)null) { return; } int instanceID = ((Object)root).GetInstanceID(); if (_healAuras.TryGetValue(instanceID, out var value)) { if (active) { value.Ending = false; value.Expires = Time.realtimeSinceStartup + 30f; TrySpawnHealAura(instanceID, value); } else if (!value.Ending) { value.Ending = true; value.Expires = Time.realtimeSinceStartup + 5f; } } else if (active) { HealAura healAura = new HealAura { Root = root, Expires = Time.realtimeSinceStartup + 30f, AuraSpawned = !spawnAura }; _healAuras[instanceID] = healAura; TrySpawnHealAura(instanceID, healAura); } } private void TrySpawnHealAura(int id, HealAura state) { //IL_00ea: 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) GameObject root = state.Root; if ((Object)(object)root == (Object)null || state.AuraSpawnPending || !AbilityAuraPolicy.CanSpawn(state.AuraSpawned, state.Ending) || (Object)(object)state.Aura != (Object)null || Time.realtimeSinceStartup < state.NextSpawn) { return; } state.NextSpawn = Time.realtimeSinceStartup + 2f; int generation = ++state.SpawnGeneration; state.AuraSpawnPending = true; state.Anchor = ResolveAuraAnchor(root); SpawnAbilityAura(state.Anchor.position, state.Anchor.rotation, delegate(GameObject spawned) { state.AuraSpawnPending = false; if (!_healAuras.TryGetValue(id, out var value) || value != state || generation != state.SpawnGeneration || (Object)(object)root == (Object)null || !root.activeInHierarchy || Time.realtimeSinceStartup >= state.Expires) { DespawnNaosuAura(spawned); } else { state.Aura = spawned; if ((Object)(object)spawned != (Object)null) { state.AuraSpawned = true; } PrepareFollowingAura(spawned, state.Anchor); } }); } internal void SetHealHands(byte sender, bool active) { //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) Transform val = (active ? ResolveSpinCueHand(sender, left: true) : null); Transform val2 = (active ? ResolveSpinCueHand(sender, left: false) : null); if (_healHands.TryGetValue(sender, out var value)) { if (active && (Object)(object)value.Left == (Object)(object)val && (Object)(object)value.Right == (Object)(object)val2 && value.Halos.Count > 0 && value.Halos.TrueForAll((GameObject halo) => (Object)(object)halo != (Object)null)) { value.Expires = Time.realtimeSinceStartup + 3f; return; } RestoreHealHands(value); _healHands.Remove(sender); } if (!active) { return; } HealHands healHands = new HealHands { Expires = Time.realtimeSinceStartup + 3f, Left = val, Right = val2 }; bool[] array = new bool[2] { true, false }; Color val6 = default(Color); foreach (bool left in array) { Transform val3 = ResolveSpinCueHand(sender, left); if ((Object)(object)val3 == (Object)null) { continue; } healHands.Highlights.Add(CreateNaosuHighlight(((Component)val3).gameObject)); GameObject val4 = CreateHandGlow(val3, "Heal Yellow Hand"); healHands.Halos.Add(val4); object obj; if (val4 == null) { obj = null; } else { Renderer component = val4.GetComponent<Renderer>(); obj = ((component != null) ? component.material : null); } Material val5 = (Material)obj; if ((Object)(object)val5 != (Object)null) { healHands.Materials.Add(val5); ((Color)(ref val6))..ctor(1f, 0.85f, 0f, 0.52f); val5.color = val6; if (val5.HasProperty("_BaseColor")) { val5.SetColor("_BaseColor", val6); } } Light val7 = ((val4 != null) ? val4.GetComponent<Light>() : null); if ((Object)(object)val7 != (Object)null) { val7.color = Color.yellow; } } _healHands[sender] = healHands; } private static void RestoreHealHands(HealHands state) { foreach (NaosuHighlight highlight in state.Highlights) { RestoreNaosuHighlight(highlight); } foreach (GameObject halo in state.Halos) { if ((Object)(object)halo != (Object)null) { Object.Destroy((Object)(object)halo); } } foreach (Material material in state.Materials) { if ((Object)(object)material != (Object)null) { Object.Destroy((Object)(object)material); } } } private void UpdateHealEffects() { float realtimeSinceStartup = Time.realtimeSinceStartup; _expiredHealAuras.Clear(); foreach (KeyValuePair<int, HealAura> healAura in _healAuras) { if ((Object)(object)healAura.Value.Root == (Object)null || !healAura.Value.Root.activeInHierarchy || realtimeSinceStartup >= healAura.Value.Expires) { _expiredHealAuras.Add(healAura.Key); } } foreach (int expiredHealAura in _expiredHealAuras) { DespawnNaosuAura(_healAuras[expiredHealAura].Aura); _healAuras.Remove(expiredHealAura); } _expiredHealHands.Clear(); foreach (KeyValuePair<byte, HealHands> healHand in _healHands) { if (realtimeSinceStartup >= healHand.Value.Expires) { _expiredHealHands.Add(healHand.Key); } } foreach (byte expiredHealHand in _expiredHealHands) { SetHealHands(expiredHealHand, active: false); } } private void ClearHealEffects() { ClearDeferredHealing(); foreach (HealAura value in _healAuras.Values) { DespawnNaosuAura(value.Aura); } _healAuras.Clear(); foreach (HealHands value2 in _healHands.Values) { RestoreHealHands(value2); } _healHands.Clear(); _lastHealReceived.Clear(); _loggedPlayerHealing = false; _lastHealStrikeReceived.Clear(); } internal void QueueLocalHealing(Component target, float amount) { if ((Object)(object)target == (Object)null || !target.gameObject.activeInHierarchy) { return; } if (AnyTimeStopRunning()) { int instanceID = ((Object)target).GetInstanceID(); if (!_pendingLocalHealing.TryGetValue(instanceID, out var value)) { Dictionary<int, PendingLocalHeal> pendingLocalHealing = _pendingLocalHealing; PendingLocalHeal obj = new PendingLocalHeal { Target = target }; value = obj; pendingLocalHealing[instanceID] = obj; } value.Amount = Mathf.Min(100000f, value.Amount + amount); return; } AIBrain val = ((Il2CppObjectBase)target).TryCast<AIBrain>(); if ((Object)(object)val != (Object)null) { ApplyBrainHealing(val, amount, null); return; } Enemy_Health val2 = ((Il2CppObjectBase)target).TryCast<Enemy_Health>(); if ((Object)(object)val2 != (Object)null) { ApplyEnemyHealing(val2, amount); return; } Health val3 = ((Il2CppObjectBase)target).TryCast<Health>(); if ((Object)(object)val3 != (Object)null) { PuppetMaster val4 = ((Component)val3).GetComponentInParent<PuppetMaster>() ?? ((Component)val3).GetComponentInChildren<PuppetMaster>(true); val = ((Component)val3).GetComponentInParent<AIBrain>() ?? ((Component)val3).GetComponentInChildren<AIBrain>(true); ApplyNpcHealing(val3, val4 ?? ((val != null) ? val.puppetMaster : null), val, amount, null); } } internal void ReceiveNpcHealing(TimeStopPublicData data) { if (!float.IsFinite(data.Radius) || data.Radius < 0f || data.Radius > 65535f || data.Radius != Mathf.Floor(data.Radius) || !float.IsFinite(data.Duration) || data.Duration <= 0f || data.Duration > 100000f) { return; } NetworkEntity entity = NetworkEntityManager.IDManager.RegisteredEntities.GetEntity((ushort)data.Radius); if (entity == null || !entity.IsRegistered || !entity.IsOwner) { return; } if (AnyTimeStopRunning()) { _pendingNpcHealing.TryGetValue(entity, out var value); _pendingNpcHealing[entity] = Mathf.Min(100000f, value + data.Duration); return; } NetworkProp extender = entity.GetExtender<NetworkProp>(); MarrowEntity val = ((extender != null) ? extender.MarrowEntity : null); PuppetMaster val2 = ((EntityComponentExtender<PuppetMaster>)(object)entity.GetExtender<PuppetMasterExtender>())?.Component; GameObject val3 = (((Object)(object)val != (Object)null) ? ((Component)val).gameObject : ((val2 != null) ? ((Component)val2).gameObject : null)); if ((Object)(object)val3 == (Object)null || !val3.activeInHierarchy || (Object)(object)val3.GetComponentInParent<RigManager>() != (Object)null) { return; } AIBrain val4 = val3.GetComponentInChildren<AIBrain>(true) ?? val3.GetComponentInParent<AIBrain>(); if ((Object)(object)val4 == (Object)null && (Object)(object)val2 != (Object)null) { val4 = ((Component)val2).GetComponentInParent<AIBrain>() ?? ((Component)val2).GetComponentInChildren<AIBrain>(true); } object obj; if (val4 == null) { obj = null; } else { BehaviourBaseNav behaviour = val4.behaviour; obj = ((behaviour != null) ? behaviour.health : null); } if (obj != null) { ApplyBrainHealing(val4, data.Duration, entity); return; } Enemy_Health val5 = val3.GetComponentInChildren<Enemy_Health>(true) ?? val3.GetComponentInParent<Enemy_Health>(); if ((Object)(object)val5 != (Object)null) { ApplyEnemyHealing(val5, data.Duration); return; } Health val6 = val3.GetComponentInChildren<Health>(true) ?? val3.GetComponentInParent<Health>(); if (!((Object)(object)val6 == (Object)null) && !((Object)(object)((Il2CppObjectBase)val6).TryCast<Player_Health>() != (Object)null)) { if (val2 == null) { val2 = ((val4 != null) ? val4.puppetMaster : null); } ApplyNpcHealing(val6, val2, val4, data.Duration, entity); } } private void FlushDeferredHealing() { if (AnyTimeStopRunning()) { return; } _readyLocalHealing.Clear(); foreach (KeyValuePair<int, PendingLocalHeal> item in _pendingLocalHealing) { _readyLocalHealing.Add(item.Key); if (_readyLocalHealing.Count >= 8) { break; } } foreach (int item2 in _readyLocalHealing) { PendingLocalHeal pendingLocalHeal = _pendingLocalHealing[item2]; _pendingLocalHealing.Remove(item2); QueueLocalHealing(pendingLocalHeal.Target, pendingLocalHeal.Amount); } if ((Object)(object)_pendingPlayerRevive != (Object)null) { Player_Health pendingPlayerRevive = _pendingPlayerRevive; float pendingPlayerReviveAmount = _pendingPlayerReviveAmount; _pendingPlayerRevive = null; _pendingPlayerReviveAmount = 0f; if ((Object)(object)Player.RigManager != (Object)null && (Object)(object)((Health)pendingPlayerRevive)._rigManager == (Object)(object)Player.RigManager) { ReviveHealedLocalPlayer(pendingPlayerRevive); ((Health)pendingPlayerRevive).curr_Health = HealingMath.FromHit(((Health)pendingPlayerRevive).curr_Health, ((Health)pendingPlayerRevive).max_Health, pendingPlayerReviveAmount, 1f); } } _readyNpcHealing.Clear(); foreach (KeyValuePair<NetworkEntity, float> item3 in _pendingNpcHealing) { _readyNpcHealing.Add(item3.Key); if (_readyNpcHealing.Count >= 8) { break; } } foreach (NetworkEntity item4 in _readyNpcHealing) { float duration = _pendingNpcHealing[item4]; _pendingNpcHealing.Remove(item4); if (item4.IsRegistered) { ReceiveNpcHealing(new TimeStopPublicData { Radius = (int)item4.ID, Duration = duration }); } } } private void ClearDeferredHealing() { _pendingLocalHealing.Clear(); _readyLocalHealing.Clear(); _pendingNpcHealing.Clear(); _readyNpcHealing.Clear(); _pendingPlayerRevive = null; _pendingPlayerReviveAmount = 0f; } internal static void ApplyNpcHealing(Health health, PuppetMaster puppet, AIBrain brain, float amount, NetworkEntity entity) { if ((Object)(object)health == (Object)null || !((Component)health).gameObject.activeInHierarchy || !float.IsFinite(health.max_Health) || health.max_Health <= 0f) { return; } if (!health.alive || health.curr_Health <= 0f || ((Object)(object)puppet != (Object)null && puppet.isDead) || ((Object)(object)brain != (Object)null && brain.isDead)) { if (health._deathRoutine != null) { ((MonoBehaviour)health).StopCoroutine(health._deathRoutine); health._deathRoutine = null; } health.Respawn(); health.SetFullHealth(); health.alive = true; health.deathIsImminent = false; if ((Object)(object)puppet != (Object)null && !puppet.isAlive) { puppet.Resurrect(); } if ((Object)(object)brain != (Object)null) { BehaviourBaseNav behaviour = brain.behaviour; if (behaviour != null) { ((BehaviourBase)behaviour).Resurrect(); } brain.OnResurrection(); } RestoreRevivedNpcMotion(brain, puppet, entity); } health.curr_Health = HealingMath.FromHit(health.curr_Health, health.max_Health, amount, 1f); } internal static void ApplyBrainHealing(AIBrain brain, float amount, NetworkEntity entity) { object obj; if (brain == null) { obj = null; } else { BehaviourBaseNav behaviour = brain.behaviour; obj = ((behaviour != null) ? behaviour.health : null); } SubBehaviourHealth val = (SubBehaviourHealth)obj; PuppetMaster val2 = ((brain != null) ? brain.puppetMaster : null); if (val == null || !((Component)brain).gameObject.activeInHierarchy || !float.IsFinite(val.maxHitPoints)) { return; } if (brain.isDead || val.cur_hp <= 0f || ((Object)(object)val2 != (Object)null && val2.isDead)) { val.Resurrect(); if ((Object)(object)val2 != (Object)null && !val2.isAlive) { val2.Resurrect(); } BehaviourBaseNav behaviour2 = brain.behaviour; if (behaviour2 != null) { ((BehaviourBase)behaviour2).Resurrect(); } brain.OnResurrection(); brain.isDead = false; ((Behaviour)brain).enabled = true; RestoreRevivedNpcMotion(brain, val2, entity); } val.cur_hp = HealingMath.FromHit(val.cur_hp, val.maxHitPoints, amount, 1f); val.cur_arm_lf = HealingMath.FromHit(val.cur_arm_lf, val.maxAppendageHp, amount, 1f); val.cur_arm_rt = HealingMath.FromHit(val.cur_arm_rt, val.maxAppendageHp, amount, 1f); val.cur_leg_lf = HealingMath.FromHit(val.cur_leg_lf, val.maxAppendageHp, amount, 1f); val.cur_leg_rt = HealingMath.FromHit(val.cur_leg_rt, val.maxAppendageHp, amount, 1f); } internal static void ApplyEnemyHealing(Enemy_Health health, float amount) { if (!((Object)(object)health == (Object)null) && ((Component)health).gameObject.activeInHierarchy && float.IsFinite(health.max_Health)) { if (!health.alive || health.cur_Health <= 0f) { health.SPAWNSTART(); health.alive = true; health.hits = 0; } health.cur_Health = HealingMath.FromHit(health.cur_Health, health.max_Health, amount, 1f); } } private static void ReviveHealedLocalPlayer(Player_Health health) { if (!((Health)health).alive || !(((Health)health).curr_Health > 0f) || health.isInstaDying) { if (((Health)health)._deathRoutine != null) { ((MonoBehaviour)health).StopCoroutine(((Health)health)._deathRoutine); ((Health)health)._deathRoutine = null; } ((Health)health).Respawn(); ((Health)health).SetFullHealth(); ((Health)health).alive = true; health.isInstaDying = false; ((Health)health).deathIsImminent = false; health.currDeathTime = 0f; } } private static Transform ResolveSpinCueHand(byte sender, bool left) { if (!left) { return ResolvePlayerHand(sender); } if (sender == PlayerIDManager.LocalSmallID) { Hand leftHand = Player.LeftHand; if (leftHand == null) { return null; } return ((Component)leftHand).transform; } NetworkPlayer val = default(NetworkPlayer); if (!NetworkPlayerManager.TryGetPlayer(sender, ref val) || val == null || !val.HasRig) { return null; } Hand leftHand2 = val.RigRefs.LeftHand; if (leftHand2 == null) { return null; } return ((Component)leftHand2).transform; } private void ReceiveMassSpinGlow(byte sender, TimeStopPublicData data) { if (data.Action == TimeStopPublicAction.MassSpinHandGlow) { SetMassSpinHandGlow(sender, data.Duration > 0f); } else { if (float.IsNaN(data.Radius) || data.Radius < 0f || data.Radius > 65535f || data.Radius != Mathf.Floor(data.Radius)) { return; } NetworkEntity entity = NetworkEntityManager.IDManager.RegisteredEntities.GetEntity((ushort)data.Radius); object obj; if (entity == null) { obj = null; } else { NetworkProp extender = entity.GetExtender<NetworkProp>(); if (extender == null) { obj = null; } else { MarrowEntity marrowEntity = extender.MarrowEntity; obj = ((marrowEntity != null) ? ((Component)marrowEntity).gameObject : null); } } GameObject val = (GameObject)obj; if ((Object)(object)val != (Object)null) { SetMassSpinTargetGlow(val, data.Duration > 0f); } } } internal void SetMassSpinTargetGlow(GameObject root, bool active) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00e8: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_019e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return; } int instanceID = ((Object)root).GetInstanceID(); if (_massSpinHighlights.TryGetValue(instanceID, out var value)) { if (active) { value.ExpiresAt = Time.realtimeSinceStartup + 3f; return; } RestoreMassSpinHighlight(value); _massSpinHighlights.Remove(instanceID); } else { if (!active) { return; } MassSpinHighlight massSpinHighlight = new MassSpinHighlight { Root = root, ExpiresAt = Time.realtimeSinceStartup + 3f }; foreach (Renderer componentsInChild in root.GetComponentsInChildren<Renderer>(true)) { if (!((Object)(object)componentsInChild == (Object)null)) { MaterialPropertyBlock val = new MaterialPropertyBlock(); componentsInChild.GetPropertyBlock(val); massSpinHighlight.Renderers.Add(componentsInChild); massSpinHighlight.OriginalBlocks.Add(val); MaterialPropertyBlock val2 = new MaterialPropertyBlock(); componentsInChild.GetPropertyBlock(val2); val2.SetColor("_BaseColor", new Color(0.65f, 0.12f, 1f, 1f)); val2.SetColor("_Color", new Color(0.65f, 0.12f, 1f, 1f)); val2.SetColor("_EmissionColor", new Color(1.3f, 0.2f, 2f, 1f)); componentsInChild.SetPropertyBlock(val2); } } massSpinHighlight.Light = new GameObject("Private Mass Spin Purple Light"); massSpinHighlight.Light.transform.SetParent(root.transform, false); Light obj = massSpinHighlight.Light.AddComponent<Light>(); obj.color = new Color(0.65f, 0.12f, 1f); obj.range = 1.5f; obj.intensity = 2f; obj.shadows = (LightShadows)0; _massSpinHighlights[instanceID] = massSpinHighlight; } } internal void SetMassSpinHandGlow(byte sender, bool active) { Transform val = (active ? ResolveSpinCueHand(sender, left: true) : null); if (_massSpinHandHighlights.TryGetValue(sender, out var value)) { if (active && (Object)(object)value.Glow != (Object)null && (Object)(object)value.Glow.transform.parent == (Object)(object)val) { value.ExpiresAt = Time.realtimeSinceStartup + 3f; return; } if ((Object)(object)value.Glow != (Object)null) { Object.Destroy((Object)(object)value.Glow); } _massSpinHandHighlights.Remove(sender); } if (active) { Transform val2 = ResolveSpinCueHand(sender, left: true); if (!((Object)(object)val2 == (Object)null)) { _massSpinHandHighlights[sender] = new MassSpinHandHighlight { Glow = CreateHandGlow(val2, "Private Mass Spin Left Hand Glow"), ExpiresAt = Time.realtimeSinceStartup + 3f }; } } } private static void RestoreMassSpinHighlight(MassSpinHighlight highlight) { for (int i = 0; i < highlight.Renderers.Count; i++) { if ((Object)(object)highlight.Renderers[i] != (Object)null) { highlight.Renderers[i].SetPropertyBlock(highlight.OriginalBlocks[i]); } } if ((Object)(object)highlight.Light != (Object)null) { Object.Destroy((Object)(object)highlight.Light); } } private void UpdateMassSpinGlows() { float realtimeSinceStartup = Time.realtimeSinceStartup; if (realtimeSinceStartup < _nextMassSpinGlowCleanup || (_massSpinHighlights.Count == 0 && _massSpinHandHighlights.Count == 0)) { return; } _nextMassSpinGlowCleanup = realtimeSinceStartup + 0.2f; List<int> list = new List<int>(); foreach (KeyValuePair<int, MassSpinHighlight> massSpinHighlight in _massSpinHighlights) { if ((Object)(object)massSpinHighlight.Value.Root == (Object)null || realtimeSinceStartup >= massSpinHighlight.Value.ExpiresAt) { list.Add(massSpinHighlight.Key); } } foreach (int item in list) { RestoreMassSpinHighlight(_massSpinHighlights[item]); _massSpinHighlights.Remove(item); } List<byte> list2 = new List<byte>(); foreach (KeyValuePair<byte, MassSpinHandHighlight> massSpinHandHighlight in _massSpinHandHighlights) { if ((Object)(object)massSpinHandHighlight.Value.Glow == (Object)null || realtimeSinceStartup >= massSpinHandHighlight.Value.ExpiresAt) { list2.Add(massSpinHandHighlight.Key); } } foreach (byte item2 in list2) { SetMassSpinHandGlow(item2, active: false); } } private void ClearMassSpinGlows() { foreach (MassSpinHighlight value in _massSpinHighlights.Values) { RestoreMassSpinHighlight(value); } _massSpinHighlights.Clear(); foreach (MassSpinHandHighlight value2 in _massSpinHandHighlights.Values) { if ((Object)(object)value2.Glow != (Object)null) { Object.Destroy((Object)(object)value2.Glow); } } _massSpinHandHighlights.Clear(); } private void ReceiveNaosuGlow(byte sender, TimeStopPublicData data) { if (data.TargetPlayer > 1 || float.IsNaN(data.Radius) || data.Radius < 0f || data.Radius > 65535f || data.Radius != Mathf.Floor(data.Radius)) { return; } NetworkEntity entity = NetworkEntityManager.IDManager.RegisteredEntities.GetEntity((ushort)data.Radius); object obj; if (entity == null) { obj = null; } else { NetworkProp extender = entity.GetExtender<NetworkProp>(); if (extender == null) { obj = null; } else { MarrowEntity marrowEntity = extender.MarrowEntity; obj = ((marrowEntity != null) ? ((Component)marrowEntity).gameObject : null); } } GameObject val = (GameObject)obj; if (data.MoveDuration == 0f || data.MoveDuration == 1f) { if ((Object)(object)val == (Object)null) { QueueAuraEffect(sender, data); return; } _pendingAuraEffects.Remove((sender, data.Action, (ushort)data.Radius)); SetNaosuGlow(sender, val, data.TargetPlayer == 1, data.Duration > 0f, data.MoveDuration == 1f, data.Initiator != 172); } } internal void SetNaosuGlow(byte sender, GameObject root, bool left, bool active, bool attached = true, bool spawnAura = true) { if (_naosuGlows.TryGetValue(sender, out var value)) { if (!active) { BeginNaosuAuraTail(value); return; } if (!value.Ending && (Object)(object)value.Prop?.Root == (Object)(object)root && value.Left == left) { value.ExpiresAt = Time.realtimeSinceStartup + 3f; Transform val = (attached ? ResolveSpinCueHand(sender, left) : null); if (attached && ((Object)(object)value.Hand?.Root == (Object)null || (Object)(object)value.Hand.Root.transform != (Object)(object)val || (Object)(object)value.Halo == (Object)null)) { RestoreNaosuHighlight(value.Hand); DestroyNaosuHalo(value); BindNaosuHand(value, val); } if (!attached) { RestoreNaosuHighlight(value.Hand); value.Hand = null; DestroyNaosuHalo(value); value.Halo = null; value.HaloMaterial = null; } return; } BeginNaosuAuraTail(value); _naosuAuraTails.Add(value); _naosuGlows.Remove(sender); } if (active) { Transform hand = (attached ? ResolveSpinCueHand(sender, left) : null); NaosuPresentation naosuPresentation = new NaosuPresentation { Left = left, ExpiresAt = Time.realtimeSinceStartup + 3f, AuraSpawned = !spawnAura, Prop = (((Object)(object)root != (Object)null) ? new NaosuHighlight { Root = root } : null) }; BindNaosuHand(naosuPresentation, hand); _naosuGlows[sender] = naosuPresentation; TrySpawnNaosuAura(sender, naosuPresentation); } } private void TrySpawnNaosuAura(byte sender, NaosuPresentation presentation) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) GameObject root = presentation.Prop?.Root; if ((Object)(object)root == (Object)null || presentation.AuraSpawnPending || !AbilityAuraPolicy.CanSpawn(presentation.AuraSpawned, presentation.Ending) || (Object)(object)presentation.Aura != (Object)null || Time.realtimeSinceStartup < presentation.NextAuraSpawn) { return; } presentation.NextAuraSpawn = Time.realtimeSinceStartup + 2f; int generation = ++presentation.AuraGeneration; presentation.AuraSpawnPending = true; Transform val = ResolveAuraAnchor(root); presentation.AuraAnchor = val; SpawnAbilityAura(val.position, val.rotation, delegate(GameObject spawned) { presentation.AuraSpawnPending = false; if (!_naosuGlows.TryGetValue(sender, out var value) || value != presentation || generation != presentation.AuraGeneration || (Object)(object)root == (Object)null || !root.activeInHierarchy || Time.realtimeSinceStartup >= value.ExpiresAt) { DespawnNaosuAura(spawned); } else { presentation.Aura = spawned; if (!((Object)(object)spawned == (Object)null)) { presentation.AuraSpawned = true; Transform val2 = ResolveAuraAnchor(root); presentation.AuraAnchor = val2; PrepareFollowingAura(spawned, val2); if ((Object)(object)spawned != (Object)null && sender != PlayerIDManager.LocalSmallID) { ((MelonBase)this).LoggerInstance.Msg("Received and attached network AuraGlow to prop."); } } } }); } private static void BindNaosuHand(NaosuPresentation presentation, Transform hand) { //IL_0093: 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_00b6: Unknown result type (might be due to invalid IL or missing references) presentation.Hand = CreateNaosuHighlight(((Object)(object)hand != (Object)null) ? ((Component)hand).gameObject : null); presentation.Halo = CreateHandGlow(hand, "Naosu Yellow Hand Glow"); presentation.HaloMaterial = null; if (!((Object)(object)presentation.Halo != (Object)null)) { return; } Renderer component = presentation.Halo.GetComponent<Renderer>(); presentation.HaloMaterial = ((component != null) ? component.material : null); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.85f, 0f, 0.52f); if ((Object)(object)presentation.HaloMaterial != (Object)null) { presentation.HaloMaterial.color = val; if (presentation.HaloMaterial.HasProperty("_BaseColor")) { presentation.HaloMaterial.SetColor("_BaseColor", val); } } Light component2 = presentation.Halo.GetComponent<Light>(); if ((Object)(object)component2 != (Object)null) { component2.color = Color.yellow; } } private static NaosuHighlight CreateNaosuHighlight(GameObject root) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0078: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return null; } NaosuHighlight naosuHighlight = new NaosuHighlight { Root = root }; foreach (Renderer componentsInChild in root.GetComponentsInChildren<Renderer>(true)) { if (!((Object)(object)componentsInChild == (Object)null)) { MaterialPropertyBlock val = new MaterialPropertyBlock(); componentsInChild.GetPropertyBlock(val); naosuHighlight.Renderers.Add(componentsInChild); naosuHighlight.Originals.Add(val); MaterialPropertyBlock val2 = new MaterialPropertyBlock(); componentsInChild.GetPropertyBlock(val2); val2.SetColor("_BaseColor", Color.yellow); val2.SetColor("_Color", Color.yellow); val2.SetColor("_EmissionColor", new Color(3f, 2.5f, 0f, 1f)); componentsInChild.SetPropertyBlock(val2); } } naosuHighlight.Light = new GameObject("Naosu Yellow Light"); naosuHighlight.Light.transform.SetParent(root.transform, false); Light obj = naosuHighlight.Light.AddComponent<Light>(); obj.color = Color.yellow; obj.range = 0.8f; obj.intensity = 2.5f; obj.shadows = (LightShadows)0; return naosuHighlight; } private static void RestoreNaosuHighlight(NaosuHighlight state) { if (state == null) { return; } for (int i = 0; i < state.Renderers.Count; i++) { if ((Object)(object)state.Renderers[i] != (Object)null) { state.Renderers[i].SetPropertyBlock(state.Originals[i]); } } if ((Object)(object)state.Light != (Object)null) { Object.Destroy((Object)(object)state.Light); } } private static void BeginNaosuAuraTail(NaosuPresentation state) { if (!state.Ending) { state.Ending = true; state.ExpiresAt = Time.realtimeSinceStartup + 5f; RestoreNaosuHighlight(state.Hand); state.Hand = null; DestroyNaosuHalo(state); state.Halo = null; state.HaloMaterial = null; } } private static void FollowNaosuAura(NaosuPresentation state) { if (!((Object)(object)state.Aura == (Object)null) && !((Object)(object)state.Prop?.Root == (Object)null)) { MoveFollowingAura(state.Aura, state.Prop.Root); } } private void UpdateNaosuGlows() { _expiredNaosuGlows.Clear(); foreach (KeyValuePair<byte, NaosuPresentation> naosuGlow in _naosuGlows) { NaosuPresentation value = naosuGlow.Value; if (!value.Ending && Time.realtimeSinceStartup >= value.ExpiresAt) { BeginNaosuAuraTail(value); } if (Time.realtimeSinceStartup >= value.ExpiresAt || (Object)(object)value.Prop?.Root == (Object)null || !value.Prop.Root.activeInHierarchy) { _expiredNaosuGlows.Add(naosuGlow.Key); continue; } TrySpawnNaosuAura(naosuGlow.Key, value); FollowNaosuAura(value); } foreach (byte expiredNaosuGlow in _expiredNaosuGlows) { NaosuPresentation naosuPresentation = _naosuGlows[expiredNaosuGlow]; RestoreNaosuHighlight(naosuPresentation.Prop); RestoreNaosuHighlight(naosuPresentation.Hand); DestroyNaosuHalo(naosuPresentation); DespawnNaosuAura(naosuPresentation.Aura); _naosuGlows.Remove(expiredNaosuGlow); } for (int num = _naosuAuraTails.Count - 1; num >= 0; num--) { NaosuPresentation naosuPresentation2 = _naosuAuraTails[num]; if (Time.realtimeSinceStartup < naosuPresentation2.ExpiresAt && (Object)(object)naosuPresentation2.Prop?.Root != (Object)null && naosuPresentation2.Prop.Root.activeInHierarchy) { FollowNaosuAura(naosuPresentation2); } else { RestoreNaosuHighlight(naosuPresentation2.Prop); DespawnNaosuAura(naosuPresentation2.Aura); _naosuAuraTails.RemoveAt(num); } } } private void ClearNaosuGlows() { _pendingAuraEffects.Clear(); _rejectedAuraSenders.Clear(); foreach (NaosuPresentation value in _naosuGlows.Values) { RestoreNaosuHighlight(value.Prop); RestoreNaosuHighlight(value.Hand); DestroyNaosuHalo(value); DespawnNaosuAura(value.Aura); } _naosuGlows.Clear(); foreach (NaosuPresentation naosuAuraTail in _naosuAuraTails) { RestoreNaosuHighlight(naosuAuraTail.Prop); DespawnNaosuAura(naosuAuraTail.Aura); } _naosuAuraTails.Clear(); } private static void DestroyNaosuHalo(NaosuPresentation state) { if ((Object)(object)state.Halo != (Object)null) { Object.Destroy((Object)(object)state.Halo); } if ((Object)(object)state.HaloMaterial != (Object)null) { Object.Destroy((Object)(object)state.HaloMaterial); } } private static void DespawnNaosuAura(GameObject aura) { if (aura != null) { if (AuraVisuals.TryGetValue(aura, out var value)) { foreach (AuraVisualFollow item in value) { if ((Object)(object)item.Transform != (Object)null && (Object)(object)aura != (Object)null && !item.Transform.IsChildOf(aura.transform)) { ((Component)item.Transform).gameObject.SetActive(false); } } } if (AuraBodies.TryGetValue(aura, out var value2)) { foreach (AuraBodyFollow item2 in value2) { if ((Object)(object)item2.Body != (Object)null && (Object)(object)aura != (Object)null && (Object)(object)((Component)item2.Body).transform != (Object)(object)aura.transform && !((Component)item2.Body).transform.IsChildOf(aura.transform)) { ((Component)item2.Body).gameObject.SetActive(false); } } } AuraBodies.Remove(aura); AuraVisuals.Remove(aura); AuraDeadlines.Remove(aura); } if ((Object)(object)aura == (Object)null) { return; } foreach (ParticleSystem componentsInChild in aura.GetComponentsInChildren<ParticleSystem>(true)) { if ((Object)(object)componentsInChild != (Object)null) { componentsInChild.Stop(true, (ParticleSystemStopBehavior)0); } } aura.transform.SetParent((Transform)null, true); if (DespawnNativeAura(aura)) { aura.SetActive(false); return; } Poolee component = aura.GetComponent<Poolee>(); if ((Object)(object)component != (Object)null) { component.Despawn(); } else { Object.Destroy((Object)(object)aura); } if ((Object)(object)aura != (Object)null) { aura.SetActive(false); } } private void SpawnAbilityAura(Vector3 position, Quaternion rotation, Action<GameObject> callback) { //IL_0020: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0082: Unknown result type (might be due to invalid IL or missing references) if (!UseNativeAuraTransport) { HelperMethods.SpawnCrate("SLZ.BONELAB.Content.VFX.AuraGlow", position, rotation, Vector3.one, true, callback, (Action<GameObject>)null); return; } try { NetworkAssetSpawner.Spawn(new SpawnRequestInfo { Spawnable = LocalAssetSpawner.CreateSpawnable("SLZ.BONELAB.Content.VFX.AuraGlow"), Position = position, Rotation = rotation, SpawnEffect = false, SpawnSource = (EntitySource)2, SpawnCallback = delegate(SpawnCallbackInfo info) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_002d: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)info.Spawned != (Object)null && info.Entity != null) { NativeAuras[info.Spawned] = new NativeAura { Entity = info.Entity }; NetworkProp extender = info.Entity.GetExtender<NetworkProp>(); int? obj; if (extender == null) { obj = null; } else { MarrowEntity marrowEntity = extender.MarrowEntity; obj = ((marrowEntity == null) ? ((int?)null) : ((Il2CppArrayBase<MarrowBody>)(object)marrowEntity.Bodies)?.Length); } int? num = obj; int valueOrDefault = num.GetValueOrDefault(); ((MelonBase)this).LoggerInstance.Msg($"Native AuraGlow spawned: entity={info.Entity.ID}, bodies={valueOrDefault}; uses stock Fusion messages."); } else { ((MelonBase)this).LoggerInstance.Warning("AuraGlow native spawn has no network entity: remote follow/despawn cannot be guaranteed for this crate."); } callback(info.Spawned); } }); } catch (Exception ex) { ((MelonBase)this).LoggerInstance.Warning("Native AuraGlow spawn failed: " + ex.Message + ". No silent local-only fallback."); callback(null); } } private static void PublishNativeAuraPose(GameObject aura) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown if (!NativeAuras.TryGetValue(aura, out var value) || value.Entity == null || !value.Entity.IsRegistered || !value.Entity.IsOwner || !NetworkInfo.HasServer || Time.realtimeSinceStartup < value.NextPose) { return; } value.NextPose = Time.realtimeSinceStartup + 0.05f; NetworkProp extender = value.Entity.GetExtender<NetworkProp>(); object obj; if (extender == null) { obj = null; } else { MarrowEntity marrowEntity = extender.MarrowEntity; obj = ((marrowEntity != null) ? marrowEntity.Bodies : null); } Il2CppReferenceArray<MarrowBody> val = (Il2CppReferenceArray<MarrowBody>)obj; if (val == null || ((Il2CppArrayBase<MarrowBody>)(object)val).Length == 0 || ((Il2CppArrayBase<MarrowBody>)(object)val).Length > 255) { return; } if (value.Pose == null || value.Pose.Bodies.Length != ((Il2CppArrayBase<MarrowBody>)(object)val).Length) { value.Pose = new EntityPose(((Il2CppArrayBase<MarrowBody>)(object)val).Length); } for (int i = 0; i < ((Il2CppArrayBase<MarrowBody>)(object)val).Length; i++) { if ((Object)(object)((Il2CppArrayBase<MarrowBody>)(object)val)[i] == (Object)null || !((Il2CppArrayBase<MarrowBody>)(object)val)[i].HasRigidbody) { return; } value.Pose.Bodies[i].ReadFrom(((Il2CppArrayBase<MarrowBody>)(object)val)[i]._rigidbody); value.Pose.Bodies[i].ResetPrediction(); } MessageRelay.RelayNative<EntityPoseUpdateData>(new EntityPoseUpdateData { Entity = new NetworkEntityReference(value.Entity), Pose = value.Pose }, NativeMessageTag.EntityPoseUpdate, CommonMessageRoutes.UnreliableToOtherClients); } private static bool DespawnNativeAura(GameObject aura) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (!NativeAuras.Remove(aura, out var value) || value.Entity == null || !value.Entity.IsRegistered || !NetworkInfo.HasServer) { return false; } NetworkAssetSpawner.Despawn(new DespawnRequestInfo { EntityID = value.Entity.ID, DespawnEffect = false }); return true; } private void InitializeNetworkContinuity() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown MultiplayerHooking.OnPlayerLeft += new PlayerUpdate(OnPresentationPlayerLeft); MultiplayerHooking.OnPlayerJoined += new PlayerUpdate(OnPresentationPlayerJoined); MultiplayerHooking.OnDisconnected += new ServerEvent(OnPresentationDisconnected); } private void OnPresentationPlayerJoined(PlayerID id) { _nextNetworkMaintenance = 0f; } private void OnPresentationPlayerLeft(PlayerID id) { if (id == null) { return; } byte smallID = id.SmallID; RemovePendingAuras(smallID); _authenticatedControllerSenders.Remove(smallID); if (_stops.Remove(smallID)) { RestoreAll(); if (_stops.Count > 0) { ScanAndFreeze(); } } if (_vanishSender == smallID) { RestoreRemoteCounterVanish(); } SetHealHands(smallID, active: false); SetRemoteSpinGlow(smallID, active: false); SetRemoteSuperPunchGlow(smallID, active: false); SetMassSpinHandGlow(smallID, active: false); _expiredPropLeases.Clear(); foreach (KeyValuePair<ushort, PropLease> propLease in _propLeases) { if (propLease.Value.Platform == id.PlatformID) { _expiredPropLeases.Add(propLease.Key); } } foreach (ushort expiredPropLease in _expiredPropLeases) { NetworkEntity entity = _propLeases[expiredPropLease].Entity; RemovePropLease(expiredPropLease); if (entity.HasOwner && entity.OwnerID.PlatformID == id.PlatformID) { entity.RemoveOwner(); } } _nextNetworkMaintenance = 0f; } private void OnPresentationDisconnected() { ClearPlayerHealthIndicators(); ClearPropControl(); _stops.Clear(); _authenticatedControllerSenders.Clear(); RestoreAll(); RestoreRemoteCounterVanish(); ClearHealEffects(); ClearNaosuGlows(); ClearSpinGlows(); ClearRemoteSuperPunchGlows(); } private void UpdateNetworkContinuity() { float realtimeSinceStartup = Time.realtimeSinceStartup; if (!(realtimeSinceStartup < _nextNetworkMaintenance)) { _nextNetworkMaintenance = realtimeSinceStartup + 1f; if (ModuleMessageManager.GetHandlerByType(typeof(TimeStopPublicMessage)) == null) { ModuleMessageManager.RegisterHandler<TimeStopPublicMessage>(); } } } private void ShutdownNetworkContinuity() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown MultiplayerHooking.OnPlayerLeft -= new PlayerUpdate(OnPresentationPlayerLeft); MultiplayerHooking.OnPlayerJoined -= new PlayerUpdate(OnPresentationPlayerJoined); MultiplayerHooking.OnDisconnected -= new ServerEvent(OnPresentationDisconnected); } private void RememberLivingNpcMotion() { //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) if (Time.realtimeSinceStartup < _nextNpcMotionScan || AnyTimeStopRunning()) { return; } _nextNpcMotionScan = Time.realtimeSinceStartup + 1f; _deadNpcSettings.Clear(); foreach (KeyValuePair<int, LivingNpcMotion> livingNpcSetting in LivingNpcSettings) { if ((Object)(object)livingNpcSetting.Value.Puppet == (Object)null) { _deadNpcSettings.Add(livingNpcSetting.Key); } } foreach (int deadNpcSetting in _deadNpcSettings) { LivingNpcSettings.Remove(deadNpcSetting); } NetworkEntity val2 = default(NetworkEntity); foreach (AIBrain item in Object.FindObjectsOfType<AIBrain>()) { PuppetMaster val = ((item != null) ? item.puppetMaster : null); if (!((Object)(object)item == (Object)null) && !item.isDead && !((Object)(object)val == (Object)null) && val.isAlive && !(val.muscleSpring <= 0f) && !(val.muscleWeight <= 0.01f) && !LivingNpcSettings.ContainsKey(((Object)val).GetInstanceID()) && (!PuppetMasterExtender.Cache.TryGet(val, ref val2) || val2.IsOwner)) { LivingNpcSettings[((Object)val).GetInstanceID()] = new LivingNpcMotion { Puppet = val, Spring = val.muscleSpring, Damper = val.muscleDamper, MuscleWeight = val.muscleWeight, MappingWeight = val.mappingWeight, JointAnchors = val.updateJointAnchors, Mental = (MentalState)((!((Object)(object)item.behaviour != (Object)null)) ? 1 : ((int)item.behaviour.mentalState)) }; } } } private static void RestoreRevivedNpcMotion(AIBrain brain, PuppetMaster puppet, NetworkEntity entity) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) if (entity != null && !entity.IsOwner) { return; } LivingNpcMotion value = null; if ((Object)(object)puppet != (Object)null) { LivingNpcSettings.TryGetValue(((Object)puppet).GetInstanceID(), out value); } if ((Object)(object)brain != (Object)null) { brain.isDead = false; ((Behaviour)brain).enabled = true; if ((Object)(object)brain.behaviour != (Object)null) { ((Behaviour)brain.behaviour).enabled = true; brain.behaviour.ResetAnimator(); brain.behaviour._isNavAgentStopped = false; brain.behaviour.applyCachedMental = false; MentalState val = (MentalState)((value == null) ? 1 : ((int)value.Mental)); brain.behaviour.mentalState = (MentalState)(((int)val == 0) ? 1 : ((int)val)); brain.behaviour.cachedMentalState = brain.behaviour.mentalState; brain.behaviour.EnableNav(); } } if ((Object)(object)puppet == (Object)null) { return; } ((Behaviour)puppet).enabled = true; puppet.freezeFlag = false; puppet.mode = (Mode)0; puppet.state = (State)0; puppet.muscleSpring = value?.Spring ?? Mathf.Max(100f, puppet.muscleSpring); puppet.muscleDamper = value?.Damper ?? Mathf.Max(10f, puppet.muscleDamper); puppet.muscleWeight = value?.MuscleWeight ?? 1f; puppet.mappingWeight = value?.MappingWeight ?? 1f; puppet.updateJointAnchors = value?.JointAnchors ?? true; foreach (Animator componentsInChild in ((Component)puppet).GetComponentsInChildren<Animator>(true)) { if ((Object)(object)componentsInChild != (Object)null) { ((Behaviour)componentsInChild).enabled = true; if (componentsInChild.speed <= 0f) { componentsInChild.speed = 1f; } } } if ((Object)(object)puppet.targetAnimator != (Object)null) { ((Behaviour)puppet.targetAnimator).enabled = true; if (puppet.targetAnimator.speed <= 0f) { puppet.targetAnimator.speed = 1f; } } HashSet<Rigidbody> hashSet = new HashSet<Rigidbody>((IEnumerable<Rigidbody>)((Component)puppet).GetComponentsInChildren<Rigidbody>(true)); if (puppet.muscles != null) { foreach (Muscle item in (Il2CppArrayBase<Muscle>)(object)puppet.muscles) { if ((Object)(object)((item != null) ? item.marrowBody : null) != (Object)null && item.marrowBody.HasRigidbody) { hashSet.Add(item.marrowBody._rigidbody); } } } foreach (Rigidbody item2 in hashSet) { if ((Object)(object)item2 == (Object)null) { continue; } MarrowBody component = ((Component)item2).GetComponent<MarrowBody>(); RigidbodyInfo val2 = ((component != null) ? component._defaultRigidbodyInfo : null); if (val2 != null) { item2.isKinematic = val2.isKinematic; item2.constraints = val2.constraints; item2.useGravity = val2.useGravity; if (!item2.isKinematic) { item2.WakeUp(); } } } } private void RemovePendingAuras(byte sender) { _readyAuraEffects.Clear(); foreach (var key in _pendingAuraEffects.Keys) { if (key.Item1 == sender) { _readyAuraEffects.Add(key); } } foreach (var readyAuraEffect in _readyAuraEffects) { _pendingAuraEffects.Remove(readyAuraEffect); } _rejectedAuraSenders.Remove(sender); } private void QueueAuraEffect(byte sender, TimeStopPublicData data) { (byte, TimeStopPublicAction, ushort) key = (sender, data.Action, (ushort)data.Radius); if (_pendingAuraEffects.Count < 256 || _pendingAuraEffects.ContainsKey(key)) { _pendingAuraEffects[key] = new PendingAuraEffect { Sender = sender, Data = data, Expires = Time.realtimeSinceStartup + 8f }; } } private void UpdatePendingAuraEffects() { float realtimeSinceStartup = Time.realtimeSinceStartup; if (realtimeSinceStartup < _nextAuraResolution) { return; } _nextAuraResolution = realtimeSinceStartup + 0.15f; _readyAuraEffects.Clear(); foreach (KeyValuePair<(byte, TimeStopPublicAction, ushort), PendingAuraEffect> pendingAuraEffect2 in _pendingAuraEffects) { NetworkEntity entity = NetworkEntityManager.IDManager.RegisteredEntities.GetEntity(pendingAuraEffect2.Key.Item3); if (!(realtimeSinceStartup >= pendingAuraEffect2.Value.Expires)) { object obj; if (entity == null) { obj = null; } else { NetworkProp extender = entity.GetExtender<NetworkProp>(); obj = ((extender != null) ? extender.MarrowEntity : null); } if (!((Object)obj != (Object)null)) { continue; } } _readyAuraEffects.Add(pendingAuraEffect2.Key); } foreach (var readyAuraEffect in _readyAuraEffects) { PendingAuraEffect pendingAuraEffect = _pendingAuraEffects[readyAuraEffect]; _pendingAuraEffects.Remove(readyAuraEffect); if (!(realtimeSinceStartup >= pendingAuraEffect.Expires)) { if (pendingAuraEffect.Data.Action == TimeStopPublicAction.NaosuGlow) { ReceiveNaosuGlow(pendingAuraEffect.Sender, pendingAuraEffect.Data); } else { ReceiveHealEffect(pendingAuraEffect.Sender, pendingAuraEffect.Data); } } } } private void UpdatePlayerHealthIndicators() { //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) if (_playerHealthBarsEnabled == null || !_playerHealthBarsEnabled.Value) { if (_playerHealthIndicators.Count > 0) { ClearPlayerHealthIndicators(); } return; } RigManager rigManager = Player.RigManager; object obj; if (rigManager == null) { obj = null; } else { PhysicsRig physicsRig = rigManager.physicsRig; if (physicsRig == null) { obj = null; } else { Transform head = ((Rig)physicsRig).m_head; obj = ((head != null) ? ((Component)head).transform : null); } } Transform val = (Transform)obj; if ((Object)(object)val == (Object)null) { ClearPlayerHealthIndicators(); return; } bool flag = Time.realtimeSinceStartup >= _nextHealthBarSample; if (flag) { _nextHealthBarSample = Time.realtimeSinceStartup + 0.2f; } _healthPlayersSeen.Clear(); foreach (NetworkPlayer player in NetworkPlayer.Players) { if (player == null || player.NetworkEntity.IsOwner || !player.HasRig || player.IsHidden || player.PlayerID.SmallID == _vanishSender || (Object)(object)player.RigRefs.Head == (Object)null) { continue; } Transform head2 = player.RigRefs.Head; Vector3 val2 = head2.position - val.position; if (((Vector3)(ref val2)).sqrMagnitude > 900f) { continue; } _healthPlayersSeen.Add(player); if (!_playerHealthIndicators.TryGetValue(player, out var value)) { value = CreatePlayerHealthIndicator(); if (value == null) { continue; } _playerHealthIndicators[player] = value; SetPlayerHealthIndicator(value, player); } value.Root.transform.position = head2.position + Vector3.up * 0.28f; Vector3 val3 = value.Root.transform.position - val.position; if (((Vector3)(ref val3)).sqrMagnitude > 0.0001f) { value.Root.transform.rotation = Quaternion.LookRotation(val3, Vector3.up); } if (flag) { SetPlayerHealthIndicator(value, player); } AnimatePlayerHealthIndicator(value); } _healthPlayersGone.Clear(); foreach (NetworkPlayer key in _playerHealthIndicators.Keys) { if (!_healthPlayersSeen.Contains(key)) { _healthPlayersGone.Add(key); } } foreach (NetworkPlayer item in _healthPlayersGone) { DestroyPlayerHealthIndicator(_playerHealthIndicators[item]); _playerHealthIndicators.Remove(item); } } private PlayerHealthIndicator CreatePlayerHealthIndicator() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val == (Object)null) { return null; } if ((Object)(object)_healthBarFont == (Object)null) { _healthBarFont = Resources.GetBuiltinResource<Font>("Arial.ttf"); } if ((Object)(object)_healthBarFont == (Object)null) { return null; } PlayerHealthIndicator playerHealthIndicator = new PlayerHealthIndicator { Root = new GameObject("Player health percentage") }; GameObject obj = GameObject.CreatePrimitive((PrimitiveType)5); Object.Destroy((Object)(object)obj.GetComponent<Collider>()); obj.transform.SetParent(playerHealthIndicator.Root.transform, false); obj.transform.localScale = new Vector3(0.24f, 0.025f, 1f); playerHealthIndicator.FillMaterial = new Material(val); obj.GetComponent<Renderer>().sharedMaterial = playerHealthIndicator.FillMaterial; MaterialPropertyBlock val2 = new MaterialPropertyBlock(); val2.SetColor("_Color", new Color(0.08f, 0.08f, 0.08f, 0.85f)); obj.GetComponent<Renderer>().SetPropertyBlock(val2); GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)5); Object.Destroy((Object)(object)val3.GetComponent<Collider>()); val3.transform.SetParent(playerHealthIndicator.Root.transform, false); playerHealthIndicator.Fill = val3.transform; playerHealthIndicator.FillRenderer = val3.GetComponent<Renderer>(); playerHealthIndicator.FillRenderer.sharedMaterial = playerHealthIndicator.FillMaterial; GameObject val4 = GameObject.CreatePrimitive((PrimitiveType)5); Object.Destroy((Object)(object)val4.GetComponent<Collider>()); val4.transform.SetParent(playerHealthIndicator.Root.transform, false); playerHealthIndicator.Change = val4.transform; playerHealthIndicator.ChangeRenderer = val4.GetComponent<Renderer>(); playerHealthIndicator.ChangeRenderer.sharedMaterial = playerHealthIndicator.FillMaterial; GameObject val5 = new GameObject("Percentage"); val5.transform.SetParent(playerHealthIndicator.Root.transform, false); val5.transform.localPosition = new Vector3(0f, 0.039f, -0.002f); val5.transform.localScale = Vector3.one * 0.007f; playerHealthIndicator.Text = val5.AddComponent<TextMesh>(); playerHealthIndicator.Text.font = _healthBarFont; playerHealthIndicator.Text.fontSize = 48; playerHealthIndicator.Text.characterSize = 0.4f; playerHealthIndicator.Text.anchor = (TextAnchor)4; playerHealthIndicator.Text.alignment = (TextAlignment)1; playerHealthIndicator.Text.color = Color.white; val5.GetComponent<Renderer>().sharedMaterial = _healthBarFont.material; GameObject val6 = Object.Instantiate<GameObject>(val5, playerHealthIndicator.Root.transform); ((Object)val6).name = "Health change"; playerHealthIndicator.DeltaText = val6.GetComponent<TextMesh>(); playerHealthIndicator.DeltaText.anchor = (TextAnchor)3; playerHealthIndicator.DeltaText.text = ""; return playerHealthIndicator; } private static void SetPlayerHealthIndicator(PlayerHealthIndicator state, NetworkPlayer player) { RigHealthBar healthBar = player.HealthBar; int num; float num2; if (healthBar != null && float.IsFinite(healthBar.Health) && float.IsFinite(healthBar.MaxHealth)) { num = ((healthBar.MaxHealth > 0f) ? 1 : 0); if (num != 0) { num2 = Mathf.Clamp01(healthBar.Health / healthBar.MaxHealth); goto IL_0050; } } else { num = 0; } num2 = 0f; goto IL_0050; IL_0050: float num3 = num2; if (num == 0) { state.Valid = false; state.Text.text = "--%"; state.Delta = 0; state.Actual = (state.Displayed = 0f); return; } if (!state.Valid) { state.Valid = true; state.Actual = (state.Displayed = (state.From = num3)); state.Delta = 0; return; } int num4 = Mathf.RoundToInt(num3 * 100f) - Mathf.RoundToInt(state.Actual * 100f); if (num4 != 0) { bool flag = Time.realtimeSinceStartup - state.ChangedAt < 0.6f && num4 > 0 == state.Delta > 0; state.Delta = (flag ? (state.Delta + num4) : num4); state.From = state.Displayed; state.ChangedAt = Time.realtimeSinceStartup; } state.Actual = num3; } private static void AnimatePlayerHealthIndicator(PlayerHealthIndicator state) { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00f2: Expected O, but got Unknown //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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) float num = Time.realtimeSinceStartup - state.ChangedAt; float num2 = Mathf.Clamp01((num - 0.1f) / 0.65f); state.Displayed = Mathf.Lerp(state.From, state.Actual, num2 * num2 * (3f - 2f * num2)); if (state.Valid) { state.Text.text = Mathf.RoundToInt(state.Displayed * 100f) + "%"; } float num3 = Mathf.Min(state.Displayed, state.Actual); float num4 = Mathf.Max(state.Displayed, state.Actual); state.Fill.localScale = new Vector3(0.23f * num3, 0.017f, 1f); state.Fill.localPosition = new Vector3(-0.115f * (1f - num3), 0f, -0.001f); MaterialPropertyBlock val = new MaterialPropertyBlock(); val.SetColor("_Color", Color.Lerp(Color.red, Color.green, state.Actual)); state.FillRenderer.SetPropertyBlock(val); state.Change.localScale = new Vector3(0.23f * (num4 - num3), 0.017f, 1f); state.Change.localPosition = new Vector3(-0.115f + 0.115f * (num3 + num4), 0f, -0.0015f); Color val2 = ((state.Delta < 0) ? new Color(1f, 0.08f, 0.16f, 1f) : new Color(0.15f, 1f, 0.4f, 1f)); val.SetColor("_Color", val2); state.ChangeRenderer.SetPropertyBlock(val); float num5 = 1f - Mathf.Clamp01((num - 0.45f) / 0.55f); state.DeltaText.text = ((state.Valid && state.Delta != 0 && num5 > 0f) ? (((state.Delta > 0) ? "+" : "") + state.Delta + "%") : ""); val2.a = num5; state.DeltaText.color = val2; ((Component)state.DeltaText).transform.localPosition = new Vector3(Mathf.Lerp(0.055f, 0.005f, 1f - num5), 0.039f, -0.003f); } private static void DestroyPlayerHealthIndicator(PlayerHealthIndicator state) { if ((Object)(object)state.Root != (Object)null) { Object.Destroy((Object)(object)state.Root); } if ((Object)(object)state.FillMaterial != (Object)null) { Object.Destroy((Object)(object)state.FillMaterial); } } private void ClearPlayerHealthIndicators() { foreach (PlayerHealthIndicator value in _playerHealthIndicators.Values) { DestroyPlayerHealthIndicator(value); } _playerHealthIndicators.Clear(); } internal void PlayHealingCue(Vector3 position, bool returning) { //IL_0035: 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) AudioClip val = (returning ? _healReturnSound : _healingSound); if ((Object)(object)val != (Object)null) { PlaySpatialSound(val, position, "Healing Sound", 1f, 35f); return; } MelonCoroutines.Start(LoadAndPlayLooseSound(returning ? "heal.wav" : "Healing.wav", delegate(AudioClip loaded) { if (returning) { _healReturnSound = loaded; } else { _healingSound = loaded; } }, position, "Healing Sound", 1f, 35f)); } private void ReceivePrivatePlayerImpulse(TimeStopPublicData data) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0071: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) if (data.TargetPlayer != PlayerIDManager.LocalSmallID) { return; } Vector3 center = data.Center; if (float.IsFinite(center.x) && float.IsFinite(center.y) && float.IsFinite(center.z)) { if (data.Duration > 0.5f) { _pendingPrivateVelocity = center; _pendingPrivateDelta = Vector3.zero; _hasPendingPrivateVelocity = true; } else { _pendingPrivateDelta += center; } } } private void ApplyPendingPrivatePlayerImpulse() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if ((!_hasPendingPrivateVelocity && ((Vector3)(ref _pendingPrivateDelta)).sqrMagnitude < 0.0001f) || ShouldFreezeLocalPlayer() || (Object)(object)Player.PhysicsRig == (Object)null) { return; } bool flag = false; foreach (Rigidbody componentsInChild in ((Component)Player.PhysicsRig).GetComponentsInChildren<Rigidbody>(true)) { if (!((Object)(object)componentsInChild == (Object)null) && !componentsInChild.isKinematic) { componentsInChild.velocity = (_hasPendingPrivateVelocity ? _pendingPrivateVelocity : componentsInChild.velocity) + _pendingPrivateDelta; componentsInChild.WakeUp(); flag = true; } } if (flag) { ClearPendingPrivatePlayerImpulse(); } } private void ClearPendingPrivatePlayerImpulse() { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) _pendingPrivateVelocity = Vector3.zero; _pendingPrivateDelta = Vector3.zero; _hasPendingPrivateVelocity = false; } private void ReceivePrivateAbilityCue(byte sender, TimeStopPublicData data) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00ff: 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_018e: Unknown result type (might be due to invalid IL or missing references) if (data.TargetPlayer == 6 || data.TargetPlayer == 7) { PlayHealingCue(data.Center, data.TargetPlayer == 7); ret