using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using FistVR; using HarmonyLib; using OtherLoader; using UnityEngine; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace JerryAr.PTKM1R_JumpMine { [BepInPlugin("JerryAr.PTKM1R_JumpMine", "PTKM1R_JumpMine", "1.1.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class PTKM1R_JumpMinePlugin : BaseUnityPlugin { private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); internal static ManualLogSource Logger; private void Awake() { Logger = ((BaseUnityPlugin)this).Logger; LoadAssets(); } private void LoadAssets() { Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.PTKM1R_JumpMine"); OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.PTKM1R_JumpMine", "", "", "ptkm1r", ""); } } } namespace JerryPTKM { public class ColActivate : MonoBehaviour { public PTKMBase PTKM; private void OnCollisionEnter(Collision collision) { if (!PTKM.ArmTrigger.m_isLargeAperture && !((FVRInteractiveObject)PTKM.MainObj).IsHeld) { PTKM.deployed = true; } } } public class PTKMBase : MonoBehaviour { public Transform centerofmassFold; public Transform centerofmassUnfold; public FVRPhysicalObject MainObj; public PTKMShell Shell; public Collider DetectCol; public GameObject Lower; public GameObject LowerGeo; public GameObject Upper; public GameObject UpperGeo; public GameObject ShellBase; public GameObject Target; public GameObject TargetRef; public bool deployed = false; public float deploycd = 5f; public float firecd = 10f; public bool Jumped; public bool Fired; public int iff; public AR15HandleSightFlipper ArmTrigger; public Rigidbody rig; public GameObject uppercol; public GameObject shellcol; public KillAfter ka; public GameObject jumpeffect; public GameObject fireeffect; public GameObject shelleffect; public AudioEvent jumpaud; public AudioEvent fireaud; public AudioEvent deployaud; public AudioEvent click; public bool clicked; public Transform Bottom; public float cdDie = 10f; private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = tr_self.rotation; Vector3 val = lookPos - tr_self.position; Vector3 val2 = tr_self.rotation * directionAxis; Vector3 val3 = Vector3.Cross(val2, val); Vector3 normalized = ((Vector3)(ref val3)).normalized; float num = Vector3.Angle(val2, val); tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation; tr_self.localEulerAngles = new Vector3(0f, tr_self.localEulerAngles.y, 0f); } private void Update() { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: 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_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)ka).enabled) { if (cdDie > 0f) { cdDie -= Time.deltaTime; } else if (cdDie <= 0f) { ((Component)MainObj).gameObject.transform.localScale = Vector3.Lerp(((Component)MainObj).gameObject.transform.localScale, new Vector3(0f, 0f, 0f), Time.deltaTime * 5f); if ((Object)(object)ShellBase != (Object)null) { ShellBase.transform.localScale = Vector3.Lerp(ShellBase.transform.localScale, new Vector3(0f, 0f, 0f), Time.deltaTime * 5f); } } } ((Component)this).gameObject.transform.position = ((Component)MainObj).gameObject.transform.position; ((Component)this).gameObject.transform.rotation = ((Component)MainObj).gameObject.transform.rotation; if (ArmTrigger.m_isLargeAperture && clicked) { SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)ArmTrigger).gameObject.transform.position); clicked = false; } if (!ArmTrigger.m_isLargeAperture && !clicked) { SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)ArmTrigger).gameObject.transform.position); clicked = true; } if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { iff = GM.CurrentPlayerBody.GetPlayerIFF(); } if (deployed) { if (Fired && (Object)(object)Shell != (Object)null) { shelleffect.SetActive(true); shelleffect.transform.position = ((Component)Shell).gameObject.transform.position; } if (Jumped) { if (firecd > 0f) { firecd -= Time.deltaTime; } if (firecd <= 8f && Vector3.Angle(((Component)Bottom).transform.forward, TargetRef.transform.position - ShellBase.transform.position) <= 5f && !Fired) { fireeffect.SetActive(true); SM.PlayCoreSound((FVRPooledAudioType)41, fireaud, ShellBase.gameObject.transform.position); shellcol.SetActive(false); if ((Object)(object)Shell != (Object)null) { Shell.activated = true; Rigidbody val = ((Component)Shell).gameObject.AddComponent(); val.AddRelativeForce(((Component)val).transform.up * -100f, (ForceMode)2); val.collisionDetectionMode = (CollisionDetectionMode)2; } Fired = true; } if (firecd <= 0f && !Fired) { if ((Object)(object)Shell != (Object)null) { Shell.Explode(); } Fired = true; } } rig.centerOfMass = centerofmassUnfold.localPosition; ((FVRInteractiveObject)MainObj).IsSimpleInteract = true; MainObj.DistantGrabbable = false; if (deploycd > 0f) { deploycd -= Time.deltaTime; DetectCol.enabled = false; } else { if (!(deploycd <= 0f)) { return; } if ((Object)(object)Target == (Object)null) { DetectCol.enabled = true; } else if ((Object)(object)Target != (Object)null) { DetectCol.enabled = false; if (!Jumped) { TargetRef.transform.SetParent((Transform)null); TargetRef.transform.position = Target.transform.position; } AxisLookAt(Lower.gameObject.transform, TargetRef.transform.position, Vector3.forward); LowerGeo.transform.localEulerAngles = Vector3.Lerp(LowerGeo.transform.localEulerAngles, Lower.transform.localEulerAngles, Time.deltaTime * 25f); UpperGeo.transform.localEulerAngles = Vector3.Lerp(UpperGeo.transform.localEulerAngles, new Vector3(0f, 0f, Vector3.Distance(((Component)this).gameObject.transform.position, Target.transform.position)), Time.deltaTime * 25f); if (Vector3.Angle(Lower.transform.forward, LowerGeo.transform.forward) < 2.5f && Vector3.Angle(UpperGeo.transform.forward, Upper.transform.forward) < 2.5f && !Jumped) { SM.PlayCoreSound((FVRPooledAudioType)41, jumpaud, ((Component)ArmTrigger).gameObject.transform.position); uppercol.SetActive(false); ShellBase.transform.SetParent((Transform)null); Rigidbody val2 = ShellBase.AddComponent(); val2.AddRelativeForce(new Vector3(0f, 25f, 0f), (ForceMode)2); val2.AddRelativeTorque(new Vector3(0f, 0f, 50f), (ForceMode)2); ((Behaviour)ka).enabled = true; Jumped = true; jumpeffect.SetActive(true); } if (Vector3.Distance(((Component)this).gameObject.transform.position, Target.transform.position) > 30f) { Target = null; } } } } else if (!deployed) { DetectCol.enabled = false; rig.centerOfMass = centerofmassFold.localPosition; } } private void OnTriggerStay(Collider other) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Invalid comparison between Unknown and I4 if ((Object)(object)Target == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent() != (Object)null && (Object)(object)((Component)other).gameObject.GetComponent().S != (Object)null && (int)((Component)other).gameObject.GetComponent().S.BodyState != 3 && !Jumped) { Target = ((Component)other).gameObject; } } private void OnDestroy() { if ((Object)(object)ShellBase != (Object)null) { Object.Destroy((Object)(object)ShellBase); } if ((Object)(object)Shell != (Object)null) { Shell.Explode(); } if ((Object)(object)TargetRef != (Object)null) { Object.Destroy((Object)(object)TargetRef); } } } public class PTKMShell : MonoBehaviour { public GameObject Explosion; public bool activated = false; private void OnCollisionEnter(Collision collision) { if (activated) { ((Component)this).gameObject.transform.SetParent((Transform)null); Explode(); } } public void Explode() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate(Explosion, ((Component)this).transform.position, ((Component)this).transform.rotation); Object.Destroy((Object)(object)((Component)this).gameObject); } } public class legwaggle : MonoBehaviour { public WaggleJoint wag; public float leftunfold; public float leftfold; public float rightunfold; public float rightfold; public PTKMBase PTKM; public float cd = 2f; private void Update() { if (PTKM.deployed) { if (cd > 0f) { cd -= Time.deltaTime; } if (cd <= 0f) { wag.angleLimitLeft = leftunfold; wag.angleLimitRight = rightunfold; } } else if (!PTKM.deployed) { wag.angleLimitLeft = leftfold; wag.angleLimitRight = rightfold; } } } }