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<Collider>());
Renderer component = val2.GetComponent<Renderer>();
Material material = component.material;
material.color = Color.white;
Light val3 = val2.AddComponent<Light>();
val3.color = Color.white;
val3.intensity = 3f;
val3.range = 8f;
((Behaviour)val3).enabled = true;
JujutsuCubeWeapon jujutsuCubeWeapon = val.AddComponent<JujutsuCubeWeapon>();
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<int> weaponSlot;
public static ConfigEntry<bool> showAoEVisual;
public static ConfigEntry<bool> useOldCube;
public static ConfigEntry<KeyCode> positiveModeKey;
public static ConfigEntry<float> blackFlashChance;
public static ConfigEntry<float> blackFlashChainModifierChance;
public static ConfigEntry<float> positiveDamageMult;
public static ConfigEntry<int> positiveHealPrimary;
public static ConfigEntry<int> positiveHealSecondary;
public static ConfigEntry<float> rctRadius;
public static ConfigEntry<float> rctDuration;
public static ConfigEntry<float> rctTickRate;
public static ConfigEntry<float> domainMinHoldTime;
public static ConfigEntry<float> domainDurationMultiplier;
public static ConfigEntry<float> domainRadius;
public static ConfigEntry<float> domainBlackFlashChance;
public static ConfigEntry<float> primaryDamageMin;
public static ConfigEntry<float> primaryDamageMax;
public static ConfigEntry<float> primaryCooldown;
public static ConfigEntry<float> primaryAltChance;
public static ConfigEntry<float> primaryLongHeight;
public static ConfigEntry<float> primaryLongWidth;
public static ConfigEntry<float> primaryWideHeight;
public static ConfigEntry<float> primaryWideWidth;
public static ConfigEntry<float> secondaryDamage;
public static ConfigEntry<int> secondaryHits;
public static ConfigEntry<float> secondaryChargeTime;
public static ConfigEntry<float> secondaryWidth;
public static ConfigEntry<float> secondaryAltChance;
public static ConfigEntry<float> secondaryLongHeight;
public static ConfigEntry<float> secondaryLongWidth;
public static ConfigEntry<float> secondaryWideHeight;
public static ConfigEntry<float> secondaryWideWidth;
public static GameObject jujutsuCubeInstance;
private readonly Harmony harmony = new Harmony("com.hellotest006.jujutsucube");
private void Awake()
{
weaponSlot = ((BaseUnityPlugin)this).Config.Bind<int>("General", "WeaponSlot", 5, "Which slot (1-5)");
showAoEVisual = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "ShowAoEVisual", false, "Show secondary AoE sphere");
useOldCube = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "UseOldCube", false, "If true, uses the old uniform cube that changes color instead of shape based on mode.");
positiveModeKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "PositiveModeKey", (KeyCode)121, "Key to toggle Positive mode");
blackFlashChance = ((BaseUnityPlugin)this).Config.Bind<float>("BlackFlash", "BaseChance", 5f, "Base chance (%) to trigger a Black Flash");
blackFlashChainModifierChance = ((BaseUnityPlugin)this).Config.Bind<float>("BlackFlash", "ChainModifierChance", 10f, "Chance (%) after a Black Flash chain ends to modify the base chance");
positiveDamageMult = ((BaseUnityPlugin)this).Config.Bind<float>("PositiveMode", "DamageMultiplier", 16f, "Damage multiplier in Positive mode (16 = 1600%)");
positiveHealPrimary = ((BaseUnityPlugin)this).Config.Bind<int>("PositiveMode", "PrimaryHeal", 5, "HP healed per primary hit in Positive mode");
positiveHealSecondary = ((BaseUnityPlugin)this).Config.Bind<int>("PositiveMode", "SecondaryHeal", 20, "HP healed per secondary hit in Positive mode");
rctRadius = ((BaseUnityPlugin)this).Config.Bind<float>("PositiveMode", "RCTRadius", 100f, "Radius of RCT health halve effect");
rctDuration = ((BaseUnityPlugin)this).Config.Bind<float>("PositiveMode", "RCTDuration", 10f, "How many seconds RCT lasts");
rctTickRate = ((BaseUnityPlugin)this).Config.Bind<float>("PositiveMode", "RCTTickRate", 0.5f, "Seconds between RCT health halving ticks");
domainMinHoldTime = ((BaseUnityPlugin)this).Config.Bind<float>("DomainExpansion", "MinHoldTime", 10f, "Seconds required to hold middle mouse to cast domain");
domainDurationMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("DomainExpansion", "DurationMultiplier", 1.5f, "Domain duration = HoldTime * Multiplier");
domainRadius = ((BaseUnityPlugin)this).Config.Bind<float>("DomainExpansion", "Radius", 30f, "Radius of the domain sphere");
domainBlackFlashChance = ((BaseUnityPlugin)this).Config.Bind<float>("DomainExpansion", "BlackFlashChance", 7.5f, "Chance (%) for domain ticks to trigger a Black Flash");
primaryDamageMin = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "MinDamage", 4f, (ConfigDescription)null);
primaryDamageMax = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "MaxDamage", 6f, (ConfigDescription)null);
primaryCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "Cooldown", 0.08f, (ConfigDescription)null);
primaryAltChance = ((BaseUnityPlugin)this).Config.Bind<float>("Primary", "AltStyleChance", 0.5f, "Chance for 'minced'");
primaryLongHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Primary.LongMode", "Height", 8f, "Vertical reach");
primaryLongWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Primary.LongMode", "Width", 0.5f, "Horizontal thickness");
primaryWideHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Primary.WideMode", "Height", 0.5f, "Vertical thickness");
primaryWideWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Primary.WideMode", "Width", 12f, "Horizontal reach");
secondaryDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "Damage", 170f, (ConfigDescription)null);
secondaryHits = ((BaseUnityPlugin)this).Config.Bind<int>("Secondary", "HitCount", 7, (ConfigDescription)null);
secondaryChargeTime = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "ChargeTime", 1.5f, (ConfigDescription)null);
secondaryWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "AoERadius", 10f, (ConfigDescription)null);
secondaryAltChance = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary", "AltStyleChance", 0.2f, "Chance for 'kitkat'd'");
secondaryLongHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary.LongMode", "Height", 25f, "Vertical reach");
secondaryLongWidth = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary.LongMode", "Width", 2f, "Horizontal thickness");
secondaryWideHeight = ((BaseUnityPlugin)this).Config.Bind<float>("Secondary.WideMode", "Height", 2f, "Vertical thickness");
secondaryWideWidth = ((BaseUnityPlugin)this).Config.Bind<float>("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<GunControl>.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 <FireSecondary>d__39 : IEnumerator<object>, IDisposable, IEnumerator
{
private int <>1__state;
private object <>2__current;
public JujutsuCubeWeapon <>4__this;
private float <damageMult>5__1;
private string <bfStyleName>5__2;
private int <bfStylePoints>5__3;
private bool <triggerEffects>5__4;
private Transform <cam>5__5;
private Vector3 <lockedCamPos>5__6;
private Vector3 <lockedCamForward>5__7;
private Quaternion <lockedCamRot>5__8;
private Vector3 <lockedSphereOrigin>5__9;
private RaycastHit <firstHit>5__10;
private string <secStyleName>5__11;
private int <secStylePoints>5__12;
private float <range>5__13;
private float <width>5__14;
private float <height>5__15;
private Vector3 <halfExtents>5__16;
private float <finalSecDamage>5__17;
private GameObject <aoeVis>5__18;
private Material <aoeMat>5__19;
private int <i>5__20;
private Vector3 <center>5__21;
private Collider[] <slashHits>5__22;
private List<EnemyIdentifier> <slashHitEnemies>5__23;
private Collider[] <colliders>5__24;
private List<EnemyIdentifier> <sphereHitEnemies>5__25;
private List<EnemyIdentifier> <allHitEnemies>5__26;
private Collider[] <>s__27;
private int <>s__28;
private Collider <col>5__29;
private EnemyIdentifier <eid>5__30;
private Collider[] <>s__31;
private int <>s__32;
private Collider <col>5__33;
private EnemyIdentifier <eid>5__34;
private Vector3 <direction>5__35;
private List<EnemyIdentifier>.Enumerator <>s__36;
private EnemyIdentifier <eid>5__37;
private int <healAmt>5__38;
private List<EnemyIdentifier>.Enumerator <>s__39;
private EnemyIdentifier <eid>5__40;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <FireSecondary>d__39(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<bfStyleName>5__2 = null;
<cam>5__5 = null;
<secStyleName>5__11 = null;
<aoeVis>5__18 = null;
<aoeMat>5__19 = null;
<slashHits>5__22 = null;
<slashHitEnemies>5__23 = null;
<colliders>5__24 = null;
<sphereHitEnemies>5__25 = null;
<allHitEnemies>5__26 = null;
<>s__27 = null;
<col>5__29 = null;
<eid>5__30 = null;
<>s__31 = null;
<col>5__33 = null;
<eid>5__34 = null;
<>s__36 = default(List<EnemyIdentifier>.Enumerator);
<eid>5__37 = null;
<>s__39 = default(List<EnemyIdentifier>.Enumerator);
<eid>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 <damageMult>5__1, out <bfStyleName>5__2, out <bfStylePoints>5__3, out <triggerEffects>5__4);
if (<triggerEffects>5__4)
{
<>4__this.TriggerBlackFlashEffects();
}
<>4__this.isFiringSecondary = true;
<cam>5__5 = ((Component)MonoSingleton<CameraController>.Instance).transform;
<lockedCamPos>5__6 = <cam>5__5.position;
<lockedCamForward>5__7 = <cam>5__5.forward;
<lockedCamRot>5__8 = <cam>5__5.rotation;
<lockedSphereOrigin>5__9 = <lockedCamPos>5__6 + <lockedCamForward>5__7 * 100f;
if (Physics.Raycast(<lockedCamPos>5__6, <lockedCamForward>5__7, ref <firstHit>5__10, 100000f, <>4__this.hitMask))
{
<lockedSphereOrigin>5__9 = ((RaycastHit)(ref <firstHit>5__10)).point + ((RaycastHit)(ref <firstHit>5__10)).normal * 0.5f;
}
if (JujutsuCubePlugin.showAoEVisual.Value)
{
<aoeVis>5__18 = GameObject.CreatePrimitive((PrimitiveType)0);
Object.Destroy((Object)(object)<aoeVis>5__18.GetComponent<Collider>());
<aoeVis>5__18.transform.position = <lockedSphereOrigin>5__9;
<aoeVis>5__18.transform.localScale = Vector3.one * JujutsuCubePlugin.secondaryWidth.Value * 2f;
<aoeMat>5__19 = <aoeVis>5__18.GetComponent<Renderer>().material;
<aoeMat>5__19.color = new Color(1f, 1f, 1f, 0.5f);
Object.Destroy((Object)(object)<aoeVis>5__18, 0.4f);
<aoeVis>5__18 = null;
<aoeMat>5__19 = null;
}
<secStyleName>5__11 = ((Random.value <= JujutsuCubePlugin.secondaryAltChance.Value) ? "kitkat'd" : "World Cutting Slash");
<secStylePoints>5__12 = ((<secStyleName>5__11 == "kitkat'd") ? 750 : 550);
<range>5__13 = 300f;
<width>5__14 = (<>4__this.isWideMode ? JujutsuCubePlugin.secondaryWideWidth.Value : JujutsuCubePlugin.secondaryLongWidth.Value);
<height>5__15 = (<>4__this.isWideMode ? JujutsuCubePlugin.secondaryWideHeight.Value : JujutsuCubePlugin.secondaryLongHeight.Value);
<halfExtents>5__16 = new Vector3(<width>5__14 / 2f, <height>5__15 / 2f, <range>5__13 / 2f);
<finalSecDamage>5__17 = JujutsuCubePlugin.secondaryDamage.Value * <damageMult>5__1;
<i>5__20 = 0;
break;
case 1:
<>1__state = -1;
<slashHits>5__22 = null;
<slashHitEnemies>5__23 = null;
<colliders>5__24 = null;
<sphereHitEnemies>5__25 = null;
<allHitEnemies>5__26 = null;
<i>5__20++;
break;
}
if (<i>5__20 < JujutsuCubePlugin.secondaryHits.Value)
{
<center>5__21 = <lockedCamPos>5__6 + <lockedCamForward>5__7 * (<range>5__13 / 2f);
<slashHits>5__22 = Physics.OverlapBox(<center>5__21, <halfExtents>5__16, <lockedCamRot>5__8, <>4__this.hitMask, (QueryTriggerInteraction)2);
<slashHitEnemies>5__23 = new List<EnemyIdentifier>();
<>s__27 = <slashHits>5__22;
for (<>s__28 = 0; <>s__28 < <>s__27.Length; <>s__28++)
{
<col>5__29 = <>s__27[<>s__28];
<eid>5__30 = <>4__this.GetEnemy(((Component)<col>5__29).gameObject);
if ((Object)(object)<eid>5__30 != (Object)null && !<slashHitEnemies>5__23.Contains(<eid>5__30))
{
<eid>5__30.hitter = "railgun";
<eid>5__30.DeliverDamage(((Component)<col>5__29).gameObject, <lockedCamForward>5__7 * 50f, ((Component)<eid>5__30).transform.position, <finalSecDamage>5__17, true, 0f, (GameObject)null, false, false);
<slashHitEnemies>5__23.Add(<eid>5__30);
}
<eid>5__30 = null;
<col>5__29 = null;
}
<>s__27 = null;
<colliders>5__24 = Physics.OverlapSphere(<lockedSphereOrigin>5__9, JujutsuCubePlugin.secondaryWidth.Value, <>4__this.hitMask, (QueryTriggerInteraction)2);
<sphereHitEnemies>5__25 = new List<EnemyIdentifier>();
<>s__31 = <colliders>5__24;
for (<>s__32 = 0; <>s__32 < <>s__31.Length; <>s__32++)
{
<col>5__33 = <>s__31[<>s__32];
<eid>5__34 = <>4__this.GetEnemy(((Component)<col>5__33).gameObject);
if ((Object)(object)<eid>5__34 != (Object)null && !<sphereHitEnemies>5__25.Contains(<eid>5__34))
{
Vector3 val = ((Component)<eid>5__34).transform.position - <lockedSphereOrigin>5__9;
<direction>5__35 = ((Vector3)(ref val)).normalized;
if (<direction>5__35 == Vector3.zero)
{
<direction>5__35 = <lockedCamForward>5__7;
}
<eid>5__34.hitter = "railgun";
<eid>5__34.DeliverDamage(((Component)<col>5__33).gameObject, <direction>5__35 * 50f, <lockedSphereOrigin>5__9, <finalSecDamage>5__17, true, 0f, (GameObject)null, false, false);
<sphereHitEnemies>5__25.Add(<eid>5__34);
}
<eid>5__34 = null;
<col>5__33 = null;
}
<>s__31 = null;
<allHitEnemies>5__26 = new List<EnemyIdentifier>(<slashHitEnemies>5__23);
<>s__36 = <sphereHitEnemies>5__25.GetEnumerator();
try
{
while (<>s__36.MoveNext())
{
<eid>5__37 = <>s__36.Current;
if (!<allHitEnemies>5__26.Contains(<eid>5__37))
{
<allHitEnemies>5__26.Add(<eid>5__37);
}
<eid>5__37 = null;
}
}
finally
{
((IDisposable)<>s__36).Dispose();
}
<>s__36 = default(List<EnemyIdentifier>.Enumerator);
if (<allHitEnemies>5__26.Count > 0)
{
if (<>4__this.isPositiveMode)
{
<healAmt>5__38 = JujutsuCubePlugin.positiveHealSecondary.Value * <allHitEnemies>5__26.Count;
MonoSingleton<NewMovement>.Instance.GetHealth(<healAmt>5__38, false, false, true);
}
<>s__39 = <allHitEnemies>5__26.GetEnumerator();
try
{
while (<>s__39.MoveNext())
{
<eid>5__40 = <>s__39.Current;
MonoSingleton<StyleHUD>.Instance.AddPoints(<secStylePoints>5__12, <secStyleName>5__11, ((Component)<>4__this).gameObject, <eid>5__40, -1, "", "");
if (!<>4__this.isPositiveMode && !string.IsNullOrEmpty(<bfStyleName>5__2))
{
MonoSingleton<StyleHUD>.Instance.AddPoints(<bfStylePoints>5__3, <bfStyleName>5__2, ((Component)<>4__this).gameObject, <eid>5__40, -1, "", "");
}
<eid>5__40 = null;
}
}
finally
{
((IDisposable)<>s__39).Dispose();
}
<>s__39 = default(List<EnemyIdentifier>.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<GunControl>.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<Collider>());
chargeSphereObj.transform.SetParent(weaponModel);
chargeSphereObj.transform.localPosition = new Vector3(0f, 0f, 1.5f);
Material material = chargeSphereObj.GetComponent<Renderer>().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<InputManager>.Instance.InputSource.Fire1.IsPressed && primaryTimer <= 0f)
{
FirePrimary();
primaryTimer = JujutsuCubePlugin.primaryCooldown.Value;
kickTimer = 0.05f;
}
if (MonoSingleton<InputManager>.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<NewMovement>.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<Collider>());
activeRCTObj.transform.SetParent(((Component)instance).transform);
activeRCTObj.transform.localPosition = Vector3.zero;
activeRCTObj.transform.localScale = Vector3.one * JujutsuCubePlugin.rctRadius.Value * 2f;
Material material = activeRCTObj.GetComponent<Renderer>().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<EnemyIdentifier> list = new List<EnemyIdentifier>();
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<StyleHUD>.Instance.AddPoints(50, "RCT", ((Component)this).gameObject, enemy, -1, "", "");
list.Add(enemy);
}
}
if (list.Count > 0)
{
MonoSingleton<NewMovement>.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<Collider>());
activeDomainObj.transform.SetParent(((Component)MonoSingleton<NewMovement>.Instance).transform);
activeDomainObj.transform.localPosition = Vector3.zero;
activeDomainObj.transform.localScale = Vector3.one * JujutsuCubePlugin.domainRadius.Value * 2f;
Material material = activeDomainObj.GetComponent<Renderer>().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<EnemyIdentifier> list = new List<EnemyIdentifier>();
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<NewMovement>.Instance.GetHealth(num5, false, false, true);
MonoSingleton<StyleHUD>.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<StyleHUD>.Instance.AddPoints(num6, text, ((Component)this).gameObject, item, -1, "", "");
MonoSingleton<StyleHUD>.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<EnemyIdentifierIdentifier>(ref val))
{
return val.eid;
}
EnemyIdentifier componentInChildren = obj.GetComponentInChildren<EnemyIdentifier>();
if ((Object)(object)componentInChildren != (Object)null)
{
return componentInChildren;
}
componentInChildren = obj.GetComponentInParent<EnemyIdentifier>();
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<CameraController>.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<EnemyIdentifier> list = new List<EnemyIdentifier>();
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<NewMovement>.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<StyleHUD>.Instance.AddPoints(num6, text, ((Component)this).gameObject, item, -1, "", "");
if (!isPositiveMode && !string.IsNullOrEmpty(bfStyleName))
{
MonoSingleton<StyleHUD>.Instance.AddPoints(bfStylePoints, bfStyleName, ((Component)this).gameObject, item, -1, "", "");
}
}
}
[IteratorStateMachine(typeof(<FireSecondary>d__39))]
private IEnumerator FireSecondary()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <FireSecondary>d__39(0)
{
<>4__this = this
};
}
}
}