using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using Alexandria.ItemAPI;
using BepInEx;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mod")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d6d7a494-722e-4763-959b-c2d6b6a42b01")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.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.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Mod
{
public class CloneItem : PassiveItem
{
public static void Register()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
string text = "Gungear Slime";
string text2 = "SKELETON/Resources/clonebullet_sprite.png";
GameObject val = new GameObject(text);
CloneItem cloneItem = val.AddComponent<CloneItem>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)cloneItem, (StatType)1, 1.3f, (ModifyMethod)1);
string text3 = "Stuck Down Buttons";
string text4 = "All Guns are automatically reloaded. Semiautomatic and Charged weapons will fire automatically. Reload speed and fire rate will be slightly increased.\n\nA strange slime like substance, it appears to have some sort of handheld game console dissolved into it after prolonged contact. This slime will slip into all your guns and do... something.\n\nGungeoneers who have used the Gungear have been known to be outcasts due to their unconventional ideas about how one should use a firearm.";
ItemBuilder.SetupItem((PickupObject)(object)cloneItem, text3, text4, "skeletonz");
((PickupObject)cloneItem).quality = (ItemQuality)3;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up " + ((PickupObject)this).DisplayName);
Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).DisplayName);
player.stats.AdditionalVolleyModifiers += ModifyVolley;
((PassiveItem)this).Pickup(player);
}
public void ModifyVolley(ProjectileVolleyData volley)
{
volley.projectiles.ForEach(delegate(ProjectileModule x)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
x.shootStyle = (ShootStyle)(((int)x.shootStyle == 0) ? 1 : ((int)x.shootStyle));
});
}
public void LateUpdate()
{
if (((PassiveItem)this).PickedUp && (Object)(object)((PassiveItem)this).Owner != (Object)null && (Object)(object)((GameActor)((PassiveItem)this).Owner).CurrentGun != (Object)null && !((GameActor)((PassiveItem)this).Owner).CurrentGun.IsReloading)
{
Gun currentGun = ((GameActor)((PassiveItem)this).Owner).CurrentGun;
List<ProjectileModule> list = (((Object)(object)currentGun.Volley != (Object)null) ? currentGun.Volley.projectiles : null) ?? new List<ProjectileModule>(1) { currentGun.singleModule };
bool flag = list.Exists((ProjectileModule x) => (int)x.shootStyle == 3) && !list.Exists((ProjectileModule x) => (int)x.shootStyle == 3 && currentGun.RuntimeModuleData[x].chargeTime < x.LongestChargeTime);
bool flag2 = currentGun.ClipShotsRemaining <= 0;
if ((!((Object)(object)currentGun.Volley != (Object)null)) ? (!currentGun.CheckHasLoadedModule(currentGun.singleModule)) : (!currentGun.CheckHasLoadedModule(currentGun.Volley)))
{
currentGun.AttemptedFireNeedReload();
}
else if (flag)
{
currentGun.CeaseAttack(true, (ProjectileData)null);
}
}
}
public override void DisableEffect(PlayerController player)
{
if (!((Object)(object)player == (Object)null))
{
player.stats.AdditionalVolleyModifiers -= ModifyVolley;
((PassiveItem)this).DisableEffect(player);
}
}
}
public class SkeletonItem : PassiveItem
{
public static void Register()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Expected O, but got Unknown
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
string text = "Anointed Figure";
string text2 = "SKELETON/Resources/idol_sprite.png";
GameObject val = new GameObject(text);
SkeletonItem skeletonItem = val.AddComponent<SkeletonItem>();
ItemBuilder.AddSpriteToObject(text, text2, val, (Assembly)null);
string text3 = "False Idol";
string text4 = "Grants increased Active Item capacity, halves reload time, improves accuracy and triples fire rate.\n\nAn antique religious keepsake, freezing to the touch. A gift by a young priest to an unfortunate victim of failed ammomancy experiments performed in the early days of the Order of the True Gun. Once anointed with gun grease and imbued with ancient power to keep the holder's body alive even after their soul has moved on to the afterlife, it's now completely dry and doesn't seem to work properly anymore.";
ItemBuilder.SetupItem((PickupObject)(object)skeletonItem, text3, text4, "skeletonz");
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)skeletonItem, (StatType)4, 3f, (ModifyMethod)0);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)skeletonItem, (StatType)14, 2f, (ModifyMethod)0);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)skeletonItem, (StatType)10, 0.5f, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)skeletonItem, (StatType)1, 2.8f, (ModifyMethod)1);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)skeletonItem, (StatType)8, 2f, (ModifyMethod)0);
ItemBuilder.AddPassiveStatModifier((PickupObject)(object)skeletonItem, (StatType)2, 0.5f, (ModifyMethod)1);
((PickupObject)skeletonItem).quality = (ItemQuality)4;
}
public override void Pickup(PlayerController player)
{
((PassiveItem)this).Pickup(player);
Plugin.Log("Player picked up " + ((PickupObject)this).DisplayName);
}
public override void DisableEffect(PlayerController player)
{
Plugin.Log("Player dropped or got rid of " + ((PickupObject)this).DisplayName);
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("arcabe.etg.modname", "SKELETON", "0.1.5")]
public class Plugin : BaseUnityPlugin
{
public const string GUID = "arcabe.etg.modname";
public const string NAME = "SKELETON";
public const string VERSION = "0.1.5";
public const string TEXT_COLOR = "#00FFFF";
public void Start()
{
ETGModMainBehaviour.WaitForGameManagerStart((Action<GameManager>)GMStart);
}
public void GMStart(GameManager g)
{
SkeletonItem.Register();
CloneItem.Register();
Log("SKELETON v0.1.5 started successfully.", "#00FFFF");
}
public static void Log(string text, string color = "#FFFFFF")
{
ETGModConsole.Log((object)("<color=" + color + ">" + text + "</color>"), false);
}
}
}