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.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CursedScraps;
using CursedScraps.Managers;
using CursedScraps.Patches;
using CursedScraps.Registries;
using GameNetcodeStuff;
using LegaFusionCore;
using LegaFusionCore.Behaviours.Shaders;
using LegaFusionCore.Managers;
using LegaFusionCore.Managers.NetworkManagers;
using LegaFusionCore.ModsCompat;
using LegaFusionCore.Utilities;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using TrickOrTreat.Behaviours;
using TrickOrTreat.Managers;
using TrickOrTreat.NetcodePatcher;
using Unity.Netcode;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("TrickOrTreat")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TrickOrTreat")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("aa332fd3-7a30-4c63-9e45-c5d6f0cb377a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("ClientNetworkTransform")]
[assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")]
[assembly: IgnoresAccessChecksTo("DissonanceVoip")]
[assembly: IgnoresAccessChecksTo("EasyTextEffects")]
[assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")]
[assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")]
[assembly: IgnoresAccessChecksTo("Unity.Burst")]
[assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")]
[assembly: IgnoresAccessChecksTo("Unity.Collections")]
[assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Jobs")]
[assembly: IgnoresAccessChecksTo("Unity.Mathematics")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")]
[assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")]
[assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")]
[assembly: IgnoresAccessChecksTo("Unity.Services.QoS")]
[assembly: IgnoresAccessChecksTo("Unity.Services.Relay")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace TrickOrTreat
{
internal class Constants
{
public const string INFORMATION = "Information";
public const string MESSAGE_TRICK_OR_TREAT = "Trick or treat?";
public const string MESSAGE_INFO_NO_CANDY = "You don't have any candy";
public const string HOLLOW_GIRL = "Hollow Girl";
public const string CURSED_CANDY = "Cursed Candy";
}
[BepInPlugin("Lega.TrickOrTreat", "Trick Or Treat", "2.0.1")]
public class TrickOrTreat : BaseUnityPlugin
{
internal const string modGUID = "Lega.TrickOrTreat";
internal const string modName = "Trick Or Treat";
internal const string modVersion = "2.0.1";
private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "trickortreat"));
internal static ManualLogSource mls;
public static ConfigFile configFile;
public static GameObject cursedBallObj;
public static GameObject cursedExplosionParticle;
public static Item cursedCandy;
public void Awake()
{
mls = Logger.CreateLogSource("TrickOrTreat");
configFile = ((BaseUnityPlugin)this).Config;
ConfigManager.Load();
NetcodePatcher();
LoadItems();
LoadEnemies();
LoadNetworkPrefabs();
}
private static void NetcodePatcher()
{
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
Type[] array = types;
foreach (Type type in array)
{
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo[] array2 = methods;
foreach (MethodInfo methodInfo in array2)
{
object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
if (customAttributes.Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
}
public static void LoadItems()
{
cursedCandy = bundle.LoadAsset<Item>("Assets/CursedCandy/CursedCandyItem.asset");
LFCObjectsManager.RegisterObject(typeof(CursedCandy), cursedCandy);
}
public static void LoadEnemies()
{
EnemyType val = bundle.LoadAsset<EnemyType>("Assets/HollowGirl/HollowGirlEnemy.asset");
NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab);
Enemies.RegisterEnemy(val, ConfigManager.hollowGirlRarity.Value, (LevelTypes)(-1), (TerminalNode)null, (TerminalKeyword)null);
SellBodiesFixedSoftCompat.RegisterBody(val.enemyName, bundle.LoadAsset<Item>("Assets/HollowGirl/HollowGirlHeadItem.asset"), ConfigManager.minHeadValue.Value, ConfigManager.maxHeadValue.Value, true);
}
public static void LoadNetworkPrefabs()
{
HashSet<GameObject> hashSet = new HashSet<GameObject>
{
cursedBallObj = bundle.LoadAsset<GameObject>("Assets/CursedBall/CursedBall.prefab"),
cursedExplosionParticle = bundle.LoadAsset<GameObject>("Assets/CursedBall/CursedExplosionParticle.prefab")
};
foreach (GameObject item in hashSet)
{
NetworkPrefabs.RegisterNetworkPrefab(item);
Utilities.FixMixerGroups(item);
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "TrickOrTreat";
public const string PLUGIN_NAME = "TrickOrTreat";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace TrickOrTreat.Managers
{
internal class ConfigManager
{
public static ConfigEntry<int> hollowGirlRarity;
public static ConfigEntry<int> waitingDuration;
public static ConfigEntry<int> damage;
public static ConfigEntry<int> minHeadValue;
public static ConfigEntry<int> maxHeadValue;
public static ConfigEntry<int> cursedCandyRarity;
public static ConfigEntry<int> minCursedCandy;
public static ConfigEntry<int> maxCursedCandy;
internal static void Load()
{
hollowGirlRarity = TrickOrTreat.configFile.Bind<int>("Hollow Girl", "Rarity", 20, "Hollow Girl base rarity.");
waitingDuration = TrickOrTreat.configFile.Bind<int>("Hollow Girl", "Waiting duration", 5, "Time window during which a player can give a candy.");
damage = TrickOrTreat.configFile.Bind<int>("Hollow Girl", "Damage", 40, "Hollow Girl damage");
minHeadValue = TrickOrTreat.configFile.Bind<int>("Hollow Girl", "Min head value", 70, "Hollow Girl min head value (SellBodiesFixed must be installed).");
maxHeadValue = TrickOrTreat.configFile.Bind<int>("Hollow Girl", "Max head value", 110, "Hollow Girl max head value (SellBodiesFixed must be installed).");
cursedCandyRarity = TrickOrTreat.configFile.Bind<int>("Cursed Candy", "Rarity", 25, "Cursed Candy spawn rarity.");
minCursedCandy = TrickOrTreat.configFile.Bind<int>("Cursed Candy", "Min spawn", 0, "Min Cursed Candy to spawn");
maxCursedCandy = TrickOrTreat.configFile.Bind<int>("Cursed Candy", "Max spawn", 2, "Max Cursed Candy to spawn");
}
}
}
namespace TrickOrTreat.Behaviours
{
public class CursedBall : NetworkBehaviour
{
public Rigidbody rigidbody;
public bool deactivated;
private int bouncesLeft = 1;
private Vector3 lastVelocity;
private readonly HashSet<ulong> cursedPlayerIds = new HashSet<ulong>();
[Rpc(/*Could not decode attribute arguments.*/)]
public void ThrowCursedBallEveryoneRpc(Vector3 startPosition, Vector3 direction, bool isOutside)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(28579578u, val2, val, (SendTo)6, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe(ref startPosition);
((FastBufferWriter)(ref val3)).WriteValueSafe(ref direction);
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref isOutside, default(ForPrimitives));
((NetworkBehaviour)this).__endSendRpc(ref val3, 28579578u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1)
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (LFCUtilities.IsServer)
{
bouncesLeft = Random.Range(0, 3);
}
((Component)this).transform.position = startPosition;
float num = (isOutside ? 45f : 30f);
Vector3 val4 = default(Vector3);
((Vector3)(ref val4))..ctor(direction.x, 0f, direction.z);
float magnitude = ((Vector3)(ref val4)).magnitude;
float num2 = MathF.PI / 4f;
float num3 = magnitude / (num * Mathf.Cos(num2));
float num4 = direction.y / num3 - 0.5f * Physics.gravity.y * num3;
Vector3 val5 = ((Vector3)(ref val4)).normalized * (num * Mathf.Cos(num2));
rigidbody.position = startPosition;
rigidbody.velocity = Vector3.zero;
rigidbody.AddForce(val5 + Vector3.up * num4, (ForceMode)2);
}
}
private void FixedUpdate()
{
//IL_0007: 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)
lastVelocity = rigidbody.velocity;
}
private void OnCollisionEnter(Collision collision)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: 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_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
if (collision != null && !deactivated && LFCUtilities.IsServer)
{
ContactPoint contact = collision.GetContact(0);
Vector3 point = ((ContactPoint)(ref contact)).point;
Vector3 normal = ((ContactPoint)(ref contact)).normal;
PlayerControllerB val = default(PlayerControllerB);
if (((Component)collision.collider).TryGetComponent<PlayerControllerB>(ref val))
{
DeactivateCursedBall();
PlayAudioEveryoneRpc();
PlayCursedExplosionEveryoneRpc(point + normal * 0.5f, Quaternion.LookRotation(normal));
}
else if (bouncesLeft > 0)
{
bouncesLeft--;
((Component)this).transform.position = point + normal * 0.5f;
rigidbody.velocity = Vector3.Reflect(lastVelocity, normal) * 0.85f;
BounceEveryoneRpc(((Component)this).transform.position, rigidbody.velocity);
}
else
{
DeactivateCursedBall();
PlayCursedExplosionEveryoneRpc(point + normal * 0.5f, Quaternion.LookRotation(normal));
}
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
private void BounceEveryoneRpc(Vector3 position, Vector3 velocity)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3817494862u, val2, val, (SendTo)6, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe(ref position);
((FastBufferWriter)(ref val3)).WriteValueSafe(ref velocity);
((NetworkBehaviour)this).__endSendRpc(ref val3, 3817494862u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1)
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (!deactivated)
{
((Component)this).transform.position = position;
rigidbody.velocity = velocity;
}
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void PlayAudioEveryoneRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: 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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(508134178u, val2, val, (SendTo)6, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 508134178u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1)
{
base.__rpc_exec_stage = (__RpcExecStage)0;
LFCGlobalManager.PlayAudio("Lega Fusion Core" + ((Object)LegaFusionCore.hitProjectileAudio).name, ((Component)this).transform.position, true);
}
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void PlayCursedExplosionEveryoneRpc(Vector3 position, Quaternion rotation)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2256938309u, val2, val, (SendTo)6, (RpcDelivery)0);
((FastBufferWriter)(ref val3)).WriteValueSafe(ref position);
((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation);
((NetworkBehaviour)this).__endSendRpc(ref val3, 2256938309u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1)
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (LFCUtilities.IsServer)
{
((MonoBehaviour)this).StartCoroutine(ApplyCurseCoroutine(position, 2f));
}
else
{
DeactivateCursedBall();
}
GameObject val4 = Object.Instantiate<GameObject>(TrickOrTreat.cursedExplosionParticle, position, rotation);
ParticleSystem component = val4.GetComponent<ParticleSystem>();
MainModule main = component.main;
Object.Destroy((Object)(object)val4, ((MainModule)(ref main)).duration);
LFCGlobalManager.PlayAudio("Lega Fusion Core" + ((Object)LegaFusionCore.poisonExplosionAudio).name, position, true);
}
}
public IEnumerator ApplyCurseCoroutine(Vector3 position, float duration)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
for (float timePassed = 0f; timePassed < duration; timePassed += 0.2f)
{
Collider[] array = Physics.OverlapSphere(position, 2f, StartOfRound.Instance.playersMask, (QueryTriggerInteraction)2);
foreach (Collider val in array)
{
PlayerControllerB component = ((Component)val).GetComponent<PlayerControllerB>();
if ((Object)(object)component != (Object)null && !component.isPlayerDead && !cursedPlayerIds.Contains(component.playerClientId))
{
cursedPlayerIds.Add(component.playerClientId);
List<CurseEffectType> eligibleCurses = RoundManagerPatch.GetEligibleCurses(StartOfRound.Instance.currentLevel.PlanetName);
CurseEffectType val2 = eligibleCurses[Random.Range(0, eligibleCurses.Count)];
CursedScrapsNetworkManager.Instance.ApplyPlayerCurseEveryoneRpc((int)component.playerClientId, val2.Name, val2.Duration);
}
}
yield return (object)new WaitForSeconds(0.2f);
}
Object.Destroy((Object)(object)((Component)this).gameObject);
}
public void DeactivateCursedBall()
{
deactivated = true;
cursedPlayerIds.Clear();
Object.Destroy((Object)(object)((Component)this).gameObject.GetComponentInChildren<ParticleSystem>());
MeshRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer val in componentsInChildren)
{
Object.Destroy((Object)(object)val);
}
Collider[] componentsInChildren2 = ((Component)this).gameObject.GetComponentsInChildren<Collider>();
foreach (Collider val2 in componentsInChildren2)
{
Object.Destroy((Object)(object)val2);
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(28579578u, new RpcReceiveHandler(__rpc_handler_28579578), "ThrowCursedBallEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(3817494862u, new RpcReceiveHandler(__rpc_handler_3817494862), "BounceEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(508134178u, new RpcReceiveHandler(__rpc_handler_508134178), "PlayAudioEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(2256938309u, new RpcReceiveHandler(__rpc_handler_2256938309), "PlayCursedExplosionEveryoneRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_28579578(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 startPosition = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref startPosition);
Vector3 direction = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref direction);
bool isOutside = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isOutside, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((CursedBall)(object)target).ThrowCursedBallEveryoneRpc(startPosition, direction, isOutside);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3817494862(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
Vector3 velocity = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity);
target.__rpc_exec_stage = (__RpcExecStage)1;
((CursedBall)(object)target).BounceEveryoneRpc(position, velocity);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_508134178(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((CursedBall)(object)target).PlayAudioEveryoneRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2256938309(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
Quaternion rotation = default(Quaternion);
((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation);
target.__rpc_exec_stage = (__RpcExecStage)1;
((CursedBall)(object)target).PlayCursedExplosionEveryoneRpc(position, rotation);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "CursedBall";
}
}
public class CursedCandy : PhysicsProp
{
public HollowGirl aimedEnemy;
public override void Update()
{
((GrabbableObject)this).Update();
if (((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && LFCUtilities.ShouldBeLocalPlayer(((GrabbableObject)this).playerHeldBy))
{
ShowAuraAimedEnemy(((GrabbableObject)this).playerHeldBy);
}
}
public void ShowAuraAimedEnemy(PlayerControllerB player)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect);
if (Physics.Raycast(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward, ref val, 5f, 524288, (QueryTriggerInteraction)2) && ((Component)((RaycastHit)(ref val)).collider).TryGetComponent<EnemyAICollisionDetect>(ref val2) && val2.mainScript is HollowGirl hollowGirl && hollowGirl.isWaiting)
{
if ((Object)(object)aimedEnemy != (Object)(object)hollowGirl)
{
RemoveAuraFromEnemy();
aimedEnemy = hollowGirl;
CustomPassManager.SetupAuraForObjects((GameObject[])(object)new GameObject[1] { ((Component)hollowGirl).gameObject }, LegaFusionCore.transparentShader, "Trick Or Treat" + ((Object)((Component)this).gameObject).name, Color.red);
}
}
else
{
RemoveAuraFromEnemy();
}
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (buttonDown && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)aimedEnemy != (Object)null && aimedEnemy.isWaiting)
{
aimedEnemy.ApplyCurseEveryoneRpc();
LFCNetworkManager.Instance.DestroyObjectEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)this).GetComponent<NetworkObject>()));
}
}
public override void PocketItem()
{
((GrabbableObject)this).PocketItem();
RemoveAuraFromEnemy();
}
public override void DiscardItem()
{
((GrabbableObject)this).DiscardItem();
RemoveAuraFromEnemy();
}
public void RemoveAuraFromEnemy()
{
if ((Object)(object)aimedEnemy != (Object)null)
{
CustomPassManager.RemoveAuraFromObjects((GameObject[])(object)new GameObject[1] { ((Component)aimedEnemy).gameObject }, "Trick Or Treat" + ((Object)((Component)this).gameObject).name);
aimedEnemy = null;
}
}
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
((PhysicsProp)this).__initializeRpcs();
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "CursedCandy";
}
}
public class HollowGirl : EnemyAI
{
public enum State
{
WANDERING,
CHASING,
THROWING,
INTERACTING
}
public Transform TurnCompass;
public AudioClip[] FootstepSounds = Array.Empty<AudioClip>();
public AudioClip SwingSound;
public Transform ThrowPoint;
public float footstepTimer;
public float throwTimer;
public float angerTimer;
public float throwCooldown = 5f;
public float angerCooldown = 30f;
public bool canThrow;
public bool isAngry;
public bool isWaiting;
public bool isCursed;
public Coroutine stunCoroutine;
public Coroutine throwCoroutine;
public Coroutine interactingCoroutine;
public Coroutine swingCoroutine;
public override void Start()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).Start();
base.currentBehaviourStateIndex = 0;
((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
if (!LFCUtilities.IsServer)
{
return;
}
for (int i = 0; i < ConfigManager.maxCursedCandy.Value; i++)
{
if (i < ConfigManager.minCursedCandy.Value || Random.Range(1, 101) <= ConfigManager.cursedCandyRarity.Value)
{
LFCObjectsManager.SpawnNewObject(RoundManager.Instance, TrickOrTreat.cursedCandy);
}
}
}
public override void Update()
{
//IL_0043: 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_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
((EnemyAI)this).Update();
PlayFootstepSound();
int currentBehaviourStateIndex = base.currentBehaviourStateIndex;
if ((Object)(object)base.targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 3 || currentBehaviourStateIndex == 2))
{
TurnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position);
((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime);
}
LFCUtilities.UpdateTimer(ref angerTimer, angerCooldown, isAngry, (Action)delegate
{
isAngry = false;
});
LFCUtilities.UpdateTimer(ref throwTimer, throwCooldown, !canThrow, (Action)delegate
{
canThrow = true;
});
}
public void PlayFootstepSound()
{
AnimatorClipInfo[] currentAnimatorClipInfo = base.creatureAnimator.GetCurrentAnimatorClipInfo(0);
if (currentAnimatorClipInfo.Length != 0 && (((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("walk") || ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("run")))
{
footstepTimer -= Time.deltaTime;
if (FootstepSounds.Length != 0 && footstepTimer <= 0f)
{
base.creatureSFX.PlayOneShot(FootstepSounds[Random.Range(0, FootstepSounds.Length)]);
footstepTimer = (((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("walk") ? 0.6f : 0.4f);
}
}
}
public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 1.917f, PlayerControllerB setStunnedByPlayer = null)
{
if (LFCUtilities.IsServer && setToStunned && stunCoroutine == null)
{
((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer);
stunCoroutine = ((MonoBehaviour)this).StartCoroutine(StunCoroutine());
}
}
public IEnumerator StunCoroutine()
{
CancelThrowCoroutine();
CancelInteractingCoroutine();
CancelSwingCoroutine();
base.agent.speed = 0f;
DoAnimationEveryoneRpc("startStun");
yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "stun", 10f, 0);
while (base.stunNormalizedTimer > 0f)
{
yield return null;
}
while (base.postStunInvincibilityTimer > 0f)
{
yield return null;
}
DoAnimationEveryoneRpc("startRun");
if (base.currentBehaviourStateIndex != 1 && (Object)(object)base.stunnedByPlayer != (Object)null)
{
base.targetPlayer = base.stunnedByPlayer;
((EnemyAI)this).StopSearch(base.currentSearch, true);
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
}
stunCoroutine = null;
}
public override void DoAIInterval()
{
((EnemyAI)this).DoAIInterval();
if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead)
{
switch (base.currentBehaviourStateIndex)
{
case 0:
DoWandering();
break;
case 1:
DoChasing();
break;
case 2:
DoThrowing();
break;
case 3:
DoInteracting();
break;
}
}
}
public void DoWandering()
{
base.agent.speed = 3f;
if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false))
{
((EnemyAI)this).StopSearch(base.currentSearch, true);
DoAnimationEveryoneRpc("startRun");
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
}
}
public void DoChasing()
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
if (swingCoroutine != null)
{
return;
}
base.agent.speed = 6f;
if (LFCEnemyManager.TargetOutsideChasedPlayer((EnemyAI)(object)this))
{
return;
}
float num = default(float);
if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false) || (num > 30f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
{
((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null);
DoAnimationEveryoneRpc("startWalk");
((EnemyAI)this).SwitchToBehaviourClientRpc(0);
return;
}
if (HoldingCursedCandy(base.targetPlayer))
{
if (num <= 5f)
{
base.agent.speed = 0f;
DoAnimationEveryoneRpc("startIdle");
((EnemyAI)this).SwitchToBehaviourClientRpc(3);
return;
}
}
else if (!CanHitPlayer(base.targetPlayer) && num <= 15f && (num <= 2f || ((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
{
((EnemyAI)this).SwitchToBehaviourClientRpc(2);
return;
}
((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer);
}
public void DoThrowing()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
if (throwCoroutine != null)
{
return;
}
base.agent.speed = 6f;
float num = Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position);
if (HoldingCursedCandy(base.targetPlayer))
{
if (num <= 5f)
{
DoAnimationEveryoneRpc("startIdle");
((EnemyAI)this).SwitchToBehaviourClientRpc(3);
}
else
{
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
}
}
else if (CanHitPlayer(base.targetPlayer) || num > 20f || (num > 2f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)))
{
((EnemyAI)this).SwitchToBehaviourClientRpc(1);
}
else if (canThrow)
{
canThrow = false;
throwCoroutine = ((MonoBehaviour)this).StartCoroutine(ThrowCoroutine());
}
else
{
((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer);
}
}
public IEnumerator ThrowCoroutine()
{
base.agent.speed = 0f;
DoAnimationEveryoneRpc("startIdle");
yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "idle", 10f, 0);
DoAnimationEveryoneRpc("startThrow");
yield return (object)new WaitForSeconds(0.13f);
PlayThrowEveryoneRpc();
GameObject val = Object.Instantiate<GameObject>(TrickOrTreat.cursedBallObj, ((Component)ThrowPoint).transform.position, Quaternion.identity);
val.GetComponent<NetworkObject>().Spawn(false);
val.GetComponent<CursedBall>().ThrowCursedBallEveryoneRpc(((Component)ThrowPoint).transform.position, ((Component)base.targetPlayer).transform.position + Vector3.up * 1.5f - ((Component)ThrowPoint).transform.position, base.isOutside);
yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "throw", 10f, 0);
DoAnimationEveryoneRpc("startRun");
throwCoroutine = null;
}
public void CancelThrowCoroutine()
{
if (throwCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(throwCoroutine);
throwCoroutine = null;
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void PlayThrowEveryoneRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(24814623u, val2, val, (SendTo)6, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 24814623u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
base.creatureVoice.Play();
}
}
}
public void DoInteracting()
{
base.agent.speed = 0f;
if (interactingCoroutine == null)
{
interactingCoroutine = ((MonoBehaviour)this).StartCoroutine(InteractingCoroutine());
}
}
public IEnumerator InteractingCoroutine()
{
StartInteractingEveryoneRpc((int)base.targetPlayer.playerClientId);
int timePassed = 0;
while (timePassed < ConfigManager.waitingDuration.Value && Vector3.Distance(((Component)this).transform.position, ((Component)base.targetPlayer).transform.position) <= 20f)
{
yield return (object)new WaitForSeconds(1f);
timePassed++;
if (isCursed)
{
break;
}
}
CancelInteractingCoroutine();
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void StartInteractingEveryoneRpc(int playerId)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1570185894u, val2, val, (SendTo)6, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val3, playerId);
((NetworkBehaviour)this).__endSendRpc(ref val3, 1570185894u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
isWaiting = true;
base.enemyType.canBeStunned = false;
if (LFCUtilities.ShouldBeLocalPlayer(StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>()))
{
HUDManager.Instance.AddChatMessage("Trick or treat?", "Hollow Girl", -1, false);
}
}
}
public void CancelInteractingCoroutine()
{
if (interactingCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(interactingCoroutine);
interactingCoroutine = null;
EndInteractingEveryoneRpc();
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void EndInteractingEveryoneRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(45174539u, val2, val, (SendTo)6, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 45174539u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
base.creatureAnimator.SetTrigger("startRun");
((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(1);
isAngry = true;
isWaiting = false;
base.enemyType.canBeStunned = true;
}
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void ApplyCurseEveryoneRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2638001245u, val2, val, (SendTo)6, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendRpc(ref val3, 2638001245u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
isCursed = true;
CustomPassManager.SetupAuraForObjects((GameObject[])(object)new GameObject[1] { ((Component)this).gameObject }, CursedScraps.cursedShader, "Trick Or Treat" + ((Object)CursedScraps.cursedShader).name, default(Color));
}
}
}
public override void OnCollideWithPlayer(Collider other)
{
((EnemyAI)this).OnCollideWithPlayer(other);
if (base.currentBehaviourStateIndex == 1 && swingCoroutine == null)
{
PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false);
if (LFCUtilities.ShouldBeLocalPlayer(val) && CanHitPlayer(val))
{
SwingEveryoneRpc((int)val.playerClientId);
}
}
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void SwingEveryoneRpc(int playerId)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3131240733u, val2, val, (SendTo)6, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val3, playerId);
((NetworkBehaviour)this).__endSendRpc(ref val3, 3131240733u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (swingCoroutine == null)
{
swingCoroutine = ((MonoBehaviour)this).StartCoroutine(SwingCoroutine(StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>()));
}
}
}
public IEnumerator SwingCoroutine(PlayerControllerB player)
{
base.agent.speed = 0f;
base.creatureAnimator.SetTrigger("startSwing");
base.creatureSFX.PlayOneShot(SwingSound);
player.DamagePlayer(ConfigManager.damage.Value, true, true, (CauseOfDeath)8, 0, false, default(Vector3));
yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "swing", 10f, 0);
base.creatureAnimator.SetTrigger("startRun");
base.agent.speed = 6f;
swingCoroutine = null;
}
public void CancelSwingCoroutine()
{
if (swingCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(swingCoroutine);
swingCoroutine = null;
}
}
public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1)
{
if (!base.isEnemyDead && CanHitPlayer(playerWhoHit))
{
((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID);
base.enemyHP -= force;
if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner)
{
((EnemyAI)this).KillEnemyOnOwnerClient(false);
}
}
}
public bool CanHitPlayer(PlayerControllerB player)
{
if (!isCursed)
{
if ((Object)(object)player != (Object)null)
{
return CSCurseRegistry.HasCurse(((Component)player).gameObject);
}
return false;
}
return true;
}
public bool HoldingCursedCandy(PlayerControllerB player)
{
if (!isCursed && !isAngry && (Object)(object)player.currentlyHeldObjectServer != (Object)null)
{
return player.currentlyHeldObjectServer is CursedCandy;
}
return false;
}
[Rpc(/*Could not decode attribute arguments.*/)]
public void DoAnimationEveryoneRpc(string animationState)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Invalid comparison between Unknown and I4
//IL_0043: 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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1)
{
RpcAttributeParams val = new RpcAttributeParams
{
RequireOwnership = false
};
RpcParams val2 = default(RpcParams);
FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1319403598u, val2, val, (SendTo)6, (RpcDelivery)0);
bool flag = animationState != null;
((FastBufferWriter)(ref val3)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
if (flag)
{
((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false);
}
((NetworkBehaviour)this).__endSendRpc(ref val3, 1319403598u, val2, val, (SendTo)6, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1)
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
base.creatureAnimator.SetTrigger(animationState);
}
}
protected override void __initializeVariables()
{
((EnemyAI)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Expected O, but got Unknown
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(24814623u, new RpcReceiveHandler(__rpc_handler_24814623), "PlayThrowEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(1570185894u, new RpcReceiveHandler(__rpc_handler_1570185894), "StartInteractingEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(45174539u, new RpcReceiveHandler(__rpc_handler_45174539), "EndInteractingEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(2638001245u, new RpcReceiveHandler(__rpc_handler_2638001245), "ApplyCurseEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(3131240733u, new RpcReceiveHandler(__rpc_handler_3131240733), "SwingEveryoneRpc");
((NetworkBehaviour)this).__registerRpc(1319403598u, new RpcReceiveHandler(__rpc_handler_1319403598), "DoAnimationEveryoneRpc");
((EnemyAI)this).__initializeRpcs();
}
private static void __rpc_handler_24814623(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((HollowGirl)(object)target).PlayThrowEveryoneRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1570185894(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((HollowGirl)(object)target).StartInteractingEveryoneRpc(playerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_45174539(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((HollowGirl)(object)target).EndInteractingEveryoneRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2638001245(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((HollowGirl)(object)target).ApplyCurseEveryoneRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3131240733(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int playerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((HollowGirl)(object)target).SwingEveryoneRpc(playerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1319403598(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool flag = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
string animationState = null;
if (flag)
{
((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false);
}
target.__rpc_exec_stage = (__RpcExecStage)1;
((HollowGirl)(object)target).DoAnimationEveryoneRpc(animationState);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "HollowGirl";
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace __GEN
{
internal class NetworkVariableSerializationHelper
{
[RuntimeInitializeOnLoadMethod]
internal static void InitializeSerialization()
{
}
}
}
namespace TrickOrTreat.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}