using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using PEAKLib.Items;
using Peak.Afflictions;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.baphometcrafts.PeakCringe.AK47")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("com.github.baphometcrafts.PeakCringe.AK47")]
[assembly: AssemblyTitle("PeakCringe AK47")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
public class Action_RaycastGun : ItemAction
{
public float maxDistance;
public float dartCollisionSize;
[SerializeReference]
public Affliction[] afflictionsOnHit;
public Transform spawnTransform;
public float fireRate;
private LayerType layerMaskType;
private RaycastHit lineHit;
private RaycastHit[] sphereHits;
public SFX_Instance shotSFX;
public LineRenderer lr;
private float cooldownTimer;
public override void RunAction()
{
if ((double)cooldownTimer < 0.001)
{
Fire();
cooldownTimer = 60f / fireRate;
}
}
public void FixedUpdate()
{
if (cooldownTimer > 0f)
{
cooldownTimer -= Time.deltaTime;
}
}
private void Fire()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: 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_0056: 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_0076: 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_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: 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_0122: 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_0137: 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_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: 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_00c5: 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_0196: 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_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0222: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
((MonoBehaviourPun)this).photonView.RPC("RPC_PlayAudio", (RpcTarget)0, new object[1] { ((Component)MainCamera.instance).transform.position });
Physics.Raycast(((Component)MainCamera.instance).transform.position + ((Component)MainCamera.instance).transform.forward * 0.3f, ((Component)MainCamera.instance).transform.forward, ref lineHit, maxDistance, LayerMask.op_Implicit(HelperFunctions.terrainMapMask), (QueryTriggerInteraction)1);
if (!Object.op_Implicit((Object)(object)((RaycastHit)(ref lineHit)).collider))
{
((RaycastHit)(ref lineHit)).distance = maxDistance;
((RaycastHit)(ref lineHit)).point = spawnTransform.position + ((Component)MainCamera.instance).transform.forward * maxDistance;
}
Vector3[] array = (Vector3[])(object)new Vector3[2]
{
((Component)MainCamera.instance).transform.position + ((Component)MainCamera.instance).transform.forward * 0.3f,
((RaycastHit)(ref lineHit)).point
};
sphereHits = Physics.SphereCastAll(((Component)MainCamera.instance).transform.position + ((Component)MainCamera.instance).transform.forward * 0.3f, dartCollisionSize, ((Component)MainCamera.instance).transform.forward, ((RaycastHit)(ref lineHit)).distance, -1, (QueryTriggerInteraction)1);
RaycastHit[] array2 = sphereHits;
for (int i = 0; i < array2.Length; i++)
{
RaycastHit val = array2[i];
if (!Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider) || !Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).rigidbody))
{
continue;
}
Character componentInParent = ((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<Character>();
if (Object.op_Implicit((Object)(object)componentInParent))
{
Debug.Log((object)"HIT");
Debug.Log((object)componentInParent.characterName);
if ((Object)(object)componentInParent != (Object)(object)((ItemActionBase)this).character)
{
BulletImpactCharacter(componentInParent, spawnTransform.position, ((RaycastHit)(ref val)).point);
((RaycastHit)(ref val)).rigidbody.AddForce(((Component)MainCamera.instance).transform.forward * 200f, (ForceMode)1);
break;
}
}
}
}
private void BulletImpactCharacter(Character hitCharacter, Vector3 origin, Vector3 endpoint)
{
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)hitCharacter))
{
((MonoBehaviourPun)this).photonView.RPC("RPC_BulletImpactCharacter", (RpcTarget)0, new object[3]
{
((MonoBehaviourPun)hitCharacter).photonView.Owner,
origin,
endpoint
});
}
else
{
((MonoBehaviourPun)this).photonView.RPC("RPC_BulletImpactCharacter", (RpcTarget)0, new object[3] { null, origin, endpoint });
}
}
[PunRPC]
private void RPC_BulletImpactCharacter(Player hitPlayer, Vector3 origin, Vector3 endpoint)
{
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
if (hitPlayer != null && hitPlayer.IsLocal)
{
Debug.Log((object)"I'M HIT");
Affliction[] array = afflictionsOnHit;
Affliction[] array2 = array;
foreach (Affliction val in array2)
{
Character.localCharacter.refs.afflictions.AddAffliction(val, false);
}
Character.localCharacter.Fall(2f, 0f);
Character localCharacter = Character.localCharacter;
Vector3 val2 = endpoint - origin;
localCharacter.AddForceAtPosition(((Vector3)(ref val2)).normalized * 400f, endpoint, 3f);
}
}
[PunRPC]
private void RPC_BulletImpactItem(Item item, Vector3 direction)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: 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)
Debug.Log((object)PhotonNetwork.IsMasterClient);
if (PhotonNetwork.IsMasterClient)
{
((Component)item).GetComponent<PhotonView>().RPC("SetKinematicRPC", (RpcTarget)0, new object[3]
{
false,
((Component)item).transform.position,
((Component)item).transform.rotation
});
Debug.Log((object)item);
Rigidbody component = ((Component)item).GetComponent<Rigidbody>();
Debug.Log((object)component);
component.AddForce(direction * 200f, (ForceMode)1);
}
}
[PunRPC]
private void RPC_PlayAudio(Vector3 position)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)shotSFX))
{
shotSFX.Play(position);
}
}
}
namespace BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace PeakCringe_AK47
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.github.baphometcrafts.PeakCringe.AK47", "PeakCringe AK47", "0.1.0")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Log;
internal static AssetBundle itemAssets;
public const string Id = "com.github.baphometcrafts.PeakCringe.AK47";
internal static ModDefinition Definition { get; set; }
public static string Name => "PeakCringe AK47";
public static string Version => "0.1.0";
private void Awake()
{
Log = ((BaseUnityPlugin)this).Logger;
Log.LogInfo((object)("Plugin " + Name + " is loaded!"));
LoadAK47();
}
private void LoadAK47()
{
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ak47");
itemAssets = AssetBundle.LoadFromFile(text);
Item component = itemAssets.LoadAsset<GameObject>("ak.prefab").GetComponent<Item>();
Definition = ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info.Metadata);
new ItemContent(component).Register(Definition);
string[] source = new string[13]
{
"AK47", null, null, null, null, null, null, null, null, null,
null, null, null
};
LocalizedText.mainTable.Add("NAME_AK47", source.ToList());
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}