using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FishNet;
using FishNet.Connection;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
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("ADHDCoryMod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ADHDCoryMod")]
[assembly: AssemblyTitle("ADHDCoryMod")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[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;
}
}
}
[BepInPlugin("com.adhdcory.adhdcory_mod", "ADHDCory Mod", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Log;
internal static ConfigEntry<float> LaunchForce;
private void Awake()
{
Log = ((BaseUnityPlugin)this).Logger;
LaunchForce = ((BaseUnityPlugin)this).Config.Bind<float>("General", "LaunchForce", 30f, "Forward velocity of launched dynamite.");
Log.LogInfo((object)"ADHDCory mod loaded.");
}
private void Update()
{
if (Keyboard.current != null && ((ButtonControl)Keyboard.current.gKey).wasPressedThisFrame)
{
Fire();
}
}
private void Fire()
{
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: 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_007f: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: 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_00de: Unknown result type (might be due to invalid IL or missing references)
if (!InstanceFinder.IsServerStarted)
{
Log.LogInfo((object)"Not the host — can't fire dynamite.");
return;
}
Player localPlayer = Player.LocalPlayer;
if ((Object)(object)localPlayer == (Object)null || (Object)(object)localPlayer.CamObject == (Object)null)
{
return;
}
Transform camObject = localPlayer.CamObject;
Item spawnable = GameInfo.GetSpawnable("dynamite");
if ((Object)(object)spawnable == (Object)null)
{
Log.LogWarning((object)"Couldn't find dynamite prefab.");
return;
}
Vector3 val = camObject.position + camObject.forward * 1.5f;
Item val2 = Object.Instantiate<Item>(spawnable, val, camObject.rotation);
InstanceFinder.ServerManager.Spawn(((Component)val2).gameObject, (NetworkConnection)null, default(Scene));
val2.RigidbodySync.StartSimulateLocal(default(Vector3), default(Quaternion));
val2.Rig.linearVelocity = camObject.forward * LaunchForce.Value;
Explosive val3 = (Explosive)(object)((val2 is Explosive) ? val2 : null);
if (val3 != null)
{
val3.ForceExplode(localPlayer, false);
}
Log.LogInfo((object)"Fired dynamite.");
}
}