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.Bootstrap;
using BepInEx.Configuration;
using ChillaxScraps.CustomEffects;
using ChillaxScraps.NetcodePatcher;
using ChillaxScraps.Utils;
using CodeRebirth.src.Content.Enemies;
using DigitalRuby.ThunderAndLightning;
using GameNetcodeStuff;
using HarmonyLib;
using LegendWeathers.Weathers;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using PremiumScraps;
using SelfSortingStorage.Cupboard;
using ShipInventoryUpdated.Helpers.API;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.UI;
using WeatherRegistry;
[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: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("PremiumScraps")]
[assembly: IgnoresAccessChecksTo("WeatherRegistry")]
[assembly: AssemblyCompany("ChillaxScraps")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+04240a0738897fc76c71a8149e5ab879170015b7")]
[assembly: AssemblyProduct("ChillaxScraps")]
[assembly: AssemblyTitle("ChillaxScraps")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: NetcodePatchedAssembly]
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;
}
}
}
namespace ChillaxScraps
{
internal class Config
{
public bool StarlancerAIFix = false;
public bool WeatherRegistery = false;
public readonly List<ulong> unluckyPlayersID = new List<ulong>();
public readonly List<(int, int)> scrapValues = new List<(int, int)>();
public readonly ConfigEntry<int> masterSwordDmg;
public readonly ConfigEntry<bool> evilBoink;
public readonly ConfigEntry<bool> deathnoteRechargeOrbit;
public readonly ConfigEntry<bool> deathnoteNoLimit;
public readonly ConfigEntry<int> freddyInvisibilityChance;
public readonly ConfigEntry<bool> ocarinaUniqueSongs;
public readonly ConfigEntry<bool> ocarinaRestrictUsage;
public readonly List<ConfigEntry<int>> entries = new List<ConfigEntry<int>>();
public readonly List<ConfigEntry<string>> values = new List<ConfigEntry<string>>();
public Config(ConfigFile cfg, List<Scrap> scraps)
{
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Expected O, but got Unknown
cfg.SaveOnConfigSet = false;
masterSwordDmg = cfg.Bind<int>("Items", "Master Sword damage", 4, "Only the chosen hero can grab this sword, so it's supposed to be strong.");
evilBoink = cfg.Bind<bool>("Items", "Evil Boink", false, "Activate this to turn Boink into an evil bird, can have negative consequences.");
deathnoteRechargeOrbit = cfg.Bind<bool>("Items", "Death Note recharge in orbit", false, "Allows the Death Note to automatically enter the recharge state when in orbit, if it's not already recharging.");
deathnoteNoLimit = cfg.Bind<bool>("Items", "Death Note no limit", false, "Removes the 'one user per player' condition for the Death Note, so there is 3 max usage until the recharge mode. With this config activated the recharge mode is going to be a bit slower than usual.");
freddyInvisibilityChance = cfg.Bind<int>("Items", "Freddy bad effect chance", 70, new ConfigDescription("Chance in % of Freddy Fazbear starting the invisibility phase when spawning inside the facility (do some bad things).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
ocarinaUniqueSongs = cfg.Bind<bool>("Items", "Ocarina unique songs", false, "Activate this if you want every connected player to have a randomly selected Ocarina song assigned to them.");
ocarinaRestrictUsage = cfg.Bind<bool>("Items", "Ocarina restrict usage", true, "Restrict the usage of Ocarina songs effects to 1, 2 or more times per moons. Setting this to false allows infinite usage of the songs effects but it's recommanded to not change this as it will be unbalanced.");
foreach (Scrap scrap in scraps)
{
entries.Add(cfg.Bind<int>("Spawn chance", scrap.asset.Split("/")[0], scrap.rarity, (ConfigDescription)null));
values.Add(cfg.Bind<string>("Values", scrap.asset.Split("/")[0], "", "Min,max value of the item, follow the format 200,300 or empty for default.\nIn-game value will be randomized between these numbers and divided by 2.5."));
}
cfg.Save();
cfg.SaveOnConfigSet = true;
}
public void SetupCustomConfigs()
{
if (Chainloader.PluginInfos.ContainsKey("AudioKnight.StarlancerAIFix"))
{
StarlancerAIFix = true;
}
if (Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry"))
{
WeatherRegistery = true;
}
foreach (ConfigEntry<string> value in values)
{
if (value.Value == "")
{
scrapValues.Add((-1, -1));
continue;
}
string[] array = (from s in value.Value.Split(',')
select s.Trim()).ToArray();
int result;
int result2;
if (array.Count() != 2)
{
scrapValues.Add((-1, -1));
}
else if (!int.TryParse(array[0], out result) || !int.TryParse(array[1], out result2))
{
scrapValues.Add((-1, -1));
}
else if (result > result2)
{
scrapValues.Add((-1, -1));
}
else
{
scrapValues.Add((result, result2));
}
}
}
public void SetupUnluckyPlayersConfig()
{
if (Plugin.config == null || Plugin.config.unluckyPlayersID == null)
{
return;
}
foreach (ulong item in Plugin.config.unluckyPlayersID)
{
unluckyPlayersID.Add(item);
}
}
}
[BepInPlugin("zigzag.chillaxscraps", "ChillaxScraps", "1.6.6")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
private const string GUID = "zigzag.chillaxscraps";
private const string NAME = "ChillaxScraps";
private const string VERSION = "1.6.6";
public static Plugin instance;
public static List<AudioClip> audioClips = new List<AudioClip>();
public static List<GameObject> gameObjects = new List<GameObject>();
private readonly Harmony harmony = new Harmony("zigzag.chillaxscraps");
internal static Config config { get; private set; } = null;
private void HarmonyPatchAll()
{
harmony.CreateClassProcessor(typeof(GetEnemies), true).Patch();
harmony.CreateClassProcessor(typeof(ChillaxPlayerControllerBPatch), true).Patch();
harmony.CreateClassProcessor(typeof(EnemyAIPatch), true).Patch();
if (Chainloader.PluginInfos.ContainsKey("org.lethalcompanymodding.shipinventoryupdated"))
{
ShipInventoryConditions.Setup(Chainloader.PluginInfos.GetValueOrDefault("org.lethalcompanymodding.shipinventoryupdated").Metadata);
}
if (Chainloader.PluginInfos.ContainsKey("zigzag.SelfSortingStorage"))
{
SSSConditions.Setup(Chainloader.PluginInfos.GetValueOrDefault("zigzag.SelfSortingStorage").Metadata);
}
}
private void LoadItemBehaviour(Item item, int behaviourId)
{
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Expected O, but got Unknown
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Expected O, but got Unknown
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Expected O, but got Unknown
GrabbableObject val;
switch (behaviourId)
{
default:
return;
case 1:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<DeathNote>();
break;
case 2:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Boink>();
break;
case 3:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Food>();
break;
case 4:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<UnoReverse>();
break;
case 5:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<EmergencyMeeting>();
break;
case 6:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<SuperSneakers>();
break;
case 7:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<MasterSword>();
SetupScript.Copy((Shovel)val, item);
break;
case 8:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Ocarina>();
SetupScript.Copy((NoisemakerProp)val, item);
break;
case 9:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<TotemOfUndying>();
break;
case 10:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<DanceNote>();
break;
case 11:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Nokia>();
SetupScript.Copy((WalkieTalkie)val, item);
break;
case 12:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Freddy>();
break;
case 13:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<UnoReverseDX>();
break;
case 14:
val = (GrabbableObject)(object)item.spawnPrefab.AddComponent<Moyai>();
break;
}
val.grabbable = true;
val.isInFactory = true;
val.grabbableToEnemies = true;
val.itemProperties = item;
}
private void Awake()
{
instance = this;
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "chillaxscraps");
AssetBundle val = AssetBundle.LoadFromFile(text);
string text2 = "Assets/Data/";
string[] array = new string[8] { "DeathNote/DeathNoteCanvas.prefab", "EmergencyMeeting/EmergencyMeetingCanvas.prefab", "Ocarina/ElegyOfEmptiness.prefab", "DanceNote/DanceNoteCanvas.prefab", "DanceNote/WarningCanvas.prefab", "DanceNote/Glow.prefab", "DanceNote/GlowBoom.prefab", "SuperSneakers/JumpBoostEffect.prefab" };
string[] array2 = new string[53]
{
"Page_Turn_Sound_Effect.wav", "Death_Note_Heart_Attack_Sound_Effect.wav", "Boink.wav", "EatSFX.wav", "uno-reverse-biaatch.wav", "emergencymeeting.wav", "sneakers-activate.wav", "sneakers-deactivate.wav", "OOT_Fanfare_Item.wav", "undying.wav",
"OOT_Warp_Song_In.wav", "OOT_Warp_Song_Out.wav", "OOT_Secret.wav", "OOT_SpiritualStone_Appear.wav", "OOT_Warp_Respawn_In.wav", "OOT_YoungEpona_Neigh.wav", "Epona_Breath.wav", "Epona_KillPlayer.wav", "OOT_YoungEpona_Walk.wav", "OOT_Epona_Walk.wav",
"OOT_Epona_Hooves.wav", "Epona_growl.wav", "Epona_Lunge.wav", "giant-spawn.wav", "giant-eating.wav", "MM_ClockTower_Bell.wav", "MM_Wizrobe_Appear.wav", "MM_GaleWarp_Out.wav", "MM_Goron_Ohhh.wav", "OOT_Biggoron_Ohh.wav",
"OOT_Goron_Oop.wav", "OOT_Goron_Ohrr.wav", "MM_Goron_Oh.wav", "New_Wave_Bossa_Nova_by_The_Indigo-gos.wav", "MM_Warp.wav", "ChargeItem.ogg", "DeathNoteL.wav", "DanceNoteBassPractice.wav", "DanceNote1-Ching.wav", "DanceNote2-Giorno.wav",
"DanceNote3-Nyan.wav", "DanceNote4-Spectre.wav", "DanceNote5-Gucci.wav", "DanceNote6-Heyyeya.wav", "nokia1.wav", "nokia2.wav", "nokia1-far.wav", "nokia2-far.wav", "toy.wav", "at_door.wav",
"Freddy_Fazbear.wav", "OOT_Song_Correct.wav", "moyai.wav"
};
string[] array3 = array;
foreach (string text3 in array3)
{
gameObjects.Add(val.LoadAsset<GameObject>(text2 + text3));
}
string[] array4 = array2;
foreach (string text4 in array4)
{
audioClips.Add(val.LoadAsset<AudioClip>(text2 + "_audio/" + text4));
}
List<Scrap> list = new List<Scrap>
{
new Scrap("DeathNote/DeathNoteItem.asset", 6, 1),
new Scrap("Boink/BoinkItem.asset", 11, 2),
new Scrap("Eevee/EeveeItem.asset", 10),
new Scrap("CupNoodle/CupNoodleItem.asset", 12, 3),
new Scrap("Moai/MoaiItem.asset", 9, 14),
new Scrap("UnoReverseCard/UnoReverseCardItem.asset", 10, 4),
new Scrap("FroggyChair/FroggyChairItem.asset", 10),
new Scrap("EmergencyMeeting/EmergencyMeetingItem.asset", 6, 5),
new Scrap("SuperSneakers/SuperSneakersItem.asset", 10, 6),
new Scrap("MasterSword/MasterSwordItem.asset", 8, 7),
new Scrap("Ocarina/OcarinaItem.asset", 10, 8),
new Scrap("TotemOfUndying/TotemOfUndyingItem.asset", 7, 9),
new Scrap("DanceNote/DanceNoteItem.asset", 6, 10),
new Scrap("Nokia/NokiaItem.asset", 12, 11),
new Scrap("FreddyFazbear/FreddyFazbearItem.asset", 8, 12),
new Scrap("UnoReverseCardDX/UnoReverseCardDXItem.asset", 7, 13)
};
int index = 0;
config = new Config(((BaseUnityPlugin)this).Config, list);
config.SetupCustomConfigs();
if (Chainloader.PluginInfos.ContainsKey("zigzag.premiumscraps") && new Version("2.0.11").CompareTo(Chainloader.PluginInfos.GetValueOrDefault("zigzag.premiumscraps").Metadata.Version) <= 0)
{
config.SetupUnluckyPlayersConfig();
}
SetupScript.Network();
foreach (Scrap item in list)
{
Item val2 = val.LoadAsset<Item>(text2 + item.asset);
if (config.scrapValues[index].Item1 != -1)
{
val2.minValue = config.scrapValues[index].Item1;
val2.maxValue = config.scrapValues[index].Item2;
}
if (item.behaviourId != 0)
{
LoadItemBehaviour(val2, item.behaviourId);
}
NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
Items.RegisterScrap(val2, config.entries[index++].Value, (LevelTypes)(-1));
}
HarmonyPatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"ChillaxScraps is loaded !");
}
}
}
namespace ChillaxScraps.Utils
{
public class Scrap
{
public string asset;
public int rarity;
public int behaviourId;
public Scrap(string asset, int rarity, int behaviourId = 0)
{
this.asset = asset;
this.rarity = rarity;
this.behaviourId = behaviourId;
}
}
public class NetworkReference
{
public NetworkObjectReference netObjectRef;
public int value;
public NetworkReference(NetworkObjectReference netObjectRef, int value)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
this.netObjectRef = netObjectRef;
this.value = value;
}
}
public class SetupScript
{
public static void Network()
{
IEnumerable<Type> enumerable;
try
{
enumerable = Assembly.GetExecutingAssembly().GetTypes();
}
catch (ReflectionTypeLoadException ex)
{
enumerable = ex.Types.Where((Type t) => t != null);
}
foreach (Type item in enumerable)
{
MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo[] array = methods;
foreach (MethodInfo methodInfo in array)
{
object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
if (customAttributes.Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
}
public static void Copy(NoisemakerProp target, Item item)
{
NoisemakerProp component = item.spawnPrefab.GetComponent<NoisemakerProp>();
((GrabbableObject)target).useCooldown = ((GrabbableObject)component).useCooldown;
target.noiseAudio = component.noiseAudio;
target.noiseAudioFar = component.noiseAudioFar;
target.noiseSFX = (AudioClip[])(object)new AudioClip[component.noiseSFX.Length];
for (int i = 0; i < component.noiseSFX.Length; i++)
{
target.noiseSFX[i] = component.noiseSFX[i];
}
target.noiseSFXFar = (AudioClip[])(object)new AudioClip[component.noiseSFXFar.Length];
for (int j = 0; j < component.noiseSFXFar.Length; j++)
{
target.noiseSFXFar[j] = component.noiseSFXFar[j];
}
target.noiseRange = component.noiseRange;
target.maxLoudness = component.maxLoudness;
target.minLoudness = component.minLoudness;
target.minPitch = component.minPitch;
target.maxPitch = component.maxPitch;
target.triggerAnimator = component.triggerAnimator;
Object.Destroy((Object)(object)component);
}
public static void Copy(Shovel target, Item item)
{
Shovel component = item.spawnPrefab.GetComponent<Shovel>();
target.shovelHitForce = component.shovelHitForce;
target.reelUp = component.reelUp;
target.swing = component.swing;
target.hitSFX = (AudioClip[])(object)new AudioClip[component.hitSFX.Length];
for (int i = 0; i < component.hitSFX.Length; i++)
{
target.hitSFX[i] = component.hitSFX[i];
}
target.shovelAudio = component.shovelAudio;
Object.Destroy((Object)(object)component);
}
public static void Copy(SoccerBallProp target, Item item)
{
SoccerBallProp component = item.spawnPrefab.GetComponent<SoccerBallProp>();
target.ballHitUpwardAmount = component.ballHitUpwardAmount;
target.grenadeFallCurve = component.grenadeFallCurve;
target.grenadeVerticalFallCurve = component.grenadeVerticalFallCurve;
target.soccerBallVerticalOffset = component.soccerBallVerticalOffset;
target.grenadeVerticalFallCurveNoBounce = component.grenadeVerticalFallCurveNoBounce;
target.hitBallSFX = (AudioClip[])(object)new AudioClip[component.hitBallSFX.Length];
for (int i = 0; i < component.hitBallSFX.Length; i++)
{
target.hitBallSFX[i] = component.hitBallSFX[i];
}
target.ballHitFloorSFX = (AudioClip[])(object)new AudioClip[component.ballHitFloorSFX.Length];
for (int j = 0; j < component.ballHitFloorSFX.Length; j++)
{
target.ballHitFloorSFX[j] = component.ballHitFloorSFX[j];
}
target.soccerBallAudio = component.soccerBallAudio;
target.ballCollider = component.ballCollider;
GrabbableObjectPhysicsTrigger componentInChildren = item.spawnPrefab.GetComponentInChildren<GrabbableObjectPhysicsTrigger>();
componentInChildren.itemScript = (GrabbableObject)(object)target;
Object.Destroy((Object)(object)component);
}
public static void Copy(WalkieTalkie target, Item item)
{
WalkieTalkie component = item.spawnPrefab.GetComponent<WalkieTalkie>();
((GrabbableObject)target).insertedBattery = ((GrabbableObject)component).insertedBattery;
((GrabbableObject)target).insertedBattery.charge = ((GrabbableObject)component).insertedBattery.charge;
((GrabbableObject)target).mainObjectRenderer = ((GrabbableObject)component).mainObjectRenderer;
target.thisAudio = component.thisAudio;
target.stopTransmissionSFX = (AudioClip[])(object)new AudioClip[component.stopTransmissionSFX.Length];
for (int i = 0; i < component.stopTransmissionSFX.Length; i++)
{
target.stopTransmissionSFX[i] = component.stopTransmissionSFX[i];
}
target.startTransmissionSFX = (AudioClip[])(object)new AudioClip[component.startTransmissionSFX.Length];
for (int j = 0; j < component.startTransmissionSFX.Length; j++)
{
target.startTransmissionSFX[j] = component.startTransmissionSFX[j];
}
target.switchWalkieTalkiePowerOff = component.switchWalkieTalkiePowerOff;
target.switchWalkieTalkiePowerOn = component.switchWalkieTalkiePowerOn;
target.talkingOnWalkieTalkieNotHeldSFX = component.talkingOnWalkieTalkieNotHeldSFX;
target.playerDieOnWalkieTalkieSFX = component.playerDieOnWalkieTalkieSFX;
target.onMaterial = component.onMaterial;
target.offMaterial = component.offMaterial;
target.walkieTalkieLight = component.walkieTalkieLight;
target.target = component.target;
target.recordingRange = component.recordingRange;
target.maxVolume = component.maxVolume;
target.collidersInRange = (Collider[])(object)new Collider[component.collidersInRange.Length];
target.wallAudio = component.wallAudio;
target.wallAudios = (AudioClip[])(object)new AudioClip[component.wallAudios.Length];
for (int k = 0; k < component.wallAudios.Length; k++)
{
target.wallAudios[k] = component.wallAudios[k];
}
Object.Destroy((Object)(object)component);
}
}
internal class Effects
{
public enum DeathAnimation
{
Normal,
NoHead1,
Spring,
Haunted,
Mask1,
Mask2,
Fire,
CutInHalf,
NoHead2
}
[CompilerGenerated]
private sealed class <DamageHost>d__6 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB player;
public int damageNb;
public CauseOfDeath cause;
public int animation;
public bool criticalBlood;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DamageHost>d__6(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
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;
Damage(player, damageNb, cause, animation, criticalBlood);
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 <FadeOutAudio>d__18 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public AudioSource source;
public float time;
private float <volume>5__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <FadeOutAudio>d__18(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: 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;
<volume>5__1 = source.volume;
break;
case 2:
<>1__state = -1;
break;
}
if (source.volume > 0f)
{
AudioSource obj = source;
obj.volume -= <volume>5__1 * Time.deltaTime / time;
<>2__current = null;
<>1__state = 2;
return true;
}
source.Stop();
source.volume = <volume>5__1;
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 <SyncScrap>d__41 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public NetworkReference reference;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SyncScrap>d__41(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Expected O, but got Unknown
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
RoundManager.Instance.SyncScrapValuesClientRpc((NetworkObjectReference[])(object)new NetworkObjectReference[1] { reference.netObjectRef }, new int[1] { reference.value });
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();
}
}
public static int NbOfPlayers()
{
return StartOfRound.Instance.connectedPlayersAmount + 1;
}
public static bool IsUnlucky(ulong playerId)
{
if (Plugin.config.unluckyPlayersID.Count == 0)
{
return false;
}
return Plugin.config.unluckyPlayersID.Find((ulong id) => id == playerId) != 0;
}
public static List<PlayerControllerB> GetPlayers(bool includeDead = false, bool excludeOutsideFactory = false)
{
List<PlayerControllerB> list = StartOfRound.Instance.allPlayerScripts.ToList();
List<PlayerControllerB> list2 = new List<PlayerControllerB>(list);
foreach (PlayerControllerB item in list)
{
if (!((NetworkBehaviour)item).IsSpawned || !item.isPlayerControlled || (!includeDead && item.isPlayerDead) || (excludeOutsideFactory && !item.isInsideFactory))
{
list2.Remove(item);
}
}
return list2;
}
public static List<EnemyAI> GetEnemies(bool includeDead = false, bool includeImmortal = false, bool excludeDaytime = false, List<string>? keepSpecificEnemiesList = null)
{
List<EnemyAI> list = Object.FindObjectsOfType<EnemyAI>().ToList();
List<EnemyAI> list2 = new List<EnemyAI>(list);
if (includeDead)
{
return list2;
}
foreach (EnemyAI item in list)
{
if ((!((NetworkBehaviour)item).IsSpawned || item.isEnemyDead || (!includeImmortal && !item.enemyType.canDie) || (excludeDaytime && item.enemyType.isDaytimeEnemy)) && (keepSpecificEnemiesList == null || keepSpecificEnemiesList.Count() == 0 || !keepSpecificEnemiesList.Contains(item.enemyType.enemyName)))
{
list2.Remove(item);
}
}
return list2;
}
public static void Damage(PlayerControllerB player, int damageNb, CauseOfDeath cause = 0, int animation = 0, bool criticalBlood = true)
{
//IL_003f: 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_004a: Unknown result type (might be due to invalid IL or missing references)
damageNb = ((player.health > 100 && damageNb == 100) ? 900 : damageNb);
if (criticalBlood && player.health - damageNb <= 20)
{
player.bleedingHeavily = true;
}
player.DamagePlayer(damageNb, true, true, cause, animation, false, default(Vector3));
}
[IteratorStateMachine(typeof(<DamageHost>d__6))]
public static IEnumerator DamageHost(PlayerControllerB player, int damageNb, CauseOfDeath cause = 0, int animation = 0, bool criticalBlood = true)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DamageHost>d__6(0)
{
player = player,
damageNb = damageNb,
cause = cause,
animation = animation,
criticalBlood = criticalBlood
};
}
public static void Heal(ulong playerID, int health)
{
PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID];
val.health = ((val.health > 100) ? val.health : health);
val.criticallyInjured = false;
val.bleedingHeavily = false;
val.playerBodyAnimator.SetBool("Limp", false);
}
public static void TeleportationLocal(PlayerControllerB player, Vector3 position)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
player.averageVelocity = 0f;
player.velocityLastFrame = Vector3.zero;
player.TeleportPlayer(position, true, 0f, false, true);
player.beamOutParticle.Play();
if (GameNetworkManager.Instance.localPlayerController.playerClientId == player.playerClientId)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
}
}
public static void SetPosFlags(ulong playerID, bool ship = false, bool exterior = false, bool interior = false)
{
PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID];
if (ship)
{
val.isInElevator = true;
val.isInHangarShipRoom = true;
val.isInsideFactory = false;
}
if (exterior)
{
val.isInElevator = false;
val.isInHangarShipRoom = false;
val.isInsideFactory = false;
}
if (interior)
{
val.isInElevator = false;
val.isInHangarShipRoom = false;
val.isInsideFactory = true;
}
GrabbableObject[] itemSlots = val.ItemSlots;
foreach (GrabbableObject val2 in itemSlots)
{
if ((Object)(object)val2 != (Object)null)
{
val2.isInFactory = val.isInsideFactory;
val2.isInElevator = val.isInElevator;
val2.isInShipRoom = val.isInHangarShipRoom;
}
}
if (GameNetworkManager.Instance.localPlayerController.playerClientId == val.playerClientId)
{
if (val.isInsideFactory)
{
TimeOfDay.Instance.DisableAllWeather(false);
}
else
{
ActivateWeatherEffect((LevelWeatherType)0);
}
}
}
public static bool IsPlayerFacingObject<T>(PlayerControllerB player, out T obj, float distance)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(new Ray(((Component)player.gameplayCamera).transform.position, ((Component)player.gameplayCamera).transform.forward), ref val, distance, 2816))
{
obj = ((Component)((RaycastHit)(ref val)).transform).GetComponent<T>();
if (obj != null)
{
return true;
}
}
obj = default(T);
return false;
}
public static bool IsPlayerNearObject<T>(PlayerControllerB player, out T obj, float distance) where T : Component
{
//IL_0013: 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)
T[] array = Object.FindObjectsByType<T>((FindObjectsSortMode)0);
for (int i = 0; i < array.Length; i++)
{
if (Vector3.Distance(((Component)player).transform.position, ((Component)array[i]).transform.position) <= distance)
{
obj = array[i];
return true;
}
}
obj = default(T);
return false;
}
public static Vector3 GetClosestAINodePosition(GameObject[] nodes, Vector3 position)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: 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_0034: Unknown result type (might be due to invalid IL or missing references)
return nodes.OrderBy((GameObject x) => Vector3.Distance(position, x.transform.position)).ToArray()[0].transform.position;
}
public static void Knockback(Vector3 position, float range, int damage = 0, float physicsForce = 30f)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
Landmine.SpawnExplosion(position, false, 0f, range, damage, physicsForce, (GameObject)null, false);
}
public static void DropItem(Vector3 placingPosition = default(Vector3))
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
GameNetworkManager.Instance.localPlayerController.DiscardHeldObject(true, (NetworkObject)null, placingPosition, true);
}
public static void Audio(int audioID, float volume)
{
RoundManager.PlayRandomClip(HUDManager.Instance.UIAudio, (AudioClip[])(object)new AudioClip[1] { Plugin.audioClips[audioID] }, false, volume, 0, 1000);
}
public static void Audio(int audioID, Vector3 startPosition, float localVolume, float clientVolume, PlayerControllerB player)
{
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: 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_0076: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)player != (Object)null && GameNetworkManager.Instance.localPlayerController.playerClientId == player.playerClientId)
{
Audio(audioID, localVolume);
}
else if ((Object)(object)player != (Object)null)
{
player.itemAudio.PlayOneShot(Plugin.audioClips[audioID], clientVolume);
}
else
{
AudioSource.PlayClipAtPoint(Plugin.audioClips[audioID], startPosition + Vector3.up * 2f, clientVolume);
}
}
public static void Audio3D(int audioID, Vector3 position, float volume = 1f, float distance = 20f)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0012: 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_002f: Expected O, but got Unknown
GameObject val = new GameObject("One shot audio");
val.transform.position = position;
AudioSource val2 = (AudioSource)val.AddComponent(typeof(AudioSource));
val2.spatialBlend = 1f;
val2.rolloffMode = (AudioRolloffMode)1;
val2.minDistance = 0f;
val2.maxDistance = distance;
val2.PlayOneShot(Plugin.audioClips[audioID], volume);
Object.Destroy((Object)(object)val, Plugin.audioClips[audioID].length * ((Time.timeScale < 0.01f) ? 0.01f : Time.timeScale));
}
[IteratorStateMachine(typeof(<FadeOutAudio>d__18))]
public static IEnumerator FadeOutAudio(AudioSource source, float time)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <FadeOutAudio>d__18(0)
{
source = source,
time = time
};
}
public static void Message(string title, string bottom, bool warning = false)
{
HUDManager.Instance.DisplayTip(title, bottom, warning, false, "LC_Tip1");
}
public static void ChangeWeather(LevelWeatherType weather)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: 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_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
LevelWeatherType currentWeather = StartOfRound.Instance.currentLevel.currentWeather;
StartOfRound.Instance.currentLevel.currentWeather = weather;
if (Plugin.config.WeatherRegistery)
{
ChangeWeatherWR(weather);
return;
}
RoundManager.Instance.SetToCurrentLevelWeather();
for (int i = 0; i < StartOfRound.Instance.currentLevel.randomWeathers.Length; i++)
{
if (StartOfRound.Instance.currentLevel.randomWeathers[i].weatherType == StartOfRound.Instance.currentLevel.currentWeather)
{
TimeOfDay.Instance.SetWeatherBasedOnVariables(StartOfRound.Instance.currentLevel.randomWeathers[i]);
}
}
if (!GameNetworkManager.Instance.localPlayerController.isInsideFactory)
{
ActivateWeatherEffect(currentWeather);
}
}
public static void ActivateWeatherEffect(LevelWeatherType originalWeather = 0)
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Invalid comparison between Unknown and I4
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Invalid comparison between Unknown and I4
for (int i = 0; i < TimeOfDay.Instance.effects.Length; i++)
{
WeatherEffect val = TimeOfDay.Instance.effects[i];
bool flag = (val.effectEnabled = (int)StartOfRound.Instance.currentLevel.currentWeather == i);
GameObject effectPermanentObject = val.effectPermanentObject;
if (effectPermanentObject != null)
{
effectPermanentObject.SetActive(flag);
}
GameObject effectObject = val.effectObject;
if (effectObject != null)
{
effectObject.SetActive(flag);
}
if ((Object)(object)TimeOfDay.Instance.sunAnimator != (Object)null)
{
if (flag && !string.IsNullOrEmpty(val.sunAnimatorBool))
{
TimeOfDay.Instance.sunAnimator.SetBool(val.sunAnimatorBool, true);
continue;
}
TimeOfDay.Instance.sunAnimator.Rebind();
TimeOfDay.Instance.sunAnimator.Update(0f);
}
}
if ((int)originalWeather == 4)
{
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
localPlayerController.isUnderwater = false;
localPlayerController.sourcesCausingSinking = Mathf.Clamp(localPlayerController.sourcesCausingSinking - 1, 0, 100);
localPlayerController.isMovementHindered = Mathf.Clamp(localPlayerController.isMovementHindered - 1, 0, 100);
localPlayerController.hinderedMultiplier = 1f;
}
}
public static void ChangeWeatherWR(string weatherNameResolvable)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
ChangeWeatherWR(((WeatherResolvable)new WeatherNameResolvable(weatherNameResolvable)).WeatherType);
}
public static void ChangeWeatherWR(LevelWeatherType weather)
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost)
{
WeatherController.SetWeatherEffects(weather);
}
}
public static void AddCombinedWeatherWR(string weatherNameResolvable)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
AddCombinedWeatherWR(((WeatherResolvable)new WeatherNameResolvable(weatherNameResolvable)).WeatherType);
}
public static void AddCombinedWeatherWR(LevelWeatherType weather)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
WeatherController.AddWeatherEffect(weather);
}
public static bool IsWeatherEffectPresent(string weatherNameResolvable)
{
if (Plugin.config.WeatherRegistery)
{
return IsWeatherEffectPresentWR(weatherNameResolvable);
}
return false;
}
public static bool IsWeatherEffectPresent(LevelWeatherType weatherType)
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.config.WeatherRegistery)
{
return IsWeatherEffectPresentWR(weatherType);
}
return StartOfRound.Instance.currentLevel.currentWeather == weatherType;
}
public static bool IsWeatherEffectPresentWR(string weatherNameResolvable)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return IsWeatherEffectPresentWR(((WeatherResolvable)new WeatherNameResolvable(weatherNameResolvable)).WeatherType);
}
public static bool IsWeatherEffectPresentWR(LevelWeatherType weatherType)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < WeatherManager.CurrentEffectTypes.Count; i++)
{
if (WeatherManager.CurrentEffectTypes[i] == weatherType)
{
return true;
}
}
return false;
}
public static bool IsModdedWeatherRegistered(string weatherName)
{
if (Plugin.config.WeatherRegistery)
{
return IsModdedWeatherRegisteredWR(weatherName);
}
return false;
}
public static bool IsModdedWeatherRegisteredWR(string weatherName)
{
List<Weather> registeredWeathers = WeatherManager.RegisteredWeathers;
for (int i = 0; i < registeredWeathers.Count; i++)
{
if (registeredWeathers[i].Name.Equals(weatherName))
{
return true;
}
}
return false;
}
public static bool IsMajoraActiveAndFinalHours()
{
if (!Plugin.config.WeatherRegistery || !IsWeatherEffectPresent("majoramoon"))
{
return false;
}
return IsMajoraFinalHours();
}
public static bool IsMajoraFinalHours()
{
MajoraMoon val = Object.FindObjectOfType<MajoraMoon>();
if ((Object)(object)val == (Object)null)
{
return false;
}
return val.finalHoursDisplayingTimer && !val.finalHoursFinishing && !val.oathToOrderStopingMoon;
}
public static void StopMajora()
{
MajoraMoon val = Object.FindObjectOfType<MajoraMoon>();
if (!((Object)(object)val == (Object)null))
{
val.StopMoonCrash();
}
}
public static void ReplaceRedwoodSfxCR(GameObject enemy)
{
RedwoodTitanAI component = enemy.GetComponent<RedwoodTitanAI>();
component.roarSound = null;
component.spawnSound = Plugin.audioClips[23];
component.eatenSound = Plugin.audioClips[24];
}
public static NetworkObjectReference Spawn(SpawnableEnemyWithRarity enemy, Vector3 position, float yRot = 0f)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: 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_0054: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(enemy.enemyType.enemyPrefab, position, Quaternion.Euler(new Vector3(0f, yRot, 0f)));
val.GetComponentInChildren<NetworkObject>().Spawn(true);
RoundManager.Instance.SpawnedEnemies.Add(val.GetComponent<EnemyAI>());
return new NetworkObjectReference(val);
}
public static void SpawnMaskedOfPlayer(ulong playerId, Vector3 position)
{
//IL_001a: 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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
bool flag = ((Component)component).transform.position.y < -80f;
NetworkObjectReference val = RoundManager.Instance.SpawnEnemyGameObject(position, ((Component)component).transform.eulerAngles.y, -1, ChillaxScraps.Utils.GetEnemies.Masked.enemyType);
NetworkObject val2 = default(NetworkObject);
if (((NetworkObjectReference)(ref val)).TryGet(ref val2, (NetworkManager)null))
{
MaskedPlayerEnemy component2 = ((Component)val2).GetComponent<MaskedPlayerEnemy>();
component2.SetSuit(component.currentSuitID);
component2.mimickingPlayer = component;
((EnemyAI)component2).SetEnemyOutside(!flag);
component2.CreateMimicClientRpc(val, flag, (int)playerId);
}
}
public static void Spawn(SpawnableMapObject trap, Vector3 position, float yRot = 0f)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(trap.prefabToSpawn, position, Quaternion.Euler(new Vector3(0f, yRot, 0f)), RoundManager.Instance.mapPropsContainer.transform);
val.GetComponent<NetworkObject>().Spawn(true);
}
public static SpawnableItemWithRarity GetScrap(string scrapName)
{
string scrapName2 = scrapName;
return ((IEnumerable<SpawnableItemWithRarity>)RoundManager.Instance.currentLevel.spawnableScrap).FirstOrDefault((Func<SpawnableItemWithRarity, bool>)((SpawnableItemWithRarity i) => ((Object)i.spawnableItem).name.Equals(scrapName2)));
}
public static NetworkReference Spawn(SpawnableItemWithRarity scrap, Vector3 position)
{
//IL_0035: 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_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: 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_006e: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
Transform val = (((Object)(object)RoundManager.Instance.spawnedScrapContainer == (Object)null) ? StartOfRound.Instance.elevatorTransform : RoundManager.Instance.spawnedScrapContainer);
GameObject val2 = Object.Instantiate<GameObject>(scrap.spawnableItem.spawnPrefab, position + Vector3.up * 0.25f, Quaternion.identity, val);
GrabbableObject component = val2.GetComponent<GrabbableObject>();
((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation);
component.fallTime = 0f;
component.scrapValue = (int)((float)Random.Range(scrap.spawnableItem.minValue, scrap.spawnableItem.maxValue) * RoundManager.Instance.scrapValueMultiplier);
((NetworkBehaviour)component).NetworkObject.Spawn(false);
component.FallToGround(true, false, default(Vector3));
return new NetworkReference(NetworkObjectReference.op_Implicit(val2.GetComponent<NetworkObject>()), component.scrapValue);
}
[IteratorStateMachine(typeof(<SyncScrap>d__41))]
public static IEnumerator SyncScrap(NetworkReference reference)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <SyncScrap>d__41(0)
{
reference = reference
};
}
public static void SpawnLightningBolt(Vector3 strikePosition, bool damage = true, bool redirectInside = true)
{
//IL_0027: 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_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: 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_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0158: 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_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0174: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
Random random = new Random(StartOfRound.Instance.randomMapSeed);
random.Next(-32, 32);
random.Next(-32, 32);
Vector3 val = strikePosition + Vector3.up * 160f + new Vector3((float)random.Next(-32, 32), 0f, (float)random.Next(-32, 32));
RaycastHit val2 = default(RaycastHit);
if (redirectInside && Physics.Linecast(val, strikePosition + Vector3.up * 0.5f, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
{
RaycastHit val3 = default(RaycastHit);
if (!Physics.Raycast(val, strikePosition - val, ref val3, 100f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
{
return;
}
strikePosition = ((RaycastHit)(ref val3)).point;
}
StormyWeather val4 = Object.FindObjectOfType<StormyWeather>(true);
LightningBoltPrefabScript val5 = Object.Instantiate<LightningBoltPrefabScript>(val4.targetedThunder);
((Behaviour)val5).enabled = true;
((LightningBoltScript)val5).Camera = GameNetworkManager.Instance.localPlayerController.gameplayCamera;
((LightningBoltPrefabScriptBase)val5).AutomaticModeSeconds = 0.2f;
val5.Source.transform.position = val;
val5.Destination.transform.position = strikePosition;
((LightningBoltPrefabScriptBase)val5).CreateLightningBoltsNow();
AudioSource val6 = Object.Instantiate<AudioSource>(val4.targetedStrikeAudio);
((Component)val6).transform.position = strikePosition + Vector3.up * 0.5f;
((Behaviour)val6).enabled = true;
if (damage)
{
Landmine.SpawnExplosion(strikePosition + Vector3.up * 0.25f, false, 2.4f, 5f, 50, 0f, (GameObject)null, false);
}
val4.PlayThunderEffects(strikePosition, val6);
}
}
[HarmonyPatch(typeof(Terminal))]
internal class GetEnemies
{
public static SpawnableEnemyWithRarity Masked;
public static SpawnableEnemyWithRarity HoardingBug;
public static SpawnableEnemyWithRarity SnareFlea;
public static SpawnableEnemyWithRarity Jester;
public static SpawnableEnemyWithRarity Bracken;
public static SpawnableEnemyWithRarity Thumper;
public static SpawnableEnemyWithRarity CoilHead;
public static SpawnableEnemyWithRarity CircuitBees;
public static SpawnableEnemyWithRarity EarthLeviathan;
public static SpawnableEnemyWithRarity BunkerSpider;
public static SpawnableEnemyWithRarity ForestKeeper;
public static SpawnableEnemyWithRarity GhostGirl;
public static SpawnableEnemyWithRarity TulipSnake;
public static SpawnableEnemyWithRarity EyelessDog;
public static SpawnableEnemyWithRarity Maneater;
public static SpawnableEnemyWithRarity Nutcracker;
public static SpawnableEnemyWithRarity Barber;
public static SpawnableEnemyWithRarity Butler;
public static SpawnableEnemyWithRarity OldBird;
public static SpawnableEnemyWithRarity ShyGuy;
public static SpawnableEnemyWithRarity RedwoodTitan;
public static SpawnableEnemyWithRarity RedwoodGiant;
public static SpawnableEnemyWithRarity Locker;
public static SpawnableEnemyWithRarity Bruce;
public static SpawnableEnemyWithRarity BaboonHawk;
public static SpawnableEnemyWithRarity Tornado;
public static SpawnableMapObject Landmine;
public static SpawnableMapObject Turret;
public static SpawnableMapObject SpikeTrap;
public static SpawnableMapObject Seamine;
public static SpawnableMapObject BigBertha;
[HarmonyPatch("Start")]
[HarmonyPostfix]
public static void GetEnemy(Terminal __instance)
{
SelectableLevel[] moonsCatalogueList = __instance.moonsCatalogueList;
foreach (SelectableLevel val in moonsCatalogueList)
{
foreach (SpawnableEnemyWithRarity enemy in val.Enemies)
{
if (enemy.enemyType.enemyName == "Masked" && Masked == null)
{
Masked = enemy;
}
else if (enemy.enemyType.enemyName == "Hoarding bug" && HoardingBug == null)
{
HoardingBug = enemy;
}
else if (enemy.enemyType.enemyName == "Centipede" && SnareFlea == null)
{
SnareFlea = enemy;
}
else if (enemy.enemyType.enemyName == "Jester" && Jester == null)
{
Jester = enemy;
}
else if (enemy.enemyType.enemyName == "Flowerman" && Bracken == null)
{
Bracken = enemy;
}
else if (enemy.enemyType.enemyName == "Crawler" && Thumper == null)
{
Thumper = enemy;
}
else if (enemy.enemyType.enemyName == "Spring" && CoilHead == null)
{
CoilHead = enemy;
}
else if (enemy.enemyType.enemyName == "Bunker Spider" && BunkerSpider == null)
{
BunkerSpider = enemy;
}
else if (enemy.enemyType.enemyName == "Girl" && GhostGirl == null)
{
GhostGirl = enemy;
}
else if (enemy.enemyType.enemyName == "Maneater" && Maneater == null)
{
Maneater = enemy;
}
else if (enemy.enemyType.enemyName == "Nutcracker" && Nutcracker == null)
{
Nutcracker = enemy;
}
else if (enemy.enemyType.enemyName == "Clay Surgeon" && Barber == null)
{
Barber = enemy;
}
else if (enemy.enemyType.enemyName == "Butler" && Butler == null)
{
Butler = enemy;
}
else if (enemy.enemyType.enemyName == "Shy guy" && ShyGuy == null)
{
ShyGuy = enemy;
}
else if (enemy.enemyType.enemyName == "Locker" && Locker == null)
{
Locker = enemy;
}
}
foreach (SpawnableEnemyWithRarity daytimeEnemy in val.DaytimeEnemies)
{
if (daytimeEnemy.enemyType.enemyName == "Red Locust Bees" && CircuitBees == null)
{
CircuitBees = daytimeEnemy;
}
else if (daytimeEnemy.enemyType.enemyName == "Tulip Snake" && TulipSnake == null)
{
TulipSnake = daytimeEnemy;
}
}
foreach (SpawnableEnemyWithRarity outsideEnemy in val.OutsideEnemies)
{
if (outsideEnemy.enemyType.enemyName == "Earth Leviathan" && EarthLeviathan == null)
{
EarthLeviathan = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "ForestGiant" && ForestKeeper == null)
{
ForestKeeper = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "MouthDog" && EyelessDog == null)
{
EyelessDog = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "RadMech" && OldBird == null)
{
OldBird = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "Redwood Titan" && RedwoodTitan == null)
{
RedwoodTitan = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "RedWoodGiant" && RedwoodGiant == null)
{
RedwoodGiant = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "Bruce" && Bruce == null)
{
Bruce = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "Baboon hawk" && BaboonHawk == null)
{
BaboonHawk = outsideEnemy;
}
else if (outsideEnemy.enemyType.enemyName == "Tornado" && Tornado == null)
{
Tornado = outsideEnemy;
}
}
SpawnableMapObject[] spawnableMapObjects = val.spawnableMapObjects;
foreach (SpawnableMapObject val2 in spawnableMapObjects)
{
if (((Object)val2.prefabToSpawn).name == "Landmine" && Landmine == null)
{
Landmine = val2;
}
else if (((Object)val2.prefabToSpawn).name == "TurretContainer" && Turret == null)
{
Turret = val2;
}
else if (((Object)val2.prefabToSpawn).name == "SpikeRoofTrapHazard" && SpikeTrap == null)
{
SpikeTrap = val2;
}
else if (((Object)val2.prefabToSpawn).name == "Seamine" && Seamine == null)
{
Seamine = val2;
}
else if (((Object)val2.prefabToSpawn).name == "Bertha" && BigBertha == null)
{
BigBertha = val2;
}
}
}
}
}
[HarmonyPatch(typeof(PlayerControllerB))]
internal class ChillaxPlayerControllerBPatch
{
[HarmonyPrefix]
[HarmonyPatch("DamagePlayer")]
public static void DamagePlayerTotemPrePatch(PlayerControllerB __instance, int damageNumber)
{
if (__instance.health - damageNumber <= 0)
{
TotemOfUndying.TrySavePlayer(__instance);
}
}
[HarmonyPrefix]
[HarmonyPatch("KillPlayer")]
public static void KillPlayerTotemPrePatch(PlayerControllerB __instance)
{
TotemOfUndying.TrySavePlayer(__instance);
}
[HarmonyPostfix]
[HarmonyPatch("DamagePlayer")]
public static void DamagePlayerTotemPostPatch(PlayerControllerB __instance, int damageNumber)
{
if (__instance.health - damageNumber <= 0)
{
TotemOfUndying.TryDestroyItem(__instance);
}
}
[HarmonyPostfix]
[HarmonyPatch("KillPlayer")]
public static void KillPlayerTotemPostPatch(PlayerControllerB __instance)
{
TotemOfUndying.TryDestroyItem(__instance);
}
[HarmonyPrefix]
[HarmonyPatch("ScrollMouse_performed")]
public static bool ScrollMouse_performedDarkBookPatch(PlayerControllerB __instance)
{
return DarkBook.PreventPocket(__instance);
}
}
[HarmonyPatch(typeof(EnemyAI))]
internal class EnemyAIPatch
{
[HarmonyPrefix]
[HarmonyPatch("UseNestSpawnObject")]
public static void UseNestSpawnObjectPatch(EnemyAI __instance, ref EnemyAINestSpawnObject nestSpawnObject)
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
if (!Ocarina.WakeOldBirdFlag || !((Object)(object)__instance.enemyType == (Object)(object)GetEnemies.OldBird.enemyType))
{
return;
}
EnemyAINestSpawnObject[] array = Object.FindObjectsByType<EnemyAINestSpawnObject>((FindObjectsSortMode)0);
for (int i = 0; i < array.Length; i++)
{
if ((Object)(object)array[i].enemyType == (Object)(object)GetEnemies.OldBird.enemyType && ((Component)array[i]).transform.position == Ocarina.WakeOldBirdPosition)
{
nestSpawnObject = array[i];
}
}
Ocarina.WakeOldBirdFlag = false;
}
}
internal class ShipInventoryConditions
{
public static void Setup(BepInPlugin inventoryMetadata)
{
if (new Version("1.2.2").CompareTo(inventoryMetadata.Version) <= 0)
{
InteractionHelper.AddCondition((Func<PlayerControllerB, bool>)ChillaxScrapsCondition, "[Item not allowed]");
}
}
private static bool ChillaxScrapsCondition(PlayerControllerB player)
{
GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer;
if (((((Object)currentlyHeldObjectServer.itemProperties).name == "DeathNoteItem" || ((Object)currentlyHeldObjectServer.itemProperties).name == "DanceNoteItem") && currentlyHeldObjectServer is DarkBook) || (((Object)currentlyHeldObjectServer.itemProperties).name == "MasterSwordItem" && currentlyHeldObjectServer is MasterSword) || (((Object)currentlyHeldObjectServer.itemProperties).name == "NokiaItem" && currentlyHeldObjectServer is Nokia) || (((Object)currentlyHeldObjectServer.itemProperties).name == "OcarinaItem" && currentlyHeldObjectServer is Ocarina) || (((Object)currentlyHeldObjectServer.itemProperties).name == "TotemOfUndyingItem" && currentlyHeldObjectServer is TotemOfUndying) || (((Object)currentlyHeldObjectServer.itemProperties).name == "UnoReverseCardDXItem" && currentlyHeldObjectServer is UnoReverseDX) || (((Object)currentlyHeldObjectServer.itemProperties).name == "FreddyFazbearItem" && currentlyHeldObjectServer is Freddy) || (((Object)currentlyHeldObjectServer.itemProperties).name == "UnoReverseCardItem" && currentlyHeldObjectServer is UnoReverse))
{
return false;
}
return true;
}
}
internal class SSSConditions
{
public static void Setup(BepInPlugin sssMetaData)
{
if (new Version("1.0.0").CompareTo(sssMetaData.Version) <= 0)
{
SmartCupboard.AddTriggerValidation((Func<PlayerControllerB, bool>)ChillaxScrapsCondition, "[Item not allowed]");
}
}
private static bool ChillaxScrapsCondition(PlayerControllerB player)
{
GrabbableObject currentlyHeldObjectServer = player.currentlyHeldObjectServer;
if (((((Object)currentlyHeldObjectServer.itemProperties).name == "DeathNoteItem" || ((Object)currentlyHeldObjectServer.itemProperties).name == "DanceNoteItem") && currentlyHeldObjectServer is DarkBook) || (((Object)currentlyHeldObjectServer.itemProperties).name == "MasterSwordItem" && currentlyHeldObjectServer is MasterSword) || (((Object)currentlyHeldObjectServer.itemProperties).name == "NokiaItem" && currentlyHeldObjectServer is Nokia) || (((Object)currentlyHeldObjectServer.itemProperties).name == "OcarinaItem" && currentlyHeldObjectServer is Ocarina ocarina && (ocarina.isPlaying || !StartOfRound.Instance.inShipPhase)) || (((Object)currentlyHeldObjectServer.itemProperties).name == "TotemOfUndyingItem" && currentlyHeldObjectServer is TotemOfUndying totemOfUndying && totemOfUndying.used) || (((Object)currentlyHeldObjectServer.itemProperties).name == "UnoReverseCardDXItem" && currentlyHeldObjectServer is UnoReverseDX unoReverseDX && !unoReverseDX.canBeUsed))
{
return false;
}
return true;
}
}
}
namespace ChillaxScraps.CustomEffects
{
internal class Boink : PhysicsProp
{
public bool isActive = false;
public float elapsedTime = 0f;
public Vector3 force;
private ParticleSystem? boingParticles;
public Boink()
{
((GrabbableObject)this).useCooldown = 2f;
}
public override void OnNetworkSpawn()
{
((NetworkBehaviour)this).OnNetworkSpawn();
if (((GrabbableObject)this).insertedBattery != null)
{
((GrabbableObject)this).insertedBattery.charge = 1f;
}
boingParticles = ((Component)((Component)this).transform.GetChild(2)).GetComponent<ParticleSystem>();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_003b: 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_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).ItemActivate(used, buttonDown);
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && ((GrabbableObject)this).insertedBattery != null && ((GrabbableObject)this).insertedBattery.charge > 0f)
{
Vector3 val = GetDirection() + Vector3.up;
BoinkServerRpc(((Vector3)(ref val)).normalized * 500f, 0.5f, 2, ((Component)((GrabbableObject)this).playerHeldBy).transform.position, 0.8f, 0.55f);
}
}
public override void Update()
{
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: 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)
((GrabbableObject)this).Update();
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && isActive)
{
elapsedTime -= Time.deltaTime;
((GrabbableObject)this).playerHeldBy.externalForces = Vector3.Lerp(((GrabbableObject)this).playerHeldBy.externalForces, force, Time.deltaTime * 5f);
if (elapsedTime < 0f)
{
isActive = false;
}
}
}
private Vector3 GetDirection()
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_007f: Unknown result type (might be due to invalid IL or missing references)
if (!Plugin.config.evilBoink.Value)
{
return -((Component)this).transform.forward;
}
int num = Random.Range(0, 10);
if (num <= 7)
{
return -((Component)this).transform.forward;
}
if (num == 8)
{
if (Random.Range(0, 2) == 0)
{
return -((Component)this).transform.right;
}
return ((Component)this).transform.right;
}
if (Random.Range(0, 2) == 0)
{
return ((Component)this).transform.forward;
}
return -((Component)this).transform.forward;
}
[ServerRpc(RequireOwnership = false)]
private void BoinkServerRpc(Vector3 force, float duration, int audioID, Vector3 clientPosition, float hostVolume, float clientVolume = 0f)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: 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_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: 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_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: 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(2418218142u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref force);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref duration, default(ForPrimitives));
BytePacker.WriteValueBitPacked(val2, audioID);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2418218142u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
BoinkClientRpc(force, duration, audioID, clientPosition, hostVolume, (clientVolume == 0f) ? hostVolume : clientVolume);
}
}
}
[ClientRpc]
private void BoinkClientRpc(Vector3 force, float duration, int audioID, Vector3 clientPosition, float hostVolume, float clientVolume)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: 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_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: 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_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: 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(2019346981u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref force);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref duration, default(ForPrimitives));
BytePacker.WriteValueBitPacked(val2, audioID);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref clientPosition);
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref hostVolume, default(ForPrimitives));
((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref clientVolume, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2019346981u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)
{
this.force = force;
elapsedTime = duration;
isActive = true;
}
Effects.Audio(audioID, clientPosition, hostVolume, clientVolume, ((GrabbableObject)this).playerHeldBy);
ParticleSystem? obj = boingParticles;
if (obj != null)
{
obj.Play();
}
}
}
protected override void __initializeVariables()
{
((PhysicsProp)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(2418218142u, new RpcReceiveHandler(__rpc_handler_2418218142), "BoinkServerRpc");
((NetworkBehaviour)this).__registerRpc(2019346981u, new RpcReceiveHandler(__rpc_handler_2019346981), "BoinkClientRpc");
((PhysicsProp)this).__initializeRpcs();
}
private static void __rpc_handler_2418218142(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: 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_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 val = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref val);
float duration = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref duration, default(ForPrimitives));
int audioID = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref audioID);
Vector3 clientPosition = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition);
float hostVolume = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives));
float clientVolume = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((Boink)(object)target).BoinkServerRpc(val, duration, audioID, clientPosition, hostVolume, clientVolume);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2019346981(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: 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_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 val = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref val);
float duration = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref duration, default(ForPrimitives));
int audioID = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref audioID);
Vector3 clientPosition = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref clientPosition);
float hostVolume = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref hostVolume, default(ForPrimitives));
float clientVolume = default(float);
((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref clientVolume, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((Boink)(object)target).BoinkClientRpc(val, duration, audioID, clientPosition, hostVolume, clientVolume);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "Boink";
}
}
internal class DanceNote : DarkBook
{
[CompilerGenerated]
private sealed class <DanceOrDie>d__20 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PlayerControllerB player;
public DanceNote <>4__this;
private GameObject <warning>5__1;
private float <actualTime>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <DanceOrDie>d__20(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<warning>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Expected O, but got Unknown
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Expected O, but got Unknown
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<warning>5__1 = Object.Instantiate<GameObject>(<>4__this.warningPrefab);
Object.Destroy((Object)(object)<warning>5__1, <>4__this.transitionTime + 0.5f);
<>2__current = (object)new WaitForSeconds(<>4__this.transitionTime);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<actualTime>5__2 = 0f;
goto IL_01c4;
case 2:
<>1__state = -1;
goto IL_012a;
case 3:
{
<>1__state = -1;
<actualTime>5__2 += 0.1f;
goto IL_01c4;
}
IL_01c4:
if ((Object)(object)player == (Object)null || player.isPlayerDead || <actualTime>5__2 >= <>4__this.danceTime)
{
break;
}
if (!player.performingEmote || player.playerBodyAnimator.GetInteger("emoteNumber") == 2)
{
goto IL_012a;
}
if (<actualTime>5__2 + 0.1f >= <>4__this.danceTime)
{
Effects.Audio(51, 0.8f);
}
<>2__current = (object)new WaitForSeconds(0.1f);
<>1__state = 3;
return true;
IL_012a:
if (player.isGrabbingObjectAnimation)
{
<>2__current = (object)new WaitForEndOfFrame();
<>1__state = 2;
return true;
}
<>4__this.KillInAreaDanceNoteServerRpc(player.playerClientId, ((Component)player).transform.position);
break;
}
<>4__this.EndDanceServerRpc();
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();
}
}
public bool danceActivated = false;
public float transitionTime = 3.5f;
public float danceTime = 6f;
public int usage = 0;
public readonly GameObject warningPrefab;
public readonly GameObject glowPrefab;
public readonly GameObject glowboomPrefab;
public int[] musicClips = new int[6] { 38, 39, 40, 41, 42, 43 };
private GameObject? glowObj;
public DanceNote()
{
((GrabbableObject)this).useCooldown = 2f;
canKillEnemies = false;
punishInOrbit = false;
usageOnServerMax = musicClips.Length;
rechargeTimeMin = 90f;
rechargeTimeMax = 120f;
musicToPlayID = 37;
canvasPrefab = Plugin.gameObjects[3];
warningPrefab = Plugin.gameObjects[4];
glowPrefab = Plugin.gameObjects[5];
glowboomPrefab = Plugin.gameObjects[6];
}
private void ShuffleMusic()
{
Random rnd = new Random();
musicClips = (from i in musicClips
select (i, rnd.Next()) into tuple
orderby tuple.Item2
select tuple.i).ToArray();
}
public override void OnNetworkSpawn()
{
base.OnNetworkSpawn();
if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
{
ShuffleMusic();
}
else
{
SyncDanceNoteServerRpc();
}
}
public override void ResetDeathNote()
{
base.ResetDeathNote();
usage = 0;
danceActivated = false;
if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
{
ShuffleMusic();
}
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
if (!danceActivated)
{
base.ItemActivate(used, buttonDown);
}
}
public override void ActivateDeathNote(GameObject objectToKill)
{
bool flag = true;
CloseDeathNote();
PlayerControllerB val = default(PlayerControllerB);
if (((Component)objectToKill.transform).TryGetComponent<PlayerControllerB>(ref val) && (Object)(object)val != (Object)null && !val.isPlayerDead && ((NetworkBehaviour)val).IsSpawned && val.isPlayerControlled)
{
StartDancingServerRpc(val.playerClientId, ((NetworkBehaviour)val).OwnerClientId, usage);
}
else
{
flag = false;
}
if (flag)
{
UpdateUsageServerRpc();
UsedServerRpc();
}
}
[ServerRpc(RequireOwnership = false)]
private void UpdateUsageServerRpc()
{
//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)
//IL_00c1: 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(2057626749u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2057626749u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
UpdateUsageClientRpc();
}
}
}
[ClientRpc]
private void UpdateUsageClientRpc()
{
//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)
//IL_00c1: 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(1198034891u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1198034891u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
usage++;
if (usage >= musicClips.Length)
{
canUseDeathNote = false;
SetControlTips();
}
}
}
[ServerRpc(RequireOwnership = false)]
private void StartDancingServerRpc(ulong playerId, ulong clientId, int musicID)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: 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_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0111: 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_0117: 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_012b: 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(3396234143u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
BytePacker.WriteValueBitPacked(val2, clientId);
BytePacker.WriteValueBitPacked(val2, musicID);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3396234143u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
ClientRpcParams val3 = default(ClientRpcParams);
val3.Send = new ClientRpcSendParams
{
TargetClientIds = new ulong[1] { clientId }
};
ClientRpcParams clientRpcParams = val3;
StartMusicClientRpc(playerId, musicClips[musicID]);
StartDancingClientRpc(playerId, clientRpcParams);
}
}
}
[ClientRpc]
private void StartMusicClientRpc(ulong playerId, int realMusicID)
{
//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)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: 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(3289818117u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
BytePacker.WriteValueBitPacked(val2, realMusicID);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3289818117u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
danceActivated = true;
if (component.itemAudio.isPlaying)
{
component.itemAudio.Stop();
}
component.itemAudio.PlayOneShot(Plugin.audioClips[realMusicID], 1.2f);
glowObj = Object.Instantiate<GameObject>(glowPrefab, ((Component)component).transform.position + Vector3.up, Quaternion.identity, ((Component)component).transform);
Object.Destroy((Object)(object)glowObj.gameObject, transitionTime + danceTime + 0.1f);
}
}
[ClientRpc]
private void StartDancingClientRpc(ulong playerId, ClientRpcParams clientRpcParams = default(ClientRpcParams))
{
//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)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(64684118u, clientRpcParams, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val, playerId);
((NetworkBehaviour)this).__endSendClientRpc(ref val, 64684118u, clientRpcParams, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
((MonoBehaviour)this).StartCoroutine(DanceOrDie(component));
}
}
}
[IteratorStateMachine(typeof(<DanceOrDie>d__20))]
private IEnumerator DanceOrDie(PlayerControllerB player)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <DanceOrDie>d__20(0)
{
<>4__this = this,
player = player
};
}
[ServerRpc(RequireOwnership = false)]
private void KillInAreaDanceNoteServerRpc(ulong playerId, Vector3 position)
{
//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_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)
//IL_00e3: 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(1338751637u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1338751637u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
KillInAreaDanceNoteClientRpc(playerId, position);
}
}
}
[ClientRpc]
private void KillInAreaDanceNoteClientRpc(ulong playerId, Vector3 position)
{
//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_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)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: 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(2838246837u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerId);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2838246837u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0;
PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>();
if (component.itemAudio.isPlaying)
{
component.itemAudio.Stop();
}
if ((Object)(object)glowObj != (Object)null)
{
Object.Destroy((Object)(object)glowObj.gameObject);
}
Object.Instantiate<GameObject>(glowboomPrefab, position, Quaternion.identity);
Landmine.SpawnExplosion(position + Vector3.up * 0.25f, false, 3f, 6f, 60, 5f, (GameObject)null, false);
}
}
[ServerRpc(RequireOwnership = false)]
private void SyncDanceNoteServerRpc()
{
//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