using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Reptile;
using Shoes.Patches;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Shoes")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Shoes")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bf811961-dbb0-4fb4-b950-39f0a8932b3f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Shoes
{
[BepInPlugin("com.yuril.Shoes", "Shoes", "1.0.0")]
public class ShoesPlugin : BaseUnityPlugin
{
private const string MyGUID = "com.yuril.Shoes";
private const string PluginName = "Shoes";
private const string VersionString = "1.0.0";
private Harmony harmony;
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
harmony = new Harmony("com.yuril.Shoes");
harmony.PatchAll(typeof(GrindAbilityPatch));
}
}
}
namespace Shoes.Patches
{
public class GrindAbilityPatch
{
[HarmonyPatch(typeof(GrindAbility), "SetToLine")]
[HarmonyPrefix]
private static bool GrindAbility_SetToLine_Prefix(GrindAbility __instance, GrindLine setGrindLine)
{
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Invalid comparison between Unknown and I4
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Invalid comparison between Unknown and I4
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Invalid comparison between Unknown and I4
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Invalid comparison between Unknown and I4
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_030d: Unknown result type (might be due to invalid IL or missing references)
//IL_0312: Unknown result type (might be due to invalid IL or missing references)
//IL_0315: Unknown result type (might be due to invalid IL or missing references)
//IL_0317: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: 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_02f3: Unknown result type (might be due to invalid IL or missing references)
//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Unknown result type (might be due to invalid IL or missing references)
__instance.timeSinceLastNode = 0f;
__instance.speedTarget = ((Ability)__instance).p.stats.grindSpeed;
bool flag = false;
__instance.speed = Mathf.Max(((Ability)__instance).p.boosting ? ((Ability)__instance).p.boostSpeed : ((Ability)__instance).p.stats.grindSpeed, ((Ability)__instance).p.GetForwardSpeed());
__instance.startTrickNames = __instance.trickingStartTrickNames;
__instance.trickNames = __instance.trickingTrickNames;
__instance.trickStandardDuration = __instance.trickingTrickDuration;
if ((int)((Ability)__instance).p.moveStyle == 2 || (int)((Ability)__instance).p.moveStyle == 4)
{
__instance.startTrickNames = __instance.skateboardStartTrickNames;
__instance.trickNames = __instance.skateboardTrickNames;
__instance.trickStandardDuration = __instance.skateboardTrickDuration;
}
else if ((int)((Ability)__instance).p.moveStyle == 3)
{
__instance.startTrickNames = __instance.inlineStartTrickNames;
__instance.trickNames = __instance.inlineTrickNames;
__instance.trickStandardDuration = __instance.trickingTrickDuration;
}
else if ((int)((Ability)__instance).p.moveStyle == 1)
{
__instance.startTrickNames = __instance.bmxStartTrickNames;
__instance.trickNames = __instance.bmxTrickNames;
__instance.trickStandardDuration = __instance.bmxTrickDuration;
}
Vector3 position = ((Ability)__instance).p.tf.position;
((Ability)__instance).p.motor.HaveCollision(false);
((Ability)__instance).p.ForceUnground(true);
Vector3 playerDirForLine = __instance.GetPlayerDirForLine(setGrindLine);
__instance.nextNode = setGrindLine.GetNextNode(playerDirForLine);
((Ability)__instance).p.SetVelocity(Vector3.zero);
((Ability)__instance).p.ResetVisualRot();
Vector3 val = setGrindLine.SnapPosToLine(position);
((Ability)__instance).p.motor.SetPositionTeleport(val);
__instance.grindLine = setGrindLine;
__instance.lastPath = __instance.grindLine.Path;
__instance.posOnLine = (__instance.justFollowNodes ? __instance.grindLine.GetRelativePosOnLine(val, __instance.nextNode) : __instance.grindLine.GetRelativePosOnLine(val, playerDirForLine));
if (Object.op_Implicit((Object)(object)__instance.grindLine.attachedToEnemyGrindLine))
{
__instance.grindingOnEnemy = __instance.grindLine.attachedToEnemyGrindLine;
__instance.grindingOnEnemy.BeingGrindedByPlayer = true;
}
AudioManager audioManager = ((Ability)__instance).p.AudioManager;
audioManager.PlaySfxGameplay(setGrindLine.sfxCollection, (AudioClipID)327, ((Ability)__instance).p.playerOneShotAudioSource, 0f);
audioManager.PlaySfxGameplayLooping(setGrindLine.sfxCollection, (AudioClipID)11, ((Ability)__instance).p.playerGrindLoopAudioSource, 0f, 0f);
((Ability)__instance).p.anim.SetFloat(__instance.grindBoostHash, 0f);
__instance.grindTilt = (__instance.grindTiltBuffer = Vector2.zero);
__instance.grindTiltBufferTimer = 0f;
__instance.softCornerBoost = false;
((Ability)__instance).p.ActivateAbility((Ability)(object)__instance);
__instance.normal = __instance.grindLine.GetNormalAtPos(val);
if (__instance.grindLine.isPole)
{
Vector3 val2 = Vector3.ProjectOnPlane(((Ability)__instance).p.dir * -1f, Vector3.up);
__instance.normal = ((Vector3)(ref val2)).normalized;
}
Vector3 val3 = (__instance.preGrindDir = setGrindLine.GetLineDir(playerDirForLine));
((Ability)__instance).p.SetRotHard(Quaternion.LookRotation(val3, __instance.normal));
__instance.StartGrindTrick(true, flag);
return false;
}
}
}