using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using SlayersSillyStuff.Scrap;
using Unity.Netcode;
using UnityEngine;
[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("SlayersSillyStuff")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Slayers Silly Stuff")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SlayersSillyStuff")]
[assembly: AssemblyTitle("SlayersSillyStuff")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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 SlayersSillyStuff
{
public class Networker : NetworkBehaviour
{
public static Networker Instance { get; private set; }
public override void OnNetworkSpawn()
{
Instance = this;
((NetworkBehaviour)this).OnNetworkSpawn();
if (!((NetworkBehaviour)this).IsServer)
{
}
}
[ServerRpc(RequireOwnership = false)]
public void MoveItemServerRpc(Vector3 position, int newValue, ulong clientId)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: 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(1157311365u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
BytePacker.WriteValueBitPacked(val2, newValue);
BytePacker.WriteValueBitPacked(val2, clientId);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1157311365u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
{
MoveItemClientRpc(position, newValue, clientId);
}
}
}
[ClientRpc]
public void MoveItemClientRpc(Vector3 position, int newValue, ulong itemID)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Invalid comparison between Unknown and I4
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: 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 != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3685289889u, val, (RpcDelivery)0);
((FastBufferWriter)(ref val2)).WriteValueSafe(ref position);
BytePacker.WriteValueBitPacked(val2, newValue);
BytePacker.WriteValueBitPacked(val2, itemID);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3685289889u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(itemID, out var value))
{
Landmine.SpawnExplosion(position, true, 0f, 1f, 20, 1f, (GameObject)null, false);
GameObject gameObject = ((Component)value).gameObject;
gameObject.transform.position = position;
Hmmmm hmmmm = default(Hmmmm);
if (gameObject.TryGetComponent<Hmmmm>(ref hmmmm))
{
((GrabbableObject)hmmmm).SetScrapValue(newValue);
((GrabbableObject)hmmmm).targetFloorPosition = position;
((GrabbableObject)hmmmm).startFallingPosition = position;
((GrabbableObject)hmmmm).FallToGround(false, false, position);
hmmmm.scanNodeProperties.scrapValue = newValue;
}
}
}
[ServerRpc(RequireOwnership = false)]
public void KillAllServerRpc(ulong itemID)
{
//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_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: 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.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(977293774u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, itemID);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 977293774u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || !NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(itemID, out var value))
{
return;
}
GameObject gameObject = ((Component)value).gameObject;
Landmine.SpawnExplosion(gameObject.transform.position, true, 0f, 0f, 0, 1f, (GameObject)null, false);
value.Despawn(true);
foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
{
if (spawnedEnemy.isOutside)
{
continue;
}
try
{
Landmine.SpawnExplosion(((Component)spawnedEnemy).transform.position, true, 2f, 5f, 50, 0f, (GameObject)null, false);
spawnedEnemy.KillEnemy(true);
try
{
if (!spawnedEnemy.isEnemyDead)
{
((Component)spawnedEnemy).GetComponent<NetworkObject>().Despawn(true);
}
}
catch (Exception)
{
}
}
catch (Exception)
{
}
}
PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
foreach (PlayerControllerB val3 in allPlayerScripts)
{
if (val3.isInsideFactory)
{
killPlayerClientRpc(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val3));
}
}
}
[ClientRpc]
public void killPlayerClientRpc(int playerID)
{
//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_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
{
ClientRpcParams val = default(ClientRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1034668425u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, playerID);
((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1034668425u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
{
PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[playerID];
Landmine.SpawnExplosion(((Component)val3).transform.position, true, 1f, 1f, 200, 1f, (GameObject)null, false);
val3.KillPlayer(Vector3.up, true, (CauseOfDeath)0, 0, default(Vector3));
}
}
}
[ServerRpc(RequireOwnership = false)]
public void TPAllServerRpc(ulong itemID)
{
//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_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: 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)
NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
if (networkManager == null || !networkManager.IsListening)
{
return;
}
if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
{
ServerRpcParams val = default(ServerRpcParams);
FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1610337453u, val, (RpcDelivery)0);
BytePacker.WriteValueBitPacked(val2, itemID);
((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1610337453u, val, (RpcDelivery)0);
}
if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost) || !NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(itemID, out var value))
{
return;
}
GameObject gameObject = ((Component)value).gameObject;
Landmine.SpawnExplosion(gameObject.transform.position, true, 0f, 0f, 0, 1f, (GameObject)null, false);
value.Despawn(true);
foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies)
{
if (spawnedEnemy.isOutside)
{
continue;
}
try
{
spawnedEnemy.isOutside = true;
spawnedEnemy.allAINodes = GameObject.FindGameObjectsWithTag("OutsideAINode");
spawnedEnemy.serverPosition = RoundManager.Instance.outsideAINodes[Random.Range(0, RoundManager.Instance.outsideAINodes.Length)].transform.position;
Transform val3 = spawnedEnemy.ChooseClosestNodeToPosition(spawnedEnemy.serverPosition, true, 0);
if (Vector3.Magnitude(val3.position - spawnedEnemy.serverPosition) > 10f)
{
spawnedEnemy.serverPosition = val3.position;
}
((Component)spawnedEnemy).transform.position = spawnedEnemy.serverPosition;
spawnedEnemy.agent.Warp(spawnedEnemy.serverPosition);
spawnedEnemy.SyncPositionToClients();
if ((Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null)
{
spawnedEnemy.EnableEnemyMesh(!StartOfRound.Instance.hangarDoorsClosed || !GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom, false);
}
}
catch (Exception)
{
}
}
PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
foreach (PlayerControllerB val4 in allPlayerScripts)
{
if (val4.isInsideFactory)
{
Vector3 position = RoundManager.Instance.outsideAINodes[Random.Range(0, RoundManager.Instance.outsideAINodes.Length)].transform.position;
TeleportPlayer(Array.IndexOf(StartOfRound.Instance.allPlayerScripts, val4), position);
}
}
}
[ClientRpc]
public void TeleportPlayer(int playerID, Vector3 position)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerID];
val.TeleportPlayer(position, false, 0f, false, true);
val.isInsideFactory = false;
val.isInElevator = false;
}
protected override void __initializeVariables()
{
((NetworkBehaviour)this).__initializeVariables();
}
[RuntimeInitializeOnLoadMethod]
internal static void InitializeRPCS_Networker()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
NetworkManager.__rpc_func_table.Add(1157311365u, new RpcReceiveHandler(__rpc_handler_1157311365));
NetworkManager.__rpc_func_table.Add(3685289889u, new RpcReceiveHandler(__rpc_handler_3685289889));
NetworkManager.__rpc_func_table.Add(977293774u, new RpcReceiveHandler(__rpc_handler_977293774));
NetworkManager.__rpc_func_table.Add(1034668425u, new RpcReceiveHandler(__rpc_handler_1034668425));
NetworkManager.__rpc_func_table.Add(1610337453u, new RpcReceiveHandler(__rpc_handler_1610337453));
}
private static void __rpc_handler_1157311365(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0072: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
int newValue = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref newValue);
ulong clientId = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref clientId);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Networker)(object)target).MoveItemServerRpc(position, newValue, clientId);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_3685289889(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: 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_0072: Unknown result type (might be due to invalid IL or missing references)
NetworkManager networkManager = target.NetworkManager;
if (networkManager != null && networkManager.IsListening)
{
Vector3 position = default(Vector3);
((FastBufferReader)(ref reader)).ReadValueSafe(ref position);
int newValue = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref newValue);
ulong itemID = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref itemID);
target.__rpc_exec_stage = (__RpcExecStage)2;
((Networker)(object)target).MoveItemClientRpc(position, newValue, itemID);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_977293774(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)
{
ulong itemID = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref itemID);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Networker)(object)target).KillAllServerRpc(itemID);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1034668425(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 playerID = default(int);
ByteUnpacker.ReadValueBitPacked(reader, ref playerID);
target.__rpc_exec_stage = (__RpcExecStage)2;
((Networker)(object)target).killPlayerClientRpc(playerID);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
private static void __rpc_handler_1610337453(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)
{
ulong itemID = default(ulong);
ByteUnpacker.ReadValueBitPacked(reader, ref itemID);
target.__rpc_exec_stage = (__RpcExecStage)1;
((Networker)(object)target).TPAllServerRpc(itemID);
target.__rpc_exec_stage = (__RpcExecStage)0;
}
}
protected internal override string __getTypeName()
{
return "Networker";
}
}
[BepInPlugin("Slayer6409.SlayersSillyStuff", "SlayersSillyStuff", "0.0.7")]
public class Plugin : BaseUnityPlugin
{
private const string modGUID = "Slayer6409.SlayersSillyStuff";
private const string modName = "SlayersSillyStuff";
private const string modVersion = "0.0.7";
public static GameObject NetworkerPrefab;
private readonly Harmony harmony = new Harmony("Slayer6409.SlayersSillyStuff");
public static Item Hmmm;
public static Item NuclearRemote;
public static Item EvilRemote;
public static Item FurbySword;
public static Item LizziesScrap;
public static ManualLogSource Log;
public static ConfigFile BepInExConfig = null;
public static AssetBundle LoadedAssets;
public static Dictionary<string, LevelTypes> RegLevels = new Dictionary<string, LevelTypes>
{
{
"Experimentation",
(LevelTypes)4
},
{
"Assurance",
(LevelTypes)8
},
{
"Vow",
(LevelTypes)16
},
{
"Offense",
(LevelTypes)32
},
{
"March",
(LevelTypes)64
},
{
"Rend",
(LevelTypes)128
},
{
"Dine",
(LevelTypes)256
},
{
"Titan",
(LevelTypes)512
},
{
"Adamance",
(LevelTypes)2048
},
{
"Artifice",
(LevelTypes)4096
},
{
"Embrion",
(LevelTypes)8192
}
};
private List<Item> AddedScrap = new List<Item>();
private void Awake()
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin SlayersSillyStuff is loaded!");
NetcodeWeaver();
LoadedAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "slayerssillystuff"));
NetworkerPrefab = LoadedAssets.LoadAsset<GameObject>("Networker");
NetworkerPrefab.AddComponent<Networker>();
BepInExConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "Slayers Silly Scrap.cfg"), true);
LoadScrap();
harmony.PatchAll();
}
internal void LoadScrap()
{
//IL_0996: Unknown result type (might be due to invalid IL or missing references)
Hmmm = LoadedAssets.LoadAsset<Item>("HmmmItem");
Hmmm.minValue = 110;
Hmmm.maxValue = 350;
Hmmmm hmmmm = Hmmm.spawnPrefab.AddComponent<Hmmmm>();
((GrabbableObject)hmmmm).grabbable = true;
((GrabbableObject)hmmmm).grabbableToEnemies = true;
((GrabbableObject)hmmmm).itemProperties = Hmmm;
AddedScrap.Add(Hmmm);
NuclearRemote = LoadedAssets.LoadAsset<Item>("NuclearRemoteItem");
NuclearRemote.minValue = 110;
NuclearRemote.maxValue = 350;
NuclearRemote nuclearRemote = NuclearRemote.spawnPrefab.AddComponent<NuclearRemote>();
((GrabbableObject)nuclearRemote).grabbable = true;
((GrabbableObject)nuclearRemote).grabbableToEnemies = true;
((GrabbableObject)nuclearRemote).itemProperties = NuclearRemote;
AddedScrap.Add(NuclearRemote);
EvilRemote = LoadedAssets.LoadAsset<Item>("EvilRemoteItem");
EvilRemote.minValue = 110;
EvilRemote.maxValue = 350;
EvilRemote evilRemote = EvilRemote.spawnPrefab.AddComponent<EvilRemote>();
((GrabbableObject)evilRemote).grabbable = true;
((GrabbableObject)evilRemote).grabbableToEnemies = true;
((GrabbableObject)evilRemote).itemProperties = EvilRemote;
AddedScrap.Add(EvilRemote);
FurbySword = LoadedAssets.LoadAsset<Item>("FurbySwordItem");
FurbySword.minValue = 110;
FurbySword.maxValue = 350;
AddedScrap.Add(FurbySword);
LizziesScrap = LoadedAssets.LoadAsset<Item>("LizziesScrapItem");
LizzieItem lizzieItem = LizziesScrap.spawnPrefab.AddComponent<LizzieItem>();
((GrabbableObject)lizzieItem).grabbable = true;
((GrabbableObject)lizzieItem).grabbableToEnemies = true;
((GrabbableObject)lizzieItem).itemProperties = LizziesScrap;
AddedScrap.Add(LizziesScrap);
Dictionary<(string, string), int> dictionary = new Dictionary<(string, string), int>
{
{
(Hmmm.itemName, "Default"),
12
},
{
(Hmmm.itemName, "Experimentation"),
8
},
{
(Hmmm.itemName, "Assurance"),
12
},
{
(Hmmm.itemName, "Vow"),
11
},
{
(Hmmm.itemName, "Offense"),
14
},
{
(Hmmm.itemName, "March"),
18
},
{
(Hmmm.itemName, "Rend"),
20
},
{
(Hmmm.itemName, "Dine"),
22
},
{
(Hmmm.itemName, "Titan"),
24
},
{
(Hmmm.itemName, "Adamance"),
11
},
{
(Hmmm.itemName, "Artifice"),
13
},
{
(Hmmm.itemName, "Embrion"),
28
},
{
(NuclearRemote.itemName, "Default"),
1
},
{
(NuclearRemote.itemName, "Experimentation"),
0
},
{
(NuclearRemote.itemName, "Assurance"),
0
},
{
(NuclearRemote.itemName, "Vow"),
0
},
{
(NuclearRemote.itemName, "Offense"),
0
},
{
(NuclearRemote.itemName, "March"),
1
},
{
(NuclearRemote.itemName, "Rend"),
1
},
{
(NuclearRemote.itemName, "Dine"),
1
},
{
(NuclearRemote.itemName, "Titan"),
2
},
{
(NuclearRemote.itemName, "Adamance"),
2
},
{
(NuclearRemote.itemName, "Artifice"),
1
},
{
(NuclearRemote.itemName, "Embrion"),
3
},
{
(EvilRemote.itemName, "Default"),
1
},
{
(EvilRemote.itemName, "Experimentation"),
0
},
{
(EvilRemote.itemName, "Assurance"),
0
},
{
(EvilRemote.itemName, "Vow"),
0
},
{
(EvilRemote.itemName, "Offense"),
0
},
{
(EvilRemote.itemName, "March"),
1
},
{
(EvilRemote.itemName, "Rend"),
1
},
{
(EvilRemote.itemName, "Dine"),
1
},
{
(EvilRemote.itemName, "Titan"),
2
},
{
(EvilRemote.itemName, "Adamance"),
2
},
{
(EvilRemote.itemName, "Artifice"),
1
},
{
(EvilRemote.itemName, "Embrion"),
3
},
{
(FurbySword.itemName, "Default"),
1
},
{
(FurbySword.itemName, "Experimentation"),
0
},
{
(FurbySword.itemName, "Assurance"),
0
},
{
(FurbySword.itemName, "Vow"),
0
},
{
(FurbySword.itemName, "Offense"),
0
},
{
(FurbySword.itemName, "March"),
1
},
{
(FurbySword.itemName, "Rend"),
1
},
{
(FurbySword.itemName, "Dine"),
1
},
{
(FurbySword.itemName, "Titan"),
2
},
{
(FurbySword.itemName, "Adamance"),
2
},
{
(FurbySword.itemName, "Artifice"),
1
},
{
(FurbySword.itemName, "Embrion"),
3
},
{
(LizziesScrap.itemName, "Default"),
1
},
{
(LizziesScrap.itemName, "Experimentation"),
0
},
{
(LizziesScrap.itemName, "Assurance"),
0
},
{
(LizziesScrap.itemName, "Vow"),
0
},
{
(LizziesScrap.itemName, "Offense"),
0
},
{
(LizziesScrap.itemName, "March"),
1
},
{
(LizziesScrap.itemName, "Rend"),
1
},
{
(LizziesScrap.itemName, "Dine"),
1
},
{
(LizziesScrap.itemName, "Titan"),
2
},
{
(LizziesScrap.itemName, "Adamance"),
2
},
{
(LizziesScrap.itemName, "Artifice"),
1
},
{
(LizziesScrap.itemName, "Embrion"),
3
}
};
foreach (Item item in AddedScrap)
{
NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
Utilities.FixMixerGroups(item.spawnPrefab);
}
foreach (Item item2 in AddedScrap)
{
ConfigEntry<int> val = BepInExConfig.Bind<int>(item2.itemName + " Spawn rates", "Default", dictionary[(item2.itemName, "Default")], "Default spawn rate for all levels");
foreach (KeyValuePair<string, LevelTypes> regLevel in RegLevels)
{
ConfigEntry<int> val2 = BepInExConfig.Bind<int>(item2.itemName + " Spawn rates", regLevel.Key, dictionary[(item2.itemName, regLevel.Key)], "Sets how often " + item2.itemName + " spawns on " + regLevel.Key);
Items.RegisterScrap(item2, val2.Value, regLevel.Value);
}
Items.RegisterScrap(item2, val.Value, (LevelTypes)(-1));
}
}
private static void NetcodeWeaver()
{
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 class Consts
{
public const string Default = "Default";
public const string Experimentation = "Experimentation";
public const string Assurance = "Assurance";
public const string Vow = "Vow";
public const string Offense = "Offense";
public const string March = "March";
public const string Rend = "Rend";
public const string Dine = "Dine";
public const string Titan = "Titan";
public const string Adamance = "Adamance";
public const string Artifice = "Artifice";
public const string Embrion = "Embrion";
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "SlayersSillyStuff";
public const string PLUGIN_NAME = "SlayersSillyStuff";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace SlayersSillyStuff.Scrap
{
public class EvilRemote : PhysicsProp
{
public PlayerControllerB PlayerUser = null;
public ScanNodeProperties scanNodeProperties;
public override void Start()
{
scanNodeProperties = ((Component)this).GetComponentInChildren<ScanNodeProperties>();
((GrabbableObject)this).Start();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0077: 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)
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (buttonDown && !((Object)(object)StartOfRound.Instance == (Object)null) && !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.shipHasLanded && !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null))
{
PlayerUser = ((GrabbableObject)this).playerHeldBy;
GameNetworkManager.Instance.localPlayerController.DiscardHeldObject(true, (NetworkObject)null, ((GrabbableObject)this).GetItemFloorPosition(((Component)this).transform.position), false);
Networker.Instance.TPAllServerRpc(((NetworkBehaviour)this).NetworkObjectId);
}
}
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "EvilRemote";
}
}
public class FurbySword : Shovel
{
public float batteryDrainAmount = 0.05f;
private bool swinging = false;
public override void ItemActivate(bool used, bool buttonDown = true)
{
base.shovelAudio.pitch = ((GrabbableObject)this).insertedBattery.charge;
if (!((((GrabbableObject)this).insertedBattery.charge <= 0f || ((GrabbableObject)this).insertedBattery.empty) && buttonDown) && !(swinging && buttonDown))
{
((Shovel)this).ItemActivate(used, buttonDown);
if (!swinging && buttonDown)
{
swinging = true;
Battery insertedBattery = ((GrabbableObject)this).insertedBattery;
insertedBattery.charge -= batteryDrainAmount;
((MonoBehaviour)this).StartCoroutine(cooldown());
}
}
}
public IEnumerator cooldown()
{
yield return (object)new WaitForSeconds(1f);
swinging = false;
}
protected override void __initializeVariables()
{
((Shovel)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "FurbySword";
}
}
public class Hmmmm : PhysicsProp
{
public PlayerControllerB PlayerUser = null;
public ScanNodeProperties scanNodeProperties;
public override void Start()
{
scanNodeProperties = ((Component)this).GetComponentInChildren<ScanNodeProperties>();
((GrabbableObject)this).Start();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_00df: 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_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)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (!buttonDown || (Object)(object)StartOfRound.Instance == (Object)null || StartOfRound.Instance.inShipPhase || !StartOfRound.Instance.shipHasLanded || (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)
{
return;
}
PlayerUser = ((GrabbableObject)this).playerHeldBy;
GameNetworkManager.Instance.localPlayerController.DiscardHeldObject(true, (NetworkObject)null, ((GrabbableObject)this).GetItemFloorPosition(((Component)this).transform.position), false);
int newValue = ((GrabbableObject)this).scrapValue + Random.Range(40, 80);
Vector3 val = Vector3.up;
do
{
try
{
val = RoundManager.Instance.insideAINodes[Random.Range(0, RoundManager.Instance.insideAINodes.Length)].transform.position;
}
catch
{
}
}
while (val == Vector3.up);
((GrabbableObject)this).targetFloorPosition = val;
Networker.Instance.MoveItemServerRpc(val, newValue, ((NetworkBehaviour)this).NetworkObjectId);
}
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "Hmmmm";
}
}
public class LizzieItem : PhysicsProp
{
public ParticleSystem particles;
public override void Start()
{
((GrabbableObject)this).Start();
particles = ((Component)this).GetComponent<ParticleSystem>();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (buttonDown)
{
particles.Play();
}
}
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "LizzieItem";
}
}
public class NuclearRemote : PhysicsProp
{
public PlayerControllerB PlayerUser = null;
public ScanNodeProperties scanNodeProperties;
public override void Start()
{
scanNodeProperties = ((Component)this).GetComponentInChildren<ScanNodeProperties>();
((GrabbableObject)this).Start();
}
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0077: 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)
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (buttonDown && !((Object)(object)StartOfRound.Instance == (Object)null) && !StartOfRound.Instance.inShipPhase && StartOfRound.Instance.shipHasLanded && !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null))
{
PlayerUser = ((GrabbableObject)this).playerHeldBy;
GameNetworkManager.Instance.localPlayerController.DiscardHeldObject(true, (NetworkObject)null, ((GrabbableObject)this).GetItemFloorPosition(((Component)this).transform.position), false);
Networker.Instance.KillAllServerRpc(((NetworkBehaviour)this).NetworkObjectId);
}
}
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
protected internal override string __getTypeName()
{
return "NuclearRemote";
}
}
}
namespace SlayersSillyStuff.Patches
{
[HarmonyPatch(typeof(GameNetworkManager))]
internal class GameNetworkManagerPatch
{
[HarmonyPostfix]
[HarmonyPatch("Start")]
public static void AddPrefab(ref GameNetworkManager __instance)
{
((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(Plugin.NetworkerPrefab);
}
}
[HarmonyPatch(typeof(StartOfRound))]
internal class StartOfRoundPatch
{
[HarmonyPostfix]
[HarmonyPatch("Start")]
public static void InstantiateNetworker(StartOfRound __instance)
{
//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)
if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)
{
GameObject val = Object.Instantiate<GameObject>(Plugin.NetworkerPrefab, Vector3.zero, Quaternion.identity);
val.GetComponent<NetworkObject>().Spawn(true);
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}