using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using LethalModDataLib.Enums;
using LethalModDataLib.Features;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using com.github.zehsteam.TakeyPlush.MonoBehaviours;
using com.github.zehsteam.TakeyPlush.NetcodePatcher;
using com.github.zehsteam.TakeyPlush.Patches;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.zehsteam.TakeyPlush")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Adds a customizable Takey Plushie scrap item with some functionalities. \ud83d\ude08")]
[assembly: AssemblyFileVersion("1.4.2.0")]
[assembly: AssemblyInformationalVersion("1.4.2+7a4e00c8a899716b5566a7c713e3da4db59e0cbd")]
[assembly: AssemblyProduct("TakeyPlush")]
[assembly: AssemblyTitle("com.github.zehsteam.TakeyPlush")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy<bool>();
NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable<bool>();
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace com.github.zehsteam.TakeyPlush
{
internal class ConfigManager
{
private ConfigEntry<int> SpawnWeightCfg;
private ConfigEntry<bool> TwoHandedCfg;
private ConfigEntry<int> CarryWeightCfg;
private ConfigEntry<int> MinValueCfg;
private ConfigEntry<int> MaxValueCfg;
private ConfigEntry<bool> EnableRadioModeCfg;
private ConfigEntry<int> EvilTakeyChanceCfg;
private ConfigEntry<float> FlyDurationCfg;
private ConfigEntry<int> ExplosionDamageCfg;
private ConfigEntry<float> MaxExplosionRangeCfg;
internal int SpawnWeight
{
get
{
return SpawnWeightCfg.Value;
}
set
{
SpawnWeightCfg.Value = value;
}
}
internal bool TwoHanded
{
get
{
return TwoHandedCfg.Value;
}
set
{
TwoHandedCfg.Value = value;
}
}
internal int CarryWeight
{
get
{
return CarryWeightCfg.Value;
}
set
{
CarryWeightCfg.Value = value;
}
}
internal int MinValue
{
get
{
return MinValueCfg.Value;
}
set
{
MinValueCfg.Value = value;
}
}
internal int MaxValue
{
get
{
return MaxValueCfg.Value;
}
set
{
MaxValueCfg.Value = value;
}
}
internal bool EnableRadioMode
{
get
{
return EnableRadioModeCfg.Value;
}
set
{
EnableRadioModeCfg.Value = value;
}
}
internal int EvilTakeyChance
{
get
{
return EvilTakeyChanceCfg.Value;
}
set
{
EvilTakeyChanceCfg.Value = value;
}
}
internal float FlyDuration
{
get
{
return Mathf.Clamp(FlyDurationCfg.Value, 3f, 6f);
}
set
{
FlyDurationCfg.Value = value;
}
}
internal int ExplosionDamage
{
get
{
return ExplosionDamageCfg.Value;
}
set
{
ExplosionDamageCfg.Value = value;
}
}
internal float MaxExplosionRange
{
get
{
return MaxExplosionRangeCfg.Value;
}
set
{
MaxExplosionRangeCfg.Value = value;
}
}
public ConfigManager()
{
BindConfigs();
ClearUnusedEntries();
}
private void BindConfigs()
{
//IL_0018: 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_003b: Expected O, but got Unknown
//IL_003b: Expected O, but got Unknown
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Expected O, but got Unknown
//IL_0067: Expected O, but got Unknown
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Expected O, but got Unknown
//IL_0093: Expected O, but got Unknown
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Expected O, but got Unknown
//IL_00c0: Expected O, but got Unknown
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Expected O, but got Unknown
//IL_00f0: Expected O, but got Unknown
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
//IL_011c: Expected O, but got Unknown
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Expected O, but got Unknown
//IL_0150: Expected O, but got Unknown
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Expected O, but got Unknown
//IL_018e: Expected O, but got Unknown
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Expected O, but got Unknown
//IL_01bb: Expected O, but got Unknown
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Expected O, but got Unknown
//IL_01eb: Expected O, but got Unknown
ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config;
SpawnWeightCfg = config.Bind<int>(new ConfigDefinition("General Settings", "SpawnWeight"), 10, new ConfigDescription("Takey Plush spawn chance weight. higher = more common.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
TwoHandedCfg = config.Bind<bool>(new ConfigDefinition("General Settings", "TwoHanded"), false, new ConfigDescription("If enabled, the Takey Plush will be two-handed.", (AcceptableValueBase)null, Array.Empty<object>()));
CarryWeightCfg = config.Bind<int>(new ConfigDefinition("General Settings", "CarryWeight"), 5, new ConfigDescription("Takey Plush carry weight in pounds.", (AcceptableValueBase)null, Array.Empty<object>()));
MinValueCfg = config.Bind<int>(new ConfigDefinition("General Settings", "MinValue"), 80, new ConfigDescription("Takey Plush min scrap value.", (AcceptableValueBase)null, Array.Empty<object>()));
MaxValueCfg = config.Bind<int>(new ConfigDefinition("General Settings", "MaxValue"), 250, new ConfigDescription("Takey Plush max scrap value.", (AcceptableValueBase)null, Array.Empty<object>()));
EnableRadioModeCfg = config.Bind<bool>(new ConfigDefinition("General Settings", "EnableRadioMode"), false, new ConfigDescription("If enabled, you can switch from random to radio mode for the squeeze voice lines. (Host only)", (AcceptableValueBase)null, Array.Empty<object>()));
EvilTakeyChanceCfg = config.Bind<int>(new ConfigDefinition("Evil Takey Settings", "EvilTakeyChance"), 20, new ConfigDescription("The percent chance Smol Takey becomes evil.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
FlyDurationCfg = config.Bind<float>(new ConfigDefinition("Evil Takey Settings", "FlyDuration"), 5f, new ConfigDescription("The flight duration of Evil Takey in seconds.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 6f), Array.Empty<object>()));
ExplosionDamageCfg = config.Bind<int>(new ConfigDefinition("Evil Takey Settings", "ExplosionDamage"), 50, new ConfigDescription("The explosion damage of Evil Takey.", (AcceptableValueBase)null, Array.Empty<object>()));
MaxExplosionRangeCfg = config.Bind<float>(new ConfigDefinition("Evil Takey Settings", "MaxExplosionRange"), 6.4f, new ConfigDescription("The max explosion range of Evil Takey in meters.", (AcceptableValueBase)null, Array.Empty<object>()));
}
private void ClearUnusedEntries()
{
ConfigFile config = ((BaseUnityPlugin)Plugin.Instance).Config;
PropertyInfo property = ((object)config).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(config, null);
dictionary.Clear();
config.Save();
}
}
internal class Content
{
public static GameObject networkHandlerPrefab;
public static Item takeyPlush;
public static void Load()
{
LoadAssetsFromAssetBundle();
}
private static void LoadAssetsFromAssetBundle()
{
try
{
string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.Instance).Info.Location);
string text = Path.Combine(directoryName, "takeyplush_assets");
AssetBundle val = AssetBundle.LoadFromFile(text);
networkHandlerPrefab = val.LoadAsset<GameObject>("NetworkHandler");
networkHandlerPrefab.AddComponent<PluginNetworkBehaviour>();
takeyPlush = val.LoadAsset<Item>("TakeyPlush");
Plugin.logger.LogInfo((object)"Successfully loaded assets from AssetBundle!");
}
catch (Exception arg)
{
Plugin.logger.LogError((object)$"Error: failed to load assets from AssetBundle.\n\n{arg}");
}
}
}
[BepInPlugin("com.github.zehsteam.TakeyPlush", "TakeyPlush", "1.4.2")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("com.github.zehsteam.TakeyPlush");
internal static Plugin Instance;
internal static ManualLogSource logger;
internal static ConfigManager ConfigManager;
public static bool IsHostOrServer => NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
logger = Logger.CreateLogSource("com.github.zehsteam.TakeyPlush");
logger.LogInfo((object)"TakeyPlush has awoken!");
harmony.PatchAll(typeof(GameNetworkManagerPatch));
harmony.PatchAll(typeof(StartOfRoundPatch));
harmony.PatchAll(typeof(HoarderBugAIPatch));
harmony.PatchAll(typeof(BaboonBirdAIPatch));
ConfigManager = new ConfigManager();
Content.Load();
RegisterScrapItems();
NetcodePatcherAwake();
}
private void NetcodePatcherAwake()
{
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
Type[] array = types;
foreach (Type type in array)
{
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo[] array2 = methods;
foreach (MethodInfo methodInfo in array2)
{
object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
if (customAttributes.Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
}
private void RegisterScrapItems()
{
int spawnWeight = ConfigManager.SpawnWeight;
bool twoHanded = ConfigManager.TwoHanded;
int carryWeight = ConfigManager.CarryWeight;
int minValue = ConfigManager.MinValue;
int maxValue = ConfigManager.MaxValue;
ScrapHelper.RegisterScrap(Content.takeyPlush, spawnWeight, twoHanded, carryWeight, minValue, maxValue);
}
}
internal class ScrapHelper
{
public static void RegisterScrap(Item item, int iRarity, bool twoHanded, int carryWeight, int minValue, int maxValue)
{
item.twoHanded = twoHanded;
item.weight = (float)carryWeight / 105f + 1f;
item.minValue = minValue;
item.maxValue = maxValue;
Utilities.FixMixerGroups(item.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
Items.RegisterScrap(item, iRarity, (LevelTypes)(-1));
Plugin.logger.LogInfo((object)$"Registered \"{item.itemName}\" scrap item with {iRarity} rarity.");
}
public static int[] GetSharedSpawnWeights(int spawnWeight, int amount)
{
List<int> list = new List<int>();
int num = (int)Mathf.Max(Mathf.Floor((float)(spawnWeight / amount)), 1f);
bool flag = num * amount < spawnWeight;
for (int i = 0; i < amount; i++)
{
int num2 = ((i == 0 && flag) ? 1 : 0);
list.Add(num + num2);
}
return list.ToArray();
}
}
internal class Utils
{
public static bool RandomPercent(int percent)
{
if (percent <= 0)
{
return false;
}
if (percent >= 100)
{
return true;
}
return Random.value <= (float)percent * 0.01f;
}
public static int GetLocalPlayerId()
{
return (int)GetLocalPlayerScript().playerClientId;
}
public static bool IsLocalPlayerId(int clientId)
{
return clientId == GetLocalPlayerId();
}
public static PlayerControllerB GetLocalPlayerScript()
{
return GameNetworkManager.Instance.localPlayerController;
}
public static bool IsPlayerNearby(Vector3 position, float range)
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
PlayerControllerB[] array = allPlayerScripts;
foreach (PlayerControllerB val in array)
{
if (Vector3.Distance(position, ((Component)val).gameObject.transform.position) <= range)
{
return true;
}
}
return false;
}
public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 6.4f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null)
{
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0336: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)"Spawning explosion at pos: {explosionPosition}");
Transform val = null;
if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null)
{
val = RoundManager.Instance.mapPropsContainer.transform;
}
if (spawnExplosionEffect)
{
Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true);
}
float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition);
if (num < 14f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
}
else if (num < 25f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
}
Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2);
PlayerControllerB val2 = null;
for (int i = 0; i < array.Length; i++)
{
float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position);
if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1))
{
continue;
}
if (((Component)array[i]).gameObject.layer == 3)
{
val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>();
if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner)
{
float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange));
val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3));
}
}
else if (((Component)array[i]).gameObject.layer == 21)
{
Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<Landmine>();
if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f)
{
Debug.Log((object)"Setting off other mine");
((MonoBehaviour)StartOfRound.Instance).StartCoroutine(TriggerOtherMineDelayed(componentInChildren));
}
}
else if (((Component)array[i]).gameObject.layer == 19)
{
EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>();
if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f)
{
componentInChildren2.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false, -1);
}
}
}
int num4 = ~LayerMask.GetMask(new string[1] { "Room" });
num4 = ~LayerMask.GetMask(new string[1] { "Colliders" });
array = Physics.OverlapSphere(explosionPosition, 10f, num4);
for (int j = 0; j < array.Length; j++)
{
Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
component.AddExplosionForce(70f, explosionPosition, 10f);
}
}
}
private static IEnumerator TriggerOtherMineDelayed(Landmine mine)
{
if (!mine.hasExploded)
{
mine.mineAudio.pitch = Random.Range(0.75f, 1.07f);
mine.hasExploded = true;
yield return (object)new WaitForSeconds(0.2f);
mine.SetOffMineAnimation();
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "com.github.zehsteam.TakeyPlush";
public const string PLUGIN_NAME = "TakeyPlush";
public const string PLUGIN_VERSION = "1.4.2";
}
}
namespace com.github.zehsteam.TakeyPlush.Patches
{
[HarmonyPatch(typeof(BaboonBirdAI))]
internal class BaboonBirdAIPatch
{
[HarmonyPatch("GrabItemAndSync")]
[HarmonyPrefix]
private static bool GrabItemAndSyncPatch(ref BaboonBirdAI __instance, ref NetworkObject item)
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
if (!((NetworkBehaviour)__instance).IsOwner)
{
return true;
}
Takey component = ((Component)item).gameObject.GetComponent<Takey>();
if ((Object)(object)component == (Object)null)
{
return true;
}
if ((!component.isEvil.Value && !component.isFlying) || !Utils.IsPlayerNearby(((Component)__instance).gameObject.transform.position, 20f))
{
return true;
}
if (!component.isFlying)
{
component.StartFlyingServerRpc();
}
return false;
}
[HarmonyPatch("DropHeldItemAndSync")]
[HarmonyPrefix]
private static void DropHeldItemAndSyncPatch(ref BaboonBirdAI __instance)
{
Takey component = ((Component)__instance.heldScrap).gameObject.GetComponent<Takey>();
if (!((Object)(object)component == (Object)null))
{
component.RollIsEvilServerRpc();
}
}
}
[HarmonyPatch(typeof(GameNetworkManager))]
internal class GameNetworkManagerPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
private static void StartPatch()
{
AddNetworkPrefabs();
}
private static void AddNetworkPrefabs()
{
AddNetworkPrefab(Content.networkHandlerPrefab);
}
private static void AddNetworkPrefab(GameObject prefab)
{
if (!((Object)(object)prefab == (Object)null))
{
NetworkManager.Singleton.AddNetworkPrefab(prefab);
Plugin.logger.LogInfo((object)("Registered \"" + ((Object)prefab).name + "\" network prefab."));
}
}
}
[HarmonyPatch(typeof(HoarderBugAI))]
internal class HoarderBugAIPatch
{
[HarmonyPatch("GrabTargetItemIfClose")]
[HarmonyPrefix]
private static bool GrabTargetItemIfClosePatch(ref HoarderBugAI __instance, ref bool __result)
{
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
if (!((NetworkBehaviour)__instance).IsOwner)
{
return true;
}
if ((Object)(object)__instance.targetItem != (Object)null && __instance.heldItem == null && Vector3.Distance(((Component)__instance).transform.position, ((Component)__instance.targetItem).transform.position) < 0.75f)
{
Takey component = ((Component)__instance.targetItem).gameObject.GetComponent<Takey>();
if ((Object)(object)component == (Object)null)
{
return true;
}
if ((!component.isEvil.Value && !component.isFlying) || !Utils.IsPlayerNearby(((Component)__instance).gameObject.transform.position, 20f))
{
return true;
}
if (!component.isFlying)
{
component.StartFlyingServerRpc();
}
__result = true;
return false;
}
return true;
}
[HarmonyPatch("DropItemAndCallDropRPC")]
[HarmonyPostfix]
private static void DropItemAndCallDropRPCPatch(ref HoarderBugAI __instance, ref NetworkObject dropItemNetworkObject)
{
if (((NetworkBehaviour)__instance).IsOwner)
{
Takey component = ((Component)dropItemNetworkObject).gameObject.GetComponent<Takey>();
if (!((Object)(object)component == (Object)null))
{
component.RollIsEvilServerRpc();
}
}
}
}
[HarmonyPatch(typeof(StartOfRound))]
internal class StartOfRoundPatch
{
[HarmonyPatch("Awake")]
[HarmonyPostfix]
private static void AwakePatch()
{
SpawnNetworkHandler();
}
private static void SpawnNetworkHandler()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.IsHostOrServer)
{
GameObject val = Object.Instantiate<GameObject>(Content.networkHandlerPrefab, Vector3.zero, Quaternion.identity);
val.GetComponent<NetworkObject>().Spawn(false);
}
}
}
}
namespace com.github.zehsteam.TakeyPlush.MonoBehaviours
{
public class AdvancedNoisemakerProp : NoisemakerProp
{
[Header("Advanced")]
[Space(3f)]
public bool useDynamicCooldown = false;
public bool cancelActiveSFXOnItemActivate = false;
protected Random noisemakerRandom;
[HideInInspector]
public int uniqueId = 0;
public bool isHostOrServer => Plugin.IsHostOrServer;
public bool isHeldByLocalPlayer => (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)Utils.GetLocalPlayerScript();
public bool canActivateItem => isHeldByLocalPlayer || ((GrabbableObject)this).isHeldByEnemy;
public string saveKey => string.Format("{0}_{1}", "AdvancedNoisemakerProp", uniqueId);
public override void LoadItemSaveData(int saveData)
{
((GrabbableObject)this).LoadItemSaveData(saveData);
uniqueId = saveData;
}
public override int GetItemDataToSave()
{
return uniqueId;
}
public virtual void Awake()
{
if (isHostOrServer)
{
uniqueId = Random.Range(0, 1000000);
}
}
public override void Start()
{
((NoisemakerProp)this).Start();
noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85);
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
if (canActivateItem)
{
int index = Random.Range(0, base.noiseSFX.Length);
PlaySound(index);
}
}
public void PlaySound(int index)
{
int fromPlayerId = (isHeldByLocalPlayer ? Utils.GetLocalPlayerId() : (-1));
if (isHostOrServer)
{
PlaySoundClientRpc(index, fromPlayerId);
}
else
{
PlaySoundServerRpc(index, fromPlayerId);
}
PlaySoundOnLocalClient(index);
}
[ServerRpc(RequireOwnership = false)]
protected void PlaySoundServerRpc(int index, int fromPlayerId)
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3879375848u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, index);
BytePacker.WriteValueBitPacked(val2, fromPlayerId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3879375848u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
PlaySoundClientRpc(index, fromPlayerId);
}
}
}
[ClientRpc]
protected void PlaySoundClientRpc(int index, int fromPlayerId)
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1515505519u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, index);
BytePacker.WriteValueBitPacked(val2, fromPlayerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1515505519u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !Utils.IsLocalPlayerId(fromPlayerId))
{
PlaySoundOnLocalClient(index);
}
}
}
protected void PlaySoundOnLocalClient(int index)
{
AudioClip audioClip = base.noiseSFX[index];
AudioClip audioClipFar = base.noiseSFXFar[index];
PlaySoundOnLocalClient(audioClip, audioClipFar);
}
protected void PlaySoundOnLocalClient(AudioClip audioClip, AudioClip audioClipFar)
{
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
float num = (float)noisemakerRandom.Next((int)(base.minLoudness * 100f), (int)(base.maxLoudness * 100f)) / 100f;
float pitch = (float)noisemakerRandom.Next((int)(base.minPitch * 100f), (int)(base.maxPitch * 100f)) / 100f;
if (cancelActiveSFXOnItemActivate)
{
base.noiseAudio.Stop();
base.noiseAudioFar.Stop();
}
if (useDynamicCooldown && !cancelActiveSFXOnItemActivate)
{
((GrabbableObject)this).currentUseCooldown = audioClip.length;
}
base.noiseAudio.pitch = pitch;
base.noiseAudio.PlayOneShot(audioClip, num);
if ((Object)(object)base.noiseAudioFar != (Object)null && (Object)(object)audioClipFar != (Object)null)
{
base.noiseAudioFar.pitch = pitch;
base.noiseAudioFar.PlayOneShot(audioClipFar, num);
}
if ((Object)(object)base.triggerAnimator != (Object)null)
{
base.triggerAnimator.SetTrigger("playAnim");
}
WalkieTalkie.TransmitOneShotAudio(base.noiseAudio, audioClip, num);
RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, base.noiseRange, num, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
if (base.minLoudness >= 0.6f && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
{
((GrabbableObject)this).playerHeldBy.timeSinceMakingLoudNoise = 0f;
}
}
protected override void __initializeVariables()
{
((NoisemakerProp)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_AdvancedNoisemakerProp()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3879375848u, new RpcReceiveHandler(__rpc_handler_3879375848));
NetworkManager.__rpc_func_table.Add(1515505519u, new RpcReceiveHandler(__rpc_handler_1515505519));
}
private static void __rpc_handler_3879375848(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);
int fromPlayerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref fromPlayerId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((AdvancedNoisemakerProp)(object)target).PlaySoundServerRpc(index, fromPlayerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1515505519(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);
int fromPlayerId = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref fromPlayerId);
target.__rpc_exec_stage = (__RpcExecStage)2;
((AdvancedNoisemakerProp)(object)target).PlaySoundClientRpc(index, fromPlayerId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "AdvancedNoisemakerProp";
}
}
public class AdvancedRadioNoisemakerProp : AdvancedNoisemakerProp
{
[HideInInspector]
public NetworkVariable<bool> isRadioModeEnabled = new NetworkVariable<bool>(true, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);
[HideInInspector]
public NetworkVariable<bool> isRadioMode = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);
[HideInInspector]
public NetworkVariable<int> clipIndex = new NetworkVariable<int>(0, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);
public override void OnNetworkSpawn()
{
NetworkVariable<bool> obj = isRadioMode;
obj.OnValueChanged = (OnValueChangedDelegate<bool>)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<bool>(OnIsRadioModeChanged));
NetworkVariable<int> obj2 = clipIndex;
obj2.OnValueChanged = (OnValueChangedDelegate<int>)(object)Delegate.Combine((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<int>(OnClipIndexChanged));
isRadioModeEnabled.Value = Plugin.ConfigManager.EnableRadioMode;
}
public override void LoadItemSaveData(int saveData)
{
base.LoadItemSaveData(saveData);
bool flag = SaveLoadHandler.LoadData<bool>(base.saveKey + "_isRadioMode", (SaveLocation)0, false, true);
int value = SaveLoadHandler.LoadData<int>(base.saveKey + "_clipIndex", (SaveLocation)0, 0, true);
isRadioMode.Value = isRadioModeEnabled.Value && flag;
clipIndex.Value = value;
}
public override int GetItemDataToSave()
{
SaveItemData();
return base.GetItemDataToSave();
}
private void SaveItemData()
{
SaveLoadHandler.SaveData<bool>(isRadioMode.Value, base.saveKey + "_isRadioMode", (SaveLocation)0, true);
SaveLoadHandler.SaveData<int>(clipIndex.Value, base.saveKey + "_clipIndex", (SaveLocation)0, true);
}
public override void OnNetworkDespawn()
{
NetworkVariable<bool> obj = isRadioMode;
obj.OnValueChanged = (OnValueChangedDelegate<bool>)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<bool>(OnIsRadioModeChanged));
NetworkVariable<int> obj2 = clipIndex;
obj2.OnValueChanged = (OnValueChangedDelegate<int>)(object)Delegate.Remove((Delegate?)(object)obj2.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<int>(OnClipIndexChanged));
}
public override void EquipItem()
{
((GrabbableObject)this).EquipItem();
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
{
((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true;
}
}
public override void DiscardItem()
{
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
{
((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false;
}
((GrabbableObject)this).DiscardItem();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
if (base.canActivateItem)
{
int index = Random.Range(0, ((NoisemakerProp)this).noiseSFX.Length);
if (isRadioMode.Value)
{
index = clipIndex.Value;
}
PlaySound(index);
}
}
public override void ItemInteractLeftRight(bool right)
{
((GrabbableObject)this).ItemInteractLeftRight(right);
if (base.isHeldByLocalPlayer)
{
if (right)
{
ItemInteractRight();
}
else
{
ItemInteractLeft();
}
}
}
private void ItemInteractLeft()
{
if (isRadioModeEnabled.Value)
{
SetIsRadioMode(!isRadioMode.Value);
SaveItemData();
}
}
private void ItemInteractRight()
{
if (isRadioMode.Value)
{
SetClipIndex(GetNextClipIndex());
SaveItemData();
}
}
private int GetNextClipIndex()
{
int num = clipIndex.Value + 1;
if (num > ((NoisemakerProp)this).noiseSFX.Length - 1)
{
num = 0;
}
return num;
}
public override void SetControlTipsForItem()
{
SetControlTips();
}
private void SetControlTips()
{
if (base.isHeldByLocalPlayer)
{
if (isRadioMode.Value)
{
SetRadioControlTips();
}
else
{
SetDefaultControlTips();
}
}
}
private void SetDefaultControlTips()
{
string[] arrayWithMinLength = GetArrayWithMinLength(((GrabbableObject)this).itemProperties.toolTips, 3);
arrayWithMinLength[0] = "Squeeze : [LMB]";
arrayWithMinLength[1] = (isRadioModeEnabled.Value ? "Switch Mode : [Q]" : string.Empty);
arrayWithMinLength[2] = string.Empty;
HUDManager.Instance.ChangeControlTipMultiple(arrayWithMinLength, base.isHeldByLocalPlayer, ((GrabbableObject)this).itemProperties);
}
private void SetRadioControlTips()
{
string[] arrayWithMinLength = GetArrayWithMinLength(((GrabbableObject)this).itemProperties.toolTips, 3);
arrayWithMinLength[0] = $"Squeeze #{clipIndex.Value} : [LMB]";
arrayWithMinLength[1] = "Switch Mode : [Q]";
arrayWithMinLength[2] = "Next Clip : [E]";
HUDManager.Instance.ChangeControlTipMultiple(arrayWithMinLength, base.isHeldByLocalPlayer, ((GrabbableObject)this).itemProperties);
}
private void SetIsRadioMode(bool enabled)
{
if (base.isHostOrServer)
{
isRadioMode.Value = enabled;
}
else
{
SetIsRadioModeServerRpc(enabled);
}
}
[ServerRpc(RequireOwnership = false)]
private void SetIsRadioModeServerRpc(bool enabled)
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3305914366u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enabled, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3305914366u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
isRadioMode.Value = enabled;
}
}
}
private void OnIsRadioModeChanged(bool previous, bool current)
{
SetControlTips();
}
private void SetClipIndex(int index)
{
if (base.isHostOrServer)
{
clipIndex.Value = index;
}
else
{
SetClipIndexServerRpc(index);
}
}
[ServerRpc(RequireOwnership = false)]
private void SetClipIndexServerRpc(int index)
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1409473325u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, index);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1409473325u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
clipIndex.Value = index;
}
}
}
private void OnClipIndexChanged(int previous, int current)
{
SetControlTips();
}
private string[] GetArrayWithMinLength(string[] array, int minLength)
{
List<string> list = array.ToList();
int num = minLength - list.Count;
if (num < 0)
{
num = 0;
}
for (int i = 0; i < num; i++)
{
list.Add(string.Empty);
}
return list.ToArray();
}
protected override void __initializeVariables()
{
if (isRadioModeEnabled == null)
{
throw new Exception("AdvancedRadioNoisemakerProp.isRadioModeEnabled cannot be null. All NetworkVariableBase instances must be initialized.");
}
((NetworkVariableBase)isRadioModeEnabled).Initialize((NetworkBehaviour)(object)this);
((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isRadioModeEnabled, "isRadioModeEnabled");
((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isRadioModeEnabled);
if (isRadioMode == null)
{
throw new Exception("AdvancedRadioNoisemakerProp.isRadioMode cannot be null. All NetworkVariableBase instances must be initialized.");
}
((NetworkVariableBase)isRadioMode).Initialize((NetworkBehaviour)(object)this);
((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isRadioMode, "isRadioMode");
((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isRadioMode);
if (clipIndex == null)
{
throw new Exception("AdvancedRadioNoisemakerProp.clipIndex cannot be null. All NetworkVariableBase instances must be initialized.");
}
((NetworkVariableBase)clipIndex).Initialize((NetworkBehaviour)(object)this);
((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)clipIndex, "clipIndex");
((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)clipIndex);
base.__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_AdvancedRadioNoisemakerProp()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3305914366u, new RpcReceiveHandler(__rpc_handler_3305914366));
NetworkManager.__rpc_func_table.Add(1409473325u, new RpcReceiveHandler(__rpc_handler_1409473325));
}
private static void __rpc_handler_3305914366(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)
{
bool isRadioModeServerRpc = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isRadioModeServerRpc, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((AdvancedRadioNoisemakerProp)(object)target).SetIsRadioModeServerRpc(isRadioModeServerRpc);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1409473325(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 clipIndexServerRpc = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref clipIndexServerRpc);
target.__rpc_exec_stage = (__RpcExecStage)1;
((AdvancedRadioNoisemakerProp)(object)target).SetClipIndexServerRpc(clipIndexServerRpc);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "AdvancedRadioNoisemakerProp";
}
}
internal class PluginNetworkBehaviour : NetworkBehaviour
{
public static PluginNetworkBehaviour Instance;
private void Awake()
{
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
}
[ServerRpc]
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_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: Invalid comparison between Unknown and I4
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2232256189u, 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, 2232256189u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
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_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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3392826419u, 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, 3392826419u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !Plugin.IsHostOrServer)
{
Utils.CreateExplosion(position, spawnExplosionEffect: true, damage, 0f, maxDamageRange, 6, (CauseOfDeath)3);
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_PluginNetworkBehaviour()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(2232256189u, new RpcReceiveHandler(__rpc_handler_2232256189));
NetworkManager.__rpc_func_table.Add(3392826419u, new RpcReceiveHandler(__rpc_handler_3392826419));
}
private static void __rpc_handler_2232256189(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: 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_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
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_3392826419(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)2;
((PluginNetworkBehaviour)(object)target).SpawnExplosionClientRpc(position, damage, maxDamageRange);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "PluginNetworkBehaviour";
}
}
internal class Takey : AdvancedRadioNoisemakerProp
{
[Header("Takey")]
[Space(3f)]
public ScanNodeProperties scanNodeProperties = null;
public GameObject jetpackObject = null;
public GameObject flameEffectsObject = null;
public AudioSource jetpackAudio = null;
public AudioSource jetpackThrustAudio = null;
public AudioSource jetpackBeepAudio = null;
public AudioSource jetpackWarningBeepAudio = null;
public AudioClip jetpackThrustStartSFX = null;
public AudioClip liftOffSFX = null;
public AudioClip liftOffSFXFar = null;
public float flySpeed = 0.2f;
public float maxFlySpeed = 2f;
public float flySpeedMultiplier = 1.2f;
public float hoverY = 2f;
public float hoverSpeed = 5f;
public float hoverRange = 0.5f;
[HideInInspector]
public NetworkVariable<bool> isEvil = new NetworkVariable<bool>(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0);
public bool isFlying { get; private set; }
public bool isHovering { get; private set; }
public override void OnNetworkSpawn()
{
base.OnNetworkSpawn();
if (Plugin.IsHostOrServer)
{
isEvil.Value = GetIsEvilRoll();
}
}
public override void InteractItem()
{
((GrabbableObject)this).InteractItem();
if (isEvil.Value && !isFlying && !((GrabbableObject)this).isHeld)
{
StartFlyingServerRpc();
}
else if (((GrabbableObject)this).grabbable)
{
StopFlyingServerRpc();
}
}
public override void DiscardItem()
{
base.DiscardItem();
RollIsEvilServerRpc();
}
[ServerRpc(RequireOwnership = false)]
public void StartFlyingServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(492595741u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 492595741u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
isEvil.Value = false;
float flyDuration = Plugin.ConfigManager.FlyDuration;
StartFlyingClientRpc(flyDuration);
}
}
}
[ClientRpc]
public void StartFlyingClientRpc(float flyDuration)
{
//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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2016010317u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref flyDuration, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2016010317u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
((MonoBehaviour)this).StopAllCoroutines();
((MonoBehaviour)this).StartCoroutine(StartFlyingOnLocalClient(flyDuration));
SetScanNodeEvil();
}
}
}
[ServerRpc(RequireOwnership = false)]
public void StopFlyingServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3000815762u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3000815762u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
StopFlyingClientRpc();
}
}
}
[ClientRpc]
public void StopFlyingClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3937760835u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3937760835u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
((MonoBehaviour)this).StopAllCoroutines();
((GrabbableObject)this).grabbable = true;
isFlying = false;
isHovering = false;
jetpackObject.SetActive(false);
flameEffectsObject.SetActive(false);
((NoisemakerProp)this).noiseAudio.Stop();
((NoisemakerProp)this).noiseAudioFar.Stop();
jetpackAudio.Stop();
jetpackThrustAudio.Stop();
jetpackBeepAudio.Stop();
jetpackWarningBeepAudio.Stop();
SetScanNodeDefault();
((GrabbableObject)this).currentUseCooldown = 0f;
}
}
}
[ServerRpc(RequireOwnership = false)]
public void RollIsEvilServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: 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_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(947337054u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 947337054u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && !isEvil.Value)
{
isEvil.Value = GetIsEvilRoll();
}
}
}
private IEnumerator StartFlyingOnLocalClient(float flyDuration)
{
isFlying = true;
isHovering = false;
((GrabbableObject)this).grabbable = false;
jetpackObject.SetActive(true);
PlaySoundOnLocalClient(liftOffSFX, liftOffSFXFar);
jetpackAudio.PlayOneShot(jetpackThrustStartSFX);
jetpackBeepAudio.Play();
yield return (object)new WaitForSeconds(0.3f);
flameEffectsObject.SetActive(true);
jetpackThrustAudio.Play();
float startY = ((Component)this).transform.localPosition.y;
float hoverPositionY = 0f;
float speed = flySpeed;
float timer = 0f;
float hoverTime = 0f;
for (; !(timer > flyDuration); timer += Time.deltaTime)
{
Vector3 position = ((Component)this).transform.localPosition;
speed += flySpeedMultiplier * Time.deltaTime;
if (speed > maxFlySpeed)
{
speed = maxFlySpeed;
}
if (!isHovering)
{
position.y += speed * Time.deltaTime;
}
else
{
position.y = hoverPositionY + Mathf.Sin(hoverTime * hoverSpeed) * hoverRange;
hoverTime += Time.deltaTime;
}
float yOffset = position.y - startY;
if (!isHovering && yOffset >= hoverY)
{
hoverPositionY = position.y;
isHovering = true;
((GrabbableObject)this).grabbable = true;
}
if (timer >= flyDuration - 1f && !jetpackWarningBeepAudio.isPlaying)
{
jetpackBeepAudio.Stop();
jetpackWarningBeepAudio.Play();
}
((Component)this).transform.localPosition = position;
yield return null;
}
if (!((GrabbableObject)this).isHeld && !((GrabbableObject)this).isPocketed)
{
flameEffectsObject.SetActive(false);
jetpackAudio.Stop();
jetpackBeepAudio.Stop();
jetpackWarningBeepAudio.Stop();
jetpackThrustAudio.Stop();
if (Plugin.IsHostOrServer)
{
int damage = Plugin.ConfigManager.ExplosionDamage;
float maxDamageRange = Plugin.ConfigManager.MaxExplosionRange;
PluginNetworkBehaviour.Instance.SpawnExplosionServerRpc(((Component)this).transform.position, damage, maxDamageRange);
Utils.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage, 0f, maxDamageRange, 6, (CauseOfDeath)3);
((Component)this).GetComponent<NetworkObject>().Despawn(true);
}
}
}
public override void Update()
{
if (isEvil.Value)
{
((GrabbableObject)this).grabbable = false;
}
if (!isFlying && !isHovering)
{
((GrabbableObject)this).Update();
}
}
private bool GetIsEvilRoll()
{
return Utils.RandomPercent(Plugin.ConfigManager.EvilTakeyChance);
}
private void SetScanNodeDefault()
{
scanNodeProperties.headerText = ((GrabbableObject)this).itemProperties.itemName;
scanNodeProperties.nodeType = 2;
}
private void SetScanNodeEvil()
{
scanNodeProperties.headerText = "Evil Smol Takey";
scanNodeProperties.nodeType = 1;
}
protected override void __initializeVariables()
{
if (isEvil == null)
{
throw new Exception("Takey.isEvil cannot be null. All NetworkVariableBase instances must be initialized.");
}
((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this);
((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil");
((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil);
base.__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_Takey()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(492595741u, new RpcReceiveHandler(__rpc_handler_492595741));
NetworkManager.__rpc_func_table.Add(2016010317u, new RpcReceiveHandler(__rpc_handler_2016010317));
NetworkManager.__rpc_func_table.Add(3000815762u, new RpcReceiveHandler(__rpc_handler_3000815762));
NetworkManager.__rpc_func_table.Add(3937760835u, new RpcReceiveHandler(__rpc_handler_3937760835));
NetworkManager.__rpc_func_table.Add(947337054u, new RpcReceiveHandler(__rpc_handler_947337054));
}
private static void __rpc_handler_492595741(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((Takey)(object)target).StartFlyingServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2016010317(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)
{
float flyDuration = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref flyDuration, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)2;
((Takey)(object)target).StartFlyingClientRpc(flyDuration);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3000815762(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((Takey)(object)target).StopFlyingServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3937760835(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((Takey)(object)target).StopFlyingClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_947337054(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((Takey)(object)target).RollIsEvilServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "Takey";
}
}
}
namespace com.github.zehsteam.TakeyPlush.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}