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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
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("BroccoliteImpactHammerRework")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Broccolite Impact Hammer Rework")]
[assembly: AssemblyTitle("BroccoliteImpactHammerRework")]
[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 BroccoliteImpactHammerRework
{
[Harmony]
public static class HammerChanges
{
private static float pitch;
[HarmonyPatch(typeof(ShotgunHammer), "DeliverDamage")]
[HarmonyPrefix]
public static void PreDeliverDamage(ShotgunHammer __instance, out bool __state)
{
__state = __instance.hitEnemy.dead;
if (PluginConfig.UnNerfRedHit && __instance.tier == 2)
{
__instance.damage = 12f;
}
}
[HarmonyPatch(typeof(ShotgunHammer), "DeliverDamage")]
[HarmonyPostfix]
public static void PostDeliverDamage(ShotgunHammer __instance, bool __state)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Invalid comparison between Unknown and I4
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Invalid comparison between Unknown and I4
if (!__state && (int)__instance.hitEnemy.enemyType != 21 && (int)__instance.hitEnemy.enemyType != 39 && __instance.wid.delay == 0f)
{
float shoAltHeat = ModdedCharges.shoAltHeat;
int tier = __instance.tier;
if (1 == 0)
{
}
float num = tier switch
{
2 => PluginConfig.HeatRed,
1 => PluginConfig.HeatYellow,
_ => PluginConfig.HeatGreen,
};
if (1 == 0)
{
}
ModdedCharges.shoAltHeat = shoAltHeat + num;
TryPutOnCooldown(__instance);
}
}
[HarmonyPatch(typeof(ShotgunHammer), "HitNade")]
[HarmonyPostfix]
private static void HitProjNade(ShotgunHammer __instance)
{
ModdedCharges.shoAltHeat += PluginConfig.HeatProj;
}
[HarmonyPatch(typeof(ShotgunHammer), "ImpactEffects")]
[HarmonyPrefix]
private static void NerfPumpCharge(ShotgunHammer __instance)
{
if (__instance.variation == 1)
{
((Component)__instance.pumpExplosion.transform).GetComponentInChildren<Explosion>().damage = ((__instance.primaryCharge == 1) ? PluginConfig.PumpDamage1 : PluginConfig.PumpDamage2);
ModdedCharges.shoAltHeat += PluginConfig.ExtraHeatPerPump * (float)__instance.primaryCharge;
TryPutOnCooldown(__instance, resetCooldown: false);
}
}
[HarmonyPatch(typeof(ShotgunHammer), "ImpactEffects")]
[HarmonyPostfix]
private static void EndOfImpact(ShotgunHammer __instance)
{
TryPutOnCooldown(__instance, resetCooldown: false);
}
[HarmonyPatch(typeof(ShotgunHammer), "ImpactRoutine")]
[HarmonyPrefix]
private static void ChangePitch(ShotgunHammer __instance)
{
if (__instance.wid.delay == 0f)
{
pitch = 1f + ModdedCharges.shoAltHeat * PluginConfig.PitchMult;
if (pitch > PluginConfig.MaxPitch)
{
pitch = PluginConfig.MaxPitch;
}
}
RandomPitch component = ((Component)__instance.hitSound).gameObject.GetComponent<RandomPitch>();
component.pitchVariation = PluginConfig.PitchVariation;
component.defaultPitch = pitch;
}
[HarmonyPatch(typeof(Shotgun), "Shoot")]
[HarmonyPostfix]
private static void ShotgunHeatReduction(Shotgun __instance)
{
if (Object.op_Implicit((Object)(object)__instance.wid) && __instance.wid.delay == 0f)
{
ModdedCharges.shoAltHeat -= ((__instance.variation == 1) ? PluginConfig.HeatShoPump : PluginConfig.HeatSho);
if (ModdedCharges.shoAltHeat < 0f)
{
ModdedCharges.shoAltHeat = 0f;
}
}
}
private static void TryPutOnCooldown(ShotgunHammer hammer, bool resetCooldown = true)
{
if (hammer.wid.delay == 0f)
{
if (resetCooldown)
{
MonoSingleton<WeaponCharges>.Instance.shoaltcooldowns[hammer.variation] = 0f;
}
if (ModdedCharges.shoAltHeat >= 1f)
{
MonoSingleton<WeaponCharges>.Instance.shoaltcooldowns[hammer.variation] = 7f;
ModdedCharges.shoAltHeat = 0f;
}
}
}
}
[Harmony]
public static class ModdedCharges
{
public static float shoAltHeat;
[HarmonyPatch(typeof(WeaponCharges), "Update")]
[HarmonyPostfix]
public static void DisableVanillaYellowNerf(WeaponCharges __instance)
{
__instance.shoAltYellows = 0;
__instance.shoAltYellowsTimer = 0f;
}
[HarmonyPatch(typeof(WeaponCharges), "MaxCharges")]
[HarmonyPostfix]
public static void MaxCharges()
{
shoAltHeat = 0f;
}
[HarmonyPatch(typeof(WeaponCharges), "Charge")]
[HarmonyPostfix]
public static void Charge(float amount)
{
if (shoAltHeat > 0f)
{
shoAltHeat = Mathf.MoveTowards(shoAltHeat, 0f, amount * PluginConfig.HeatPerSecond);
}
}
}
[BepInPlugin("BroccoliteImpactHammerRework", "Broccolite Impact Hammer Rework", "1.0.0")]
[Harmony]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger;
internal static PluginConfigurator config;
private void Awake()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
Logger = ((BaseUnityPlugin)this).Logger;
Harmony val = new Harmony("BroccoliteImpactHammerRework");
val.PatchAll();
config = PluginConfig.CreateConfig();
Logger.LogInfo((object)"Plugin BroccoliteImpactHammerRework is loaded!");
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPostfix]
private static void BlockLeaderboardScores(ref bool __result)
{
__result = false;
}
}
public static class PluginConfig
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static FloatValueChangeEventDelegate <>9__14_0;
public static FloatValueChangeEventDelegate <>9__14_1;
public static FloatValueChangeEventDelegate <>9__14_2;
public static FloatValueChangeEventDelegate <>9__14_3;
public static FloatValueChangeEventDelegate <>9__14_4;
public static FloatValueChangeEventDelegate <>9__14_5;
public static FloatValueChangeEventDelegate <>9__14_6;
public static FloatValueChangeEventDelegate <>9__14_7;
public static FloatValueChangeEventDelegate <>9__14_8;
public static FloatValueChangeEventDelegate <>9__14_9;
public static FloatValueChangeEventDelegate <>9__14_10;
public static BoolValueChangeEventDelegate <>9__14_11;
public static IntValueChangeEventDelegate <>9__14_12;
public static IntValueChangeEventDelegate <>9__14_13;
internal void <CreateConfig>b__14_0(FloatValueChangeEvent e)
{
HeatPerSecond = e.value;
}
internal void <CreateConfig>b__14_1(FloatValueChangeEvent e)
{
HeatGreen = e.value;
}
internal void <CreateConfig>b__14_2(FloatValueChangeEvent e)
{
HeatYellow = e.value;
}
internal void <CreateConfig>b__14_3(FloatValueChangeEvent e)
{
HeatRed = e.value;
}
internal void <CreateConfig>b__14_4(FloatValueChangeEvent e)
{
HeatProj = e.value;
}
internal void <CreateConfig>b__14_5(FloatValueChangeEvent e)
{
ExtraHeatPerPump = e.value;
}
internal void <CreateConfig>b__14_6(FloatValueChangeEvent e)
{
HeatSho = e.value;
}
internal void <CreateConfig>b__14_7(FloatValueChangeEvent e)
{
HeatShoPump = e.value;
}
internal void <CreateConfig>b__14_8(FloatValueChangeEvent e)
{
PitchMult = e.value;
}
internal void <CreateConfig>b__14_9(FloatValueChangeEvent e)
{
MaxPitch = e.value;
}
internal void <CreateConfig>b__14_10(FloatValueChangeEvent e)
{
PitchVariation = e.value;
}
internal void <CreateConfig>b__14_11(BoolValueChangeEvent e)
{
UnNerfRedHit = e.value;
}
internal void <CreateConfig>b__14_12(IntValueChangeEvent e)
{
PumpDamage1 = e.value;
}
internal void <CreateConfig>b__14_13(IntValueChangeEvent e)
{
PumpDamage2 = e.value;
}
}
public static float HeatPerSecond = 0.25f;
public static float HeatGreen = 0.25f;
public static float HeatYellow = 0.5f;
public static float HeatRed = 1f;
public static float HeatProj = 0.25f;
public static float HeatSho = 0.25f;
public static float HeatShoPump = 0.125f;
public static float ExtraHeatPerPump = 0.125f;
public static float PitchMult = 0.8f;
public static float PitchVariation = 0.0325f;
public static float MaxPitch = 1.25f;
public static int PumpDamage1 = 15;
public static int PumpDamage2 = 35;
public static bool UnNerfRedHit = true;
public static PluginConfigurator CreateConfig()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Expected O, but got Unknown
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Expected O, but got Unknown
//IL_0111: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Expected O, but got Unknown
//IL_0187: 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_0192: Expected O, but got Unknown
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Expected O, but got Unknown
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Expected O, but got Unknown
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Expected O, but got Unknown
//IL_0273: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_027e: Expected O, but got Unknown
//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Expected O, but got Unknown
//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02f4: Expected O, but got Unknown
//IL_0324: Unknown result type (might be due to invalid IL or missing references)
//IL_0329: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: Expected O, but got Unknown
//IL_0360: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: Unknown result type (might be due to invalid IL or missing references)
//IL_036b: Expected O, but got Unknown
//IL_039c: Unknown result type (might be due to invalid IL or missing references)
//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
//IL_03a7: Expected O, but got Unknown
//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e3: Expected O, but got Unknown
PluginConfigurator val = PluginConfigurator.Create("Impact Hammer Rework Config", "BroccoliteImpactHammerRework");
new ConfigSpace(val.rootPanel, 5f);
ConfigPanel val2 = new ConfigPanel(val.rootPanel, "Gaining Heat", "gainHeatPanel");
ConfigPanel val3 = new ConfigPanel(val.rootPanel, "Losing Heat", "loseHeatPanel");
ConfigPanel val4 = new ConfigPanel(val.rootPanel, "Audio", "audioPanel");
ConfigPanel val5 = new ConfigPanel(val.rootPanel, "Misc", "miscPanel");
new ConfigSpace(val2, 5f);
new ConfigSpace(val3, 5f);
new ConfigSpace(val4, 5f);
new ConfigSpace(val5, 5f);
FloatField obj = FloatSetting(val, val3, "Heat Lost Per Second", "HeatPerSecond", ref HeatPerSecond);
object obj2 = <>c.<>9__14_0;
if (obj2 == null)
{
FloatValueChangeEventDelegate val6 = delegate(FloatValueChangeEvent e)
{
HeatPerSecond = e.value;
};
<>c.<>9__14_0 = val6;
obj2 = (object)val6;
}
obj.onValueChange += (FloatValueChangeEventDelegate)obj2;
FloatField obj3 = FloatSetting(val, val2, "Green Hit Heat Amount", "HeatGreen", ref HeatGreen);
object obj4 = <>c.<>9__14_1;
if (obj4 == null)
{
FloatValueChangeEventDelegate val7 = delegate(FloatValueChangeEvent e)
{
HeatGreen = e.value;
};
<>c.<>9__14_1 = val7;
obj4 = (object)val7;
}
obj3.onValueChange += (FloatValueChangeEventDelegate)obj4;
FloatField obj5 = FloatSetting(val, val2, "Yellow Hit Heat Amount", "HeatYellow", ref HeatYellow);
object obj6 = <>c.<>9__14_2;
if (obj6 == null)
{
FloatValueChangeEventDelegate val8 = delegate(FloatValueChangeEvent e)
{
HeatYellow = e.value;
};
<>c.<>9__14_2 = val8;
obj6 = (object)val8;
}
obj5.onValueChange += (FloatValueChangeEventDelegate)obj6;
FloatField obj7 = FloatSetting(val, val2, "Red Hit Heat Amount", "HeatRed", ref HeatRed);
object obj8 = <>c.<>9__14_3;
if (obj8 == null)
{
FloatValueChangeEventDelegate val9 = delegate(FloatValueChangeEvent e)
{
HeatRed = e.value;
};
<>c.<>9__14_3 = val9;
obj8 = (object)val9;
}
obj7.onValueChange += (FloatValueChangeEventDelegate)obj8;
FloatField obj9 = FloatSetting(val, val2, "Projectile Hit Heat Amount", "HeatProj", ref HeatProj);
object obj10 = <>c.<>9__14_4;
if (obj10 == null)
{
FloatValueChangeEventDelegate val10 = delegate(FloatValueChangeEvent e)
{
HeatProj = e.value;
};
<>c.<>9__14_4 = val10;
obj10 = (object)val10;
}
obj9.onValueChange += (FloatValueChangeEventDelegate)obj10;
FloatField obj11 = FloatSetting(val, val2, "Extra Heat Per Pump", "ExtraHeatPerPump", ref ExtraHeatPerPump);
object obj12 = <>c.<>9__14_5;
if (obj12 == null)
{
FloatValueChangeEventDelegate val11 = delegate(FloatValueChangeEvent e)
{
ExtraHeatPerPump = e.value;
};
<>c.<>9__14_5 = val11;
obj12 = (object)val11;
}
obj11.onValueChange += (FloatValueChangeEventDelegate)obj12;
FloatField obj13 = FloatSetting(val, val3, "Shotgun Heat Reduction Amount", "HeatSho", ref HeatSho);
object obj14 = <>c.<>9__14_6;
if (obj14 == null)
{
FloatValueChangeEventDelegate val12 = delegate(FloatValueChangeEvent e)
{
HeatSho = e.value;
};
<>c.<>9__14_6 = val12;
obj14 = (object)val12;
}
obj13.onValueChange += (FloatValueChangeEventDelegate)obj14;
FloatField obj15 = FloatSetting(val, val3, "Pump Shotgun Heat Reduction Amount", "HeatShoPump", ref HeatShoPump);
object obj16 = <>c.<>9__14_7;
if (obj16 == null)
{
FloatValueChangeEventDelegate val13 = delegate(FloatValueChangeEvent e)
{
HeatShoPump = e.value;
};
<>c.<>9__14_7 = val13;
obj16 = (object)val13;
}
obj15.onValueChange += (FloatValueChangeEventDelegate)obj16;
FloatField obj17 = FloatSetting(val, val4, "Current Heat Pitch Multiplier", "PitchMult", ref PitchMult);
object obj18 = <>c.<>9__14_8;
if (obj18 == null)
{
FloatValueChangeEventDelegate val14 = delegate(FloatValueChangeEvent e)
{
PitchMult = e.value;
};
<>c.<>9__14_8 = val14;
obj18 = (object)val14;
}
obj17.onValueChange += (FloatValueChangeEventDelegate)obj18;
FloatField obj19 = FloatSetting(val, val4, "Max Pitch", "MaxPitch", ref MaxPitch);
object obj20 = <>c.<>9__14_9;
if (obj20 == null)
{
FloatValueChangeEventDelegate val15 = delegate(FloatValueChangeEvent e)
{
MaxPitch = e.value;
};
<>c.<>9__14_9 = val15;
obj20 = (object)val15;
}
obj19.onValueChange += (FloatValueChangeEventDelegate)obj20;
FloatField obj21 = FloatSetting(val, val4, "Pitch Variation", "PitchVariation", ref PitchVariation);
object obj22 = <>c.<>9__14_10;
if (obj22 == null)
{
FloatValueChangeEventDelegate val16 = delegate(FloatValueChangeEvent e)
{
PitchVariation = e.value;
};
<>c.<>9__14_10 = val16;
obj22 = (object)val16;
}
obj21.onValueChange += (FloatValueChangeEventDelegate)obj22;
BoolField obj23 = BoolSetting(val, val5, "Un-Nerf Red Hit", "UnNerfRedHit", ref UnNerfRedHit);
object obj24 = <>c.<>9__14_11;
if (obj24 == null)
{
BoolValueChangeEventDelegate val17 = delegate(BoolValueChangeEvent e)
{
UnNerfRedHit = e.value;
};
<>c.<>9__14_11 = val17;
obj24 = (object)val17;
}
obj23.onValueChange += (BoolValueChangeEventDelegate)obj24;
IntField obj25 = IntSetting(val, val5, "First Pump Damage", "PumpDamage1", ref PumpDamage1);
object obj26 = <>c.<>9__14_12;
if (obj26 == null)
{
IntValueChangeEventDelegate val18 = delegate(IntValueChangeEvent e)
{
PumpDamage1 = e.value;
};
<>c.<>9__14_12 = val18;
obj26 = (object)val18;
}
obj25.onValueChange += (IntValueChangeEventDelegate)obj26;
IntField obj27 = IntSetting(val, val5, "Second Pump Damage", "PumpDamage2", ref PumpDamage2);
object obj28 = <>c.<>9__14_13;
if (obj28 == null)
{
IntValueChangeEventDelegate val19 = delegate(IntValueChangeEvent e)
{
PumpDamage2 = e.value;
};
<>c.<>9__14_13 = val19;
obj28 = (object)val19;
}
obj27.onValueChange += (IntValueChangeEventDelegate)obj28;
return val;
}
public static FloatField FloatSetting(PluginConfigurator config, ConfigPanel panel, string name, string guid, ref float value)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
FloatField val = new FloatField(panel, name, guid, value);
value = val.value;
return val;
}
public static IntField IntSetting(PluginConfigurator config, ConfigPanel panel, string name, string guid, ref int value)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
IntField val = new IntField(panel, name, guid, value);
value = val.value;
return val;
}
public static BoolField BoolSetting(PluginConfigurator config, ConfigPanel panel, string name, string guid, ref bool value)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
BoolField val = new BoolField(panel, name, guid, value);
value = val.value;
return val;
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "BroccoliteImpactHammerRework";
public const string PLUGIN_NAME = "Broccolite Impact Hammer Rework";
public const string PLUGIN_VERSION = "1.0.0";
}
}