using System; using System.Collections; using System.Collections.Generic; 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.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; 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(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("JujutsuCube")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.0.1.0")] [assembly: AssemblyInformationalVersion("0.0.1")] [assembly: AssemblyProduct("JujutsuCube")] [assembly: AssemblyTitle("JujutsuCube")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.1.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 JujutsuCube { [BepInPlugin("com.hellotest006.jujutsucube", "JujutsuCube", "0.0.1")] public class JujutsuCubePlugin : BaseUnityPlugin { [HarmonyPatch(typeof(GunControl), "Start")] public static class GunControlStartPatch { private static void Postfix(GunControl __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("JujutsuCubeWeapon"); val.transform.SetParent(((Component)__instance).transform); val.transform.localPosition = new Vector3(0.5f, -0.25f, 0.6f); val.transform.localRotation = Quaternion.identity; GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)3); val2.transform.SetParent(val.transform); val2.transform.localPosition = Vector3.zero; Object.Destroy((Object)(object)val2.GetComponent()); Renderer component = val2.GetComponent(); Material material = component.material; material.color = Color.white; Light val3 = val2.AddComponent(); val3.color = Color.white; val3.intensity = 3f; val3.range = 8f; ((Behaviour)val3).enabled = true; JujutsuCubeWeapon jujutsuCubeWeapon = val.AddComponent(); jujutsuCubeWeapon.weaponModel = val2.transform; jujutsuCubeWeapon.weaponRenderer = component; jujutsuCubeWeapon.weaponLight = val3; jujutsuCubeWeapon.UpdateWeaponVisuals(); int num = weaponSlot.Value - 1; if (num < 0 || num >= __instance.slots.Count) { num = 4; } __instance.slots[num].Add(val); jujutsuCubeInstance = val; val.SetActive(false); } } public static ConfigEntry weaponSlot; public static ConfigEntry showAoEVisual; public static ConfigEntry useOldCube; public static ConfigEntry positiveModeKey; public static ConfigEntry blackFlashChance; public static ConfigEntry blackFlashChainModifierChance; public static ConfigEntry positiveDamageMult; public static ConfigEntry positiveHealPrimary; public static ConfigEntry positiveHealSecondary; public static ConfigEntry rctRadius; public static ConfigEntry rctDuration; public static ConfigEntry rctTickRate; public static ConfigEntry domainMinHoldTime; public static ConfigEntry domainDurationMultiplier; public static ConfigEntry domainRadius; public static ConfigEntry domainBlackFlashChance; public static ConfigEntry primaryDamageMin; public static ConfigEntry primaryDamageMax; public static ConfigEntry primaryCooldown; public static ConfigEntry primaryAltChance; public static ConfigEntry primaryLongHeight; public static ConfigEntry primaryLongWidth; public static ConfigEntry primaryWideHeight; public static ConfigEntry primaryWideWidth; public static ConfigEntry secondaryDamage; public static ConfigEntry secondaryHits; public static ConfigEntry secondaryChargeTime; public static ConfigEntry secondaryWidth; public static ConfigEntry secondaryAltChance; public static ConfigEntry secondaryLongHeight; public static ConfigEntry secondaryLongWidth; public static ConfigEntry secondaryWideHeight; public static ConfigEntry secondaryWideWidth; public static GameObject jujutsuCubeInstance; private readonly Harmony harmony = new Harmony("com.hellotest006.jujutsucube"); private void Awake() { weaponSlot = ((BaseUnityPlugin)this).Config.Bind("General", "WeaponSlot", 5, "Which slot (1-5)"); showAoEVisual = ((BaseUnityPlugin)this).Config.Bind("General", "ShowAoEVisual", false, "Show secondary AoE sphere"); useOldCube = ((BaseUnityPlugin)this).Config.Bind("General", "UseOldCube", false, "If true, uses the old uniform cube that changes color instead of shape based on mode."); positiveModeKey = ((BaseUnityPlugin)this).Config.Bind("General", "PositiveModeKey", (KeyCode)121, "Key to toggle Positive mode"); blackFlashChance = ((BaseUnityPlugin)this).Config.Bind("BlackFlash", "BaseChance", 5f, "Base chance (%) to trigger a Black Flash"); blackFlashChainModifierChance = ((BaseUnityPlugin)this).Config.Bind("BlackFlash", "ChainModifierChance", 10f, "Chance (%) after a Black Flash chain ends to modify the base chance"); positiveDamageMult = ((BaseUnityPlugin)this).Config.Bind("PositiveMode", "DamageMultiplier", 16f, "Damage multiplier in Positive mode (16 = 1600%)"); positiveHealPrimary = ((BaseUnityPlugin)this).Config.Bind("PositiveMode", "PrimaryHeal", 5, "HP healed per primary hit in Positive mode"); positiveHealSecondary = ((BaseUnityPlugin)this).Config.Bind("PositiveMode", "SecondaryHeal", 20, "HP healed per secondary hit in Positive mode"); rctRadius = ((BaseUnityPlugin)this).Config.Bind("PositiveMode", "RCTRadius", 100f, "Radius of RCT health halve effect"); rctDuration = ((BaseUnityPlugin)this).Config.Bind("PositiveMode", "RCTDuration", 10f, "How many seconds RCT lasts"); rctTickRate = ((BaseUnityPlugin)this).Config.Bind("PositiveMode", "RCTTickRate", 0.5f, "Seconds between RCT health halving ticks"); domainMinHoldTime = ((BaseUnityPlugin)this).Config.Bind("DomainExpansion", "MinHoldTime", 10f, "Seconds required to hold middle mouse to cast domain"); domainDurationMultiplier = ((BaseUnityPlugin)this).Config.Bind("DomainExpansion", "DurationMultiplier", 1.5f, "Domain duration = HoldTime * Multiplier"); domainRadius = ((BaseUnityPlugin)this).Config.Bind("DomainExpansion", "Radius", 30f, "Radius of the domain sphere"); domainBlackFlashChance = ((BaseUnityPlugin)this).Config.Bind("DomainExpansion", "BlackFlashChance", 7.5f, "Chance (%) for domain ticks to trigger a Black Flash"); primaryDamageMin = ((BaseUnityPlugin)this).Config.Bind("Primary", "MinDamage", 4f, (ConfigDescription)null); primaryDamageMax = ((BaseUnityPlugin)this).Config.Bind("Primary", "MaxDamage", 6f, (ConfigDescription)null); primaryCooldown = ((BaseUnityPlugin)this).Config.Bind("Primary", "Cooldown", 0.08f, (ConfigDescription)null); primaryAltChance = ((BaseUnityPlugin)this).Config.Bind("Primary", "AltStyleChance", 0.5f, "Chance for 'minced'"); primaryLongHeight = ((BaseUnityPlugin)this).Config.Bind("Primary.LongMode", "Height", 8f, "Vertical reach"); primaryLongWidth = ((BaseUnityPlugin)this).Config.Bind("Primary.LongMode", "Width", 0.5f, "Horizontal thickness"); primaryWideHeight = ((BaseUnityPlugin)this).Config.Bind("Primary.WideMode", "Height", 0.5f, "Vertical thickness"); primaryWideWidth = ((BaseUnityPlugin)this).Config.Bind("Primary.WideMode", "Width", 12f, "Horizontal reach"); secondaryDamage = ((BaseUnityPlugin)this).Config.Bind("Secondary", "Damage", 170f, (ConfigDescription)null); secondaryHits = ((BaseUnityPlugin)this).Config.Bind("Secondary", "HitCount", 7, (ConfigDescription)null); secondaryChargeTime = ((BaseUnityPlugin)this).Config.Bind("Secondary", "ChargeTime", 1.5f, (ConfigDescription)null); secondaryWidth = ((BaseUnityPlugin)this).Config.Bind("Secondary", "AoERadius", 10f, (ConfigDescription)null); secondaryAltChance = ((BaseUnityPlugin)this).Config.Bind("Secondary", "AltStyleChance", 0.2f, "Chance for 'kitkat'd'"); secondaryLongHeight = ((BaseUnityPlugin)this).Config.Bind("Secondary.LongMode", "Height", 25f, "Vertical reach"); secondaryLongWidth = ((BaseUnityPlugin)this).Config.Bind("Secondary.LongMode", "Width", 2f, "Horizontal thickness"); secondaryWideHeight = ((BaseUnityPlugin)this).Config.Bind("Secondary.WideMode", "Height", 2f, "Vertical thickness"); secondaryWideWidth = ((BaseUnityPlugin)this).Config.Bind("Secondary.WideMode", "Width", 35f, "Horizontal reach"); harmony.PatchAll(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Jujutsu Cube Loaded!"); } private void Update() { if (!Input.GetKeyDown((KeyCode)55)) { return; } GunControl instance = MonoSingleton.Instance; if (!((Object)(object)instance != (Object)null) || !instance.activated || !((Object)(object)jujutsuCubeInstance != (Object)null)) { return; } for (int i = 0; i < instance.slots.Count; i++) { if (instance.slots[i].Contains(jujutsuCubeInstance)) { instance.SwitchWeapon(i, (int?)instance.slots[i].IndexOf(jujutsuCubeInstance), false, false, false); break; } } } } public class JujutsuCubeWeapon : MonoBehaviour { [CompilerGenerated] private sealed class d__39 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public JujutsuCubeWeapon <>4__this; private float 5__1; private string 5__2; private int 5__3; private bool 5__4; private Transform 5__5; private Vector3 5__6; private Vector3 5__7; private Quaternion 5__8; private Vector3 5__9; private RaycastHit 5__10; private string 5__11; private int 5__12; private float 5__13; private float 5__14; private float 5__15; private Vector3 5__16; private float 5__17; private GameObject 5__18; private Material 5__19; private int 5__20; private Vector3
5__21; private Collider[] 5__22; private List 5__23; private Collider[] 5__24; private List 5__25; private List 5__26; private Collider[] <>s__27; private int <>s__28; private Collider 5__29; private EnemyIdentifier 5__30; private Collider[] <>s__31; private int <>s__32; private Collider 5__33; private EnemyIdentifier 5__34; private Vector3 5__35; private List.Enumerator <>s__36; private EnemyIdentifier 5__37; private int 5__38; private List.Enumerator <>s__39; private EnemyIdentifier 5__40; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__5 = null; 5__11 = null; 5__18 = null; 5__19 = null; 5__22 = null; 5__23 = null; 5__24 = null; 5__25 = null; 5__26 = null; <>s__27 = null; 5__29 = null; 5__30 = null; <>s__31 = null; 5__33 = null; 5__34 = null; <>s__36 = default(List.Enumerator); 5__37 = null; <>s__39 = default(List.Enumerator); 5__40 = null; <>1__state = -2; } private bool MoveNext() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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_01ca: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031c: 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_045f: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0527: 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_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057f: 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_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.ProcessBlackFlash(out 5__1, out 5__2, out 5__3, out 5__4); if (5__4) { <>4__this.TriggerBlackFlashEffects(); } <>4__this.isFiringSecondary = true; 5__5 = ((Component)MonoSingleton.Instance).transform; 5__6 = 5__5.position; 5__7 = 5__5.forward; 5__8 = 5__5.rotation; 5__9 = 5__6 + 5__7 * 100f; if (Physics.Raycast(5__6, 5__7, ref 5__10, 100000f, <>4__this.hitMask)) { 5__9 = ((RaycastHit)(ref 5__10)).point + ((RaycastHit)(ref 5__10)).normal * 0.5f; } if (JujutsuCubePlugin.showAoEVisual.Value) { 5__18 = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)5__18.GetComponent()); 5__18.transform.position = 5__9; 5__18.transform.localScale = Vector3.one * JujutsuCubePlugin.secondaryWidth.Value * 2f; 5__19 = 5__18.GetComponent().material; 5__19.color = new Color(1f, 1f, 1f, 0.5f); Object.Destroy((Object)(object)5__18, 0.4f); 5__18 = null; 5__19 = null; } 5__11 = ((Random.value <= JujutsuCubePlugin.secondaryAltChance.Value) ? "kitkat'd" : "World Cutting Slash"); 5__12 = ((5__11 == "kitkat'd") ? 750 : 550); 5__13 = 300f; 5__14 = (<>4__this.isWideMode ? JujutsuCubePlugin.secondaryWideWidth.Value : JujutsuCubePlugin.secondaryLongWidth.Value); 5__15 = (<>4__this.isWideMode ? JujutsuCubePlugin.secondaryWideHeight.Value : JujutsuCubePlugin.secondaryLongHeight.Value); 5__16 = new Vector3(5__14 / 2f, 5__15 / 2f, 5__13 / 2f); 5__17 = JujutsuCubePlugin.secondaryDamage.Value * 5__1; 5__20 = 0; break; case 1: <>1__state = -1; 5__22 = null; 5__23 = null; 5__24 = null; 5__25 = null; 5__26 = null; 5__20++; break; } if (5__20 < JujutsuCubePlugin.secondaryHits.Value) {
5__21 = 5__6 + 5__7 * (5__13 / 2f); 5__22 = Physics.OverlapBox(
5__21, 5__16, 5__8, <>4__this.hitMask, (QueryTriggerInteraction)2); 5__23 = new List(); <>s__27 = 5__22; for (<>s__28 = 0; <>s__28 < <>s__27.Length; <>s__28++) { 5__29 = <>s__27[<>s__28]; 5__30 = <>4__this.GetEnemy(((Component)5__29).gameObject); if ((Object)(object)5__30 != (Object)null && !5__23.Contains(5__30)) { 5__30.hitter = "railgun"; 5__30.DeliverDamage(((Component)5__29).gameObject, 5__7 * 50f, ((Component)5__30).transform.position, 5__17, true, 0f, (GameObject)null, false, false); 5__23.Add(5__30); } 5__30 = null; 5__29 = null; } <>s__27 = null; 5__24 = Physics.OverlapSphere(5__9, JujutsuCubePlugin.secondaryWidth.Value, <>4__this.hitMask, (QueryTriggerInteraction)2); 5__25 = new List(); <>s__31 = 5__24; for (<>s__32 = 0; <>s__32 < <>s__31.Length; <>s__32++) { 5__33 = <>s__31[<>s__32]; 5__34 = <>4__this.GetEnemy(((Component)5__33).gameObject); if ((Object)(object)5__34 != (Object)null && !5__25.Contains(5__34)) { Vector3 val = ((Component)5__34).transform.position - 5__9; 5__35 = ((Vector3)(ref val)).normalized; if (5__35 == Vector3.zero) { 5__35 = 5__7; } 5__34.hitter = "railgun"; 5__34.DeliverDamage(((Component)5__33).gameObject, 5__35 * 50f, 5__9, 5__17, true, 0f, (GameObject)null, false, false); 5__25.Add(5__34); } 5__34 = null; 5__33 = null; } <>s__31 = null; 5__26 = new List(5__23); <>s__36 = 5__25.GetEnumerator(); try { while (<>s__36.MoveNext()) { 5__37 = <>s__36.Current; if (!5__26.Contains(5__37)) { 5__26.Add(5__37); } 5__37 = null; } } finally { ((IDisposable)<>s__36).Dispose(); } <>s__36 = default(List.Enumerator); if (5__26.Count > 0) { if (<>4__this.isPositiveMode) { 5__38 = JujutsuCubePlugin.positiveHealSecondary.Value * 5__26.Count; MonoSingleton.Instance.GetHealth(5__38, false, false, true); } <>s__39 = 5__26.GetEnumerator(); try { while (<>s__39.MoveNext()) { 5__40 = <>s__39.Current; MonoSingleton.Instance.AddPoints(5__12, 5__11, ((Component)<>4__this).gameObject, 5__40, -1, "", ""); if (!<>4__this.isPositiveMode && !string.IsNullOrEmpty(5__2)) { MonoSingleton.Instance.AddPoints(5__3, 5__2, ((Component)<>4__this).gameObject, 5__40, -1, "", ""); } 5__40 = null; } } finally { ((IDisposable)<>s__39).Dispose(); } <>s__39 = default(List.Enumerator); } <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } <>4__this.isFiringSecondary = false; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform weaponModel; public Renderer weaponRenderer; public Light weaponLight; private float primaryTimer = 0f; private float chargeTimer = 0f; private float kickTimer = 0f; private float hitstopTimer = 0f; private bool isHitstopped = false; private bool isBlackFlashing = false; private bool isFiringSecondary = false; private bool isWideMode = false; private bool isPositiveMode = false; private float currentBlackFlashChance; private int blackFlashChainsLeft = 0; private float domainHoldTimer = 0f; private bool isDomainCharging = false; private bool isDomainActive = false; private float domainActiveTimer = 0f; private float domainTickTimer = 0f; private GameObject chargeSphereObj; private GameObject activeDomainObj; private bool isRCTActive = false; private float rctActiveTimer = 0f; private float rctTickTimer = 0f; private GameObject activeRCTObj; private int hitMask = LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)0)) | LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)); private void Start() { currentBlackFlashChance = JujutsuCubePlugin.blackFlashChance.Value; } public void UpdateWeaponVisuals() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)weaponModel == (Object)null) { return; } weaponModel.localRotation = Quaternion.identity; if (isPositiveMode) { if (JujutsuCubePlugin.useOldCube.Value) { weaponModel.localScale = new Vector3(0.4f, 0.4f, 0.4f); if ((Object)(object)weaponRenderer != (Object)null) { weaponRenderer.material.color = Color.yellow; } } else { if (isWideMode) { weaponModel.localScale = new Vector3(0.6f, 0.1f, 0.4f); } else { weaponModel.localScale = new Vector3(0.1f, 0.6f, 0.4f); } if ((Object)(object)weaponRenderer != (Object)null) { weaponRenderer.material.color = Color.yellow; } } if ((Object)(object)weaponLight != (Object)null && !isBlackFlashing) { weaponLight.color = Color.yellow; weaponLight.intensity = 5f; } return; } if (JujutsuCubePlugin.useOldCube.Value) { weaponModel.localScale = new Vector3(0.4f, 0.4f, 0.4f); if ((Object)(object)weaponRenderer != (Object)null) { weaponRenderer.material.color = (isWideMode ? Color.white : Color.black); } } else { if (isWideMode) { weaponModel.localScale = new Vector3(0.6f, 0.1f, 0.4f); } else { weaponModel.localScale = new Vector3(0.1f, 0.6f, 0.4f); } if ((Object)(object)weaponRenderer != (Object)null) { weaponRenderer.material.color = Color.white; } } if ((Object)(object)weaponLight != (Object)null && !isBlackFlashing) { weaponLight.color = Color.white; weaponLight.intensity = 3f; weaponLight.range = 8f; } } private void OnDisable() { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) chargeTimer = 0f; kickTimer = 0f; hitstopTimer = 0f; isBlackFlashing = false; isFiringSecondary = false; isDomainCharging = false; if (isHitstopped) { Time.timeScale = 1f; isHitstopped = false; } if ((Object)(object)chargeSphereObj != (Object)null) { Object.Destroy((Object)(object)chargeSphereObj); } if ((Object)(object)activeDomainObj != (Object)null) { Object.Destroy((Object)(object)activeDomainObj); } isDomainActive = false; if ((Object)(object)activeRCTObj != (Object)null) { Object.Destroy((Object)(object)activeRCTObj); } isRCTActive = false; ((MonoBehaviour)this).StopAllCoroutines(); UpdateWeaponVisuals(); if ((Object)(object)weaponLight != (Object)null) { weaponLight.intensity = 3f; weaponLight.range = 8f; weaponLight.color = (isPositiveMode ? Color.yellow : Color.white); } } private void Update() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030b: 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_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) if (!MonoSingleton.Instance.activated || isFiringSecondary) { return; } ((Component)this).transform.localScale = Vector3.one; ((Component)weaponModel).gameObject.SetActive(true); Vector3 localPosition = default(Vector3); ((Vector3)(ref localPosition))..ctor(0.5f, -0.25f, 0.6f); if (hitstopTimer > 0f) { hitstopTimer -= Time.unscaledDeltaTime; Time.timeScale = 0.01f; isHitstopped = true; ((Component)this).transform.localPosition = localPosition; } else { if (isHitstopped) { Time.timeScale = 1f; isHitstopped = false; ((Component)this).transform.localPosition = localPosition; } if (isBlackFlashing) { isBlackFlashing = false; UpdateWeaponVisuals(); } } if (Input.GetKeyDown(JujutsuCubePlugin.positiveModeKey.Value)) { isPositiveMode = !isPositiveMode; CancelDomainCharge(); if (isDomainActive) { if ((Object)(object)activeDomainObj != (Object)null) { Object.Destroy((Object)(object)activeDomainObj); } isDomainActive = false; } if (isRCTActive) { if ((Object)(object)activeRCTObj != (Object)null) { Object.Destroy((Object)(object)activeRCTObj); } isRCTActive = false; } UpdateWeaponVisuals(); } float y = Input.mouseScrollDelta.y; if (y != 0f) { if (isPositiveMode) { FirePrimary(); primaryTimer = 0.01f; } else { isWideMode = !isWideMode; UpdateWeaponVisuals(); } } if (isPositiveMode) { if (Input.GetMouseButtonDown(2) && !isRCTActive) { ActivateRCT(); } } else if (Input.GetMouseButton(2)) { domainHoldTimer += Time.deltaTime; isDomainCharging = true; if ((Object)(object)chargeSphereObj == (Object)null) { chargeSphereObj = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)chargeSphereObj.GetComponent()); chargeSphereObj.transform.SetParent(weaponModel); chargeSphereObj.transform.localPosition = new Vector3(0f, 0f, 1.5f); Material material = chargeSphereObj.GetComponent().material; material.color = new Color(0f, 0f, 0f, 0.8f); } float num = Mathf.Clamp01(domainHoldTimer / JujutsuCubePlugin.domainMinHoldTime.Value); chargeSphereObj.transform.localScale = Vector3.one * num * 1.5f; } else if (isDomainCharging) { if (domainHoldTimer >= JujutsuCubePlugin.domainMinHoldTime.Value) { ActivateDomain(); } else { CancelDomainCharge(); } } if (isDomainActive) { domainActiveTimer -= Time.deltaTime; domainTickTimer -= Time.deltaTime; if (domainActiveTimer <= 0f) { if ((Object)(object)activeDomainObj != (Object)null) { Object.Destroy((Object)(object)activeDomainObj); } isDomainActive = false; } else if (domainTickTimer <= 0f) { domainTickTimer = 0.2f; DomainDamageTick(); } } if (isRCTActive) { rctActiveTimer -= Time.deltaTime; rctTickTimer -= Time.deltaTime; if (rctActiveTimer <= 0f) { if ((Object)(object)activeRCTObj != (Object)null) { Object.Destroy((Object)(object)activeRCTObj); } isRCTActive = false; } else if (rctTickTimer <= 0f) { rctTickTimer = JujutsuCubePlugin.rctTickRate.Value; RCTTick(); } } primaryTimer -= Time.deltaTime; kickTimer -= Time.deltaTime; if ((Object)(object)weaponModel != (Object)null) { if (kickTimer > 0f) { weaponModel.localPosition = new Vector3(0f, 0f, -0.15f); } else { weaponModel.localPosition = Vector3.zero; } } if (MonoSingleton.Instance.InputSource.Fire1.IsPressed && primaryTimer <= 0f) { FirePrimary(); primaryTimer = JujutsuCubePlugin.primaryCooldown.Value; kickTimer = 0.05f; } if (MonoSingleton.Instance.InputSource.Fire2.IsPressed) { chargeTimer += Time.deltaTime; if ((Object)(object)weaponModel != (Object)null) { float num2 = 600f + chargeTimer * 400f; if (isWideMode) { weaponModel.Rotate(0f, num2 * Time.deltaTime, 0f, (Space)1); } else { weaponModel.Rotate(0f, 0f, num2 * Time.deltaTime, (Space)1); } } if ((Object)(object)weaponLight != (Object)null) { float num3 = Mathf.Clamp01(chargeTimer / JujutsuCubePlugin.secondaryChargeTime.Value); weaponLight.intensity = (isPositiveMode ? 5f : 3f) + num3 * 15f; weaponLight.range = 8f + num3 * 15f; } } else { if (chargeTimer >= JujutsuCubePlugin.secondaryChargeTime.Value) { ((MonoBehaviour)this).StartCoroutine(FireSecondary()); } chargeTimer = 0f; UpdateWeaponVisuals(); } } private void ActivateRCT() { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) isRCTActive = true; rctActiveTimer = JujutsuCubePlugin.rctDuration.Value; rctTickTimer = 0f; NewMovement instance = MonoSingleton.Instance; if ((Object)(object)instance != (Object)null) { float num = 200f - (float)instance.hp; if (num > 0f) { instance.GetHealth((int)num, false, false, true); } } if ((Object)(object)activeRCTObj == (Object)null) { activeRCTObj = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)activeRCTObj.GetComponent()); activeRCTObj.transform.SetParent(((Component)instance).transform); activeRCTObj.transform.localPosition = Vector3.zero; activeRCTObj.transform.localScale = Vector3.one * JujutsuCubePlugin.rctRadius.Value * 2f; Material material = activeRCTObj.GetComponent().material; material.SetInt("_Surface", 1); material.SetInt("_Blend", 0); material.SetInt("_Cull", 0); material.SetInt("_ZWrite", 0); material.SetInt("_SrcBlend", 5); material.SetInt("_DstBlend", 10); material.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); material.DisableKeyword("_ALPHATEST_ON"); material.DisableKeyword("_ALPHAPREMULTIPLY_ON"); material.renderQueue = 3000; material.SetColor("_BaseColor", new Color(1f, 1f, 0f, 0.15f)); } } private void RCTTick() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)activeRCTObj == (Object)null) { return; } Collider[] array = Physics.OverlapSphere(activeRCTObj.transform.position, JujutsuCubePlugin.rctRadius.Value, hitMask, (QueryTriggerInteraction)2); List list = new List(); Collider[] array2 = array; foreach (Collider val in array2) { EnemyIdentifier enemy = GetEnemy(((Component)val).gameObject); if ((Object)(object)enemy != (Object)null && !list.Contains(enemy)) { float num = enemy.health / 2f; if (num > 0f) { enemy.hitter = "railgun"; enemy.DeliverDamage(((Component)enemy).gameObject, Vector3.zero, ((Component)enemy).transform.position, num, true, 0f, (GameObject)null, false, false); } MonoSingleton.Instance.AddPoints(50, "RCT", ((Component)this).gameObject, enemy, -1, "", ""); list.Add(enemy); } } if (list.Count > 0) { MonoSingleton.Instance.GetHealth(1, false, false, true); } } private void ActivateDomain() { //IL_0090: 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_00b5: 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_0174: Unknown result type (might be due to invalid IL or missing references) isDomainActive = true; isDomainCharging = false; domainActiveTimer = domainHoldTimer * JujutsuCubePlugin.domainDurationMultiplier.Value; domainTickTimer = 0f; if ((Object)(object)chargeSphereObj != (Object)null) { Object.Destroy((Object)(object)chargeSphereObj); } activeDomainObj = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)activeDomainObj.GetComponent()); activeDomainObj.transform.SetParent(((Component)MonoSingleton.Instance).transform); activeDomainObj.transform.localPosition = Vector3.zero; activeDomainObj.transform.localScale = Vector3.one * JujutsuCubePlugin.domainRadius.Value * 2f; Material material = activeDomainObj.GetComponent().material; material.SetInt("_Surface", 1); material.SetInt("_Blend", 0); material.SetInt("_Cull", 0); material.SetInt("_ZWrite", 0); material.SetInt("_SrcBlend", 5); material.SetInt("_DstBlend", 10); material.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); material.DisableKeyword("_ALPHATEST_ON"); material.DisableKeyword("_ALPHAPREMULTIPLY_ON"); material.renderQueue = 3000; material.SetColor("_BaseColor", new Color(0f, 0f, 0f, 0.4f)); } private void CancelDomainCharge() { isDomainCharging = false; domainHoldTimer = 0f; if ((Object)(object)chargeSphereObj != (Object)null) { Object.Destroy((Object)(object)chargeSphereObj); } } private void DomainDamageTick() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)activeDomainObj == (Object)null) { return; } Collider[] array = Physics.OverlapSphere(activeDomainObj.transform.position, JujutsuCubePlugin.domainRadius.Value, hitMask, (QueryTriggerInteraction)2); bool flag = !isPositiveMode && Random.value * 100f < JujutsuCubePlugin.domainBlackFlashChance.Value; float num = (flag ? 2.5f : (isPositiveMode ? JujutsuCubePlugin.positiveDamageMult.Value : 1f)); if (flag) { isBlackFlashing = true; if ((Object)(object)weaponLight != (Object)null) { weaponLight.color = Color.magenta; weaponLight.intensity = 100f; weaponLight.range = 50f; } } float num2 = Random.Range(JujutsuCubePlugin.primaryDamageMin.Value, JujutsuCubePlugin.primaryDamageMax.Value) * num; float num3 = JujutsuCubePlugin.secondaryDamage.Value * num; float num4 = num2 + num3; List list = new List(); Collider[] array2 = array; foreach (Collider val in array2) { EnemyIdentifier enemy = GetEnemy(((Component)val).gameObject); if ((Object)(object)enemy != (Object)null && !list.Contains(enemy)) { enemy.hitter = "shotgun"; enemy.DeliverDamage(((Component)val).gameObject, Vector3.up * 50f, ((Component)enemy).transform.position, num4, true, 0f, (GameObject)null, false, false); list.Add(enemy); } } if (list.Count <= 0) { return; } if (isPositiveMode) { int num5 = (JujutsuCubePlugin.positiveHealPrimary.Value + JujutsuCubePlugin.positiveHealSecondary.Value) * list.Count; MonoSingleton.Instance.GetHealth(num5, false, false, true); MonoSingleton.Instance.AddPoints(15 * list.Count, "dismantled", ((Component)this).gameObject, (EnemyIdentifier)null, -1, "", ""); return; } string text = (flag ? "black flash" : "dismantled"); int num6 = (flag ? 750 : 15); string text2 = (flag ? "black flash again" : "World Cutting Slash"); int num7 = (flag ? 350 : 550); foreach (EnemyIdentifier item in list) { MonoSingleton.Instance.AddPoints(num6, text, ((Component)this).gameObject, item, -1, "", ""); MonoSingleton.Instance.AddPoints(num7, text2, ((Component)this).gameObject, item, -1, "", ""); } } private void ProcessBlackFlash(out float damageMult, out string bfStyleName, out int bfStylePoints, out bool triggerEffects) { damageMult = 1f; bfStyleName = ""; bfStylePoints = 0; triggerEffects = false; if (isPositiveMode) { damageMult = JujutsuCubePlugin.positiveDamageMult.Value; } else if (blackFlashChainsLeft > 0) { damageMult = 2.5f; bfStyleName = "black flash again"; bfStylePoints = 350; triggerEffects = false; blackFlashChainsLeft--; if (blackFlashChainsLeft == 0 && Random.value * 100f < JujutsuCubePlugin.blackFlashChainModifierChance.Value) { if (Random.value < 0.5f) { currentBlackFlashChance += 0.35f; } else { currentBlackFlashChance -= 0.75f; } currentBlackFlashChance = Mathf.Clamp(currentBlackFlashChance, 0.1f, 100f); } } else if (Random.value * 100f < currentBlackFlashChance) { damageMult = 2.5f; bfStyleName = "black flash"; bfStylePoints = 750; triggerEffects = true; blackFlashChainsLeft = Random.Range(1, 37); } } private void TriggerBlackFlashEffects() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) hitstopTimer = 0.25f; isBlackFlashing = true; if ((Object)(object)weaponLight != (Object)null) { weaponLight.color = Color.magenta; weaponLight.intensity = 100f; weaponLight.range = 50f; } } private EnemyIdentifier GetEnemy(GameObject obj) { EnemyIdentifierIdentifier val = default(EnemyIdentifierIdentifier); if (obj.TryGetComponent(ref val)) { return val.eid; } EnemyIdentifier componentInChildren = obj.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { return componentInChildren; } componentInChildren = obj.GetComponentInParent(); if ((Object)(object)componentInChildren != (Object)null) { return componentInChildren; } return null; } private void FirePrimary() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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) ProcessBlackFlash(out var damageMult, out var bfStyleName, out var bfStylePoints, out var triggerEffects); if (triggerEffects) { TriggerBlackFlashEffects(); } Transform transform = ((Component)MonoSingleton.Instance).transform; float num = 200f; float num2 = (isWideMode ? JujutsuCubePlugin.primaryWideWidth.Value : JujutsuCubePlugin.primaryLongWidth.Value); float num3 = (isWideMode ? JujutsuCubePlugin.primaryWideHeight.Value : JujutsuCubePlugin.primaryLongHeight.Value); Vector3 val = transform.position + transform.forward * (num / 2f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(num2 / 2f, num3 / 2f, num / 2f); Collider[] array = Physics.OverlapBox(val, val2, transform.rotation, hitMask, (QueryTriggerInteraction)2); List list = new List(); Collider[] array2 = array; foreach (Collider val3 in array2) { EnemyIdentifier enemy = GetEnemy(((Component)val3).gameObject); if ((Object)(object)enemy != (Object)null && !list.Contains(enemy)) { float num4 = Random.Range(JujutsuCubePlugin.primaryDamageMin.Value, JujutsuCubePlugin.primaryDamageMax.Value); num4 *= damageMult; enemy.hitter = "shotgun"; enemy.DeliverDamage(((Component)val3).gameObject, transform.forward * 5f, ((Component)enemy).transform.position, num4, true, 0f, (GameObject)null, false, false); list.Add(enemy); } } if (list.Count <= 0) { return; } if (isPositiveMode) { int num5 = JujutsuCubePlugin.positiveHealPrimary.Value * list.Count; MonoSingleton.Instance.GetHealth(num5, false, false, true); } string text = ((Random.value <= JujutsuCubePlugin.primaryAltChance.Value) ? "minced" : "dismantled"); int num6 = ((text == "minced") ? 20 : 15); foreach (EnemyIdentifier item in list) { MonoSingleton.Instance.AddPoints(num6, text, ((Component)this).gameObject, item, -1, "", ""); if (!isPositiveMode && !string.IsNullOrEmpty(bfStyleName)) { MonoSingleton.Instance.AddPoints(bfStylePoints, bfStyleName, ((Component)this).gameObject, item, -1, "", ""); } } } [IteratorStateMachine(typeof(d__39))] private IEnumerator FireSecondary() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this }; } } }