using System; 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 Sodalite.Api; 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 JerryComponent { public class ClosedBoltHandleLock : ClosedBoltHandle { private bool isLocked = false; private bool springread = false; private float springh; private float springb; private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) if (!(Vector3.Distance(((Component)this).gameObject.transform.position, base.Point_Rear.position) < 0.01f) || !((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null)) { return; } if (!isLocked) { if ((((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.BYButtonPressed) || (!((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.Secondary2AxisNorthPressed)) { if (!springread) { springh = base.Speed_Forward; springb = base.Weapon.Bolt.Speed_Forward; springread = true; } base.Speed_Forward = 0f; base.Weapon.Bolt.Speed_Forward = 0f; base.Weapon.Bolt.LockBolt(); base.CurPos = (HandlePos)2; base.Weapon.Bolt.CurPos = (BoltPos)2; ((FVRInteractiveObject)this).ForceBreakInteraction(); isLocked = true; } if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && !((FVRInteractiveObject)this).m_hand.Input.BYButtonPressed && !((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && !((FVRInteractiveObject)this).m_hand.Input.Secondary2AxisNorthPressed) { if (springread) { base.Speed_Forward = springh; base.Weapon.Bolt.Speed_Forward = springb; base.CurPos = (HandlePos)0; base.Weapon.Bolt.ReleaseBolt(); base.Weapon.Bolt.CurPos = (BoltPos)0; springread = false; } isLocked = false; } } else { if (!isLocked) { return; } if ((((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.BYButtonPressed) || (!((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.Secondary2AxisNorthPressed)) { if (!springread) { springh = base.Speed_Forward; springb = base.Weapon.Bolt.Speed_Forward; springread = true; } base.Speed_Forward = 0f; base.Weapon.Bolt.Speed_Forward = 0f; base.CurPos = (HandlePos)2; base.Weapon.Bolt.LockBolt(); base.Weapon.Bolt.CurPos = (BoltPos)2; ((FVRInteractiveObject)this).ForceBreakInteraction(); isLocked = true; } if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && !((FVRInteractiveObject)this).m_hand.Input.BYButtonPressed && !((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && !((FVRInteractiveObject)this).m_hand.Input.Secondary2AxisNorthPressed) { if (springread) { base.Speed_Forward = springh; base.Weapon.Bolt.Speed_Forward = springb; base.CurPos = (HandlePos)0; base.Weapon.Bolt.ReleaseBolt(); base.Weapon.Bolt.CurPos = (BoltPos)0; springread = false; } isLocked = false; } } } } public class OTSGLTrigger : MonoBehaviour { public GP25 GLitself; public AttachableFirearmPhysicalObject AFPO; [NonSerialized] public ClosedBoltWeapon gun; public int prefireselectermode; public bool stored = false; private void FixedUpdate() { //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0346: 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_0359: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRFireArmAttachment)AFPO).curMount != (Object)null) { if (!GLitself.m_safetyEngaged) { if ((Object)(object)((Component)((FVRFireArmAttachment)AFPO).curMount.MyObject).gameObject.GetComponent() != (Object)null) { gun = ((Component)((FVRFireArmAttachment)AFPO).curMount.MyObject).gameObject.GetComponent(); if (!stored) { prefireselectermode = gun.m_fireSelectorMode; stored = true; } if (gun.m_fireSelectorMode != 0) { gun.ToggleFireSelector(); } } if (((FVRInteractiveObject)((FVRFireArmAttachment)AFPO).curMount.MyObject).m_isHeld) { if ((Object)(object)gun != (Object)null && ((FVRInteractiveObject)gun).m_hand.Input.TriggerFloat >= gun.TriggerFiringThreshold && GLitself.Chamber.IsFull) { GLitself.Fire(true); } ((Component)GLitself.Trigger).transform.localPosition = new Vector3(((Component)GLitself.Trigger).transform.localPosition.x, ((Component)GLitself.Trigger).transform.localPosition.y, GLitself.TriggerRange.y * ((FVRInteractiveObject)((FVRFireArmAttachment)AFPO).curMount.MyObject).m_hand.Input.TriggerFloat); } else if (!((FVRInteractiveObject)((FVRFireArmAttachment)AFPO).curMount.MyObject).m_isHeld) { ((Component)GLitself.Trigger).transform.localPosition = new Vector3(((Component)GLitself.Trigger).transform.localPosition.x, ((Component)GLitself.Trigger).transform.localPosition.y, 0f); } } else { if (!GLitself.m_safetyEngaged || !((Object)(object)((Component)((FVRFireArmAttachment)AFPO).curMount.MyObject).gameObject.GetComponent() != (Object)null)) { return; } gun = ((Component)((FVRFireArmAttachment)AFPO).curMount.MyObject).gameObject.GetComponent(); if (stored && (Object)(object)gun != (Object)null) { if (gun.m_fireSelectorMode != prefireselectermode) { gun.ToggleFireSelector(); } else if (gun.m_fireSelectorMode == prefireselectermode) { stored = false; } } } } else { if (!((Object)(object)((FVRFireArmAttachment)AFPO).curMount == (Object)null)) { return; } ((Component)GLitself.Trigger).transform.localPosition = new Vector3(((Component)GLitself.Trigger).transform.localPosition.x, ((Component)GLitself.Trigger).transform.localPosition.y, 0f); if (stored && (Object)(object)gun != (Object)null) { if (gun.m_fireSelectorMode != prefireselectermode) { gun.ToggleFireSelector(); } else if (gun.m_fireSelectorMode == prefireselectermode) { gun = null; stored = false; } } } } } } namespace Volks.ModulGroza { [BepInPlugin("Volks.ModulGroza", "ModulGroza", "1.3.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] [BepInDependency("h3vr.cityrobo.ModularWorkshopManager", "1.0.0")] [BepInDependency("nrgill28.Sodalite", "1.4.2")] public class ModulGrozaPlugin : 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(), "Volks.ModulGroza"); OtherLoader.RegisterDirectLoad(BasePath, "Volks.ModulGroza", "", "", "modulgroza4", ""); GameAPI.PreloadAllAssets(Path.Combine(BasePath, "mw_modulgroza")); } } } namespace JerryComponent { public class AttachableClosedBoltWeaponBoltRelease : MonoBehaviour { public AttachableClosedBolt bolt; public AttachableClosedBoltWeapon weapon; public bool buttonpressed = false; public void Update() { if ((Object)(object)((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand != (Object)null && ((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand.IsInStreamlinedMode) { if (((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand.Input.BYButtonPressed) { if (bolt.m_isBoltLocked) { weapon.IsBoltReleaseButtonHeld = true; } else if (!bolt.m_isBoltLocked && !buttonpressed) { weapon.ToggleFireSelector(); buttonpressed = true; } } else if (!((FVRInteractiveObject)((AttachableFirearm)weapon).Interface).m_hand.Input.BYButtonPressed) { if (bolt.m_isBoltLocked) { weapon.IsBoltReleaseButtonHeld = false; } buttonpressed = false; } } if (weapon.HasBoltReleaseButton && weapon.IsBoltReleaseButtonHeld) { bolt.ReleaseBolt(); } } } }