using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using CleaningCompany.Misc;
using CleaningCompany.Monos;
using CleaningCompany.NetcodePatcher;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Events;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CleaningCompany")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Viscera Cleanup meets Lethal Company")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("CleaningCompany")]
[assembly: AssemblyTitle("CleaningCompany")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace CleaningCompany
{
[BepInPlugin("malco.cleaning_company", "Cleaning Company", "1.0.0")]
[BepInDependency("evaisa.lethallib", "0.6.0")]
public class Plugin : BaseUnityPlugin
{
private readonly Harmony harmony = new Harmony("malco.cleaning_company");
private const string GUID = "malco.cleaning_company";
private const string NAME = "Cleaning Company";
private const string VERSION = "1.0.0";
private static string root = "Assets/CleaningAssets/";
private Dictionary<string, int> minBodyValues;
private Dictionary<string, int> maxBodyValues;
private Dictionary<string, float> bodyWeights;
private Dictionary<string, AnimationCurve> bodyPaths;
private Dictionary<string, string> pathToName = new Dictionary<string, string>
{
{
root + "ScavItem.asset",
"IgnoreThis"
},
{
root + "HoarderItem.asset",
"Hoarding bug"
},
{
root + "SpiderItem.asset",
"Bunker Spider"
},
{
root + "ThumperItem.asset",
"Crawler"
},
{
root + "CentipedeItem.asset",
"Centipede"
},
{
root + "BrackenDustItem.asset",
"Flowerman"
}
};
private Dictionary<string, string> messPaths = new Dictionary<string, string>
{
{
root + "ThumperDroolItem.asset",
"mop"
},
{
root + "SporePileItem.asset",
"vacuum"
},
{
root + "EtherealItem.asset",
"vacuum"
},
{
root + "ScavGoopItem.asset",
"mop"
},
{
root + "BrackenDustItem.asset",
"broom"
},
{
root + "NailPileItem.asset",
"broom"
},
{
root + "HoardingEggItem.asset",
"garbage"
},
{
root + "BonesItem.asset",
"garbage"
}
};
public Dictionary<string, Item> BodySpawns = new Dictionary<string, Item>();
public List<GameObject> tools = new List<GameObject>();
private AssetBundle bundle;
public Texture2D janitorMat;
public static Plugin instance;
public AudioClip open;
public AudioClip close;
public AudioClip zeroDays;
public AudioClip firedSFX;
public AudioClip introSFX;
public static PluginConfig cfg { get; private set; }
private void Awake()
{
cfg = new PluginConfig(((BaseUnityPlugin)this).Config);
cfg.InitBindings();
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
Type[] array = types;
foreach (Type type in array)
{
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo[] array2 = methods;
foreach (MethodInfo methodInfo in array2)
{
object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
if (customAttributes.Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
instance = this;
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "cleaningassets");
bundle = AssetBundle.LoadFromFile(text);
janitorMat = bundle.LoadAsset<Texture2D>("Assets/CleaningAssets/JanitorOutfit.png");
open = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/open.ogg");
close = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/close.ogg");
zeroDays = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/VA/zeroDays.mp3");
firedSFX = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/VA/fired.mp3");
introSFX = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/VA/intro.mp3");
ApplyConfig();
SetupItems();
SetupScrap();
harmony.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Cleaning Company is patched!");
((BaseUnityPlugin)this).Logger.LogInfo((object)string.Join(", ", BodySpawns.Keys));
}
private void ApplyConfig()
{
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_024b: Unknown result type (might be due to invalid IL or missing references)
//IL_0262: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Unknown result type (might be due to invalid IL or missing references)
//IL_026c: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Expected O, but got Unknown
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02da: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Expected O, but got Unknown
//IL_0307: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Unknown result type (might be due to invalid IL or missing references)
//IL_033e: Unknown result type (might be due to invalid IL or missing references)
//IL_0343: Unknown result type (might be due to invalid IL or missing references)
//IL_0348: Unknown result type (might be due to invalid IL or missing references)
//IL_0352: Expected O, but got Unknown
//IL_0375: Unknown result type (might be due to invalid IL or missing references)
//IL_037a: Unknown result type (might be due to invalid IL or missing references)
//IL_0390: Unknown result type (might be due to invalid IL or missing references)
//IL_0395: Unknown result type (might be due to invalid IL or missing references)
//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
//IL_03c0: Expected O, but got Unknown
//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0403: Unknown result type (might be due to invalid IL or missing references)
//IL_041a: Unknown result type (might be due to invalid IL or missing references)
//IL_041f: Unknown result type (might be due to invalid IL or missing references)
//IL_0424: Unknown result type (might be due to invalid IL or missing references)
//IL_042e: Expected O, but got Unknown
bodyWeights = new Dictionary<string, float>
{
{
root + "ScavItem.asset",
cfg.SCAV_WEIGHT
},
{
root + "HoarderItem.asset",
cfg.HOARDER_WEIGHT
},
{
root + "SpiderItem.asset",
cfg.SPIDER_WEIGHT
},
{
root + "ThumperItem.asset",
cfg.THUMPER_WEIGHT
},
{
root + "CentipedeItem.asset",
cfg.CENTIPEDE_WEIGHT
}
};
maxBodyValues = new Dictionary<string, int>
{
{
root + "ScavItem.asset",
cfg.SCAV_MAX
},
{
root + "HoarderItem.asset",
cfg.HOARDER_MAX
},
{
root + "SpiderItem.asset",
cfg.SPIDER_MAX
},
{
root + "ThumperItem.asset",
cfg.THUMPER_MAX
},
{
root + "CentipedeItem.asset",
cfg.CENTIPEDE_MAX
}
};
minBodyValues = new Dictionary<string, int>
{
{
root + "ScavItem.asset",
cfg.SCAV_MIN
},
{
root + "HoarderItem.asset",
cfg.HOARDER_MIN
},
{
root + "SpiderItem.asset",
cfg.SPIDER_MIN
},
{
root + "ThumperItem.asset",
cfg.THUMPER_MIN
},
{
root + "CentipedeItem.asset",
cfg.CENTIPEDE_MIN
}
};
bodyPaths = new Dictionary<string, AnimationCurve>
{
{
root + "ScavItem.asset",
new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 1f),
new Keyframe(cfg.SCAV_CURVE, 0f),
new Keyframe(1f, (float)cfg.MAX_SCAVS)
})
},
{
root + "HoarderItem.asset",
new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(cfg.HOARDER_CURVE, 0f),
new Keyframe(1f, (float)cfg.MAX_HOARDERS)
})
},
{
root + "SpiderItem.asset",
new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(cfg.SPIDER_CURVE, 0f),
new Keyframe(1f, (float)cfg.MAX_SPIDERS)
})
},
{
root + "ThumperItem.asset",
new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(cfg.THUMPER_CURVE, 0f),
new Keyframe(1f, (float)cfg.MAX_THUMPERS)
})
},
{
root + "CentipedeItem.asset",
new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 0f),
new Keyframe(cfg.CENTIPEDE_CURVE, 0f),
new Keyframe(1f, (float)cfg.MAX_CENTIPEDES)
})
}
};
}
private void SetupItems()
{
Item val = bundle.LoadAsset<Item>("Assets/CleaningAssets/MopItem.asset");
ToolItem toolItem = val.spawnPrefab.AddComponent<ToolItem>();
val.spawnPrefab.AddComponent<AudioMixerFixer>();
val.itemSpawnsOnGround = true;
val.canBeGrabbedBeforeGameStart = true;
toolItem.toolType = "mop";
((GrabbableObject)toolItem).grabbable = true;
((GrabbableObject)toolItem).grabbableToEnemies = true;
((GrabbableObject)toolItem).itemProperties = val;
Items.RegisterItem(val);
NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
tools.Add(val.spawnPrefab);
Item val2 = bundle.LoadAsset<Item>("Assets/CleaningAssets/BroomItem.asset");
ToolItem toolItem2 = val2.spawnPrefab.AddComponent<ToolItem>();
val2.spawnPrefab.AddComponent<AudioMixerFixer>();
val2.itemSpawnsOnGround = true;
val2.canBeGrabbedBeforeGameStart = true;
toolItem2.toolType = "broom";
((GrabbableObject)toolItem2).grabbable = true;
((GrabbableObject)toolItem2).grabbableToEnemies = true;
((GrabbableObject)toolItem2).itemProperties = val2;
Items.RegisterItem(val2);
NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
tools.Add(val2.spawnPrefab);
Item val3 = bundle.LoadAsset<Item>("Assets/CleaningAssets/GarbageBox.asset");
ToolItem toolItem3 = val3.spawnPrefab.AddComponent<ToolItem>();
val3.spawnPrefab.AddComponent<AudioMixerFixer>();
val3.itemSpawnsOnGround = true;
val3.canBeGrabbedBeforeGameStart = true;
toolItem3.toolType = "garbage";
((GrabbableObject)toolItem3).grabbable = true;
((GrabbableObject)toolItem3).grabbableToEnemies = true;
((GrabbableObject)toolItem3).itemProperties = val3;
Items.RegisterItem(val3);
NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
tools.Add(val3.spawnPrefab);
Item val4 = bundle.LoadAsset<Item>("Assets/CleaningAssets/DusterItem.asset");
ToolItem toolItem4 = val4.spawnPrefab.AddComponent<ToolItem>();
val4.spawnPrefab.AddComponent<AudioMixerFixer>();
val4.canBeGrabbedBeforeGameStart = true;
val4.itemSpawnsOnGround = true;
toolItem4.toolType = "vacuum";
((GrabbableObject)toolItem4).grabbable = true;
((GrabbableObject)toolItem4).grabbableToEnemies = true;
((GrabbableObject)toolItem4).itemProperties = val4;
Items.RegisterItem(val4);
NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
tools.Add(val4.spawnPrefab);
UnlockablesList val5 = bundle.LoadAsset<UnlockablesList>("Assets/CleaningAssets/TestUnlocks.asset");
val5.unlockables[0].prefabObject.AddComponent<CabinetScript>();
val5.unlockables[0].prefabObject.AddComponent<AudioMixerFixer>();
NetworkPrefabs.RegisterNetworkPrefab(val5.unlockables[0].prefabObject);
Unlockables.RegisterUnlockable(val5.unlockables[0], 0, (StoreType)0);
}
private void SetupScrap()
{
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Expected O, but got Unknown
Dictionary<string, AudioClip> dictionary = new Dictionary<string, AudioClip>();
AudioClip value = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/mop.mp3");
AudioClip value2 = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/vac.mp3");
AudioClip value3 = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/sweep.mp3");
AudioClip value4 = bundle.LoadAsset<AudioClip>("Assets/CleaningAssets/garb.mp3");
dictionary.Add("mop", value);
dictionary.Add("vacuum", value2);
dictionary.Add("broom", value3);
dictionary.Add("garbage", value4);
Dictionary<string, Item> dictionary2 = new Dictionary<string, Item>();
Item val = bundle.LoadAsset<Item>("Assets/CleaningAssets/GarbageBagItem.asset");
val.spawnPrefab.AddComponent<AudioMixerFixer>();
Item val2 = bundle.LoadAsset<Item>("Assets/CleaningAssets/BucketItem.asset");
val2.spawnPrefab.AddComponent<AudioMixerFixer>();
NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab);
NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab);
dictionary2.Add("mop", val2);
dictionary2.Add("vacuum", val);
dictionary2.Add("broom", val);
dictionary2.Add("garbage", val);
foreach (KeyValuePair<string, string> messPath in messPaths)
{
Item val3 = bundle.LoadAsset<Item>(messPath.Key);
val3.spawnPrefab.AddComponent<AudioMixerFixer>();
MessItem messItem = val3.spawnPrefab.AddComponent<MessItem>();
messItem.loot = dictionary2[messPath.Value].spawnPrefab;
messItem.toolType = messPath.Value;
messItem.cleanNoise = dictionary[messPath.Value];
val3.maxValue = cfg.TRASH_MAX;
val3.minValue = cfg.TRASH_MIN;
NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab);
Items.RegisterScrap(val3, cfg.MESS_RARITY, (LevelTypes)(-1));
if (messPath.Key.Contains("Bracken"))
{
BodySpawns.Add("Flowerman", val3);
}
}
foreach (KeyValuePair<string, AnimationCurve> pair in bodyPaths)
{
Item val4 = bundle.LoadAsset<Item>(pair.Key);
val4.spawnPrefab.AddComponent<AudioMixerFixer>();
val4.spawnPrefab.AddComponent<BodySyncer>();
val4.maxValue = maxBodyValues[pair.Key];
val4.minValue = minBodyValues[pair.Key];
val4.weight = bodyWeights[pair.Key];
NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
SpawnableMapObjectDef val5 = ScriptableObject.CreateInstance<SpawnableMapObjectDef>();
val5.spawnableMapObject = new SpawnableMapObject();
val5.spawnableMapObject.prefabToSpawn = val4.spawnPrefab;
MapObjects.RegisterMapObject(val5, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => pair.Value));
Items.RegisterItem(val4);
BodySpawns.Add(pathToName[pair.Key], val4);
}
}
}
}
namespace CleaningCompany.Patches
{
[HarmonyPatch(typeof(EnemyAI))]
internal class EnemyAIPatcher
{
private static ulong currentEnemy = 9999999uL;
[HarmonyPrefix]
[HarmonyPatch("KillEnemyServerRpc")]
private static void SpawnScrapBody(EnemyAI __instance)
{
//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_0072: 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)
if (currentEnemy != ((NetworkBehaviour)__instance).NetworkObject.NetworkObjectId)
{
currentEnemy = ((NetworkBehaviour)__instance).NetworkObject.NetworkObjectId;
string enemyName = __instance.enemyType.enemyName;
if (Plugin.instance.BodySpawns.ContainsKey(enemyName))
{
GameObject val = Object.Instantiate<GameObject>(Plugin.instance.BodySpawns[enemyName].spawnPrefab, ((Component)__instance).transform.position + Vector3.up, Quaternion.identity);
val.GetComponent<NetworkObject>().Spawn(false);
((Component)__instance).gameObject.SetActive(false);
}
}
}
}
[HarmonyPatch(typeof(GrabbableObject))]
internal class GrabbableObjectPatcher
{
[HarmonyPrefix]
[HarmonyPatch("SetScrapValue")]
private static bool ReturnFalseGaming(GrabbableObject __instance)
{
if ((Object)(object)((Component)__instance).GetComponent<MessItem>() != (Object)null)
{
return false;
}
return true;
}
}
[HarmonyPatch(typeof(StartOfRound))]
internal class StartOfRoundPatcher
{
[CompilerGenerated]
private sealed class <SpawnCabinet>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StartOfRound __instance;
private GameObject <cabinet>5__1;
private GameObject <terminal>5__2;
private GameObject <cab>5__3;
private List<UnlockableItem>.Enumerator <>s__4;
private UnlockableItem <unlockable>5__5;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SpawnCabinet>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<cabinet>5__1 = null;
<terminal>5__2 = null;
<cab>5__3 = null;
<>s__4 = default(List<UnlockableItem>.Enumerator);
<unlockable>5__5 = null;
<>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
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if ((Object)(object)GameObject.Find("TestCabinet(Clone)") == (Object)null)
{
<cabinet>5__1 = null;
<>s__4 = __instance.unlockablesList.unlockables.GetEnumerator();
try
{
while (<>s__4.MoveNext())
{
<unlockable>5__5 = <>s__4.Current;
if (<unlockable>5__5.unlockableName == "Cleaning Cabinet")
{
<cabinet>5__1 = <unlockable>5__5.prefabObject;
break;
}
<unlockable>5__5 = null;
}
}
finally
{
((IDisposable)<>s__4).Dispose();
}
<>s__4 = default(List<UnlockableItem>.Enumerator);
<terminal>5__2 = GameObject.Find("Terminal");
<cab>5__3 = Object.Instantiate<GameObject>(<cabinet>5__1, <terminal>5__2.transform.parent);
<cab>5__3.GetComponent<NetworkObject>().Spawn(false);
<cabinet>5__1 = null;
<terminal>5__2 = null;
<cab>5__3 = null;
}
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();
}
}
[HarmonyPostfix]
[HarmonyPatch("Awake")]
private static void RemoveScrap(StartOfRound __instance)
{
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
if (!Plugin.cfg.SCRAP_SPAWN)
{
SelectableLevel[] levels = __instance.levels;
foreach (SelectableLevel val in levels)
{
string name = ((Object)val).name;
if (!Enum.IsDefined(typeof(LevelTypes), name))
{
continue;
}
LevelTypes val2 = (LevelTypes)Enum.Parse(typeof(LevelTypes), name);
foreach (SpawnableItemWithRarity item in val.spawnableScrap)
{
if (item.spawnableItem.isScrap)
{
item.rarity = 0;
}
}
}
}
if (Plugin.cfg.JANITOR_SUIT)
{
foreach (UnlockableItem unlockable in __instance.unlockablesList.unlockables)
{
if ((Object)(object)unlockable.suitMaterial != (Object)null && unlockable.alreadyUnlocked)
{
unlockable.suitMaterial.mainTexture = (Texture)(object)Plugin.instance.janitorMat;
break;
}
}
PlayerControllerB[] array = Object.FindObjectsOfType<PlayerControllerB>();
foreach (PlayerControllerB val3 in array)
{
((Renderer)val3.thisPlayerModel).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat;
((Renderer)val3.thisPlayerModelLOD1).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat;
((Renderer)val3.thisPlayerModelLOD2).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat;
((Renderer)val3.thisPlayerModelArms).material.mainTexture = (Texture)(object)Plugin.instance.janitorMat;
}
}
if (Plugin.cfg.JANITOR_VA)
{
__instance.zeroDaysLeftAlertSFX = Plugin.instance.zeroDays;
__instance.firedVoiceSFX = Plugin.instance.firedSFX;
__instance.shipIntroSpeechSFX = Plugin.instance.introSFX;
}
((MonoBehaviour)__instance).StartCoroutine(SpawnCabinet(__instance));
}
[IteratorStateMachine(typeof(<SpawnCabinet>d__1))]
private static IEnumerator SpawnCabinet(StartOfRound __instance)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <SpawnCabinet>d__1(0)
{
__instance = __instance
};
}
}
}
namespace CleaningCompany.Monos
{
internal class BodySyncer : NetworkBehaviour
{
public override void OnNetworkSpawn()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
((NetworkBehaviour)this).OnNetworkSpawn();
if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
{
PhysicsProp component = ((Component)this).GetComponent<PhysicsProp>();
if (((GrabbableObject)component).scrapValue == 0)
{
int price = Random.Range(((GrabbableObject)component).itemProperties.minValue, ((GrabbableObject)component).itemProperties.maxValue);
SyncDetailsClientRpc(price, new NetworkBehaviourReference((NetworkBehaviour)(object)component));
}
}
}
[ClientRpc]
private void SyncDetailsClientRpc(int price, NetworkBehaviourReference netRef)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3571516743u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, price);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref netRef, default(ForNetworkSerializable));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3571516743u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
PhysicsProp val3 = default(PhysicsProp);
((NetworkBehaviourReference)(ref netRef)).TryGet<PhysicsProp>(ref val3, (NetworkManager)null);
if ((Object)(object)val3 != (Object)null)
{
((GrabbableObject)val3).scrapValue = price;
((GrabbableObject)val3).itemProperties.creditsWorth = price;
((Component)val3).GetComponentInChildren<ScanNodeProperties>().subText = $"Value: ${price}";
Debug.Log((object)"Successfully synced body values");
}
else
{
Debug.LogError((object)"Failed to resolve network reference!");
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(3571516743u, new RpcReceiveHandler(__rpc_handler_3571516743), "SyncDetailsClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_3571516743(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//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_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int price = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref price);
NetworkBehaviourReference netRef = default(NetworkBehaviourReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref netRef, default(ForNetworkSerializable));
target.__rpc_exec_stage = (__RpcExecStage)1;
((BodySyncer)(object)target).SyncDetailsClientRpc(price, netRef);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "BodySyncer";
}
}
[RequireComponent(typeof(AudioSource))]
internal class CabinetScript : NetworkBehaviour
{
[CompilerGenerated]
private sealed class <setParentToShip>d__20 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public NetworkObject netObj;
public CabinetScript <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <setParentToShip>d__20(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
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
netObj.TrySetParent(((Component)<>4__this).transform.parent, true);
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private Animator leftDoor;
private Animator rightDoor;
private AudioSource audio;
private AudioClip open;
private AudioClip close;
private InteractTrigger leftTrig;
private InteractTrigger rightTrig;
private InteractTrigger broomTrig;
private InteractTrigger vacTrig;
private InteractTrigger mopTrig;
private InteractTrigger garbTrig;
private bool leftClosed;
private bool rightClosed;
private Dictionary<bool, string> doorTip = new Dictionary<bool, string>
{
{ true, "Open : [E]" },
{ false, "Close : [E]" }
};
private void Start()
{
audio = ((Component)this).GetComponent<AudioSource>();
open = Plugin.instance.open;
close = Plugin.instance.close;
leftDoor = ((Component)((Component)this).transform.GetChild(0).GetChild(1)).GetComponent<Animator>();
rightDoor = ((Component)((Component)this).transform.GetChild(0).GetChild(0)).GetComponent<Animator>();
leftTrig = ((Component)leftDoor).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)leftTrig.onInteract).AddListener((UnityAction<PlayerControllerB>)ChangeLeftDoorState);
rightTrig = ((Component)rightDoor).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)rightTrig.onInteract).AddListener((UnityAction<PlayerControllerB>)ChangeRightDoorState);
broomTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(2)).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)broomTrig.onInteract).AddListener((UnityAction<PlayerControllerB>)GrabBroom);
mopTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(3)).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)mopTrig.onInteract).AddListener((UnityAction<PlayerControllerB>)GrabMop);
garbTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(4)).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)garbTrig.onInteract).AddListener((UnityAction<PlayerControllerB>)GrabGarb);
vacTrig = ((Component)((Component)this).transform.GetChild(0).GetChild(5)).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)vacTrig.onInteract).AddListener((UnityAction<PlayerControllerB>)GrabVac);
}
private void GrabBroom(PlayerControllerB player)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
SpawnToolServerRpc(1, ((Component)player).transform.position);
}
private void GrabVac(PlayerControllerB player)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
SpawnToolServerRpc(3, ((Component)player).transform.position);
}
private void GrabMop(PlayerControllerB player)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
SpawnToolServerRpc(0, ((Component)player).transform.position);
}
private void GrabGarb(PlayerControllerB player)
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
SpawnToolServerRpc(2, ((Component)player).transform.position);
}
[ServerRpc(RequireOwnership = false)]
private void SpawnToolServerRpc(int toolID, Vector3 pos)
{
//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_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(495819505u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, toolID);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 495819505u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
GameObject val3 = Object.Instantiate<GameObject>(Plugin.instance.tools[toolID], pos, Quaternion.identity);
NetworkObject component = val3.GetComponent<NetworkObject>();
component.Spawn(false);
((MonoBehaviour)this).StartCoroutine(setParentToShip(component));
}
}
}
[IteratorStateMachine(typeof(<setParentToShip>d__20))]
private IEnumerator setParentToShip(NetworkObject netObj)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <setParentToShip>d__20(0)
{
<>4__this = this,
netObj = netObj
};
}
private void ChangeLeftDoorState(PlayerControllerB player)
{
if (leftClosed)
{
audio.PlayOneShot(open);
}
else
{
audio.PlayOneShot(close);
}
if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
{
TriggerDoorClientRpc(left: true);
}
else
{
TriggerDoorServerRpc(left: true);
}
}
private void ChangeRightDoorState(PlayerControllerB player)
{
if (rightClosed)
{
audio.PlayOneShot(open);
}
else
{
audio.PlayOneShot(close);
}
if (((NetworkBehaviour)this).IsHost || ((NetworkBehaviour)this).IsServer)
{
TriggerDoorClientRpc(left: false);
}
else
{
TriggerDoorServerRpc(left: false);
}
}
[ServerRpc(RequireOwnership = false)]
private void TriggerDoorServerRpc(bool left)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2501078389u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref left, default(ForPrimitives));
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2501078389u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
TriggerDoorClientRpc(left);
}
}
}
[ClientRpc]
private void TriggerDoorClientRpc(bool left)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3535707651u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref left, default(ForPrimitives));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3535707651u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
if (left)
{
leftDoor.SetTrigger("Play");
leftClosed = !leftClosed;
leftTrig.hoverTip = doorTip[leftClosed];
}
else
{
rightDoor.SetTrigger("Play");
rightClosed = !rightClosed;
rightTrig.hoverTip = doorTip[rightClosed];
}
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(495819505u, new RpcReceiveHandler(__rpc_handler_495819505), "SpawnToolServerRpc");
((NetworkBehaviour)this).__registerRpc(2501078389u, new RpcReceiveHandler(__rpc_handler_2501078389), "TriggerDoorServerRpc");
((NetworkBehaviour)this).__registerRpc(3535707651u, new RpcReceiveHandler(__rpc_handler_3535707651), "TriggerDoorClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_495819505(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int toolID = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref toolID);
Vector3 pos = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref pos);
target.__rpc_exec_stage = (__RpcExecStage)1;
((CabinetScript)(object)target).SpawnToolServerRpc(toolID, pos);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2501078389(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool left = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref left, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((CabinetScript)(object)target).TriggerDoorServerRpc(left);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3535707651(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
bool left = default(bool);
((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref left, default(ForPrimitives));
target.__rpc_exec_stage = (__RpcExecStage)1;
((CabinetScript)(object)target).TriggerDoorClientRpc(left);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "CabinetScript";
}
}
internal class MessItem : NetworkBehaviour
{
private Animator anim;
public GameObject loot;
public string toolType;
private InteractTrigger trig;
private AudioSource audio;
public AudioClip cleanNoise;
private int cleaning = 0;
private void Awake()
{
trig = ((Component)this).GetComponent<InteractTrigger>();
((UnityEvent<PlayerControllerB>)(object)trig.onInteract).AddListener((UnityAction<PlayerControllerB>)CleanMess);
((UnityEvent<PlayerControllerB>)(object)trig.onStopInteract).AddListener((UnityAction<PlayerControllerB>)StopMess);
((UnityEvent<PlayerControllerB>)(object)trig.onInteractEarly).AddListener((UnityAction<PlayerControllerB>)PlayMess);
anim = ((Component)this).GetComponentInChildren<Animator>();
audio = ((Component)this).GetComponent<AudioSource>();
audio.clip = cleanNoise;
}
private void Update()
{
PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
if ((Object)(object)localPlayerController == (Object)null)
{
trig.interactable = false;
return;
}
if ((Object)(object)localPlayerController.currentlyHeldObjectServer == (Object)null)
{
trig.interactable = false;
return;
}
ToolItem component = ((Component)localPlayerController.currentlyHeldObjectServer).GetComponent<ToolItem>();
if ((Object)(object)component == (Object)null)
{
trig.interactable = false;
return;
}
if (component.toolType == toolType)
{
trig.interactable = true;
}
else
{
trig.interactable = false;
}
anim.SetInteger("CleanStatus", cleaning);
if (cleaning == 1)
{
if (!audio.isPlaying)
{
audio.Play();
}
}
else if (audio.isPlaying)
{
audio.Stop();
}
}
private void CleanMess(PlayerControllerB player)
{
SpawnLootServerRpc();
audio.Stop();
audio.volume = 0f;
}
private void StopMess(PlayerControllerB player)
{
cleaning = 0;
}
private void PlayMess(PlayerControllerB player)
{
cleaning = 1;
}
[ServerRpc(RequireOwnership = false)]
private void SpawnLootServerRpc()
{
//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)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(969310882u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 969310882u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
GameObject val3 = Object.Instantiate<GameObject>(loot, ((Component)this).transform.position + Vector3.up, Quaternion.identity);
val3.GetComponent<NetworkObject>().Spawn(false);
PhysicsProp component = val3.GetComponent<PhysicsProp>();
int price = Random.Range(((GrabbableObject)component).itemProperties.minValue, ((GrabbableObject)component).itemProperties.maxValue);
SyncDetailsClientRpc(price, new NetworkBehaviourReference((NetworkBehaviour)(object)component));
}
}
}
[ClientRpc]
private void SyncDetailsClientRpc(int price, NetworkBehaviourReference netRef)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1088653732u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, price);
((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref netRef, default(ForNetworkSerializable));
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1088653732u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost))
{
base.__rpc_exec_stage = (__RpcExecStage)0;
PhysicsProp val3 = default(PhysicsProp);
((NetworkBehaviourReference)(ref netRef)).TryGet<PhysicsProp>(ref val3, (NetworkManager)null);
if ((Object)(object)val3 != (Object)null)
{
((GrabbableObject)val3).scrapValue = price;
((GrabbableObject)val3).itemProperties.creditsWorth = price;
((Component)val3).GetComponentInChildren<ScanNodeProperties>().subText = $"Value: ${price}";
Debug.Log((object)"Successfully synced trash values");
}
else
{
Debug.LogError((object)"Failed to resolve network reference!");
}
((Component)this).gameObject.SetActive(false);
}
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
((NetworkBehaviour)this).__registerRpc(969310882u, new RpcReceiveHandler(__rpc_handler_969310882), "SpawnLootServerRpc");
((NetworkBehaviour)this).__registerRpc(1088653732u, new RpcReceiveHandler(__rpc_handler_1088653732), "SyncDetailsClientRpc");
((NetworkBehaviour)this).__initializeRpcs();
}
private static void __rpc_handler_969310882(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((MessItem)(object)target).SpawnLootServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1088653732(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//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_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int price = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref price);
NetworkBehaviourReference netRef = default(NetworkBehaviourReference);
((FastBufferReader)(ref reader)).ReadValueSafe<NetworkBehaviourReference>(ref netRef, default(ForNetworkSerializable));
target.__rpc_exec_stage = (__RpcExecStage)1;
((MessItem)(object)target).SyncDetailsClientRpc(price, netRef);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "MessItem";
}
}
internal class ToolItem : PhysicsProp
{
public string toolType;
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
protected override void __initializeRpcs()
{
((PhysicsProp)this).__initializeRpcs();
}
protected internal override string __getTypeName()
{
return "ToolItem";
}
}
}
namespace CleaningCompany.Misc
{
public class AudioMixerFixer : MonoBehaviour
{
private static AudioMixerGroup _masterDiageticMixer;
[SerializeField]
private List<AudioSource> sourcesToFix;
public static AudioMixerGroup MasterDiageticMixer
{
get
{
if ((Object)(object)_masterDiageticMixer == (Object)null)
{
AudioSource val = (from p in ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().NetworkConfig.Prefabs.Prefabs
select p.Prefab.GetComponentInChildren<NoisemakerProp>() into p
where (Object)(object)p != (Object)null
select ((Component)p).GetComponentInChildren<AudioSource>() into p
where (Object)(object)p != (Object)null
select p).FirstOrDefault();
if ((Object)(object)val == (Object)null)
{
throw new Exception("Failed to locate a suitable AudioSource output mixer to reference! Could you be calling this method before the GameNetworkManager is initialized?");
}
_masterDiageticMixer = val.outputAudioMixerGroup;
}
return _masterDiageticMixer;
}
}
private void Start()
{
AudioSource[] componentsInChildren = ((Component)this).GetComponentsInChildren<AudioSource>();
foreach (AudioSource item in componentsInChildren)
{
if (!sourcesToFix.Contains(item))
{
sourcesToFix.Add(item);
}
}
foreach (AudioSource item2 in sourcesToFix)
{
item2.outputAudioMixerGroup = MasterDiageticMixer;
}
}
}
public class PluginConfig
{
private readonly ConfigFile configFile;
public bool JANITOR_SUIT { get; set; }
public bool JANITOR_VA { get; set; }
public int MAX_SCAVS { get; set; }
public int MAX_SPIDERS { get; set; }
public int MAX_HOARDERS { get; set; }
public int MAX_THUMPERS { get; set; }
public int MAX_CENTIPEDES { get; set; }
public float SCAV_CURVE { get; set; }
public float SPIDER_CURVE { get; set; }
public float THUMPER_CURVE { get; set; }
public float CENTIPEDE_CURVE { get; set; }
public float HOARDER_CURVE { get; set; }
public int SCAV_MIN { get; set; }
public int SPIDER_MIN { get; set; }
public int THUMPER_MIN { get; set; }
public int CENTIPEDE_MIN { get; set; }
public int HOARDER_MIN { get; set; }
public int SCAV_MAX { get; set; }
public int SPIDER_MAX { get; set; }
public int THUMPER_MAX { get; set; }
public int CENTIPEDE_MAX { get; set; }
public int HOARDER_MAX { get; set; }
public float SCAV_WEIGHT { get; set; }
public float SPIDER_WEIGHT { get; set; }
public float THUMPER_WEIGHT { get; set; }
public float CENTIPEDE_WEIGHT { get; set; }
public float HOARDER_WEIGHT { get; set; }
public int TRASH_MIN { get; set; }
public int TRASH_MAX { get; set; }
public bool SCRAP_SPAWN { get; set; }
public int MESS_RARITY { get; set; }
public PluginConfig(ConfigFile cfg)
{
configFile = cfg;
}
private T ConfigEntry<T>(string section, string key, T defaultVal, string description)
{
return configFile.Bind<T>(section, key, defaultVal, description).Value;
}
public void InitBindings()
{
JANITOR_SUIT = ConfigEntry("Janitor Theme", "Janitor Suits", defaultVal: true, "If true the default suit will be replaced with a janitor suit.");
JANITOR_VA = ConfigEntry("Janitor Theme", "Janitor Voice Acting", defaultVal: true, "If true the default loud speaker voicelines will be replaced with Rufus'.");
MAX_CENTIPEDES = ConfigEntry("Max Body Spawns", "Max number of Centipede Bodies", 2, "");
MAX_HOARDERS = ConfigEntry("Max Body Spawns", "Max number of Hoarding Bug Bodies", 1, "");
MAX_SCAVS = ConfigEntry("Max Body Spawns", "Max number of Scavenger Bodies", 3, "");
MAX_SPIDERS = ConfigEntry("Max Body Spawns", "Max number of Spider Bodies", 1, "");
MAX_THUMPERS = ConfigEntry("Max Body Spawns", "Max number of Thumper Bodies", 1, "");
CENTIPEDE_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Centipede Bodies", 0.25f, "Lower this number to increase spawn chance.");
HOARDER_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Hoarding Bug Bodies", 0.35f, "Lower this number to increase spawn chance.");
SCAV_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Scavenger Bodies", 0.35f, "Lower this number to increase spawn chance.");
SPIDER_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Spider Bodies", 0.5f, "Lower this number to increase spawn chance.");
THUMPER_CURVE = ConfigEntry("Body Spawn Chance", "Max number of Thumper Bodies", 0.75f, "Lower this number to increase spawn chance.");
CENTIPEDE_MIN = ConfigEntry("Body Values", "Min price of Centipede Bodies", 45, "");
CENTIPEDE_MAX = ConfigEntry("Body Values", "Max price of Centipede Bodies", 70, "");
HOARDER_MIN = ConfigEntry("Body Values", "Min price of Hoarding Bug Bodies", 55, "");
HOARDER_MAX = ConfigEntry("Body Values", "Max price of Hoarding Bug Bodies", 88, "");
SCAV_MIN = ConfigEntry("Body Values", "Min price of Scavenger Bodies", 100, "");
SCAV_MAX = ConfigEntry("Body Values", "Max price of Scavenger Bodies", 170, "");
SPIDER_MIN = ConfigEntry("Body Values", "Min price of Spider Bodies", 70, "");
SPIDER_MAX = ConfigEntry("Body Values", "Max price of Spider Bodies", 110, "");
THUMPER_MIN = ConfigEntry("Body Values", "Min price of Thumper Bodies", 120, "");
THUMPER_MAX = ConfigEntry("Body Values", "Max price of Thumper Bodies", 160, "");
CENTIPEDE_WEIGHT = ConfigEntry("Body Weights", "Weight of Centipede Bodies", 1.65f, "");
HOARDER_WEIGHT = ConfigEntry("Body Weights", "Weight of Hoarding Bug Bodies", 1.6f, "");
SCAV_WEIGHT = ConfigEntry("Body Weights", "Weight of Scavenger Bodies", 2.5f, "");
SPIDER_WEIGHT = ConfigEntry("Body Weights", "Weight of Spider Bodies", 2.3f, "");
THUMPER_WEIGHT = ConfigEntry("Body Weights", "Weight of Thumper Bodies", 2.9f, "");
TRASH_MIN = ConfigEntry("Trash Value", "Min price of trash", 20, "");
TRASH_MAX = ConfigEntry("Trash Value", "Max price of trash", 70, "");
SCRAP_SPAWN = ConfigEntry("Scrap", "Spawn regular scrap", defaultVal: false, "");
MESS_RARITY = ConfigEntry("Scrap", "Mess rarity", 50, "Higher means it has a higher chance of spawning. if the above option is false this doesn't matter.");
}
}
}
namespace __GEN
{
internal class NetworkVariableSerializationHelper
{
[RuntimeInitializeOnLoadMethod]
internal static void InitializeSerialization()
{
}
}
}
namespace CleaningCompany.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}