using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Dawn;
using GameNetcodeStuff;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using com.github.zehsteam.TakeyPlush.MonoBehaviours;
using com.github.zehsteam.ZombiesPlush.Data;
using com.github.zehsteam.ZombiesPlush.Dependencies;
using com.github.zehsteam.ZombiesPlush.Enums;
using com.github.zehsteam.ZombiesPlush.Extensions;
using com.github.zehsteam.ZombiesPlush.Helpers;
using com.github.zehsteam.ZombiesPlush.Managers;
using com.github.zehsteam.ZombiesPlush.MonoBehaviours;
using com.github.zehsteam.ZombiesPlush.NetcodePatcher;
using com.github.zehsteam.ZombiesPlush.Patches;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Zehs")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © 2026 Zehs")]
[assembly: AssemblyDescription("Adds 1 scrap and 1 enemy skin. The Smol Zombies plushie has over 11 variants with each one having a unique appearence and voice lines. Some variants have special interactions and behaviours.")]
[assembly: AssemblyFileVersion("1.3.0.0")]
[assembly: AssemblyInformationalVersion("1.3.0+5ed1f3050a52d18174cd71a7752210e61735dcc0")]
[assembly: AssemblyProduct("ZombiesPlush")]
[assembly: AssemblyTitle("com.github.zehsteam.ZombiesPlush")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.3.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
[CompilerGenerated]
internal sealed class <>z__ReadOnlySingleElementList<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator<T>
{
object IEnumerator.Current => _item;
T IEnumerator<T>.Current => _item;
public Enumerator(T item)
{
_item = item;
}
bool IEnumerator.MoveNext()
{
if (!_moveNextCalled)
{
return _moveNextCalled = true;
}
return false;
}
void IEnumerator.Reset()
{
_moveNextCalled = false;
}
void IDisposable.Dispose()
{
}
}
int ICollection.Count => 1;
bool ICollection.IsSynchronized => false;
object ICollection.SyncRoot => this;
object IList.this[int index]
{
get
{
if (index != 0)
{
throw new IndexOutOfRangeException();
}
return _item;
}
set
{
throw new NotSupportedException();
}
}
bool IList.IsFixedSize => true;
bool IList.IsReadOnly => true;
int IReadOnlyCollection<T>.Count => 1;
T IReadOnlyList<T>.this[int index]
{
get
{
if (index != 0)
{
throw new IndexOutOfRangeException();
}
return _item;
}
}
int ICollection<T>.Count => 1;
bool ICollection<T>.IsReadOnly => true;
T IList<T>.this[int index]
{
get
{
if (index != 0)
{
throw new IndexOutOfRangeException();
}
return _item;
}
set
{
throw new NotSupportedException();
}
}
public <>z__ReadOnlySingleElementList(T item)
{
_item = item;
}
IEnumerator IEnumerable.GetEnumerator()
{
return new Enumerator(_item);
}
void ICollection.CopyTo(Array array, int index)
{
array.SetValue(_item, index);
}
int IList.Add(object value)
{
throw new NotSupportedException();
}
void IList.Clear()
{
throw new NotSupportedException();
}
bool IList.Contains(object value)
{
return EqualityComparer<T>.Default.Equals(_item, (T)value);
}
int IList.IndexOf(object value)
{
if (!EqualityComparer<T>.Default.Equals(_item, (T)value))
{
return -1;
}
return 0;
}
void IList.Insert(int index, object value)
{
throw new NotSupportedException();
}
void IList.Remove(object value)
{
throw new NotSupportedException();
}
void IList.RemoveAt(int index)
{
throw new NotSupportedException();
}
IEnumerator<T> IEnumerable<T>.GetEnumerator()
{
return new Enumerator(_item);
}
void ICollection<T>.Add(T item)
{
throw new NotSupportedException();
}
void ICollection<T>.Clear()
{
throw new NotSupportedException();
}
bool ICollection<T>.Contains(T item)
{
return EqualityComparer<T>.Default.Equals(_item, item);
}
void ICollection<T>.CopyTo(T[] array, int arrayIndex)
{
array[arrayIndex] = _item;
}
bool ICollection<T>.Remove(T item)
{
throw new NotSupportedException();
}
int IList<T>.IndexOf(T item)
{
if (!EqualityComparer<T>.Default.Equals(_item, item))
{
return -1;
}
return 0;
}
void IList<T>.Insert(int index, T item)
{
throw new NotSupportedException();
}
void IList<T>.RemoveAt(int index)
{
throw new NotSupportedException();
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace com.github.zehsteam.ZombiesPlush
{
public static class Api
{
public static bool ForceMaskedZombiesSpawns
{
get
{
return MaskedPlayerEnemy_Patches.ForceMaskedZombiesSpawns;
}
set
{
MaskedPlayerEnemy_Patches.ForceMaskedZombiesSpawns = value;
}
}
[Obsolete("forceMaskedZombiesSpawns is deprecated, please use ForceMaskedZombiesSpawns instead.", true)]
public static bool forceMaskedZombiesSpawns
{
get
{
return MaskedPlayerEnemy_Patches.ForceMaskedZombiesSpawns;
}
set
{
MaskedPlayerEnemy_Patches.ForceMaskedZombiesSpawns = value;
}
}
public static bool SetMaskedZombiesOnServer(MaskedPlayerEnemy maskedPlayerEnemy)
{
return MaskedPlayerEnemy_Patches.SetMaskedZombies_Server(maskedPlayerEnemy);
}
}
internal static class Assets
{
public static readonly string AssetBundleFileName = "zombiesplush_assets";
public static AssetBundle AssetBundle { get; private set; }
public static bool IsLoaded { get; private set; }
public static GameObject NetworkHandlerPrefab { get; private set; }
public static GameObject MaskedZombiesControllerPrefab { get; private set; }
public static Item SmolZombies { get; private set; }
public static Item Poop { get; private set; }
public static Item GoldenPoop { get; private set; }
public static void Load()
{
string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string text = Path.Combine(directoryName, AssetBundleFileName);
if (!File.Exists(text))
{
Logger.LogFatal("Failed to load assets. AssetBundle file could not be found at path \"" + text + "\". Make sure the \"" + AssetBundleFileName + "\" file is in the same folder as the mod's DLL file.");
}
else
{
AssetBundle = AssetBundle.LoadFromFile(text);
if ((Object)(object)AssetBundle == (Object)null)
{
Logger.LogFatal("Failed to load assets. AssetBundle is null.");
return;
}
OnAssetBundleLoaded(AssetBundle);
IsLoaded = true;
}
}
private static void OnAssetBundleLoaded(AssetBundle assetBundle)
{
NetworkHandlerPrefab = LoadAsset<GameObject>("NetworkHandler", assetBundle);
NetworkHandlerPrefab.AddComponent<PluginNetworkBehaviour>();
MaskedZombiesControllerPrefab = LoadAsset<GameObject>("MaskedZombiesController", assetBundle);
SmolZombies = LoadAsset<Item>("SmolZombies", assetBundle);
Poop = LoadAsset<Item>("Poop", assetBundle);
GoldenPoop = LoadAsset<Item>("GoldenPoop", assetBundle);
}
private static T LoadAsset<T>(string name, AssetBundle assetBundle) where T : Object
{
if (string.IsNullOrWhiteSpace(name))
{
Logger.LogError("Failed to load asset of type \"" + typeof(T).Name + "\" from AssetBundle. Name is null or whitespace.");
return default(T);
}
if ((Object)(object)assetBundle == (Object)null)
{
Logger.LogError("Failed to load asset of type \"" + typeof(T).Name + "\" with name \"" + name + "\" from AssetBundle. AssetBundle is null.");
return default(T);
}
T val = assetBundle.LoadAsset<T>(name);
if ((Object)(object)val == (Object)null)
{
Logger.LogError("Failed to load asset of type \"" + typeof(T).Name + "\" with name \"" + name + "\" from AssetBundle. No asset found with that type and name.");
return default(T);
}
return val;
}
private static bool TryLoadAsset<T>(string name, AssetBundle assetBundle, out T asset) where T : Object
{
asset = LoadAsset<T>(name, assetBundle);
return (Object)(object)asset != (Object)null;
}
}
internal static class Logger
{
public static ManualLogSource ManualLogSource { get; private set; }
public static bool IsExtendedLoggingEnabled => ConfigManager.Misc_ExtendedLogging?.Value ?? false;
public static void Initialize(ManualLogSource manualLogSource)
{
ManualLogSource = manualLogSource;
}
public static void LogDebug(object data)
{
Log((LogLevel)32, data);
}
public static void LogInfo(object data, bool extended = false)
{
Log((LogLevel)16, data, extended);
}
public static void LogMessage(object data, bool extended = false)
{
Log((LogLevel)8, data, extended);
}
public static void LogWarning(object data, bool extended = false)
{
Log((LogLevel)4, data, extended);
}
public static void LogError(object data, bool extended = false)
{
Log((LogLevel)2, data, extended);
}
public static void LogFatal(object data, bool extended = false)
{
Log((LogLevel)1, data, extended);
}
public static void Log(LogLevel logLevel, object data, bool extended = false)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
if (!extended || IsExtendedLoggingEnabled)
{
ManualLogSource manualLogSource = ManualLogSource;
if (manualLogSource != null)
{
manualLogSource.Log(logLevel, data);
}
}
}
}
[BepInPlugin("com.github.zehsteam.ZombiesPlush", "ZombiesPlush", "1.3.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal class Plugin : BaseUnityPlugin
{
private readonly Harmony _harmony = new Harmony("com.github.zehsteam.ZombiesPlush");
internal static Plugin Instance { get; private set; }
private void Awake()
{
Instance = this;
Logger.Initialize(Logger.CreateLogSource("com.github.zehsteam.ZombiesPlush"));
Logger.LogInfo("ZombiesPlush has awoken!");
_harmony.PatchAll(typeof(StartOfRound_Patches));
_harmony.PatchAll(typeof(PlayerControllerB_Patches));
_harmony.PatchAll(typeof(MaskedPlayerEnemy_Patches));
_harmony.PatchAll(typeof(NoisemakerProp_Patches));
_harmony.PatchAll(typeof(GiftBoxItem_Patches));
ConfigManager.Initialize(((BaseUnityPlugin)this).Config);
Assets.Load();
RegisterNetworkPrefabs();
RegisterItems();
NetworkUtils.NetcodePatcherAwake();
}
private void RegisterNetworkPrefabs()
{
DawnLib.RegisterNetworkPrefab(Assets.NetworkHandlerPrefab);
DawnLib.RegisterNetworkPrefab(Assets.MaskedZombiesControllerPrefab);
DawnLib.FixMixerGroups(Assets.MaskedZombiesControllerPrefab);
}
private void RegisterItems()
{
ItemHelper.RegisterScrap(ZombiesPlushKeys.SmolZombies, Assets.SmolZombies, ConfigManager.SmolZombies_SpawnWeight.Value);
ItemHelper.RegisterScrap(ZombiesPlushKeys.Poop, Assets.Poop, 0);
ItemHelper.RegisterScrap(ZombiesPlushKeys.GoldenPoop, Assets.GoldenPoop, 0);
}
}
public static class ZombiesPlushKeys
{
public static readonly NamespacedKey<DawnItemInfo> SmolZombies = NamespacedKey<DawnItemInfo>.From("zombies_plush", "smol_zombies");
public static readonly NamespacedKey<DawnItemInfo> Poop = NamespacedKey<DawnItemInfo>.From("zombies_plush", "poop");
public static readonly NamespacedKey<DawnItemInfo> GoldenPoop = NamespacedKey<DawnItemInfo>.From("zombies_plush", "golden_poop");
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "com.github.zehsteam.ZombiesPlush";
public const string PLUGIN_NAME = "ZombiesPlush";
public const string PLUGIN_VERSION = "1.3.0";
}
}
namespace com.github.zehsteam.ZombiesPlush.Patches
{
[HarmonyPatch(typeof(GiftBoxItem))]
internal static class GiftBoxItem_Patches
{
[HarmonyPatch("ItemActivate")]
[HarmonyPrefix]
private static void ItemActivate_Patch(GiftBoxItem __instance)
{
if (!PlayerUtils.IsLocalPlayer(((GrabbableObject)__instance).playerHeldBy))
{
return;
}
foreach (ZombiesBehaviour item in PlayerUtils.GetSmolZombiesInLocalPlayerInventory())
{
item.SetSpecialVariantServerRpc(ZombiesVariantType.Christmas);
}
}
}
[HarmonyPatch(typeof(MaskedPlayerEnemy))]
internal static class MaskedPlayerEnemy_Patches
{
public static bool ForceMaskedZombiesSpawns = false;
public static Dictionary<MaskedPlayerEnemy, MaskedZombiesBehaviour> MaskedZombiesPairs { get; private set; } = new Dictionary<MaskedPlayerEnemy, MaskedZombiesBehaviour>();
public static void OnShipHasLeft()
{
if (!NetworkUtils.IsServer)
{
return;
}
int num = 0;
NetworkObject val = default(NetworkObject);
foreach (MaskedZombiesBehaviour value in MaskedZombiesPairs.Values)
{
if (!((Object)(object)value == (Object)null) && ((NetworkBehaviour)value).IsSpawned && ((Component)value).TryGetComponent<NetworkObject>(ref val))
{
val.Despawn(true);
num++;
Logger.LogInfo("Despawned MaskedZombiesController.", extended: true);
}
}
Logger.LogInfo($"Finished despawning {num}/{MaskedZombiesPairs.Count} MaskedZombiesController(s)", extended: true);
MaskedZombiesPairs.Clear();
ForceMaskedZombiesSpawns = false;
}
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void Start_Patch(MaskedPlayerEnemy __instance)
{
if (NetworkUtils.IsServer && (Utils.RollPercentChance(ConfigManager.MaskedZombies_SpawnChance.Value) || ForceMaskedZombiesSpawns))
{
SetMaskedZombies_Server(__instance);
}
}
public static bool SetMaskedZombies_Server(MaskedPlayerEnemy maskedPlayerEnemy)
{
if (!NetworkUtils.IsServer)
{
return false;
}
if (MaskedZombiesPairs.ContainsKey(maskedPlayerEnemy))
{
Logger.LogError("Failed to set masked zombies on server. MaskedPlayerEnemy is already a masked zombies.");
return false;
}
try
{
GameObject val = Object.Instantiate<GameObject>(Assets.MaskedZombiesControllerPrefab, ((Component)maskedPlayerEnemy).transform);
val.GetComponent<NetworkObject>().Spawn(false);
val.transform.SetParent(((Component)maskedPlayerEnemy).transform);
MaskedZombiesPairs.Add(maskedPlayerEnemy, val.GetComponent<MaskedZombiesBehaviour>());
Logger.LogInfo("Spawned masked zombies.", extended: true);
return true;
}
catch (Exception arg)
{
Logger.LogError($"Failed to set masked zombies on server. {arg}");
}
return false;
}
[HarmonyPatch("KillPlayerAnimationClientRpc")]
[HarmonyPostfix]
private static void KillPlayerAnimationClientRpc_Patch(MaskedPlayerEnemy __instance)
{
if (NetworkUtils.IsExecutingRPCMethod((NetworkBehaviour)(object)__instance) && __instance.inKillAnimation && ((EnemyAI)__instance).inSpecialAnimation && !((Object)(object)((EnemyAI)__instance).inSpecialAnimationWithPlayer == (Object)null) && !((EnemyAI)__instance).inSpecialAnimationWithPlayer.isPlayerDead)
{
SetZombiesHead_Server(__instance, ZombiesVariantType.Heart);
}
}
[HarmonyPatch("FinishKillAnimation")]
[HarmonyPrefix]
private static void FinishKillAnimation_Patch(MaskedPlayerEnemy __instance, bool killedPlayer)
{
SetZombiesHead_Server(__instance, ZombiesVariantType.Angry);
}
private static void SetZombiesHead_Server(MaskedPlayerEnemy maskedPlayerEnemy, ZombiesVariantType state)
{
if (NetworkUtils.IsServer && MaskedZombiesPairs.TryGetValue(maskedPlayerEnemy, out var value))
{
value.SetZombiesHead_ServerRpc(state);
}
}
}
[HarmonyPatch(typeof(NoisemakerProp))]
internal static class NoisemakerProp_Patches
{
[HarmonyPatch("ItemActivate")]
[HarmonyPostfix]
private static void ItemActivate_Patch(NoisemakerProp __instance)
{
if (PlayerUtils.IsLocalPlayer(((GrabbableObject)__instance).playerHeldBy) && !((Object)(object)((GrabbableObject)__instance).itemProperties == (Object)null))
{
string itemName = ((GrabbableObject)__instance).itemProperties.itemName;
if (itemName.Equals("Clown horn", StringComparison.OrdinalIgnoreCase))
{
ItemActivate_ClownHorn(__instance);
}
else if (itemName.Equals("Hairdryer", StringComparison.OrdinalIgnoreCase))
{
ItemActivate_Hairdryer(__instance);
}
}
}
private static void ItemActivate_ClownHorn(NoisemakerProp noisemakerProp)
{
foreach (ZombiesBehaviour item in PlayerUtils.GetSmolZombiesInLocalPlayerInventory())
{
item.SetSpecialVariantServerRpc(ZombiesVariantType.Clown);
}
}
private static void ItemActivate_Hairdryer(NoisemakerProp noisemakerProp)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB localPlayerScript = PlayerUtils.LocalPlayerScript;
if ((Object)(object)localPlayerScript == (Object)null)
{
return;
}
Transform transform = ((Component)localPlayerScript.gameplayCamera).transform;
RaycastHit[] array = Physics.RaycastAll(transform.position, transform.forward, 2.5f, LayerMask.GetMask(new string[1] { "Props" }));
RaycastHit[] array2 = array;
ZombiesBehaviour zombiesBehaviour = default(ZombiesBehaviour);
for (int i = 0; i < array2.Length; i++)
{
RaycastHit val = array2[i];
if (((Component)((RaycastHit)(ref val)).collider).TryGetComponent<ZombiesBehaviour>(ref zombiesBehaviour))
{
zombiesBehaviour.SetSpecialVariantServerRpc(ZombiesVariantType.Sunburnt);
}
}
}
}
[HarmonyPatch(typeof(PlayerControllerB))]
internal static class PlayerControllerB_Patches
{
[CompilerGenerated]
private sealed class <DamagePlayerNextFrameCoroutine>d__3 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB playerScript;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DamagePlayerNextFrameCoroutine>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if (playerScript.isPlayerDead)
{
return false;
}
foreach (ZombiesBehaviour item in PlayerUtils.GetSmolZombiesInLocalPlayerInventory())
{
item.OnLocalPlayerHoldingPlushieTookDamage();
}
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private static float _drunkCheckCooldown = 1f;
private static float _drunkCheckTimer;
[HarmonyPatch("DamagePlayer")]
[HarmonyPrefix]
private static void DamagePlayer_Patch(PlayerControllerB __instance, int damageNumber)
{
if (PlayerUtils.IsLocalPlayer(__instance) && !__instance.isPlayerDead && damageNumber > 0)
{
CoroutineRunner.Start(DamagePlayerNextFrameCoroutine(__instance));
}
}
[IteratorStateMachine(typeof(<DamagePlayerNextFrameCoroutine>d__3))]
private static IEnumerator DamagePlayerNextFrameCoroutine(PlayerControllerB playerScript)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DamagePlayerNextFrameCoroutine>d__3(0)
{
playerScript = playerScript
};
}
[HarmonyPatch("Update")]
[HarmonyPrefix]
private static void Update_Patch(PlayerControllerB __instance)
{
if (!PlayerUtils.IsLocalPlayer(__instance) || __instance.isPlayerDead)
{
return;
}
if (__instance.drunkness > 0f)
{
if (_drunkCheckTimer >= _drunkCheckCooldown)
{
_drunkCheckTimer = 0f;
{
foreach (ZombiesBehaviour item in PlayerUtils.GetSmolZombiesInLocalPlayerInventory())
{
if (NetworkUtils.IsServer)
{
item.SetDrunkOnServer();
}
else
{
item.SetDrunkServerRpc();
}
}
return;
}
}
_drunkCheckTimer += Time.deltaTime;
}
else
{
_drunkCheckTimer = 0f;
}
}
[HarmonyPatch("PerformEmote")]
[HarmonyPostfix]
private static void PerformEmote_Patch(PlayerControllerB __instance, int emoteID)
{
if (!PlayerUtils.IsLocalPlayer(__instance) || __instance.isPlayerDead || !__instance.performingEmote || emoteID != 1 || !UnlockableHelper.HasActiveDiscoBall())
{
return;
}
foreach (ZombiesBehaviour item in PlayerUtils.GetSmolZombiesInLocalPlayerInventory())
{
item.SetSpecialVariantServerRpc(ZombiesVariantType.Party);
}
}
[HarmonyPatch("KillPlayer")]
[HarmonyPrefix]
private static void KillPlayer_Patch(PlayerControllerB __instance)
{
if (!PlayerUtils.IsLocalPlayer(__instance) || __instance.isPlayerDead || !__instance.AllowPlayerDeath())
{
return;
}
ZombiesVariantType specialVariantServerRpc = (PlayerDiedToShotgunFromPlayer() ? ZombiesVariantType.Panda : ZombiesVariantType.Dead);
foreach (ZombiesBehaviour item in PlayerUtils.GetSmolZombiesInLocalPlayerInventory())
{
item.SetSpecialVariantServerRpc(specialVariantServerRpc);
}
}
private static bool PlayerDiedToShotgunFromPlayer()
{
StackTrace stackTrace = new StackTrace();
StackFrame[] frames = stackTrace.GetFrames();
foreach (StackFrame stackFrame in frames)
{
MethodBase method = stackFrame.GetMethod();
if (!(method.DeclaringType == null) && method.DeclaringType.Name == "ShotgunItem" && method.Name == "ShootGunClientRpc")
{
return true;
}
}
return false;
}
}
[HarmonyPatch(typeof(StartOfRound))]
internal static class StartOfRound_Patches
{
[HarmonyPatch("Awake")]
[HarmonyPostfix]
private static void Awake_Patch()
{
SpawnNetworkHandler();
}
private static void SpawnNetworkHandler()
{
if (NetworkUtils.IsServer)
{
GameObject val = Object.Instantiate<GameObject>(Assets.NetworkHandlerPrefab);
val.GetComponent<NetworkObject>().Spawn(false);
}
}
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void Start_Patch()
{
ItemHelper.OnLobbyLoaded();
}
[HarmonyPatch("ShipHasLeft")]
[HarmonyPostfix]
private static void ShipHasLeft_Patch()
{
MaskedPlayerEnemy_Patches.OnShipHasLeft();
}
}
}
namespace com.github.zehsteam.ZombiesPlush.MonoBehaviours
{
public abstract class AdvancedGrabbableObject : GrabbableObject
{
public int UniqueId { get; private set; }
public string SaveKey => string.Format("{0}_{1}", "AdvancedGrabbableObject", UniqueId);
public virtual void Awake()
{
if (NetworkUtils.IsServer)
{
UniqueId = Random.Range(0, 1000000);
}
}
public override void OnNetworkSpawn()
{
((NetworkBehaviour)this).OnNetworkSpawn();
if (NetworkUtils.IsServer)
{
NetworkManager.Singleton.OnClientConnectedCallback += OnClientConnected;
}
}
public override void OnNetworkDespawn()
{
((NetworkBehaviour)this).OnNetworkDespawn();
if (NetworkUtils.IsServer)
{
NetworkManager.Singleton.OnClientConnectedCallback -= OnClientConnected;
}
}
protected virtual void OnClientConnected(ulong clientId)
{
}
public override int GetItemDataToSave()
{
return UniqueId;
}
public override void LoadItemSaveData(int saveData)
{
((GrabbableObject)this).LoadItemSaveData(saveData);
UniqueId = saveData;
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
((GrabbableObject)this).__initializeRpcs();
}
protected internal override string __getTypeName()
{
return "AdvancedGrabbableObject";
}
}
public class AdvancedNoisemakerProp : AdvancedGrabbableObject
{
[Space(20f)]
[Header("Advanced Noisemaker Prop")]
[Space(5f)]
public AudioSourceGroup NoiseAudio;
public AudioClipGroupWithWeight[] NoiseSFX = Array.Empty<AudioClipGroupWithWeight>();
[Space(10f)]
public float NoiseRange = 65f;
public float MaxLoudness = 1f;
public float MinLoudness = 0.95f;
public float MinPitch = 1f;
public float MaxPitch = 1f;
[Space(10f)]
public bool UseDynamicCooldown;
public bool CancelActiveSFXOnItemActivate;
public override void ItemActivate(bool used, bool buttonDown = true)
{
if (NoiseSFX.Length != 0)
{
int randomIndexFromWeightList = Utils.GetRandomIndexFromWeightList(NoiseSFX.Select((AudioClipGroupWithWeight x) => x.Weight).ToList());
PlaySound(randomIndexFromWeightList);
}
}
public void PlaySound(int index)
{
//IL_000e: 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)
if (NoiseSFX.Length != 0)
{
PlaySoundServerRpc(index);
PlaySoundOnLocalClient(index);
}
}
[ServerRpc(RequireOwnership = false)]
protected void PlaySoundServerRpc(int index, ServerRpcParams serverRpcParams = default(ServerRpcParams))
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(1446525904u, serverRpcParams, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val, index);
((NetworkBehaviour)this).__endSendServerRpc(ref val, 1446525904u, serverRpcParams, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ulong senderClientId = serverRpcParams.Receive.SenderClientId;
if (((NetworkBehaviour)this).NetworkManager.ConnectedClients.ContainsKey(senderClientId))
{
PlaySoundClientRpc(index, senderClientId);
}
}
}
[ClientRpc]
protected void PlaySoundClientRpc(int index, ulong senderClientId)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: 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 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4191135864u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, index);
BytePacker.WriteValueBitPacked(val2, senderClientId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4191135864u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if (!NetworkUtils.IsLocalClientId(senderClientId))
{
PlaySoundOnLocalClient(index);
}
}
}
public void PlaySoundOnLocalClient(int index)
{
AudioClipGroup audioClipGroup = ((index >= 0 && index < NoiseSFX.Length) ? NoiseSFX[index] : null);
PlaySoundOnLocalClient(audioClipGroup);
OnPlaySoundFromIndex(index);
}
protected virtual void OnPlaySoundFromIndex(int index)
{
}
public float PlaySoundOnLocalClient(AudioClip audioClip, AudioClip audioClipFar, bool stopPreviousSFX = false)
{
return PlaySoundOnLocalClient(new AudioClipGroup(audioClip, audioClipFar), stopPreviousSFX);
}
public float PlaySoundOnLocalClient(AudioClipGroup audioClipGroup, bool stopPreviousSFX = false)
{
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
if (audioClipGroup == null || (Object)(object)audioClipGroup.AudioClip == (Object)null)
{
return 0f;
}
float num = (float)Random.Range((int)(MinLoudness * 100f), (int)(MaxLoudness * 100f)) / 100f;
float pitch = (float)Random.Range((int)(MinPitch * 100f), (int)(MaxPitch * 100f)) / 100f;
if (CancelActiveSFXOnItemActivate || stopPreviousSFX)
{
NoiseAudio.Stop();
}
if (UseDynamicCooldown && !CancelActiveSFXOnItemActivate)
{
((GrabbableObject)this).currentUseCooldown = audioClipGroup.Length;
}
NoiseAudio.Pitch = pitch;
NoiseAudio.PlayOneShot(audioClipGroup, num);
WalkieTalkie.TransmitOneShotAudio(NoiseAudio.AudioSource, audioClipGroup.AudioClip, num);
RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, NoiseRange, num, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
if (MinLoudness >= 0.6f && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
{
((GrabbableObject)this).playerHeldBy.timeSinceMakingLoudNoise = 0f;
}
return audioClipGroup.Length;
}
protected override void __initializeVariables()
{
base.__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
((NetworkBehaviour)this).__registerRpc(1446525904u, new RpcReceiveHandler(__rpc_handler_1446525904), "PlaySoundServerRpc");
((NetworkBehaviour)this).__registerRpc(4191135864u, new RpcReceiveHandler(__rpc_handler_4191135864), "PlaySoundClientRpc");
base.__initializeRpcs();
}
private static void __rpc_handler_1446525904(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: 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_0040: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int index = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref index);
ServerRpcParams server = rpcParams.Server;
target.__rpc_exec_stage = (__RpcExecStage)1;
((AdvancedNoisemakerProp)(object)target).PlaySoundServerRpc(index, server);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4191135864(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: 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)
{
int index = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref index);
ulong senderClientId = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref senderClientId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((AdvancedNoisemakerProp)(object)target).PlaySoundClientRpc(index, senderClientId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "AdvancedNoisemakerProp";
}
}
internal class CoroutineRunner : MonoBehaviour
{
public static CoroutineRunner Instance { get; private set; }
public static CoroutineRunner Spawn()
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
if ((Object)(object)Instance != (Object)null)
{
return Instance;
}
GameObject val = new GameObject("ZombiesPlush CoroutineRunner", new Type[1] { typeof(CoroutineRunner) })
{
hideFlags = (HideFlags)61
};
Object.DontDestroyOnLoad((Object)(object)val);
return val.GetComponent<CoroutineRunner>();
}
private void Awake()
{
if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
else
{
Instance = this;
}
}
public static Coroutine Start(IEnumerator routine)
{
if ((Object)(object)Instance == (Object)null)
{
CoroutineRunner coroutineRunner = Spawn();
return ((coroutineRunner != null) ? ((MonoBehaviour)coroutineRunner).StartCoroutine(routine) : null) ?? null;
}
CoroutineRunner instance = Instance;
return ((instance != null) ? ((MonoBehaviour)instance).StartCoroutine(routine) : null) ?? null;
}
public static void Stop(IEnumerator routine)
{
CoroutineRunner instance = Instance;
if (instance != null)
{
((MonoBehaviour)instance).StopCoroutine(routine);
}
}
public static void Stop(Coroutine routine)
{
CoroutineRunner instance = Instance;
if (instance != null)
{
((MonoBehaviour)instance).StopCoroutine(routine);
}
}
}
public class EnemyRandomPeriodicAudioPlayer : NetworkBehaviour
{
public bool OnlyPlayWhenEnemyIsAlive = true;
public AudioClip[] RandomClips = Array.Empty<AudioClip>();
public AudioSource ThisAudio;
public float AudioMinInterval = 6f;
public float AudioMaxInterval = 16f;
public float AudioChancePercent = 40f;
private EnemyAI _enemyAI;
private float _timer;
private float _interval;
private void Start()
{
_enemyAI = ((Component)((Component)this).transform.parent).GetComponent<EnemyAI>();
}
private void Update()
{
if (!NetworkUtils.IsServer || (OnlyPlayWhenEnemyIsAlive && (Object)(object)_enemyAI == (Object)null) || (OnlyPlayWhenEnemyIsAlive && _enemyAI.isEnemyDead))
{
return;
}
if (_timer >= _interval)
{
if (Utils.RollPercentChance(AudioChancePercent))
{
PlayRandomAudioClientRpc(Random.Range(0, RandomClips.Length));
}
_timer = 0f;
_interval = Random.Range(AudioChancePercent, AudioMaxInterval);
}
else
{
_timer += Time.deltaTime;
}
}
[ClientRpc]
public void PlayRandomAudioClientRpc(int clipIndex)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3922081718u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, clipIndex);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3922081718u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
PlayAudio(clipIndex);
}
}
}
private void PlayAudio(int clipIndex)
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)ThisAudio == (Object)null))
{
AudioClip val = RandomClips[clipIndex];
ThisAudio.PlayOneShot(val, 1f);
WalkieTalkie.TransmitOneShotAudio(ThisAudio, val, 1f);
RoundManager.Instance.PlayAudibleNoise(((Component)ThisAudio).transform.position, 7f, 0.6f, 0, false, 0);
}
}
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
((NetworkBehaviour)this).__registerRpc(3922081718u, new RpcReceiveHandler(__rpc_handler_3922081718), "PlayRandomAudioClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_3922081718(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 clipIndex = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref clipIndex);
target.__rpc_exec_stage = (__RpcExecStage)1;
((EnemyRandomPeriodicAudioPlayer)(object)target).PlayRandomAudioClientRpc(clipIndex);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "EnemyRandomPeriodicAudioPlayer";
}
}
public class MaskedZombiesBehaviour : NetworkBehaviour
{
public GameObject AngryHeadPrefab;
public GameObject HeartHeadPrefab;
public AudioClip ElloSFX;
public Material SuitMaterial;
private MaskedPlayerEnemy _maskedPlayerEnemy;
private GameObject _angryHeadObject;
private GameObject _heartHeadObject;
private AudioSource _voiceAudio;
public ZombiesVariantType State { get; private set; }
private void Start()
{
_maskedPlayerEnemy = ((Component)((Component)this).transform.parent).GetComponent<MaskedPlayerEnemy>();
SetupRandomPeriodicAudioPlayer();
SetSuitMaterial();
DisableMaskObjects();
MoveMaskFloodParticleObject();
SpawnZombiesHeadObjects();
SetZombiesHead_LocalClient(ZombiesVariantType.Angry);
}
private void SetupRandomPeriodicAudioPlayer()
{
_voiceAudio = ((Component)((Component)this).transform.parent.Find("VoiceSFX")).GetComponent<AudioSource>();
((Component)this).GetComponent<EnemyRandomPeriodicAudioPlayer>().ThisAudio = _voiceAudio;
}
private void SetSuitMaterial()
{
if (!((Object)(object)SuitMaterial == (Object)null))
{
Material[] materials = (Material[])(object)new Material[1] { SuitMaterial };
((Renderer)_maskedPlayerEnemy.rendererLOD0).materials = materials;
((Renderer)_maskedPlayerEnemy.rendererLOD1).materials = materials;
((Renderer)_maskedPlayerEnemy.rendererLOD2).materials = materials;
}
}
private void DisableMaskObjects()
{
Transform maskedHeadTransform = GetMaskedHeadTransform();
((Component)maskedHeadTransform.Find("HeadMaskComedy")).gameObject.SetActive(false);
((Component)maskedHeadTransform.Find("HeadMaskTragedy")).gameObject.SetActive(false);
}
private void MoveMaskFloodParticleObject()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: 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)
Transform val = GetMaskedHeadTransform().Find("MaskFloodParticle");
Vector3 localPosition = val.localPosition;
localPosition.y = 0f;
val.localPosition = localPosition;
}
private void SpawnZombiesHeadObjects()
{
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
Transform maskedHeadTransform = GetMaskedHeadTransform();
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(0f, 0.184f, 0.019f);
_angryHeadObject = Object.Instantiate<GameObject>(AngryHeadPrefab, maskedHeadTransform);
_angryHeadObject.transform.SetLocalPositionAndRotation(val, Quaternion.identity);
_heartHeadObject = Object.Instantiate<GameObject>(HeartHeadPrefab, maskedHeadTransform);
_heartHeadObject.transform.SetLocalPositionAndRotation(val, Quaternion.identity);
}
[ServerRpc(RequireOwnership = false)]
public void SetZombiesHead_ServerRpc(ZombiesVariantType state)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1516096199u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<ZombiesVariantType>(ref state, default(ForEnums));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1516096199u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
SetZombiesHead_ClientRpc(state);
SetZombiesHead_LocalClient(state);
}
}
}
[ClientRpc]
public void SetZombiesHead_ClientRpc(ZombiesVariantType state)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2100117249u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<ZombiesVariantType>(ref state, default(ForEnums));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2100117249u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (!NetworkUtils.IsServer)
{
SetZombiesHead_LocalClient(state);
}
}
}
public void SetZombiesHead_LocalClient(ZombiesVariantType state)
{
Logger.LogInfo(string.Format("[{0}] {1}() state: {2}", "MaskedZombiesBehaviour", "SetZombiesHead_LocalClient", state), extended: true);
if (state != State)
{
State = state;
_angryHeadObject.SetActive(state == ZombiesVariantType.Angry);
_heartHeadObject.SetActive(state == ZombiesVariantType.Heart);
if (state == ZombiesVariantType.Heart)
{
PlayOneShotVoiceAudio(ElloSFX);
}
}
}
private void PlayOneShotVoiceAudio(AudioClip audioClip)
{
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)audioClip == (Object)null))
{
_voiceAudio.PlayOneShot(audioClip);
WalkieTalkie.TransmitOneShotAudio(_voiceAudio, audioClip, 1f);
RoundManager.Instance.PlayAudibleNoise(((Component)_voiceAudio).transform.position, 7f, 0.6f, 0, false, 0);
}
}
private Transform GetMaskedHeadTransform()
{
return ((Component)this).transform.parent.GetChild(0).GetChild(3).GetChild(0)
.GetChild(0)
.GetChild(0)
.GetChild(0)
.GetChild(2);
}
public override void OnNetworkDespawn()
{
Object.Destroy((Object)(object)_angryHeadObject);
Object.Destroy((Object)(object)_heartHeadObject);
}
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
((NetworkBehaviour)this).__registerRpc(1516096199u, new RpcReceiveHandler(__rpc_handler_1516096199), "SetZombiesHead_ServerRpc");
((NetworkBehaviour)this).__registerRpc(2100117249u, new RpcReceiveHandler(__rpc_handler_2100117249), "SetZombiesHead_ClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_1516096199(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_0044: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
ZombiesVariantType zombiesHead_ServerRpc = default(ZombiesVariantType);
((FastBufferReader)(ref reader)).ReadValueSafe<ZombiesVariantType>(ref zombiesHead_ServerRpc, default(ForEnums));
target.__rpc_exec_stage = (__RpcExecStage)1;
((MaskedZombiesBehaviour)(object)target).SetZombiesHead_ServerRpc(zombiesHead_ServerRpc);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2100117249(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_0044: 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)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
ZombiesVariantType zombiesHead_ClientRpc = default(ZombiesVariantType);
((FastBufferReader)(ref reader)).ReadValueSafe<ZombiesVariantType>(ref zombiesHead_ClientRpc, default(ForEnums));
target.__rpc_exec_stage = (__RpcExecStage)1;
((MaskedZombiesBehaviour)(object)target).SetZombiesHead_ClientRpc(zombiesHead_ClientRpc);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "MaskedZombiesBehaviour";
}
}
internal class PluginNetworkBehaviour : NetworkBehaviour
{
public static PluginNetworkBehaviour Instance { get; private set; }
private void Awake()
{
if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
else
{
Instance = this;
}
}
public override void OnNetworkSpawn()
{
((NetworkBehaviour)this).OnNetworkSpawn();
if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this)
{
if (((NetworkBehaviour)this).IsServer)
{
((NetworkBehaviour)this).NetworkObject.Despawn(true);
}
}
else
{
Instance = this;
}
}
[ClientRpc]
public void SetGrabbableObjectScrapValueClientRpc(NetworkObjectReference networkObjectReference, int scrapValue)
{
//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_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: 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_00e9: 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 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4053626412u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref networkObjectReference, default(ForNetworkSerializable));
BytePacker.WriteValueBitPacked(val2, scrapValue);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4053626412u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
NetworkObject val3 = default(NetworkObject);
GrabbableObject val4 = default(GrabbableObject);
if (((NetworkObjectReference)(ref networkObjectReference)).TryGet(ref val3, (NetworkManager)null) && ((Component)val3).TryGetComponent<GrabbableObject>(ref val4))
{
val4.SetScrapValue(scrapValue);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void SpawnExplosionServerRpc(Vector3 position, int damage, float maxDamageRange)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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_009d: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2530139943u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
BytePacker.WriteValueBitPacked(val2, damage);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDamageRange, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2530139943u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
SpawnExplosionClientRpc(position, damage, maxDamageRange);
}
}
}
[ClientRpc]
public void SpawnExplosionClientRpc(Vector3 position, int damage, float maxDamageRange)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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_009d: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(627078499u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
BytePacker.WriteValueBitPacked(val2, damage);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref maxDamageRange, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 627078499u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
Utils.CreateExplosion(position, spawnExplosionEffect: true, damage, 0f, maxDamageRange, 6, (CauseOfDeath)3);
}
}
}
[ServerRpc(RequireOwnership = false)]
public void DamagePlayerServerRpc(ulong targetClientId, int damage, CauseOfDeath causeOfDeath)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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_009d: 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_00f6: 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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2617461259u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, targetClientId);
BytePacker.WriteValueBitPacked(val2, damage);
((FastBufferWriter)(ref val2)).WriteValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2617461259u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
DamagePlayerClientRpc(targetClientId, damage, causeOfDeath);
}
}
}
[ClientRpc]
public void DamagePlayerClientRpc(ulong targetClientId, int damage, CauseOfDeath causeOfDeath)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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_009d: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: 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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2134151679u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, targetClientId);
BytePacker.WriteValueBitPacked(val2, damage);
((FastBufferWriter)(ref val2)).WriteValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2134151679u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost))
{
return;
}
base.__rpc_exec_stage = (__RpcExecStage)0;
if (NetworkUtils.IsLocalClientId(targetClientId))
{
PlayerControllerB localPlayerScript = PlayerUtils.LocalPlayerScript;
if (!((Object)(object)localPlayerScript == (Object)null))
{
localPlayerScript.DamagePlayer(damage, true, true, causeOfDeath, 0, false, default(Vector3));
}
}
}
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
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(4053626412u, new RpcReceiveHandler(__rpc_handler_4053626412), "SetGrabbableObjectScrapValueClientRpc");
((NetworkBehaviour)this).__registerRpc(2530139943u, new RpcReceiveHandler(__rpc_handler_2530139943), "SpawnExplosionServerRpc");
((NetworkBehaviour)this).__registerRpc(627078499u, new RpcReceiveHandler(__rpc_handler_627078499), "SpawnExplosionClientRpc");
((NetworkBehaviour)this).__registerRpc(2617461259u, new RpcReceiveHandler(__rpc_handler_2617461259), "DamagePlayerServerRpc");
((NetworkBehaviour)this).__registerRpc(2134151679u, new RpcReceiveHandler(__rpc_handler_2134151679), "DamagePlayerClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_4053626412(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_003e: 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_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
NetworkObjectReference networkObjectReference = default(NetworkObjectReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref networkObjectReference, default(ForNetworkSerializable));
int scrapValue = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref scrapValue);
target.__rpc_exec_stage = (__RpcExecStage)1;
((PluginNetworkBehaviour)(object)target).SetGrabbableObjectScrapValueClientRpc(networkObjectReference, scrapValue);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2530139943(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0080: 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);
int damage = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref damage);
float maxDamageRange = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref maxDamageRange, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((PluginNetworkBehaviour)(object)target).SpawnExplosionServerRpc(position, damage, maxDamageRange);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_627078499(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0080: 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);
int damage = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref damage);
float maxDamageRange = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref maxDamageRange, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((PluginNetworkBehaviour)(object)target).SpawnExplosionClientRpc(position, damage, maxDamageRange);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2617461259(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0071: 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)
{
ulong targetClientId = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref targetClientId);
int damage = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref damage);
CauseOfDeath causeOfDeath = default(CauseOfDeath);
((FastBufferReader)(ref reader)).ReadValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
target.__rpc_exec_stage = (__RpcExecStage)1;
((PluginNetworkBehaviour)(object)target).DamagePlayerServerRpc(targetClientId, damage, causeOfDeath);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2134151679(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0071: 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)
{
ulong targetClientId = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref targetClientId);
int damage = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref damage);
CauseOfDeath causeOfDeath = default(CauseOfDeath);
((FastBufferReader)(ref reader)).ReadValueSafe<CauseOfDeath>(ref causeOfDeath, default(ForEnums));
target.__rpc_exec_stage = (__RpcExecStage)1;
((PluginNetworkBehaviour)(object)target).DamagePlayerClientRpc(targetClientId, damage, causeOfDeath);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "PluginNetworkBehaviour";
}
}
public class PoopBehaviour : StunGrenadeItem
{
[Space(20f)]
[Header("Poop")]
[Space(5f)]
public StunGrenadeItemDamageTrigger DamageTrigger;
public override void ItemActivate(bool used, bool buttonDown = true)
{
PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy;
((StunGrenadeItem)this).ItemActivate(used, buttonDown);
DamageTrigger.WasThrown(playerHeldBy);
}
protected override void __initializeVariables()
{
((StunGrenadeItem)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
((StunGrenadeItem)this).__initializeRpcs();
}
protected internal override string __getTypeName()
{
return "PoopBehaviour";
}
}
[RequireComponent(typeof(BoxCollider))]
public class StunGrenadeItemDamageTrigger : MonoBehaviour
{
public StunGrenadeItem StunGrenadeItem;
public int PlayerDamage = 10;
public int EnemyDamage = 1;
public float CollisionCheckDuration = 3f;
private PlayerControllerB _playerThrownBy;
private bool _checkForCollision;
private float _collisionCheckTimer;
private void Start()
{
((Collider)((Component)this).GetComponent<BoxCollider>()).isTrigger = true;
}
public void WasThrown(PlayerControllerB playerThrownBy)
{
_checkForCollision = true;
_playerThrownBy = playerThrownBy;
}
private void Update()
{
if (_checkForCollision)
{
if (_collisionCheckTimer >= CollisionCheckDuration)
{
_collisionCheckTimer = 0f;
_checkForCollision = false;
}
else
{
_collisionCheckTimer += Time.deltaTime;
}
}
}
private void OnTriggerEnter(Collider other)
{
if (!((GrabbableObject)StunGrenadeItem).isHeld && _checkForCollision)
{
CheckIfHitPlayer(other);
CheckIfHitEnemy(other);
}
}
private void CheckIfHitPlayer(Collider other)
{
GameObject gameObject = ((Component)other).gameObject;
bool flag = false;
if (((Object)gameObject).name == "PlayerPhysicsBox")
{
gameObject = ((Component)gameObject.transform.parent).gameObject;
flag = true;
}
PlayerControllerB val = default(PlayerControllerB);
if (gameObject.TryGetComponent<PlayerControllerB>(ref val) && !val.isPlayerDead && !((Object)(object)val == (Object)(object)_playerThrownBy) && (!flag || val.isHostPlayerObject) && (!flag || !NetworkUtils.IsServer))
{
PluginNetworkBehaviour.Instance.DamagePlayerServerRpc(val.actualClientId, PlayerDamage, (CauseOfDeath)0);
LogInfo($"Hit player \"{val.playerUsername}\" for {PlayerDamage} damage.", extended: true);
}
}
private void CheckIfHitEnemy(Collider other)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
IHittable val = default(IHittable);
if (!((Component)other).gameObject.CompareTag("Player") && ((Component)other).TryGetComponent<IHittable>(ref val))
{
PlayerControllerB localPlayerScript = PlayerUtils.LocalPlayerScript;
val.Hit(EnemyDamage, ((Component)localPlayerScript.gameplayCamera).transform.forward, localPlayerScript, true, 1);
EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect);
if (((Component)other).TryGetComponent<EnemyAICollisionDetect>(ref val2))
{
LogInfo($"Hit enemy \"{val2.mainScript.enemyType.enemyName}\" for {EnemyDamage} damage.", extended: true);
}
else
{
LogInfo($"Hit \"{((Object)((Component)other).gameObject).name}\" for {EnemyDamage} damage.", extended: true);
}
}
}
private void Log(LogLevel logLevel, object data, bool extended = false)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
string arg = "[" + ((Object)StunGrenadeItem).name + "]";
Logger.Log(logLevel, $"{arg} {data}", extended);
}
private void LogInfo(object data, bool extended = false)
{
Log((LogLevel)16, data, extended);
}
private void LogWarning(object data, bool extended = false)
{
Log((LogLevel)4, data, extended);
}
private void LogError(object data, bool extended = false)
{
Log((LogLevel)2, data, extended);
}
}
public class ZombiesBehaviour : AdvancedNoisemakerProp
{
[CompilerGenerated]
private sealed class <CooldownFromAngryAfterTimeOnServer>d__106 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public float duration;
public ZombiesBehaviour <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <CooldownFromAngryAfterTimeOnServer>d__106(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
int num = <>1__state;
ZombiesBehaviour zombiesBehaviour = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
if (!NetworkUtils.IsServer)
{
return false;
}
<>2__current = (object)new WaitForSeconds(duration);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if (!((GrabbableObject)zombiesBehaviour).isHeld)
{
zombiesBehaviour.SetIsCoolFromAngryOnServer(value: true);
zombiesBehaviour.LogInfo("CooldownFromAngryAfterTimeOnServer Coroutine finished. Set _isCoolFromAngry to true.", extended: true);
}
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <SetObjectToHitGroundSFX>d__129 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public GrabbableObject grabbableObject;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SetObjectToHitGroundSFX>d__129(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForEndOfFrame();
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
grabbableObject.reachedFloorTarget = false;
grabbableObject.hasHitGround = false;
grabbableObject.fallTime = 0f;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <StartGivePrizeInteraction>d__121 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public ZombiesBehaviour <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <StartGivePrizeInteraction>d__121(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
int num = <>1__state;
ZombiesBehaviour zombiesBehaviour = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
if (!NetworkUtils.IsServer)
{
return false;
}
zombiesBehaviour.SetIsGivingPrizeOnServer(value: true);
zombiesBehaviour.SetIsHeartOnServer(value: true);
<>2__current = (object)new WaitForSeconds(zombiesBehaviour.PlayOtherSFXOnServer(ZombiesOtherSFX.PrizeSFX) + 0.1f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
zombiesBehaviour.SpawnRandomGiftOnServer(((Component)zombiesBehaviour).transform.position);
zombiesBehaviour.SetIsGivingPrizeOnServer(value: false);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <StartPoopEventOnServer>d__124 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public ZombiesBehaviour <>4__this;
private float <fartLength>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <StartPoopEventOnServer>d__124(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Expected O, but got Unknown
int num = <>1__state;
ZombiesBehaviour zombiesBehaviour = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
if (!NetworkUtils.IsServer)
{
return false;
}
zombiesBehaviour.SetIsPoopingOnServer(value: true);
<fartLength>5__2 = zombiesBehaviour.PlayOtherSFXOnServer(ZombiesOtherSFX.FartSFX);
<>2__current = (object)new WaitForSeconds(0.9f);
<>1__state = 1;
return true;
case 1:
{
<>1__state = -1;
bool flag = Utils.RollPercentChance(zombiesBehaviour.GoldenPoopSpawnPercentChance);
Item item = Assets.Poop;
int num2;
int scrapValueOnServer;
if (flag)
{
item = Assets.GoldenPoop;
num2 = zombiesBehaviour.GoldenPoopValue;
scrapValueOnServer = Mathf.Max(0, ((GrabbableObject)zombiesBehaviour).scrapValue - zombiesBehaviour.PoopValue);
}
else if (((GrabbableObject)zombiesBehaviour).scrapValue >= zombiesBehaviour.PoopValue)
{
num2 = zombiesBehaviour.PoopValue;
scrapValueOnServer = ((GrabbableObject)zombiesBehaviour).scrapValue - num2;
}
else
{
num2 = ((GrabbableObject)zombiesBehaviour).scrapValue;
scrapValueOnServer = 0;
}
zombiesBehaviour.SpawnItemOnServer(item, num2, zombiesBehaviour.PoopSpawnPosTransform.position);
zombiesBehaviour.SetScrapValueOnServer(scrapValueOnServer);
<>2__current = (object)new WaitForSeconds(<fartLength>5__2 - 0.9f);
<>1__state = 2;
return true;
}
case 2:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(zombiesBehaviour.PlayOtherSFXOnServer(ZombiesOtherSFX.AfterPoopSFX));
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
zombiesBehaviour.SetIsPoopingOnServer(value: false);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <StartSmolTakeyInterationOnServer>d__119 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public ZombiesBehaviour <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <StartSmolTakeyInterationOnServer>d__119(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Expected O, but got Unknown
int num = <>1__state;
ZombiesBehaviour zombiesBehaviour = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
if (!NetworkUtils.IsServer)
{
return false;
}
zombiesBehaviour.SetIsDoingSmolTakeyInterationOnServer(value: true);
<>2__current = (object)new WaitForSeconds(zombiesBehaviour.PlayOtherSFXOnServer(ZombiesOtherSFX.ElloTakeySFX));
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(zombiesBehaviour.PlayOtherSFXOnServer(ZombiesOtherSFX.StinkyZombiesSFX) + 0.25f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
if (zombiesBehaviour.CanGivePrize() && !zombiesBehaviour._isGivingPrize)
{
<>2__current = ((MonoBehaviour)zombiesBehaviour).StartCoroutine(zombiesBehaviour.StartGivePrizeInteraction());
<>1__state = 3;
return true;
}
break;
case 3:
<>1__state = -1;
break;
}
zombiesBehaviour.SetIsDoingSmolTakeyInterationOnServer(value: false);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <WaitForScrapToSpawnOnLocalClient>d__131 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public NetworkObjectReference networkObjectReference;
public int scrapValue;
public Vector3 startFallingPos;
public ZombiesBehaviour <>4__this;
private NetworkObject <networkObject>5__2;
private float <startTime>5__3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <WaitForScrapToSpawnOnLocalClient>d__131(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<networkObject>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00ec: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
int num = <>1__state;
ZombiesBehaviour zombiesBehaviour = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
<networkObject>5__2 = null;
<startTime>5__3 = Time.realtimeSinceStartup;
goto IL_005d;
case 1:
<>1__state = -1;
goto IL_005d;
case 2:
{
<>1__state = -1;
GrabbableObject component = ((Component)<networkObject>5__2).GetComponent<GrabbableObject>();
RoundManager instance = RoundManager.Instance;
instance.totalScrapValueInLevel += (float)component.scrapValue;
component.SetScrapValue(scrapValue);
component.startFallingPosition = startFallingPos;
component.fallTime = 0f;
component.hasHitGround = false;
component.reachedFloorTarget = false;
if ((Object)(object)((GrabbableObject)zombiesBehaviour).playerHeldBy != (Object)null && ((GrabbableObject)zombiesBehaviour).playerHeldBy.isInHangarShipRoom)
{
((GrabbableObject)zombiesBehaviour).playerHeldBy.SetItemInElevator(true, true, component);
}
return false;
}
IL_005d:
if (Time.realtimeSinceStartup - <startTime>5__3 < 8f && !((NetworkObjectReference)(ref networkObjectReference)).TryGet(ref <networkObject>5__2, (NetworkManager)null))
{
<>2__current = (object)new WaitForSeconds(0.03f);
<>1__state = 1;
return true;
}
if ((Object)(object)<networkObject>5__2 == (Object)null)
{
Logger.LogInfo("No network object found.");
return false;
}
<>2__current = (object)new WaitForEndOfFrame();
<>1__state = 2;
return true;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[Space(20f)]
[Header("Smol Zombies")]
[Space(5f)]
public ZombiesVariantData[] Variants = Array.Empty<ZombiesVariantData>();
public AudioSourceGroup MusicAudio;
public AudioClipGroupWithData<ZombiesOtherSFX>[] OtherSFX = Array.Empty<AudioClipGroupWithData<ZombiesOtherSFX>>();
public float OtherPlushieInteractionRadius = 3f;
public GameObject AngrySymbolObject;
[Space(10f)]
public float HappinessDrainAmount = 20f;
[Space(10f)]
public float ForceAngryStateDuration = 1.75f;
public float AngryCooldownDuration = 10f;
public float AngryDamageInterval = 3f;
public int AngryDamageAmount = 5;
public int AngryExplosionDamage = 90;
public float AngryExplosionMaxDamageRange = 6.5f;
[Space(10f)]
public float ScaredInterval = 0.5f;
public float ScaredRaduis = 15f;
public float ScaredDuration = 5f;
public Transform PoopSpawnPosTransform;
public float PoopSpawnDuration = 30f;
public int PoopValue = 3;
public int GoldenPoopValue = 69;
public int GoldenPoopSpawnPercentChance = 5;
[Space(10f)]
public float DrunkDuration = 5f;
private float _happiness = 100f;
private bool _isScared;
private bool _keepScaredState;
private bool _isDrunk;
private bool _isHeart;
private bool _isPlayingMusic = true;
private bool _isSpecialVariant;
private int _specialVariantIndex;
private bool _ignoreDamageEvent;
private float _angryDamageTimer;
private bool _forceAngryState;
private float _forceAngryStateTimer;
private bool _isCoolFromAngry = true;
private float _scaredIntervalTimer;
private float _scaredHeldTimer;
private bool _spawnedPoop;
private float _drunkTimer;
private bool _isCoolFromDrunk = true;
private bool _wasHeldByEnemy;
private bool _isExploding;
private bool _isDoingSmolTakeyInteration;
private bool _isGivingPrize;
private bool _isPooping;
private Coroutine _cooldownFromAngryAfterTime;
public bool IsHeldByLocalPlayer => PlayerUtils.IsLocalPlayer(((GrabbableObject)this).playerHeldBy);
public ZombiesVariantType ZombieState { get; private set; }
public AudioClipGroupWithWeight[] PickupSFX => GetVariantData()?.PickupSFX;
public AudioClipGroupWithWeight[] SqueezeSFX => GetVariantData()?.SqueezeSFX;
public AudioClipGroupWithWeight[] TransformSFX => GetVariantData()?.TransformSFX;
public override void Start()
{
((GrabbableObject)this).Start();
ApplyConfigSettings();
if (NetworkUtils.IsServer)
{
SetIsPlayingMusicOnServer(_isPlayingMusic);
}
}
public override void Update()
{
((GrabbableObject)this).Update();
if (NetworkUtils.IsServer)
{
ServerUpdate();
}
ClientUpdate();
}
public override void LoadItemSaveData(int saveData)
{
base.LoadItemSaveData(saveData);
if (NetworkUtils.IsServer)
{
LogInfo("Loading item save data.", extended: true);
_isSpecialVariant = GameSaveFileHelper.Load(base.SaveKey + "__isSpecialVariant", defaultValue: false);
_specialVariantIndex = GameSaveFileHelper.Load(base.SaveKey + "__specialVariantIndex", 7);
SetHappinessOnServer(GameSaveFileHelper.Load(base.SaveKey + "__happiness", 100f), updateZombieState: false);
SetIsScaredOnServer(GameSaveFileHelper.Load(base.SaveKey + "__isScared", defaultValue: false), updateZombieState: false);
SetIsDrunkOnServer(GameSaveFileHelper.Load(base.SaveKey + "__isDrunk", defaultValue: false), updateZombieState: false);
SetIsHeartOnServer(GameSaveFileHelper.Load(base.SaveKey + "__isHeart", defaultValue: false), updateZombieState: false);
SetIsPlayingMusicOnLocalClient(GameSaveFileHelper.Load(base.SaveKey + "__isPlayingMusic", defaultValue: false));
_keepScaredState = GameSaveFileHelper.Load(base.SaveKey + "__keepScaredState", defaultValue: false);
UpdateZombieStateOnServer();
}
}
public override int GetItemDataToSave()
{
SaveItemData();
return base.GetItemDataToSave();
}
private void SaveItemData()
{
if (NetworkUtils.IsServer)
{
GameSaveFileHelper.Save(base.SaveKey + "__happiness", _happiness);
GameSaveFileHelper.Save(base.SaveKey + "__isScared", _isScared);
GameSaveFileHelper.Save(base.SaveKey + "__isDrunk", _isDrunk);
GameSaveFileHelper.Save(base.SaveKey + "__isHeart", _isHeart);
GameSaveFileHelper.Save(base.SaveKey + "__isPlayingMusic", _isPlayingMusic);
GameSaveFileHelper.Save(base.SaveKey + "__keepScaredState", _keepScaredState);
GameSaveFileHelper.Save(base.SaveKey + "__isSpecialVariant", _isSpecialVariant);
GameSaveFileHelper.Save(base.SaveKey + "__specialVariantIndex", _specialVariantIndex);
LogInfo($"Saved item data. _happiness: {_happiness}, _isScared: {_isScared}, _isDrunk: {_isDrunk}, _isHeart: {_isHeart}, _isPlayingMusic: {_isPlayingMusic}, _keepScaredState: {_keepScaredState}, _isSpecialVariant: {_isSpecialVariant}, _specialVariantIndex: {_specialVariantIndex}", extended: true);
}
}
public override void GrabItem()
{
((GrabbableObject)this).GrabItem();
LogInfo($"GrabItem() wasHeldByEnemy: {_wasHeldByEnemy}", extended: true);
if (!NetworkUtils.IsServer)
{
return;
}
if (_cooldownFromAngryAfterTime != null)
{
((MonoBehaviour)this).StopCoroutine(_cooldownFromAngryAfterTime);
}
bool wasHeldByEnemy = _wasHeldByEnemy;
if (wasHeldByEnemy)
{
SetIsHeartOnServer(value: true, updateZombieState: false);
_wasHeldByEnemy = false;
}
if (_isCoolFromAngry)
{
SetHappinessOnServer(100f, updateZombieState: false);
}
if (_isCoolFromDrunk)
{
SetIsDrunkOnServer(value: false, updateZombieState: false);
}
if (!IsEnemyNearby())
{
SetIsScaredOnServer(value: false, updateZombieState: false);
_keepScaredState = false;
}
if (_isPlayingMusic)
{
SetIsPlayingMusicOnServer(value: false, updateZombieState: false);
}
UpdateZombieStateOnServer();
if (!_isDoingSmolTakeyInteration && !_isGivingPrize && !_isPooping)
{
if (wasHeldByEnemy)
{
PlayOtherSFXOnServer(ZombiesOtherSFX.RescuedSFX);
}
else
{
PlayPickupSFXOnServer();
}
}
}
public override void GrabItemFromEnemy(EnemyAI enemy)
{
((GrabbableObject)this).GrabItemFromEnemy(enemy);
_wasHeldByEnemy = true;
SetIsScaredOnServer(value: true);
}
public override void EquipItem()
{
((GrabbableObject)this).EquipItem();
UpdateModel();
}
public override void EnableItemMeshes(bool enable)
{
((GrabbableObject)this).EnableItemMeshes(enable);
UpdateModel();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
if (!_isDoingSmolTakeyInteration && !_isGivingPrize && !_isPooping && NoiseSFX.Length != 0 && NoiseSFX.Length == SqueezeSFX.Length)
{
int randomIndexFromWeightList = Utils.GetRandomIndexFromWeightList(SqueezeSFX.Select((AudioClipGroupWithWeight _) => _.Weight).ToList());
PlaySound(randomIndexFromWeightList);
}
}
public override void PocketItem()
{
((GrabbableObject)this).PocketItem();
UpdateModel();
}
public override void DiscardItem()
{
((GrabbableObject)this).DiscardItem();
UpdateModel();
_angryDamageTimer = 0f;
_forceAngryStateTimer = 0f;
if (NetworkUtils.IsServer && _happiness < 100f)
{
if (_cooldownFromAngryAfterTime != null)
{
((MonoBehaviour)this).StopCoroutine(_cooldownFromAngryAfterTime);
}
_cooldownFromAngryAfterTime = ((MonoBehaviour)this).StartCoroutine(CooldownFromAngryAfterTimeOnServer(AngryCooldownDuration));
LogInfo("Started CooldownFromAngryAfterTimeOnServer Coroutine.", extended: true);
}
}
public override void PlayDropSFX()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).PlayDropSFX();
if (NetworkUtils.IsServer && !_isPooping)
{
if (TakeyPlushProxy.IsInstalled && TakeyPlushProxy.HasSmolTakeyNearby(((Component)this).transform.position, OtherPlushieInteractionRadius) && !_isDoingSmolTakeyInteration)
{
((MonoBehaviour)this).StartCoroutine(StartSmolTakeyInterationOnServer());
}
else if (CanGivePrize() && !_isGivingPrize)
{
((MonoBehaviour)this).StartCoroutine(StartGivePrizeInteraction());
}
}
}
private ZombiesVariantData GetVariantData()
{
ZombiesVariantData[] variants = Variants;
foreach (ZombiesVariantData zombiesVariantData in variants)
{
if (zombiesVariantData.VariantType == ZombieState)
{
return zombiesVariantData;
}
}
return null;
}
private ZombiesVariantData GetVariantData(ZombiesVariantType variantType)
{
ZombiesVariantData[] variants = Variants;
foreach (ZombiesVariantData zombiesVariantData in variants)
{
if (zombiesVariantData.VariantType == variantType)
{
return zombiesVariantData;
}
}
return null;
}
private bool IsVariantType(ZombiesVariantType variantType)
{
return ZombieState == variantType;
}
private bool IsVariantType(params ZombiesVariantType[] variantTypes)
{
foreach (ZombiesVariantType zombiesVariantType in variantTypes)
{
if (zombiesVariantType == ZombieState)
{
return true;
}
}
return false;
}
protected override void OnClientConnected(ulong clientId)
{
//IL_000b: 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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
if (!NetworkUtils.IsLocalClientId(clientId))
{
ClientRpcParams val = default(ClientRpcParams);
val.