using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
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 UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("GearshiftFix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyInformationalVersion("0.0.0-alpha.0+4e6c7754b3a25a22afeb3d2df40816b4e6c2620d")]
[assembly: AssemblyProduct("GearshiftFix")]
[assembly: AssemblyTitle("GearshiftFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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;
}
}
}
[BepInPlugin("sparroh.gearshiftfix", "GearshiftFix", "1.0.0")]
public class SparrohPlugin : BaseUnityPlugin
{
public const string PluginGUID = "sparroh.gearshiftfix";
public const string PluginName = "GearshiftFix";
public const string PluginVersion = "1.0.0";
internal static ManualLogSource Logger;
private void Awake()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
Logger = ((BaseUnityPlugin)this).Logger;
new Harmony("sparroh.gearshiftfix").PatchAll();
Logger.LogInfo((object)"GearshiftFix loaded successfully.");
}
}
public static class ShocklancePatches
{
[HarmonyPatch(typeof(Shocklance), "OnBeforeTakeDamage")]
private static class OnBeforeTakeDamagePatch
{
private static bool isApplyingResist;
[HarmonyPrefix]
private static bool Prefix(ref DamageData damage, ref IDamageSource source, Shocklance __instance)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
if (isApplyingResist)
{
return false;
}
isApplyingResist = true;
Traverse obj = Traverse.Create((object)__instance);
Data shocklanceData = __instance.ShocklanceData;
bool flag = (float)obj.Field("isBoosting").GetValue() > 0f;
float num = (float)obj.Field("stopBoostTime").GetValue();
if (shocklanceData.augerDamageResistDuration > 0f && (flag || Time.time - num < shocklanceData.augerDamageResistDuration))
{
damage *= 1f - shocklanceData.augerDamageResist;
}
if ((Object)obj.Field("attachedToPlayer").GetValue() != (Object)null)
{
damage *= 1f - shocklanceData.cableDamageResist;
}
return false;
}
[HarmonyPostfix]
private static void Postfix()
{
isApplyingResist = false;
}
}
}
[CompilerGenerated]
[ExcludeFromCodeCoverage]
internal static class GitVersionInformation
{
public const string AssemblySemFileVer = "0.0.1.0";
public const string AssemblySemVer = "0.0.1.0";
public const string BranchName = "master";
public const string BuildMetaData = "";
public const string CommitDate = "2025-10-17";
public const string CommitsSinceVersionSource = "1";
public const string EscapedBranchName = "master";
public const string FullBuildMetaData = "Branch.master.Sha.4e6c7754b3a25a22afeb3d2df40816b4e6c2620d";
public const string FullSemVer = "0.0.1-1";
public const string InformationalVersion = "0.0.1-1+Branch.master.Sha.4e6c7754b3a25a22afeb3d2df40816b4e6c2620d";
public const string Major = "0";
public const string MajorMinorPatch = "0.0.1";
public const string Minor = "0";
public const string Patch = "1";
public const string PreReleaseLabel = "";
public const string PreReleaseLabelWithDash = "";
public const string PreReleaseNumber = "1";
public const string PreReleaseTag = "1";
public const string PreReleaseTagWithDash = "-1";
public const string SemVer = "0.0.1-1";
public const string Sha = "4e6c7754b3a25a22afeb3d2df40816b4e6c2620d";
public const string ShortSha = "4e6c775";
public const string UncommittedChanges = "16";
public const string VersionSourceSha = "";
public const string WeightedPreReleaseNumber = "55001";
}
namespace GearshiftFix
{
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "GearshiftFix";
public const string PLUGIN_NAME = "GearshiftFix";
public const string PLUGIN_VERSION = "0.0.0";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}