using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Characters.Abilities;
using Characters.Actions;
using Characters.Cooldowns;
using Characters.Gear.Weapons;
using Characters.Gear.Weapons.Gauges;
using Characters.Operations.Gauge;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Plugins.Common")]
[assembly: IgnoresAccessChecksTo("Plugins.Singletons")]
[assembly: AssemblyCompany("BuffChamp")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Haxa said the Champion skull is too weak. So we made him better!")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("BuffChamp")]
[assembly: AssemblyTitle("BuffChamp")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.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 BuffChamp
{
[HarmonyPatch]
public class BuffChampPatch
{
[HarmonyPrefix]
[HarmonyPatch(typeof(Weapon), "InitializeSkills")]
private static void ReduceSkillCosts(ref Weapon __instance)
{
GameObject gameObject = ((Component)__instance).gameObject;
if (!((Object)gameObject).name.StartsWith("Fighter"))
{
return;
}
try
{
SkillInfo[] componentsInChildren = gameObject.GetComponentsInChildren<SkillInfo>(true);
foreach (SkillInfo obj in componentsInChildren)
{
Action component = ((Component)obj).GetComponent<Action>();
AddGaugeValue[] componentsInChildren2 = ((Component)obj).GetComponentsInChildren<AddGaugeValue>(true);
CooldownSerializer cooldown = component.cooldown;
cooldown._requiredAmount -= 10;
AddGaugeValue[] array = componentsInChildren2;
foreach (AddGaugeValue val in array)
{
if (!(val._amount >= 0f))
{
val._amount += 10f;
break;
}
}
}
}
catch (Exception ex)
{
Debug.LogError((object)("[BuffChamp]: " + ex));
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(Weapon), "StartSwitchAction")]
private static void RestoreEnergyOnSwap(ref Weapon __instance)
{
GameObject gameObject = ((Component)__instance).gameObject;
if (((Object)gameObject).name.StartsWith("Fighter"))
{
Gauge gauge = __instance._gauge;
Gauge obj = ((gauge is ValueGauge) ? gauge : null);
if (obj != null)
{
((ValueGauge)obj).Add(25f);
}
gameObject.GetComponent<FighterPassiveAttacher>()._fighterPassive.UpdateTime(10f);
}
}
}
[BepInPlugin("BuffChamp", "BuffChamp", "0.0.1")]
public class Plugin : BaseUnityPlugin
{
private void Awake()
{
Harmony.CreateAndPatchAll(typeof(BuffChampPatch), (string)null);
((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod BuffChamp is loaded!");
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "BuffChamp";
public const string PLUGIN_NAME = "BuffChamp";
public const string PLUGIN_VERSION = "0.0.1";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}