using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using ImmersiveScrap.Configs;
using ImmersiveScrap.Keybinds;
using ImmersiveScrap.Misc;
using ImmersiveScrap.NetcodePatcher;
using LethalCompanyInputUtils.Api;
using LethalLevelLoader;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ImmersiveScrap")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Immersive Scrap mod with 40+ Vanilla style Scrap!")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0+b909b1d36a07f97121306ec234e9ff83f9360c7b")]
[assembly: AssemblyProduct("ImmersiveScrap")]
[assembly: AssemblyTitle("ImmersiveScrap")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
static <Module>()
{
}
}
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ImmersiveScrap
{
[BepInPlugin("ImmersiveScrap", "ImmersiveScrap", "1.4.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger;
public static GameObject explosionPrefab;
internal static IngameKeybinds InputActionsInstance;
public static ImmersiveScrapConfig ModConfig { get; private set; }
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
InputActionsInstance = new IngameKeybinds();
ModConfig = new ImmersiveScrapConfig(((BaseUnityPlugin)this).Config);
AssetBundleLoader.AddOnExtendedModLoadedListener((Action<ExtendedMod>)OnExtendedModRegistered, "XuXiaolan", "ImmersiveScraps");
AssetBundleLoader.AddOnLethalBundleLoadedListener((Action<AssetBundle>)OnLethalBundleLoaded, "immersivescrapassets.lethalbundle");
InitializeNetworkBehaviours();
Logger.LogInfo((object)"Plugin ImmersiveScrap is loaded!");
}
internal static void OnExtendedModRegistered(ExtendedMod extendedMod)
{
if ((Object)(object)extendedMod == (Object)null)
{
return;
}
foreach (ExtendedItem extendedItem in extendedMod.ExtendedItems)
{
string configValueForItem = GetConfigValueForItem(extendedItem.Item.itemName);
if (!string.IsNullOrEmpty(configValueForItem))
{
List<StringWithRarity> collection = ConfigParsing(configValueForItem);
extendedItem.LevelMatchingProperties.levelTags.AddRange(collection);
extendedItem.LevelMatchingProperties.planetNames.AddRange(collection);
Logger.LogInfo((object)$"Updated matching properties for {extendedItem.Item}.");
}
}
}
internal static void OnLethalBundleLoaded(AssetBundle assetBundle)
{
_ = (Object)(object)assetBundle == (Object)null;
}
private static string GetConfigValueForItem(string itemName)
{
switch (itemName)
{
case "Alcohol Flask":
return ImmersiveScrapConfig.ConfigAlcoholSpawnWeight.Value;
case "ImmersiveAnvil":
return ImmersiveScrapConfig.ConfigAnvilSpawnWeight.Value;
case "IBaseball bat":
return ImmersiveScrapConfig.ConfigBaseballSpawnWeight.Value;
case "Beer can":
return ImmersiveScrapConfig.ConfigBeercanSpawnWeight.Value;
case "IBrick":
return ImmersiveScrapConfig.ConfigBrickSpawnWeight.Value;
case "Broken engine":
return ImmersiveScrapConfig.ConfigBrokenEngineSpawnWeight.Value;
case "Bucket":
return ImmersiveScrapConfig.ConfigBucketSpawnWeight.Value;
case "Can paint":
return ImmersiveScrapConfig.ConfigCanPaintSpawnWeight.Value;
case "Canteen":
return ImmersiveScrapConfig.ConfigCanteenSpawnWeight.Value;
case "Car battery":
return ImmersiveScrapConfig.ConfigCarBatterySpawnWeight.Value;
case "Clamp":
return ImmersiveScrapConfig.ConfigClampSpawnWeight.Value;
case "IClock":
return ImmersiveScrapConfig.ConfigClockSpawnWeight.Value;
case "IFan":
return ImmersiveScrapConfig.ConfigFanSpawnWeight.Value;
case "Fancy Painting":
return ImmersiveScrapConfig.ConfigFancyPaintingSpawnWeight.Value;
case "IFireAxe":
return ImmersiveScrapConfig.ConfigFireAxeSpawnWeight.Value;
case "Fire extinguisher":
return ImmersiveScrapConfig.ConfigFireExtingSpawnWeight.Value;
case "Fire hydrant":
return ImmersiveScrapConfig.ConfigFireHydrantSpawnWeight.Value;
case "Food can":
return ImmersiveScrapConfig.ConfigFoodCanSpawnWeight.Value;
case "Gameboy":
return ImmersiveScrapConfig.ConfigGameboySpawnWeight.Value;
case "Garbage":
return ImmersiveScrapConfig.ConfigGarbageSpawnWeight.Value;
case "ImmersiveHammer":
return ImmersiveScrapConfig.ConfigHammerSpawnWeight.Value;
case "Jerrycan":
return ImmersiveScrapConfig.ConfigJerryCanSpawnWeight.Value;
case "IKeyboard":
return ImmersiveScrapConfig.ConfigKeyboardSpawnWeight.Value;
case "ILantern":
return ImmersiveScrapConfig.ConfigLanternSpawnWeight.Value;
case "Library lamp":
return ImmersiveScrapConfig.ConfigLibraryLampSpawnWeight.Value;
case "ImmersivePlant":
return ImmersiveScrapConfig.ConfigPlantSpawnWeight.Value;
case "Pliers":
return ImmersiveScrapConfig.ConfigPliersSpawnWeight.Value;
case "Plunger":
return ImmersiveScrapConfig.ConfigPlungerSpawnWeight.Value;
case "Retro Toy":
return ImmersiveScrapConfig.ConfigRetroToySpawnWeight.Value;
case "Screwdriver":
return ImmersiveScrapConfig.ConfigScrewdriverSpawnWeight.Value;
case "Sink":
return ImmersiveScrapConfig.ConfigSinkSpawnWeight.Value;
case "Socket Wrench":
return ImmersiveScrapConfig.ConfigSocketSpawnWeight.Value;
case "ISqueaky toy":
return ImmersiveScrapConfig.ConfigSqueakyToySpawnWeight.Value;
case "Suitcase":
return ImmersiveScrapConfig.ConfigSuitcaseSpawnWeight.Value;
case "Toaster":
return ImmersiveScrapConfig.ConfigToasterSpawnWeight.Value;
case "Toolbox":
return ImmersiveScrapConfig.ConfigToolboxSpawnWeight.Value;
case "Top hat":
return ImmersiveScrapConfig.ConfigTophatSpawnWeight.Value;
case "Traffic cone":
return ImmersiveScrapConfig.ConfigTrafficConeSpawnWeight.Value;
case "Vent":
return ImmersiveScrapConfig.ConfigVentSpawnWeight.Value;
case "Watering Can":
return ImmersiveScrapConfig.ConfigWateringCanSpawnWeight.Value;
case "Wheel":
return ImmersiveScrapConfig.ConfigWheelSpawnWeight.Value;
case "Wine bottle":
return ImmersiveScrapConfig.ConfigWineBottleSpawnWeight.Value;
case "Wrench":
return ImmersiveScrapConfig.ConfigWrenchSpawnWeight.Value;
default:
Logger.LogInfo((object)("No configuration found for item type: " + itemName));
return null;
}
}
private static List<StringWithRarity> ConfigParsing(string configMoonRarity)
{
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Expected O, but got Unknown
List<StringWithRarity> list = new List<StringWithRarity>();
foreach (string item in from s in configMoonRarity.Split(",")
select s.Trim())
{
string[] array = item.Split(":");
if (array.Length == 2)
{
string text = array[0];
if (int.TryParse(array[1], out var result))
{
list.Add(new StringWithRarity(text, result));
Logger.LogInfo((object)$"Registered spawn rate for {text} to {result}");
}
}
}
return list;
}
private void InitializeNetworkBehaviours()
{
Type[] types = Assembly.GetExecutingAssembly().GetTypes();
Type[] array = types;
foreach (Type type in array)
{
MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
MethodInfo[] array2 = methods;
foreach (MethodInfo methodInfo in array2)
{
object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
if (customAttributes.Length != 0)
{
methodInfo.Invoke(null, null);
}
}
}
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "ImmersiveScrap";
public const string PLUGIN_NAME = "ImmersiveScrap";
public const string PLUGIN_VERSION = "1.4.0";
}
}
namespace ImmersiveScrap.Misc
{
public class ThrowableNoisemaker : NoisemakerProp
{
public bool throwWithRight;
public bool beingThrown;
public AnimationCurve itemFallCurve;
public AnimationCurve itemVerticalFallCurve;
public AnimationCurve itemVerticalFallCurveNoBounce;
public RaycastHit itemHit;
public Ray itemThrowRay;
public override void FallWithCurve()
{
//IL_0001: 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)
//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)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: 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_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_015c: Unknown result type (might be due to invalid IL or missing references)
//IL_0166: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: 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)
Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition;
float magnitude = ((Vector3)(ref val)).magnitude;
((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z), 14f * Time.deltaTime / magnitude);
((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, itemFallCurve.Evaluate(((GrabbableObject)this).fallTime));
if (magnitude > 5f)
{
((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), itemVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime));
}
else
{
((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), itemVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime));
}
((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude);
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
}
public Vector3 GetItemThrowDestination()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: 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_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_003c: 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_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: 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_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: 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_009e: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
Vector3 position = ((Component)this).transform.position;
itemThrowRay = new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward);
float num = 30f;
position = ((!Physics.Raycast(itemThrowRay, ref itemHit, num, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1)) ? ((Ray)(ref itemThrowRay)).GetPoint(num) : ((Ray)(ref itemThrowRay)).GetPoint(((RaycastHit)(ref itemHit)).distance - 0.05f));
itemThrowRay = new Ray(position, Vector3.down);
if (Physics.Raycast(itemThrowRay, ref itemHit, 30f, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))
{
return ((RaycastHit)(ref itemHit)).point + Vector3.up * 0.05f;
}
return ((Ray)(ref itemThrowRay)).GetPoint(30f);
}
protected override void __initializeVariables()
{
((NoisemakerProp)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "ThrowableNoisemaker";
}
}
public class Utilities
{
private static Dictionary<int, int> _masksByLayer;
public static void Init()
{
GenerateLayerMap();
}
public static void GenerateLayerMap()
{
_masksByLayer = new Dictionary<int, int>();
for (int i = 0; i < 32; i++)
{
int num = 0;
for (int j = 0; j < 32; j++)
{
if (!Physics.GetIgnoreLayerCollision(i, j))
{
num |= 1 << j;
}
}
_masksByLayer.Add(i, num);
}
}
public static Transform TryFindRoot(Transform child)
{
Transform val = child;
while ((Object)(object)val != (Object)null)
{
if ((Object)(object)((Component)val).GetComponent<NetworkObject>() != (Object)null)
{
return val;
}
val = ((Component)val).transform.parent;
}
return null;
}
public static int MaskForLayer(int layer)
{
return _masksByLayer[layer];
}
public static void TeleportPlayer(int playerObj, Vector3 teleportPos)
{
//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_0062: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj];
if (Object.op_Implicit((Object)(object)Object.FindObjectOfType<AudioReverbPresets>()))
{
Object.FindObjectOfType<AudioReverbPresets>().audioPresets[2].ChangeAudioReverbForPlayer(val);
}
val.isInElevator = false;
val.isInHangarShipRoom = false;
val.isInsideFactory = true;
val.averageVelocity = 0f;
val.velocityLastFrame = Vector3.zero;
StartOfRound.Instance.allPlayerScripts[playerObj].TeleportPlayer(teleportPos, false, 0f, false, true);
StartOfRound.Instance.allPlayerScripts[playerObj].beamOutParticle.Play();
if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
}
}
public static IEnumerator TeleportPlayerBody(int playerObj, Vector3 teleportPosition)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
float startTime = Time.realtimeSinceStartup;
yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)StartOfRound.Instance.allPlayerScripts[playerObj].deadBody != (Object)null || Time.realtimeSinceStartup - startTime > 2f));
if (StartOfRound.Instance.inShipPhase || SceneManager.sceneCount <= 1)
{
yield break;
}
DeadBodyInfo deadBody = StartOfRound.Instance.allPlayerScripts[playerObj].deadBody;
if ((Object)(object)deadBody != (Object)null)
{
deadBody.attachedTo = null;
deadBody.attachedLimb = null;
deadBody.secondaryAttachedLimb = null;
deadBody.secondaryAttachedTo = null;
if ((Object)(object)deadBody.grabBodyObject != (Object)null && deadBody.grabBodyObject.isHeld && (Object)(object)deadBody.grabBodyObject.playerHeldBy != (Object)null)
{
deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false);
}
deadBody.isInShip = false;
deadBody.parentedToShip = false;
((Component)deadBody).transform.SetParent((Transform)null, true);
deadBody.SetRagdollPositionSafely(teleportPosition, true);
}
}
public static void TeleportEnemy(EnemyAI enemy, Vector3 teleportPos)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
enemy.serverPosition = teleportPos;
((Component)enemy).transform.position = teleportPos;
enemy.agent.Warp(teleportPos);
enemy.SyncPositionToClients();
}
public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null)
{
//IL_0005: 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_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: 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_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0263: Unknown result type (might be due to invalid IL or missing references)
Debug.Log((object)$"Spawning explosion at pos: {explosionPosition}");
Transform val = null;
if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null)
{
val = RoundManager.Instance.mapPropsContainer.transform;
}
if (spawnExplosionEffect)
{
Object.Instantiate<GameObject>(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true);
}
float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition);
if (num < 14f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)1);
}
else if (num < 25f)
{
HUDManager.Instance.ShakeCamera((ScreenShakeType)0);
}
Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2);
PlayerControllerB val2 = null;
for (int i = 0; i < array.Length; i++)
{
float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position);
if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1))
{
continue;
}
if (((Component)array[i]).gameObject.layer == 3)
{
val2 = ((Component)array[i]).gameObject.GetComponent<PlayerControllerB>();
if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner)
{
float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange));
val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3));
}
}
else if (((Component)array[i]).gameObject.layer == 21)
{
Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren<Landmine>();
if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f)
{
Debug.Log((object)"Setting off other mine");
((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren));
}
}
else if (((Component)array[i]).gameObject.layer == 19)
{
EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren<EnemyAICollisionDetect>();
if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f)
{
componentInChildren2.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false, -1);
}
}
}
int num4 = ~LayerMask.GetMask(new string[1] { "Room" });
num4 = ~LayerMask.GetMask(new string[1] { "Colliders" });
array = Physics.OverlapSphere(explosionPosition, 10f, num4);
for (int j = 0; j < array.Length; j++)
{
Rigidbody component = ((Component)array[j]).GetComponent<Rigidbody>();
if ((Object)(object)component != (Object)null)
{
component.AddExplosionForce(70f, explosionPosition, 10f);
}
}
}
}
}
namespace ImmersiveScrap.Scrap
{
public class Brick : ThrowableNoisemaker
{
public AudioClip[] cookieSpecialAudio;
public AudioSource brickPlayer;
private float explodePercentage = 100f;
public bool wasThrown;
private Random noiseMakerRandom;
public override void Start()
{
((NoisemakerProp)this).Start();
noiseMakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85);
}
public void DetectThrowKeyPressed()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.InputActionsInstance.ThrowKey.triggered && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController))
{
wasThrown = true;
Vector3 itemThrowDestination = GetItemThrowDestination();
((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, itemThrowDestination, true);
PlayCookieAudioServerRpc(0);
}
}
public override void Update()
{
((GrabbableObject)this).Update();
if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer != (Object)(object)this))
{
DetectThrowKeyPressed();
}
}
[ServerRpc]
public void PlayCookieAudioServerRpc(int index)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: 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)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3742843923u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, index);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3742843923u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
PlayCookieAudioClientRpc(index);
}
}
[ClientRpc]
public void PlayCookieAudioClientRpc(int index)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2929058189u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, index);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2929058189u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && cookieSpecialAudio.Length != 0)
{
brickPlayer.PlayOneShot(cookieSpecialAudio[index]);
WalkieTalkie.TransmitOneShotAudio(brickPlayer, cookieSpecialAudio[index], 0.5f);
RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 15f, 0.5f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0);
}
}
}
[ServerRpc]
public void StopPlayingCookieAudioServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4170301725u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4170301725u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
StopPlayingCookieAudioClientRpc();
}
}
[ClientRpc]
public void StopPlayingCookieAudioClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(366094878u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 366094878u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
brickPlayer.Stop();
}
}
}
[ClientRpc]
public void BoomClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2731884806u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2731884806u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
Boom();
}
}
}
[ServerRpc]
public void BoomServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3369954093u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3369954093u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
Boom();
BoomClientRpc();
}
}
public void CreateExplosion()
{
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB attacker = ((IEnumerable<PlayerControllerB>)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func<PlayerControllerB, bool>)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId));
int num = 0;
if (ImmersiveScrapConfig.ConfigBrickDealingDamage.Value)
{
num = ImmersiveScrapConfig.ConfigBrickDealingXDamage.Value;
}
Utilities.CreateExplosion(((Component)this).transform.position, ImmersiveScrapConfig.ConfigBrickExploding.Value, 20, 0f, num, 2, (CauseOfDeath)3, attacker);
}
public void Boom()
{
CreateExplosion();
}
public override void OnHitGround()
{
if (wasThrown)
{
wasThrown = false;
if (((NetworkBehaviour)this).IsOwner && (float)noiseMakerRandom.Next(0, 101) <= explodePercentage)
{
Boom();
BoomServerRpc();
}
}
}
protected override void __initializeVariables()
{
base.__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_Brick()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(3742843923u, new RpcReceiveHandler(__rpc_handler_3742843923));
NetworkManager.__rpc_func_table.Add(2929058189u, new RpcReceiveHandler(__rpc_handler_2929058189));
NetworkManager.__rpc_func_table.Add(4170301725u, new RpcReceiveHandler(__rpc_handler_4170301725));
NetworkManager.__rpc_func_table.Add(366094878u, new RpcReceiveHandler(__rpc_handler_366094878));
NetworkManager.__rpc_func_table.Add(2731884806u, new RpcReceiveHandler(__rpc_handler_2731884806));
NetworkManager.__rpc_func_table.Add(3369954093u, new RpcReceiveHandler(__rpc_handler_3369954093));
}
private static void __rpc_handler_3742843923(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
int index = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref index);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Brick)(object)target).PlayCookieAudioServerRpc(index);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2929058189(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int index = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref index);
target.__rpc_exec_stage = (__RpcExecStage)2;
((Brick)(object)target).PlayCookieAudioClientRpc(index);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_4170301725(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((Brick)(object)target).StopPlayingCookieAudioServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_366094878(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((Brick)(object)target).StopPlayingCookieAudioClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2731884806(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((Brick)(object)target).BoomClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3369954093(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((Brick)(object)target).BoomServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "Brick";
}
}
internal class HittingStuff : GrabbableObject
{
public int hammerHitForce = 1;
public float hammerHitPercentage = 1f;
public bool reelingUp;
public bool isHoldingButton;
private RaycastHit rayHit;
private Coroutine reelingUpCoroutine;
private RaycastHit[] objectsHitByHammer;
private List<RaycastHit> objectsHitByHammerList = new List<RaycastHit>();
public AudioClip reelUp;
public AudioClip swing;
public AudioClip[] hitSFX;
public AudioSource hammerAudio;
private PlayerControllerB previousPlayerHeldBy;
private int hammerMask = 11012424;
public override void ItemActivate(bool used, bool buttonDown = true)
{
if ((Object)(object)base.playerHeldBy == (Object)null)
{
return;
}
isHoldingButton = buttonDown;
if (!reelingUp && buttonDown)
{
reelingUp = true;
previousPlayerHeldBy = base.playerHeldBy;
if (reelingUpCoroutine != null)
{
((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine);
}
reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpHammer());
}
}
private IEnumerator reelUpHammer()
{
base.playerHeldBy.activatingItem = true;
base.playerHeldBy.twoHanded = true;
base.playerHeldBy.playerBodyAnimator.ResetTrigger("hammerHit");
base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true);
hammerAudio.PlayOneShot(reelUp);
ReelUpSFXServerRpc();
yield return (object)new WaitForSeconds(0.35f);
yield return (object)new WaitUntil((Func<bool>)(() => !isHoldingButton || !base.isHeld));
SwingHammer(!base.isHeld);
yield return (object)new WaitForSeconds(0.13f);
HitHammer(!base.isHeld);
yield return (object)new WaitForSeconds(0.3f);
reelingUp = false;
reelingUpCoroutine = null;
}
[ServerRpc]
public void ReelUpSFXServerRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2951614796u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2951614796u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
ReelUpSFXClientRpc();
}
}
[ClientRpc]
public void ReelUpSFXClientRpc()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(989564174u, val, (RpcDelivery)0);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 989564174u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
hammerAudio.PlayOneShot(reelUp);
}
}
}
public override void DiscardItem()
{
base.playerHeldBy.activatingItem = false;
((GrabbableObject)this).DiscardItem();
}
public void SwingHammer(bool cancel = false)
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false);
if (!cancel)
{
hammerAudio.PlayOneShot(swing);
previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false);
}
}
public void HitHammer(bool cancel = false)
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: 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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_0380: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: 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_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01df: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Unknown result type (might be due to invalid IL or missing references)
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_0324: Unknown result type (might be due to invalid IL or missing references)
//IL_032e: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)previousPlayerHeldBy == (Object)null)
{
return;
}
previousPlayerHeldBy.activatingItem = false;
bool flag = false;
int num = -1;
if (!cancel)
{
previousPlayerHeldBy.twoHanded = false;
Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f);
objectsHitByHammer = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, hammerMask, (QueryTriggerInteraction)2);
objectsHitByHammerList = objectsHitByHammer.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList();
Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position;
IHittable val3 = default(IHittable);
RaycastHit val5 = default(RaycastHit);
for (int i = 0; i < objectsHitByHammerList.Count; i++)
{
RaycastHit val2 = objectsHitByHammerList[i];
if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8)
{
val2 = objectsHitByHammerList[i];
if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11)
{
val2 = objectsHitByHammerList[i];
if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent<IHittable>(ref val3))
{
continue;
}
val2 = objectsHitByHammerList[i];
if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform)
{
continue;
}
val2 = objectsHitByHammerList[i];
if (!(((RaycastHit)(ref val2)).point == Vector3.zero))
{
Vector3 val4 = val;
val2 = objectsHitByHammerList[i];
if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRound.Instance.collidersAndRoomMaskAndDefault))
{
continue;
}
}
flag = true;
Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward;
val3.Hit(hammerHitForce, forward, previousPlayerHeldBy, true, -1);
continue;
}
}
val2 = objectsHitByHammerList[i];
Vector3 point = ((RaycastHit)(ref val2)).point;
val2 = objectsHitByHammerList[i];
val = point + ((RaycastHit)(ref val2)).normal * 0.01f;
flag = true;
val2 = objectsHitByHammerList[i];
string tag = ((Component)((RaycastHit)(ref val2)).collider).gameObject.tag;
for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++)
{
if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag)
{
hammerAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX);
WalkieTalkie.TransmitOneShotAudio(hammerAudio, StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX, 1f);
num = j;
break;
}
}
}
}
if (flag)
{
int soundID = RoundManager.PlayRandomClip(hammerAudio, hitSFX, true, 1f, 0, 1000);
Object.FindObjectOfType<RoundManager>().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0);
base.playerHeldBy.playerBodyAnimator.SetTrigger("hammerHit");
HitHammerServerRpc(soundID);
}
}
[ServerRpc]
public void HitHammerServerRpc(int soundID)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Invalid comparison between Unknown and I4
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: 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)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Invalid comparison between Unknown and I4
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
return;
}
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2176195719u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, soundID);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2176195719u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
HitHammerClientRpc(soundID);
}
}
[ClientRpc]
public void HitHammerClientRpc(int soundID)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3269527847u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, soundID);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3269527847u, val, (RpcDelivery)0);
}
if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
HitSurfaceWithHammer(soundID);
}
}
}
private void HitSurfaceWithHammer(int soundID)
{
if (!((NetworkBehaviour)this).IsOwner)
{
hammerAudio.PlayOneShot(hitSFX[soundID]);
}
WalkieTalkie.TransmitOneShotAudio(hammerAudio, hitSFX[soundID], 1f);
}
protected override void __initializeVariables()
{
((GrabbableObject)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_HittingStuff()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(2951614796u, new RpcReceiveHandler(__rpc_handler_2951614796));
NetworkManager.__rpc_func_table.Add(989564174u, new RpcReceiveHandler(__rpc_handler_989564174));
NetworkManager.__rpc_func_table.Add(2176195719u, new RpcReceiveHandler(__rpc_handler_2176195719));
NetworkManager.__rpc_func_table.Add(3269527847u, new RpcReceiveHandler(__rpc_handler_3269527847));
}
private static void __rpc_handler_2951614796(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: 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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
target.__rpc_exec_stage = (__RpcExecStage)1;
((HittingStuff)(object)target).ReelUpSFXServerRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_989564174(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
target.__rpc_exec_stage = (__RpcExecStage)2;
((HittingStuff)(object)target).ReelUpSFXClientRpc();
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_2176195719(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Invalid comparison between Unknown and I4
NetworkManager networkManager = target.NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId)
{
if ((int)networkManager.LogLevel <= 1)
{
Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!");
}
}
else
{
int soundID = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref soundID);
target.__rpc_exec_stage = (__RpcExecStage)1;
((HittingStuff)(object)target).HitHammerServerRpc(soundID);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3269527847(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
int soundID = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref soundID);
target.__rpc_exec_stage = (__RpcExecStage)2;
((HittingStuff)(object)target).HitHammerClientRpc(soundID);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "HittingStuff";
}
}
}
namespace ImmersiveScrap.Weapons
{
public class BaseballBat : Shovel
{
protected override void __initializeVariables()
{
((Shovel)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "BaseballBat";
}
}
public class Plunger : Shovel
{
protected override void __initializeVariables()
{
((Shovel)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "Plunger";
}
}
}
namespace ImmersiveScrap.Keybinds
{
public class IngameKeybinds : LcInputActions
{
[InputAction("<Keyboard>/q", Name = "ThrowKeybind")]
public InputAction ThrowKey { get; set; }
}
}
namespace ImmersiveScrap.Configs
{
public class ImmersiveScrapConfig
{
public static ConfigEntry<int> ConfigVanillaSpawnWeight { get; private set; }
public static ConfigEntry<int> ConfigCustomSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigAlcoholSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigAnvilSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigBaseballSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigBeercanSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigBrickSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigBrokenEngineSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigBucketSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigCanPaintSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigCanteenSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigCarBatterySpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigClampSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigClockSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigFanSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigFancyPaintingSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigFireAxeSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigFireExtingSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigFireHydrantSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigFoodCanSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigGameboySpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigGarbageSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigHammerSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigJerryCanSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigKeyboardSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigLanternSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigLibraryLampSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigPlantSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigPliersSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigPlungerSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigRetroToySpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigScrewdriverSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigSinkSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigSocketSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigSqueakyToySpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigSuitcaseSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigToasterSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigToolboxSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigTophatSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigTrafficConeSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigVentSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigWateringCanSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigWheelSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigWineBottleSpawnWeight { get; private set; }
public static ConfigEntry<string> ConfigWrenchSpawnWeight { get; private set; }
public static ConfigEntry<bool> ConfigBrickExploding { get; private set; }
public static ConfigEntry<bool> ConfigBrickDealingDamage { get; private set; }
public static ConfigEntry<int> ConfigBrickDealingXDamage { get; private set; }
public ImmersiveScrapConfig(ConfigFile configFile)
{
ConfigBrickExploding = configFile.Bind<bool>("Scrap Options", "Brick Exploding", false, "Enable/Disable Brick Exploding");
ConfigBrickDealingDamage = configFile.Bind<bool>("Scrap Options", "Brick Dealing Damage", false, "Enable/Disable Brick Dealing Damage");
ConfigBrickDealingXDamage = configFile.Bind<int>("Scrap Options", "Brick Dealing X Damage", 1, "Set how much damage the Brick deals");
ConfigAlcoholSpawnWeight = configFile.Bind<string>("Scrap Options", "Alcohol | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for alcohol scrap on moons");
ConfigAnvilSpawnWeight = configFile.Bind<string>("Scrap Options", "Anvil | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for anvil scrap on moons");
ConfigBaseballSpawnWeight = configFile.Bind<string>("Scrap Options", "Baseball | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for baseball scrap on moons");
ConfigBeercanSpawnWeight = configFile.Bind<string>("Scrap Options", "Beercan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for beer can scrap on moons");
ConfigBrickSpawnWeight = configFile.Bind<string>("Scrap Options", "Brick | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for brick scrap on moons");
ConfigCanteenSpawnWeight = configFile.Bind<string>("Scrap Options", "Canteen | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for canteen scrap on moons");
ConfigCarBatterySpawnWeight = configFile.Bind<string>("Scrap Options", "CarBattery | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for car battery scrap on moons");
ConfigFireAxeSpawnWeight = configFile.Bind<string>("Scrap Options", "FireAxe | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire axe scrap on moons");
ConfigFireExtingSpawnWeight = configFile.Bind<string>("Scrap Options", "FireExtinguisher | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire extinguisher scrap on moons");
ConfigFireHydrantSpawnWeight = configFile.Bind<string>("Scrap Options", "FireHydrant | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fire hydrant scrap on moons");
ConfigFoodCanSpawnWeight = configFile.Bind<string>("Scrap Options", "FoodCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for food can scrap on moons");
ConfigLibraryLampSpawnWeight = configFile.Bind<string>("Scrap Options", "LibraryLamp | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for library lamp scrap on moons");
ConfigPlantSpawnWeight = configFile.Bind<string>("Scrap Options", "Plant | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for plant scrap on moons");
ConfigPliersSpawnWeight = configFile.Bind<string>("Scrap Options", "Pliers | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for pliers scrap on moons");
ConfigPlungerSpawnWeight = configFile.Bind<string>("Scrap Options", "Plunger | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for plunger scrap on moons");
ConfigTrafficConeSpawnWeight = configFile.Bind<string>("Scrap Options", "TrafficCone | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for traffic cone scrap on moons");
ConfigWateringCanSpawnWeight = configFile.Bind<string>("Scrap Options", "WateringCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for watering can scrap on moons");
ConfigWrenchSpawnWeight = configFile.Bind<string>("Scrap Options", "Wrench | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wrench scrap on moons");
ConfigBrokenEngineSpawnWeight = configFile.Bind<string>("Scrap Options", "BrokenEngine | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for broken engine scrap on moons");
ConfigBucketSpawnWeight = configFile.Bind<string>("Scrap Options", "Bucket | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for bucket scrap on moons");
ConfigCanPaintSpawnWeight = configFile.Bind<string>("Scrap Options", "CanPaint | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for can of paint scrap on moons");
ConfigClampSpawnWeight = configFile.Bind<string>("Scrap Options", "Clamp | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for clamp scrap on moons");
ConfigClockSpawnWeight = configFile.Bind<string>("Scrap Options", "Clock | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for clock scrap on moons");
ConfigFanSpawnWeight = configFile.Bind<string>("Scrap Options", "Fan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fan scrap on moons");
ConfigFancyPaintingSpawnWeight = configFile.Bind<string>("Scrap Options", "FancyPainting | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for fancy painting scrap on moons");
ConfigGarbageSpawnWeight = configFile.Bind<string>("Scrap Options", "Garbage | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for garbage scrap on moons");
ConfigGameboySpawnWeight = configFile.Bind<string>("Scrap Options", "Gameboy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for Gameboy scrap on moons");
ConfigHammerSpawnWeight = configFile.Bind<string>("Scrap Options", "Hammer | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for hammer scrap on moons");
ConfigJerryCanSpawnWeight = configFile.Bind<string>("Scrap Options", "JerryCan | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for jerry can scrap on moons");
ConfigKeyboardSpawnWeight = configFile.Bind<string>("Scrap Options", "Keyboard | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for keyboard scrap on moons");
ConfigLanternSpawnWeight = configFile.Bind<string>("Scrap Options", "Lantern | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for lantern scrap on moons");
ConfigRetroToySpawnWeight = configFile.Bind<string>("Scrap Options", "RetroToy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for retro toy scrap on moons");
ConfigScrewdriverSpawnWeight = configFile.Bind<string>("Scrap Options", "Screwdriver | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for screwdriver scrap on moons");
ConfigSinkSpawnWeight = configFile.Bind<string>("Scrap Options", "Sink | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for sink scrap on moons");
ConfigSocketSpawnWeight = configFile.Bind<string>("Scrap Options", "Socket | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for socket scrap on moons");
ConfigSqueakyToySpawnWeight = configFile.Bind<string>("Scrap Options", "SqueakyToy | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for squeaky toy scrap on moons");
ConfigSuitcaseSpawnWeight = configFile.Bind<string>("Scrap Options", "Suitcase | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for suitcase scrap on moons");
ConfigToasterSpawnWeight = configFile.Bind<string>("Scrap Options", "Toaster | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for toaster scrap on moons");
ConfigToolboxSpawnWeight = configFile.Bind<string>("Scrap Options", "Toolbox | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for toolbox scrap on moons");
ConfigTophatSpawnWeight = configFile.Bind<string>("Scrap Options", "Tophat | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for top hat scrap on moons");
ConfigVentSpawnWeight = configFile.Bind<string>("Scrap Options", "Vent | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for vent scrap on moons");
ConfigWheelSpawnWeight = configFile.Bind<string>("Scrap Options", "Wheel | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wheel scrap on moons");
ConfigWineBottleSpawnWeight = configFile.Bind<string>("Scrap Options", "WineBottle | SpawnWeight", "Vanilla:20, Custom:20", "Configurable Spawn Weight of Scrap for wine bottle scrap on moons");
ClearUnusedEntries(configFile);
Plugin.Logger.LogInfo((object)"Setting up config for ImmersiveScrap plugin...");
}
private void ClearUnusedEntries(ConfigFile configFile)
{
PropertyInfo property = ((object)configFile).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic);
Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)property.GetValue(configFile, null);
dictionary.Clear();
configFile.Save();
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace ImmersiveScrap.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}