using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using REPOLib.Modules; using SukunaMod.Model; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SukunaMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.5.0")] [assembly: AssemblyInformationalVersion("1.2.5")] [assembly: AssemblyProduct("SukunaMod")] [assembly: AssemblyTitle("SukunaMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.5.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 SukunaMod { internal static class BandanaItem { internal static readonly RuntimeItem Runtime = new RuntimeItem(new ItemSpec { AssetName = "Item Gojo Blindfold", DisplayName = "Gojo's Blindfold", Description = "Satoru Gojo's blindfold. Put it on to see with the Six Eyes and wield Limitless.", IconResource = "bandana_icon.png", ValueMax = 12500f, ColliderSize = new Vector3(0.24f, 0.07f, 0.3f), BuildModel = BuildModel, Behaviour = typeof(GojoBlindfoldItem) }); internal static Item Item => Runtime.Item; internal static Texture2D IconTexture => Runtime.Icon; internal static void TryRegister() { Runtime.TryRegister(); } private static void BuildModel(Transform parent, Vector3 center, Material baseMat, int layer) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) Mesh mesh = ItemFactory.ToMesh(BandanaModel.BuildMesh(), "Gojo Blindfold"); Texture2D tex = ItemFactory.ToTexture(BandanaModel.BuildTexture(), 256, "Gojo Blindfold"); Material val = ItemFactory.ModelMaterial(baseMat, tex, new Color(0.004f, 0.01f, 0.03f), "Gojo Blindfold"); if (val.HasProperty("_Glossiness")) { val.SetFloat("_Glossiness", 0.45f); } ItemFactory.SmallGlow(ItemFactory.ModelObject("Gojo Blindfold Model", parent, center, mesh, val, layer).transform, new Color(0.3f, 0.6f, 1f), 0.45f, 1.4f, layer); } } public class GojoBlindfoldItem : MonoBehaviour { private ItemToggle toggle; private ItemAttributes attributes; private PhysGrabObject physGrabObject; private bool used; private float rejectCooldown; private void Awake() { ItemFactory.GiveOwnIcon((Component)(object)this, BandanaItem.Runtime); } private void Start() { toggle = ((Component)this).GetComponent(); attributes = ((Component)this).GetComponent(); physGrabObject = ((Component)this).GetComponent(); NotValuableObject component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.hasHealth = false; } } private void Update() { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (rejectCooldown > 0f) { rejectCooldown -= Time.deltaTime; } if (used || !Object.op_Implicit((Object)(object)toggle) || !toggle.toggleState || SemiFunc.RunIsShop() || RunManager.instance.levelIsShop || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } PlayerAvatar val = SemiFunc.PlayerAvatarGetFromPhotonID(toggle.playerTogglePhotonID); if (!Object.op_Implicit((Object)(object)val)) { return; } if (Blindfold.Get(val) > 0) { toggle.ToggleItem(false, -1); if (rejectCooldown <= 0f) { rejectCooldown = 1f; SukunaNet.SendFingerEvent(Tech.BlindfoldRejected, val, 1, ((Component)this).transform.position); } return; } used = true; Powers.Grant(val, Powers.Kind.Gojo); if (Object.op_Implicit((Object)(object)attributes) && !string.IsNullOrEmpty(attributes.instanceName)) { StatsManager.instance.ItemRemove(attributes.instanceName); } toggle.ToggleDisable(true); SukunaNet.SendFingerEvent(Tech.BlindfoldWorn, val, Fingers.Get(val), ((Component)this).transform.position); physGrabObject.DestroyPhysGrabObject(); } } internal sealed class BossDef { internal readonly string PrefabName; internal readonly string Name; private readonly Func health; private readonly Type ai; private readonly Type model; internal EnemySetup Setup; private bool done; private float nextAttempt; private int attempts; internal BossDef(string prefabName, string name, Func health, Type ai, Type model) { PrefabName = prefabName; Name = name; this.health = health; this.ai = ai; this.model = model; } internal void TryRegister() { if (done || Time.unscaledTime < nextAttempt || !Object.op_Implicit((Object)(object)EnemyDirector.instance) || !Object.op_Implicit((Object)(object)RunManager.instance)) { return; } nextAttempt = Time.unscaledTime + 3f; attempts++; try { done = Build(); if (done && Object.op_Implicit((Object)(object)Setup)) { Plugin.Log.LogInfo((object)(Name + " registered.")); } } catch (Exception ex) { Plugin.Log.LogError((object)("Building the " + Name + " enemy failed: " + ex)); done = attempts >= 3; } } private static EnemySetup FindRobe() { EnemyDirector instance = EnemyDirector.instance; List[] array = new List[3] { instance.enemiesDifficulty1, instance.enemiesDifficulty2, instance.enemiesDifficulty3 }; foreach (List list in array) { if (list == null) { continue; } foreach (EnemySetup item in list) { if (Object.op_Implicit((Object)(object)item) && ((Object)item).name == "Enemy - Robe" && item.spawnObjects != null && item.spawnObjects.Count > 0) { return item; } } } return null; } private bool Build() { //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) EnemySetup val = FindRobe(); if (!Object.op_Implicit((Object)(object)val)) { return false; } GameObject prefab = ((PrefabRef)(object)val.spawnObjects[0]).Prefab; if (!Object.op_Implicit((Object)(object)prefab)) { return false; } GameObject val2 = Object.Instantiate(prefab, ItemFactory.Holder); ((Object)val2).name = PrefabName; EnemyRobe[] componentsInChildren = val2.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } EnemyRobeAnim[] componentsInChildren2 = val2.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren2[i]); } EnemyRobePersistent[] componentsInChildren3 = val2.GetComponentsInChildren(true); foreach (EnemyRobePersistent obj in componentsInChildren3) { GameObject gameObject = ((Component)obj).gameObject; Object.DestroyImmediate((Object)(object)obj); gameObject.SetActive(false); } Animator[] componentsInChildren4 = val2.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren4.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren4[i]); } Enemy componentInChildren = val2.GetComponentInChildren(true); EnemyParent component = val2.GetComponent(); EnemyHealth componentInChildren2 = val2.GetComponentInChildren(true); if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)componentInChildren2)) { throw new InvalidOperationException("Robe prefab is missing Enemy/EnemyParent/EnemyHealth"); } Transform val3 = null; Transform[] componentsInChildren5 = val2.GetComponentsInChildren(true); foreach (Transform val4 in componentsInChildren5) { if (((Object)val4).name == "Visual") { val3 = val4; break; } } if (!Object.op_Implicit((Object)(object)val3)) { throw new InvalidOperationException("Robe prefab has no Visual"); } Renderer[] componentsInChildren6 = ((Component)val3).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren6.Length; i++) { componentsInChildren6[i].enabled = false; } Light[] componentsInChildren7 = ((Component)val3).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren7.Length; i++) { ((Behaviour)componentsInChildren7[i]).enabled = false; } HurtCollider[] componentsInChildren8 = ((Component)val3).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren8.Length; i++) { ((Component)componentsInChildren8[i]).gameObject.SetActive(false); } component.enemyName = Name; component.enemyNameLocalized = null; component.difficulty = (Difficulty)2; component.SpawnedTimeMin = 600f; component.SpawnedTimeMax = 900f; component.DespawnedTimeMin = 60f; component.DespawnedTimeMax = 90f; componentInChildren2.health = health(); componentInChildren2.spawnValuable = true; componentInChildren.Type = (EnemyType)4; componentInChildren.SightingStinger = false; componentInChildren.EnemyNearMusic = false; ((Component)componentInChildren).gameObject.AddComponent(ai); ((Component)val3).gameObject.AddComponent(model); EnemySetup val5 = ScriptableObject.CreateInstance(); ((Object)val5).name = PrefabName; val5.status = (Status)1; val5.rarityPreset = val.rarityPreset; ((Object)val5).hideFlags = (HideFlags)32; PrefabRef val6 = NetworkPrefabs.RegisterNetworkPrefab("Enemies/" + PrefabName, val2); if (val6 == null) { Plugin.Log.LogError((object)("REPOLib refused the " + Name + " enemy prefab.")); return true; } Utilities.FixAudioMixerGroups(val2); val5.spawnObjects = new List { val6 }; Setup = val5; return true; } internal bool Spawn(Vector3 position) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Setup) || !SemiFunc.IsMasterClientOrSingleplayer()) { return false; } List list = Enemies.SpawnEnemy(Setup, position, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), false); if (list != null) { return list.Count > 0; } return false; } } internal static class Bosses { internal static readonly BossDef Gojo = new BossDef("Enemy - Gojo", "Satoru Gojo", () => SukunaConfig.GojoHealth.Value, typeof(GojoEnemyAI), typeof(GojoModel)); internal static readonly BossDef Sukuna = new BossDef("Enemy - Sukuna", "Ryomen Sukuna", () => SukunaConfig.SukunaHealth.Value, typeof(SukunaEnemyAI), typeof(SukunaModel)); internal static readonly BossDef Megumi = new BossDef("Enemy - Megumi", "Megumi Fushiguro", () => SukunaConfig.MegumiHealth.Value, typeof(MegumiEnemyAI), typeof(MegumiModel)); internal static readonly BossDef[] All = new BossDef[3] { Gojo, Sukuna, Megumi }; internal static float SpawnChance(BossDef b) { if (b != Gojo) { if (b != Sukuna) { return SukunaConfig.MegumiSpawnChance.Value; } return SukunaConfig.SukunaSpawnChance.Value; } return SukunaConfig.GojoSpawnChance.Value; } internal static void TryRegister() { BossDef[] all = All; for (int i = 0; i < all.Length; i++) { all[i].TryRegister(); } } } internal abstract class BossAI : MonoBehaviour { internal static readonly List All = new List(); private static int nextLocalId = 1; internal Enemy enemy; internal BossModel Model; internal bool Dead; protected PhotonView view; protected PlayerAvatar target; protected float aggroTimer; private int localId; private bool dropped; protected Vector3 roamTarget; private float roamTimer; internal int NetId { get { if (!Object.op_Implicit((Object)(object)view) || view.ViewID == 0) { return localId; } return view.ViewID; } } internal Transform HandPoint { get { if (!Object.op_Implicit((Object)(object)Model) || !Object.op_Implicit((Object)(object)Model.Hand)) { return ((Component)this).transform; } return Model.Hand; } } internal bool Aggro => aggroTimer > 0f; protected static bool Host => SemiFunc.IsMasterClientOrSingleplayer(); internal Vector3 Center { get { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)enemy) || !Object.op_Implicit((Object)(object)enemy.CenterTransform)) { return ((Component)this).transform.position + Vector3.up; } return enemy.CenterTransform.position; } } internal float HealthFraction { get { if (!Object.op_Implicit((Object)(object)enemy) || !enemy.HasHealth) { return 1f; } return (float)enemy.Health.healthCurrent / (float)Mathf.Max(1, enemy.Health.health); } } protected bool Busy { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)enemy) && (int)enemy.CurrentState != 11) { return !enemy.EnemyParent.Spawned; } return true; } } internal static BossAI Find(int id) { foreach (BossAI item in All) { if (Object.op_Implicit((Object)(object)item) && item.NetId == id) { return item; } } return null; } internal static T First() where T : BossAI { foreach (BossAI item in All) { if (item is T result) { return result; } } return null; } protected virtual void Awake() { enemy = ((Component)this).GetComponent(); view = ((Component)this).GetComponent(); localId = -(nextLocalId++); All.Add(this); } protected virtual void Start() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown Model = (Object.op_Implicit((Object)(object)((Component)this).transform.parent) ? ((Component)((Component)this).transform.parent).GetComponentInChildren(true) : null); if (Object.op_Implicit((Object)(object)Model)) { Model.Ai = this; } BossHitbox.Add(enemy, Object.op_Implicit((Object)(object)Model) ? ((Component)Model).transform : null, 2.4f, 0.42f); if (enemy.HasStateSpawn && Object.op_Implicit((Object)(object)enemy.StateSpawn)) { enemy.StateSpawn.OnSpawn.AddListener(new UnityAction(SpawnHook)); } if (enemy.HasHealth && Object.op_Implicit((Object)(object)enemy.Health)) { enemy.Health.onHurt.AddListener(new UnityAction(HurtHook)); enemy.Health.onObjectHurt.AddListener(new UnityAction(ObjectHurtHook)); enemy.Health.onDeath.AddListener(new UnityAction(DeathHook)); } if (enemy.HasRigidbody && Object.op_Implicit((Object)(object)enemy.Rigidbody)) { enemy.Rigidbody.onGrabbed.AddListener(new UnityAction(GrabHook)); } if (enemy.HasVision && Object.op_Implicit((Object)(object)enemy.Vision)) { enemy.Vision.onVisionTriggered.AddListener(new UnityAction(VisionHook)); } } protected virtual void OnDestroy() { All.Remove(this); } private void SpawnHook() { if (Host) { dropped = false; Dead = false; if (SemiFunc.EnemySpawn(enemy)) { OnSpawned(); } } } private void HurtHook() { if (Host && !Dead) { PlayerAvatar val = enemy.Health.onObjectHurtPlayer; if (!Object.op_Implicit((Object)(object)val)) { val = NearestPlayer(25f, needSight: false); } Provoke(val); } } private void ObjectHurtHook() { if (Host && !Dead && Object.op_Implicit((Object)(object)enemy.Health.onObjectHurtPlayer)) { Provoke(enemy.Health.onObjectHurtPlayer); } } private void GrabHook() { if (Host && !Dead && Object.op_Implicit((Object)(object)enemy.Rigidbody.onGrabbedPlayerAvatar)) { Provoke(enemy.Rigidbody.onGrabbedPlayerAvatar); } } private void VisionHook() { if (Host && !Dead) { PlayerAvatar onVisionTriggeredPlayer = enemy.Vision.onVisionTriggeredPlayer; if (Object.op_Implicit((Object)(object)onVisionTriggeredPlayer)) { OnSeen(onVisionTriggeredPlayer); } } } private void DeathHook() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (Dead) { return; } Dead = true; OnDied(); if (Host) { Vector3 center = Center; SukunaNet.SendEnemy(Tech.EnemyDefeated, this, center, Vector3.up); if (!dropped) { dropped = true; DropLoot(center); } enemy.EnemyParent.Despawn(); enemy.EnemyParent.DespawnedTimer = 10000000f; } } protected abstract void OnSpawned(); protected abstract void OnSeen(PlayerAvatar p); protected abstract void Provoke(PlayerAvatar who); protected abstract void DropLoot(Vector3 at); protected virtual void OnDied() { } internal abstract void ProvokedFx(Cast c); internal abstract void DefeatedFx(Cast c); protected static bool Valid(PlayerAvatar p) { if (Object.op_Implicit((Object)(object)p) && !p.deadSet) { return !p.isDisabled; } return false; } protected PlayerAvatar NearestPlayer(float range, bool needSight) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar result = null; float num = range; foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (Valid(item)) { float num2 = Vector3.Distance(((Component)item).transform.position, ((Component)this).transform.position); if (!(num2 >= num) && (!needSight || Combat.LineOfSight(((Component)this).transform.position + Vector3.up * 1.6f, BossHits.Center(item)))) { result = item; num = num2; } } } return result; } protected void Roam(float speed) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) enemy.NavMeshAgent.OverrideAgent(speed, 6f, 0.2f); roamTimer -= Time.deltaTime; if (roamTimer <= 0f || Vector3.Distance(((Component)this).transform.position, roamTarget) < 1.5f) { roamTimer = 12f; LevelPoint val = SemiFunc.LevelPointGet(((Component)this).transform.position, 5f, 18f); NavMeshHit val2 = default(NavMeshHit); if (Object.op_Implicit((Object)(object)val) && NavMesh.SamplePosition(((Component)val).transform.position + Random.insideUnitSphere * 2f, ref val2, 4f, -1)) { roamTarget = ((NavMeshHit)(ref val2)).position; } } enemy.NavMeshAgent.SetDestination(roamTarget); } protected void Face(PlayerAvatar p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) Vector3 val = Vector3.zero; if (Object.op_Implicit((Object)(object)p)) { val = ((Component)p).transform.position - ((Component)this).transform.position; } else if (((Vector3)(ref enemy.NavMeshAgent.AgentVelocity)).sqrMagnitude > 0.05f) { val = enemy.NavMeshAgent.AgentVelocity; } val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f)) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Quaternion.LookRotation(val), Time.deltaTime * 8f); } } protected bool TeleportAround(PlayerAvatar p, float distance, Tech tech) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(((Component)p).transform.position + Quaternion.Euler(0f, Random.Range(0f, 360f), 0f) * Vector3.forward * distance, ref val, 4f, -1)) { return false; } enemy.EnemyTeleported(((NavMeshHit)(ref val)).position); SukunaNet.SendEnemy(tech, this, position, ((NavMeshHit)(ref val)).position - position, Vector3.Distance(position, ((NavMeshHit)(ref val)).position)); return true; } protected void Announce() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) SukunaNet.SendEnemy(Tech.EnemyProvoked, this, HandPoint.position, ((Component)this).transform.forward); } } internal static class BossHits { internal static bool LocalTarget(out PlayerAvatar me) { me = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)me) && !me.deadSet && !me.isDisabled) { return Object.op_Implicit((Object)(object)me.playerHealth); } return false; } internal static Vector3 Center(PlayerAvatar p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return ((Component)p).transform.position + Vector3.up * 0.9f; } internal static void Hurt(Cast c, PlayerAvatar me, int damage, Vector3 push, float tumbleTime = 1.5f) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) int num = ((Object.op_Implicit((Object)(object)c.Enemy) && Object.op_Implicit((Object)(object)c.Enemy.enemy)) ? SemiFunc.EnemyGetIndex(c.Enemy.enemy) : (-1)); if (damage > 0) { me.playerHealth.Hurt(damage, true, num, false); } if (((Vector3)(ref push)).sqrMagnitude > 0.01f && Object.op_Implicit((Object)(object)me.tumble)) { me.tumble.TumbleRequest(true, false); me.tumble.TumbleOverrideTime(tumbleTime); me.tumble.TumbleForce(push); } } internal static bool LocalNear(Vector3 p, float radius, bool needSight, out PlayerAvatar me) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!LocalTarget(out me)) { return false; } Vector3 val = Center(me); if (Vector3.Distance(val, p) > radius) { return false; } if (needSight) { return Combat.LineOfSight(p, val); } return true; } internal static bool AnyPlayerNear(Vector3 a, Vector3 b, float radius, out Vector3 at) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (Object.op_Implicit((Object)(object)item) && !item.deadSet && !item.isDisabled) { Vector3 val = Center(item); if (Combat.DistanceToSegment(val, a, b) < radius) { at = val; return true; } } } at = Vector3.zero; return false; } internal static PlayerAvatar NearestPlayer(Vector3 from, float range) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar result = null; float num = range; foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (Object.op_Implicit((Object)(object)item) && !item.deadSet && !item.isDisabled) { float num2 = Vector3.Distance(Center(item), from); if (num2 < num) { num = num2; result = item; } } } return result; } } internal abstract class BossModel : MonoBehaviour { internal BossAI Ai; internal Transform Hand; protected float castTimer; protected float aggroTimer; protected float speed; protected float phase; private Vector3 lastPos; protected bool Fighting => aggroTimer > 0f; internal void SetAggro(float time) { aggroTimer = time; } internal virtual void OnCast() { castTimer = 0.9f; } protected virtual void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Build(); lastPos = ((Component)this).transform.position; } protected abstract void Build(); protected float Step(float dt, out float s) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Vector3 val = (position - lastPos) / dt; lastPos = position; val.y = 0f; speed = Mathf.Lerp(speed, Mathf.Min(((Vector3)(ref val)).magnitude, 6f), dt * 6f); castTimer -= dt; aggroTimer -= dt; float result = Mathf.Clamp01(speed / 2.5f); phase += dt * (3f + speed * 2.2f); s = Mathf.Sin(phase); return result; } protected static void Legs(float walk, float s, Transform legL, Transform legR, Transform kneeL, Transform kneeR) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) legL.localRotation = Quaternion.Euler(s * 28f * walk, 0f, 0f); legR.localRotation = Quaternion.Euler((0f - s) * 28f * walk, 0f, 0f); kneeL.localRotation = Quaternion.Euler((0f - Mathf.Max(0f, 0f - s)) * 35f * walk, 0f, 0f); kneeR.localRotation = Quaternion.Euler((0f - Mathf.Max(0f, s)) * 35f * walk, 0f, 0f); } protected Transform NewRoot(string name, float scale) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject(name).transform; transform.SetParent(((Component)this).transform, false); transform.localPosition = new Vector3(0f, 0.11f, 0f); transform.localScale = Vector3.one * scale; return transform; } protected void Finish(Transform root) { int layer = ((Component)this).gameObject.layer; Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.layer = layer; } Renderer[] componentsInChildren2 = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].shadowCastingMode = (ShadowCastingMode)1; } } internal static Transform Pivot(string name, Transform parent, Vector3 localPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject(name).transform; transform.SetParent(parent, false); transform.localPosition = localPos; return transform; } internal static Transform Limb(string name, Transform parent, Vector3 at, float upperLen, float upperR, Material upperMat, out Transform lower, float lowerLen, float lowerR, Material lowerMat) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_00a4: 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) Transform val = Pivot(name, parent, at); Vfx.Prim((PrimitiveType)1, val, new Vector3(0f, (0f - upperLen) * 0.5f, 0f), new Vector3(upperR * 2f, upperLen * 0.5f, upperR * 2f), Quaternion.identity, upperMat); lower = Pivot(name + " Lower", val, new Vector3(0f, 0f - upperLen, 0f)); Vfx.Prim((PrimitiveType)1, lower, new Vector3(0f, (0f - lowerLen) * 0.5f, 0f), new Vector3(lowerR * 2f, lowerLen * 0.5f, lowerR * 2f), Quaternion.identity, lowerMat); return val; } internal static Light PointLight(Transform parent, Vector3 at, Color c, float range, float intensity) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Light obj = ((Component)Pivot("Glow", parent, at)).gameObject.AddComponent(); obj.type = (LightType)2; obj.color = c; obj.range = range; obj.intensity = intensity; obj.shadows = (LightShadows)0; return obj; } } internal static class Combat { internal enum Impact { None, Light, Medium, Heavy } private static int worldMask = -1; private static int hingeMask = -1; private static int propMask = -1; internal const float DoorHealth = 100f; private static readonly Dictionary doorHealth = new Dictionary(); internal static bool IsHost => SemiFunc.IsMasterClientOrSingleplayer(); internal static int WorldMask { get { if (worldMask == -1) { worldMask = LayerMask.GetMask(new string[2] { "Default", "StaticGrabObject" }); } return worldMask; } } private static int HingeMask { get { if (hingeMask == -1) { hingeMask = LayerMask.GetMask(new string[2] { "PhysGrabObjectHinge", "PhysGrabObject" }); } return hingeMask; } } private static int PropMask { get { if (propMask == -1) { propMask = LayerMask.GetMask(new string[2] { "PhysGrabObject", "PhysGrabObjectCart" }); } return propMask; } } internal static List Enemies() { List list = new List(); EnemyDirector instance = EnemyDirector.instance; if (!Object.op_Implicit((Object)(object)instance) || instance.enemiesSpawned == null) { return list; } foreach (EnemyParent item in instance.enemiesSpawned) { if (Object.op_Implicit((Object)(object)item) && item.Spawned) { Enemy enemy = item.Enemy; if (Object.op_Implicit((Object)(object)enemy) && ((Behaviour)enemy).isActiveAndEnabled && (!enemy.HasHealth || !Object.op_Implicit((Object)(object)enemy.Health) || (!enemy.Health.dead && enemy.Health.healthCurrent > 0))) { list.Add(enemy); } } } return list; } internal static Vector3 Center(Enemy e) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)e.CenterTransform)) { return e.CenterTransform.position; } if (e.HasRigidbody && Object.op_Implicit((Object)(object)e.Rigidbody)) { return ((Component)e.Rigidbody).transform.position; } return ((Component)e).transform.position + Vector3.up; } internal static int MaxHealth(Enemy e) { if (!e.HasHealth || !Object.op_Implicit((Object)(object)e.Health)) { return 100; } return e.Health.health; } internal static bool LineOfSight(Vector3 from, Vector3 to) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return !Physics.Linecast(from, to, WorldMask, (QueryTriggerInteraction)1); } internal static void HurtEnemy(Enemy e, float damage, Vector3 dir, float stun, float knockback, float freeze = 0f) { //IL_00c2: 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_008e: Unknown result type (might be due to invalid IL or missing references) if (IsHost && Object.op_Implicit((Object)(object)e)) { if (stun > 0f && e.HasStateStunned && Object.op_Implicit((Object)(object)e.StateStunned)) { e.StateStunned.Set(stun); } if (freeze > 0f) { e.Freeze(freeze); } if (knockback > 0f && e.HasRigidbody && Object.op_Implicit((Object)(object)e.Rigidbody) && Object.op_Implicit((Object)(object)e.Rigidbody.rb)) { e.Rigidbody.rb.AddForce(((Vector3)(ref dir)).normalized * knockback, (ForceMode)2); } int num = Mathf.RoundToInt(damage); if (num > 0 && e.HasHealth && Object.op_Implicit((Object)(object)e.Health)) { e.Health.Hurt(num, ((Vector3)(ref dir)).normalized); } } } private static void DamageDoors(Collider[] cols, float damage, Vector3 from, HashSet once) { //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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) if (!IsHost || !SukunaConfig.CutDoors.Value) { return; } if (doorHealth.Count > 200) { foreach (PhysGrabHinge item in new List(doorHealth.Keys)) { if (!Object.op_Implicit((Object)(object)item)) { doorHealth.Remove(item); } } } HashSet hashSet = new HashSet(); for (int i = 0; i < cols.Length; i++) { PhysGrabHinge componentInParent = ((Component)cols[i]).GetComponentInParent(); if (!Object.op_Implicit((Object)(object)componentInParent) || componentInParent.dead || componentInParent.broken || !hashSet.Add(componentInParent) || (once != null && !once.Add((Object)(object)componentInParent))) { continue; } float value; float num = (doorHealth.TryGetValue(componentInParent, out value) ? value : 100f) - damage; if (num <= 0f) { doorHealth.Remove(componentInParent); componentInParent.DestroyHinge(); continue; } doorHealth[componentInParent] = num; PhysGrabObject component = ((Component)componentInParent).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.rb) && !component.rb.isKinematic) { Vector3 val = Vector3.ProjectOnPlane(component.rb.worldCenterOfMass - from, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { component.rb.AddForce(((Vector3)(ref val)).normalized * (1.5f + damage * 0.06f), (ForceMode)2); } component.lightBreakImpulse = true; } } } internal static void DamageDoorsSphere(Vector3 center, float radius, float damage, Vector3 from, HashSet once = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) DamageDoors(Physics.OverlapSphere(center, radius, HingeMask, (QueryTriggerInteraction)1), damage, from, once); } internal static void DamageDoorsCapsule(Vector3 a, Vector3 b, float radius, float damage, HashSet once = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) DamageDoors(Physics.OverlapCapsule(a, b, radius, HingeMask, (QueryTriggerInteraction)1), damage, a, once); } internal static void DamageDoorsBox(Vector3 center, Vector3 halfExtents, Quaternion rot, float damage, Vector3 from) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) DamageDoors(Physics.OverlapBox(center, halfExtents, rot, HingeMask, (QueryTriggerInteraction)1), damage, from, null); } private static void HitObjects(Collider[] cols, Impact impact, float force, Vector3 from, Vector3? pushDir, float upward, HashSet once) { //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) if (!IsHost) { return; } bool flag = SukunaConfig.DamageItems.Value && impact != Impact.None; HashSet hashSet = new HashSet(); for (int i = 0; i < cols.Length; i++) { PhysGrabObject componentInParent = ((Component)cols[i]).GetComponentInParent(); if (!Object.op_Implicit((Object)(object)componentInParent) || !Object.op_Implicit((Object)(object)componentInParent.rb) || !hashSet.Add(componentInParent) || Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) || Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) || Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponentInParent()) || IsOurItem(componentInParent) || Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) || (Object.op_Implicit((Object)(object)componentInParent.impactDetector) && componentInParent.impactDetector.isCart) || (Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) && !flag) || (once != null && !once.Add((Object)(object)componentInParent))) { continue; } if (flag) { switch (impact) { case Impact.Light: componentInParent.lightBreakImpulse = true; break; case Impact.Medium: componentInParent.mediumBreakImpulse = true; break; case Impact.Heavy: componentInParent.heavyBreakImpulse = true; break; } } if (!(force <= 0f) && !componentInParent.rb.isKinematic) { Vector3 val = componentInParent.rb.worldCenterOfMass - from; float num = 1f - Mathf.Clamp01(((Vector3)(ref val)).magnitude / 8f) * 0.5f; Vector3 val2 = pushDir ?? val; Vector3 val3 = ((Vector3)(ref val2)).normalized + Vector3.up * upward; val2 = ((Vector3)(ref val3)).normalized; componentInParent.rb.AddForce(val2 * force * num, (ForceMode)2); componentInParent.rb.AddTorque(Random.insideUnitSphere * force * 0.5f, (ForceMode)2); } } } internal static void PullObjects(Vector3 center, float radius, float strength) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_0106: Unknown result type (might be due to invalid IL or missing references) if (!IsHost) { return; } Summon.HurtSphere(center, radius, 4f * SukunaConfig.DamageMultiplier.Value, null); HashSet hashSet = new HashSet(); Collider[] array = Physics.OverlapSphere(center, radius, PropMask, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { PhysGrabObject componentInParent = ((Component)array[i]).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && Object.op_Implicit((Object)(object)componentInParent.rb) && !componentInParent.rb.isKinematic && hashSet.Add(componentInParent) && !Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) && !Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) && !Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponentInParent()) && !IsOurItem(componentInParent) && !Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()) && (SukunaConfig.DamageItems.Value || !Object.op_Implicit((Object)(object)((Component)componentInParent).GetComponent()))) { Vector3 val = center - componentInParent.rb.worldCenterOfMass; componentInParent.rb.AddForce(((Vector3)(ref val)).normalized * Mathf.Min(strength, ((Vector3)(ref val)).magnitude * 2f), (ForceMode)2); } } } internal static bool IsOurItem(PhysGrabObject pgo) { if (!Object.op_Implicit((Object)(object)((Component)pgo).GetComponent()) && !Object.op_Implicit((Object)(object)((Component)pgo).GetComponent())) { return Object.op_Implicit((Object)(object)((Component)pgo).GetComponent()); } return true; } private static float SummonDamage(Impact impact) { return impact switch { Impact.Light => 12f, Impact.Medium => 35f, Impact.Heavy => 90f, _ => 5f, } * SukunaConfig.DamageMultiplier.Value; } internal static void HitObjectsSphere(Vector3 center, float radius, Impact impact, float force, float upward = 0.3f, HashSet once = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) Summon.HurtSphere(center, radius, SummonDamage(impact), once); HitObjects(Physics.OverlapSphere(center, radius, PropMask, (QueryTriggerInteraction)1), impact, force, center, null, upward, once); } internal static void HitObjectsCapsule(Vector3 a, Vector3 b, float radius, Impact impact, float force, HashSet once = null) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Summon.HurtCapsule(a, b, radius, SummonDamage(impact), once); HitObjects(Physics.OverlapCapsule(a, b, radius, PropMask, (QueryTriggerInteraction)1), impact, force, a, b - a, 0.2f, once); } internal static void HitObjectsBox(Vector3 center, Vector3 halfExtents, Quaternion rot, Impact impact, float force, Vector3 from) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Summon.HurtBox(center, halfExtents, rot, SummonDamage(impact)); HitObjects(Physics.OverlapBox(center, halfExtents, rot, PropMask, (QueryTriggerInteraction)1), impact, force, from, null, 0.3f, null); } internal static Vector3 LocalPlayerCenter(out PlayerAvatar me) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) me = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)me)) { return Vector3.zero; } return ((Component)me).transform.position + Vector3.up * 0.9f; } internal static bool CanTakeFriendlyFire(Cast c, out PlayerAvatar me) { me = PlayerAvatar.instance; if (SukunaConfig.FriendlyFire.Value && !c.Local && !c.Hostile && Object.op_Implicit((Object)(object)me) && !me.deadSet) { return Object.op_Implicit((Object)(object)me.playerHealth); } return false; } internal static void HurtLocalPlayer(PlayerAvatar me, int damage) { if (Object.op_Implicit((Object)(object)me) && Object.op_Implicit((Object)(object)me.playerHealth) && damage > 0) { me.playerHealth.Hurt(damage, true, -1, false); } } internal static float DistanceToSegment(Vector3 p, Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < 1E-06f) { return Vector3.Distance(p, a); } float num = Mathf.Clamp01(Vector3.Dot(p - a, val) / sqrMagnitude); return Vector3.Distance(p, a + val * num); } } internal sealed class DebugKeys : MonoBehaviour { private int nextBoss; private int nextPower; private static bool Enabled => SukunaConfig.TestKeys.Value; private void Update() { //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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) if (!Enabled) { return; } Keyboard current = Keyboard.current; PlayerAvatar instance = PlayerAvatar.instance; if (current == null || !Object.op_Implicit((Object)(object)instance) || !SemiFunc.NoTextInputsActive()) { return; } if (((ButtonControl)current.f8Key).wasPressedThisFrame) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { Hud.Notice("F8 only works for the host", 2f); return; } int num = Mathf.Min(SukunaConfig.MaxFingers.Value, Fingers.Get(instance) + 1); Fingers.SetHost(instance.steamID, num); Powers.Grant(instance, Powers.Kind.Sukuna); SukunaNet.SendFingerEvent(Tech.FingerEaten, instance, num, ((Component)instance).transform.position + Vector3.up); } if (((ButtonControl)current.f7Key).wasPressedThisFrame) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { Hud.Notice("F7 only works for the host", 2f); return; } if (!Object.op_Implicit((Object)(object)FingerItem.Item)) { Hud.Notice("Cursed Finger item isn't registered (see the log)", 3f); return; } Transform val = ((Object.op_Implicit((Object)(object)GameDirector.instance) && Object.op_Implicit((Object)(object)GameDirector.instance.MainCamera)) ? ((Component)GameDirector.instance.MainCamera).transform : ((Component)instance).transform); Items.SpawnItem(FingerItem.Item, val.position + val.forward * 1.2f, Quaternion.identity); } if (((ButtonControl)current.f6Key).wasPressedThisFrame) { if (Object.op_Implicit((Object)(object)SukunaController.Instance)) { SukunaController.Instance.DebugRefill(); } if (Object.op_Implicit((Object)(object)GojoController.Instance)) { GojoController.Instance.DebugRefill(); } if (Object.op_Implicit((Object)(object)MegumiController.Instance)) { MegumiController.Instance.DebugRefill(); } Hud.Notice("Cursed energy refilled", 1.5f); } if (((ButtonControl)current.f9Key).wasPressedThisFrame) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { Hud.Notice("F9 only works for the host", 2f); return; } BossDef bossDef = Bosses.All[nextBoss % Bosses.All.Length]; nextBoss++; if (!Object.op_Implicit((Object)(object)bossDef.Setup)) { Hud.Notice(bossDef.Name + " isn't registered (see the log)", 3f); return; } Vector3 val2 = Vector3.ProjectOnPlane(((Component)instance).transform.forward, Vector3.up); Vector3 normalized = ((Vector3)(ref val2)).normalized; if (bossDef.Spawn(((Component)instance).transform.position + normalized * 8f)) { Hud.Notice(bossDef.Name + " appears", 2f); } else { Hud.Notice(bossDef.Name + " couldn't be spawned", 2f); } } if (((ButtonControl)current.f10Key).wasPressedThisFrame) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { Hud.Notice("F10 only works for the host", 2f); return; } bool flag = nextPower++ % 2 == 0; Powers.Grant(instance, flag ? Powers.Kind.Gojo : Powers.Kind.Megumi); SukunaNet.SendFingerEvent(flag ? Tech.BlindfoldWorn : Tech.TalismanUsed, instance, Fingers.Get(instance), ((Component)instance).transform.position + Vector3.up); } } } internal static class FingerItem { internal static readonly RuntimeItem Runtime = new RuntimeItem(new ItemSpec { AssetName = "Item Cursed Finger", DisplayName = "Cursed Finger", Description = "One of the twenty fingers of Ryomen Sukuna, the King of Curses. Eat it to inherit his cursed techniques.", IconResource = "finger_icon.png", ValueMax = 25000f, ColliderSize = new Vector3(0.085f, 0.08f, 0.32000002f), BuildModel = BuildModel, Behaviour = typeof(CursedFingerItem) }); internal static Item Item => Runtime.Item; internal static Texture2D IconTexture => Runtime.Icon; internal static void TryRegister() { Runtime.Spec.ValueMax = (float)SukunaConfig.ShopPrice.Value * 250f; Runtime.TryRegister(); } private static void BuildModel(Transform parent, Vector3 center, Material baseMat, int layer) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown Mesh mesh = ItemFactory.ToMesh(FingerModel.BuildMesh(), "Cursed Finger"); Texture2D tex = ItemFactory.ToTexture(FingerModel.BuildTexture(), 256, "Cursed Finger"); Material mat = ItemFactory.ModelMaterial(baseMat, tex, new Color(0.025f, 0.004f, 0.004f), "Cursed Finger"); GameObject val = ItemFactory.ModelObject("Cursed Finger Model", parent, center, mesh, mat, layer); ItemFactory.SmallGlow(val.transform, new Color(0.8f, 0.05f, 0.05f), 0.4f, 1.3f, layer); GameObject val2 = new GameObject("Cursed Aura") { layer = layer }; val2.transform.SetParent(val.transform, false); Vfx.MakeAura(val2, 0.05f, 0.18f, 0.24000001f); } } internal static class SukunaConfigDefaults { internal const float FingerValue = 25000f; } public class CursedFingerItem : MonoBehaviour { private ItemToggle toggle; private ItemAttributes attributes; private PhysGrabObject physGrabObject; private bool used; private float rejectCooldown; private void Awake() { ItemFactory.GiveOwnIcon((Component)(object)this, FingerItem.Runtime); } private void Start() { toggle = ((Component)this).GetComponent(); attributes = ((Component)this).GetComponent(); physGrabObject = ((Component)this).GetComponent(); NotValuableObject component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.hasHealth = false; } } private void Update() { //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) if (rejectCooldown > 0f) { rejectCooldown -= Time.deltaTime; } if (used || !Object.op_Implicit((Object)(object)toggle) || !toggle.toggleState || SemiFunc.RunIsShop() || RunManager.instance.levelIsShop || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } PlayerAvatar val = SemiFunc.PlayerAvatarGetFromPhotonID(toggle.playerTogglePhotonID); if (!Object.op_Implicit((Object)(object)val)) { return; } int num = Fingers.Get(val); if (num >= SukunaConfig.MaxFingers.Value) { toggle.ToggleItem(false, -1); if (rejectCooldown <= 0f) { rejectCooldown = 1f; SukunaNet.SendFingerEvent(Tech.FingerRejected, val, num, ((Component)this).transform.position); } return; } used = true; num++; Fingers.SetHost(val.steamID, num); Powers.Grant(val, Powers.Kind.Sukuna); if (Object.op_Implicit((Object)(object)attributes) && !string.IsNullOrEmpty(attributes.instanceName)) { StatsManager.instance.ItemRemove(attributes.instanceName); } toggle.ToggleDisable(true); SukunaNet.SendFingerEvent(Tech.FingerEaten, val, num, ((Component)this).transform.position); physGrabObject.DestroyPhysGrabObject(); } } internal sealed class PlayerStat { internal readonly string DictKey; private readonly string displayName; private Dictionary Dict { get { StatsManager instance = StatsManager.instance; if (!Object.op_Implicit((Object)(object)instance)) { return null; } EnsureRegistered(); if (!instance.dictionaryOfDictionaries.TryGetValue(DictKey, out var value)) { return null; } return value; } } internal PlayerStat(string dictKey, string displayName) { DictKey = dictKey; this.displayName = displayName; } internal void EnsureRegistered() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown StatsManager instance = StatsManager.instance; if (Object.op_Implicit((Object)(object)instance) && !instance.dictionaryOfDictionaries.ContainsKey(DictKey)) { instance.dictionaryOfDictionaries.Add(DictKey, new Dictionary()); if (!instance.stripTheseDictionaries.ContainsKey(DictKey)) { instance.stripTheseDictionaries.Add(DictKey, 0); } if (!instance.upgradesInfo.ContainsKey(DictKey)) { instance.upgradesInfo.Add(DictKey, new UpgradeInfo { displayName = displayName }); } } } internal int Get(string steamID) { if (string.IsNullOrEmpty(steamID)) { return 0; } Dictionary dict = Dict; if (dict == null || !dict.TryGetValue(steamID, out var value)) { return 0; } return value; } internal void SetHost(string steamID, int value) { value = Mathf.Max(0, value); if (Object.op_Implicit((Object)(object)PunManager.instance)) { PunManager.instance.UpdateStat(DictKey, steamID, value); } else { SetLocal(steamID, value); } } internal void SetLocal(string steamID, int value) { Dictionary dict = Dict; if (dict != null && !string.IsNullOrEmpty(steamID)) { if (value <= 0) { dict.Remove(steamID); } else { dict[steamID] = value; } } } } internal static class Fingers { internal static readonly PlayerStat Stat = new PlayerStat("playerUpgradeSukunaFingers", "Sukuna's Fingers"); internal static void EnsureRegistered() { Stat.EnsureRegistered(); } internal static int Get(string steamID) { return Stat.Get(steamID); } internal static int Get(PlayerAvatar player) { if (!Object.op_Implicit((Object)(object)player)) { return 0; } return Stat.Get(player.steamID); } internal static void SetHost(string steamID, int value) { Stat.SetHost(steamID, value); } internal static void SetLocal(string steamID, int value) { Stat.SetLocal(steamID, value); } } internal static class Blindfold { internal static readonly PlayerStat Stat = new PlayerStat("playerUpgradeGojoBlindfold", "Gojo's Blindfold"); internal static int Get(PlayerAvatar player) { if (!Object.op_Implicit((Object)(object)player)) { return 0; } return Stat.Get(player.steamID); } } internal static class Shadows { internal static readonly PlayerStat Stat = new PlayerStat("playerUpgradeMegumiShadows", "Ten Shadows"); internal static int Get(PlayerAvatar player) { if (!Object.op_Implicit((Object)(object)player)) { return 0; } return Stat.Get(player.steamID); } } internal static class Powers { internal enum Kind { Sukuna, Gojo, Megumi } internal static bool IsGojo(PlayerAvatar p) { return Blindfold.Get(p) > 0; } internal static bool IsMegumi(PlayerAvatar p) { if (!IsGojo(p)) { return Shadows.Get(p) > 0; } return false; } internal static bool IsSukuna(PlayerAvatar p) { if (!IsGojo(p) && !IsMegumi(p)) { return Fingers.Get(p) > 0; } return false; } internal static void Grant(PlayerAvatar p, Kind kind) { if (Object.op_Implicit((Object)(object)p)) { SetIfChanged(Blindfold.Stat, p, (kind == Kind.Gojo) ? 1 : 0); SetIfChanged(Shadows.Stat, p, (kind == Kind.Megumi) ? 1 : 0); } } private static void SetIfChanged(PlayerStat stat, PlayerAvatar p, int value) { if (stat.Get(p.steamID) != value) { stat.SetHost(p.steamID, value); } } internal static void EnsureRegistered() { Fingers.Stat.EnsureRegistered(); Blindfold.Stat.EnsureRegistered(); Shadows.Stat.EnsureRegistered(); } } [HarmonyPatch(typeof(StatsManager), "Start")] internal static class StatsManagerStartPatch { private static void Postfix() { Powers.EnsureRegistered(); } } [HarmonyPatch(typeof(ShopManager), "GetAllItemsFromStatsManager")] internal static class ShopPatch { private static bool Remove(ShopManager shop, Item item) { if (!Object.op_Implicit((Object)(object)item)) { return false; } bool flag = shop.potentialItems.RemoveAll((Item i) => (Object)(object)i == (Object)(object)item) > 0; flag |= shop.potentialItemConsumables.RemoveAll((Item i) => (Object)(object)i == (Object)(object)item) > 0; flag |= shop.potentialItemUpgrades.RemoveAll((Item i) => (Object)(object)i == (Object)(object)item) > 0; flag |= shop.potentialItemHealthPacks.RemoveAll((Item i) => (Object)(object)i == (Object)(object)item) > 0; foreach (List value in shop.potentialSecretItems.Values) { flag |= value.RemoveAll((Item i) => (Object)(object)i == (Object)(object)item) > 0; } return flag; } private static void Postfix(ShopManager __instance) { if (!SemiFunc.IsNotMasterClient()) { Remove(__instance, BandanaItem.Item); Remove(__instance, TalismanItem.Item); Item item = FingerItem.Item; if (Object.op_Implicit((Object)(object)item) && Remove(__instance, item) && Random.value < SukunaConfig.ShopChance.Value) { __instance.potentialItemHealthPacks.Add(item); } } } } internal static class Fuga { private static readonly Dictionary charging = new Dictionary(); internal static void Charge(Cast c) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) StopCharge(c.Key); if (!c.Local) { GameObject val = new GameObject("Fuga Charge"); FollowHand followHand = val.AddComponent(); followHand.Target = c.Caster; if (c.Hostile) { followHand.Anchor = c.Enemy.HandPoint; } ((Component)Vfx.Emitter("Fuga Charge Flames", val.transform.position, val.transform, Vfx.FireMat, Vfx.FireYellow, Vfx.FireOrange, 50f, 0.6f, 0.22f, 0.45f, 0.12f, -0.4f, (ParticleSystemShapeType)0)).transform.localPosition = Vector3.zero; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = Vfx.FireOrange; obj.range = 5f; obj.intensity = 2.5f; Object.Destroy((Object)(object)val, 3f); charging[c.Key] = val; Sfx.Play(SfxId.FireCharge, c.Origin, 0.7f); } } internal static void StopCharge(Object p) { if (Object.op_Implicit(p) && charging.TryGetValue(p, out var value)) { charging.Remove(p); if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } } } internal static void Fire(Cast c) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) StopCharge(c.Key); Sfx.Play(SfxId.FireLaunch, c.Origin); Vfx.LightFlash(c.Origin, Vfx.FireOrange, 5f, 7f, 0.3f); GameObject val = new GameObject("Fuga Arrow"); val.transform.SetPositionAndRotation(c.Origin, Quaternion.LookRotation(c.Dir)); val.AddComponent().Init(c); } } internal sealed class FollowHand : MonoBehaviour { internal PlayerAvatar Target; internal Transform Anchor; private void LateUpdate() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Anchor)) { ((Component)this).transform.position = Anchor.position; return; } if (!Object.op_Implicit((Object)(object)Target)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Transform transform = ((Component)Target).transform; ((Component)this).transform.position = transform.position + Vector3.up * 1.15f + transform.forward * 0.55f + transform.right * 0.25f; } } internal sealed class FugaArrow : MonoBehaviour { private Cast c; private const float Speed = 34f; private const float Range = 55f; private float traveled; private LineRenderer core; private LineRenderer glow; private ParticleSystem trail; private bool exploded; internal void Init(Cast cast) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0156: Unknown result type (might be due to invalid IL or missing references) c = cast; core = Vfx.Line("Fuga Core", 2, 0.12f, new Color(1f, 0.95f, 0.8f)); glow = Vfx.Line("Fuga Glow", 2, 0.45f, new Color(1f, 0.45f, 0.08f, 0.55f)); ((Component)core).transform.SetParent(((Component)this).transform, false); ((Component)glow).transform.SetParent(((Component)this).transform, false); AnimationCurve widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.2f), new Keyframe(0.8f, 1f), new Keyframe(1f, 0.3f) }); core.widthCurve = widthCurve; glow.widthCurve = widthCurve; trail = Vfx.Emitter("Fuga Trail", ((Component)this).transform.position, ((Component)this).transform, Vfx.FireMat, Vfx.FireYellow, Vfx.FireOrange, 90f, 0.5f, 0.35f, 0.5f, 0.08f, -0.3f, (ParticleSystemShapeType)0); Light obj = ((Component)this).gameObject.AddComponent(); obj.type = (LightType)2; obj.color = Vfx.FireOrange; obj.range = 8f; obj.intensity = 4f; obj.shadows = (LightShadows)0; } private void Update() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_00ba: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) if (exploded) { return; } Vector3 position = ((Component)this).transform.position; float num = 34f * Time.deltaTime; RaycastHit val = default(RaycastHit); bool flag = Physics.SphereCast(position, 0.15f, c.Dir, ref val, num, Combat.WorldMask, (QueryTriggerInteraction)1); Vector3 val2 = (flag ? (((RaycastHit)(ref val)).point - c.Dir * 0.2f) : (position + c.Dir * num)); if (c.Hostile) { if (traveled > 1.5f && BossHits.AnyPlayerNear(position, val2, 1.1f, out var at)) { Explode(at - c.Dir * 0.3f); return; } } else { foreach (Enemy item in Combat.Enemies()) { Vector3 val3 = Combat.Center(item); if (Combat.DistanceToSegment(val3, position, val2) < 1.1f) { Explode(val3 - c.Dir * 0.3f); return; } } } ((Component)this).transform.position = val2; traveled += Vector3.Distance(position, val2); Vector3 val4 = val2; Vector3 val5 = val2 - c.Dir * 1.6f; core.SetPosition(0, val5); core.SetPosition(1, val4); glow.SetPosition(0, val5 - c.Dir * 0.3f); glow.SetPosition(1, val4 + c.Dir * 0.15f); if (flag || traveled >= 55f) { Explode(val2); } } private void Explode(Vector3 at) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: 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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) exploded = true; float num = 5.5f + 0.05f * (float)c.Fingers; Vfx.Explosion(at, 1.5f + 0.03f * (float)c.Fingers); Vfx.Burst(at, Vfx.FireYellow, Vfx.FireOrange, 60, 10f, 0.5f, 0.9f, -0.1f, Vfx.FireMat, 0.6f); Vfx.LightFlash(at, Vfx.FireOrange, 12f, num * 3f, 1.2f); Vfx.Shake(at, 10f, 0.7f); Sfx.Play(SfxId.Boom, at); GameObject val = new GameObject("Fuga Flames"); val.transform.position = at; val.AddComponent().Init(c, num * 0.75f); if (c.Hostile && BossHits.LocalNear(at, num * 0.8f, needSight: false, out var me)) { Vector3 val2 = BossHits.Center(me) - at; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < 2f || Combat.LineOfSight(at + Vector3.up * 0.2f, BossHits.Center(me))) { BossHits.Hurt(c, me, Mathf.RoundToInt(45f * (1f - 0.5f * magnitude / num)), (((Vector3)(ref val2)).normalized + Vector3.up * 0.6f) * 16f, 2f); } } if (!c.Hostile) { foreach (Enemy item in Combat.Enemies()) { Vector3 val3 = Combat.Center(item); Vector3 val4 = val3 - at; float magnitude2 = ((Vector3)(ref val4)).magnitude; if (!(magnitude2 > num) && (!(magnitude2 > 2f) || Combat.LineOfSight(at + Vector3.up * 0.2f, val3))) { Vfx.Burst(val3, Vfx.FireYellow, Vfx.FireOrange, 12, 3f, 0.3f, 0.6f, -0.2f, Vfx.FireMat, 0.3f); if (Combat.IsHost) { float num2 = 1f - 0.5f * magnitude2 / num; float damage = 140f * c.Power * num2; Vector3 val5 = ((Vector3)(ref val4)).normalized + Vector3.up * 0.5f; Combat.HurtEnemy(item, damage, ((Vector3)(ref val5)).normalized, 3f, 10f * num2); } } } } if (Combat.IsHost) { Combat.DamageDoorsSphere(at, num * 0.7f, 80f, at); Combat.HitObjectsSphere(at, num, Combat.Impact.Heavy, 9f, 0.6f); } if (Combat.CanTakeFriendlyFire(c, out var me2)) { PlayerAvatar me3; float num3 = Vector3.Distance(Combat.LocalPlayerCenter(out me3), at); if (num3 < num * 0.8f) { Combat.HurtLocalPlayer(me2, Mathf.RoundToInt(35f * (1f - 0.5f * num3 / num))); } } Vfx.StopEmitter(trail); Object.Destroy((Object)(object)((Component)core).gameObject); Object.Destroy((Object)(object)((Component)glow).gameObject); Object.Destroy((Object)(object)((Component)this).gameObject); } } internal sealed class FireField : MonoBehaviour { private Cast c; private float radius; private float life = 4.5f; private float t; private float tick; private ParticleSystem flames; private ParticleSystem embers; private Light glow; internal void Init(Cast cast, float r) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) c = cast; radius = r; Vector3 val = ((Component)this).transform.position; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 0.5f, Vector3.down, ref val2, 4f, Combat.WorldMask, (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val2)).point; } ((Component)this).transform.position = val; flames = Vfx.Emitter("Fuga Ground Fire", val, ((Component)this).transform, Vfx.FireMat, Vfx.FireYellow, Vfx.FireOrange, 110f, 1.6f, 0.7f, 0.8f, r, -0.3f, (ParticleSystemShapeType)0); ((Component)flames).transform.rotation = Quaternion.LookRotation(Vector3.up); ShapeModule shape = flames.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(r * 1.6f, r * 1.6f, 0.1f); embers = Vfx.Emitter("Fuga Embers", val, ((Component)this).transform, Vfx.GlowMat, Vfx.FireYellow, Vfx.Red, 35f, 2.5f, 0.06f, 1.4f, r * 0.8f, -0.3f, (ParticleSystemShapeType)0); glow = ((Component)this).gameObject.AddComponent(); glow.type = (LightType)2; glow.color = Vfx.FireOrange; glow.range = r * 2.5f; glow.intensity = 3f; glow.shadows = (LightShadows)0; } private void Update() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) t += Time.deltaTime; glow.intensity = (3f + Mathf.PerlinNoise(t * 6f, 0.3f) * 1.5f) * Mathf.Clamp01((life - t) / 1f); tick -= Time.deltaTime; if (tick <= 0f && t < life) { tick = 0.5f; Vector3 val; if (c.Hostile && BossHits.LocalTarget(out var me)) { val = Vector3.ProjectOnPlane(((Component)me).transform.position - ((Component)this).transform.position, Vector3.up); if (((Vector3)(ref val)).magnitude < radius && Mathf.Abs(((Component)me).transform.position.y - ((Component)this).transform.position.y) < 2f) { BossHits.Hurt(c, me, 4, Vector3.zero); } } if (!c.Hostile) { foreach (Enemy item in Combat.Enemies()) { Vector3 val2 = Combat.Center(item); Vector3 val3 = Vector3.ProjectOnPlane(val2 - ((Component)this).transform.position, Vector3.up); if (!(((Vector3)(ref val3)).magnitude > radius) && !(Mathf.Abs(val2.y - ((Component)this).transform.position.y) > 2.5f)) { Combat.HurtEnemy(item, 10f * c.Power, Vector3.up, 0.3f, 0f); } } } if (Combat.CanTakeFriendlyFire(c, out var me2)) { val = Vector3.ProjectOnPlane(((Component)me2).transform.position - ((Component)this).transform.position, Vector3.up); if (((Vector3)(ref val)).magnitude < radius && Mathf.Abs(((Component)me2).transform.position.y - ((Component)this).transform.position.y) < 2f) { Combat.HurtLocalPlayer(me2, 3); } } } if (t >= life) { Vfx.StopEmitter(flames, 1.2f); Vfx.StopEmitter(embers, 1.6f); Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal sealed class GojoController : MonoBehaviour, IPowerHud { internal const float PurpleChargeTime = 1.2f; internal static GojoController Instance; internal bool HudVisible; internal float Energy = 300f; internal bool InfinityOn; internal bool SixEyesOn; internal float PurpleCharge = -1f; private readonly Dictionary cooldowns = new Dictionary(); private LevelGenerator level; private float infinityPulse; private float rctTimer; bool IPowerHud.HudVisible => HudVisible; string IPowerHud.CountText => "GOJO"; Texture IPowerHud.Icon => (Texture)(object)BandanaItem.IconTexture; Color IPowerHud.Accent => GojoStats.Blue; float IPowerHud.Energy => Energy; float IPowerHud.MaxEnergy => 300f; string IPowerHud.EnergyTag { get { if (!InfinityOn) { return ""; } return "INFINITY"; } } bool IPowerHud.EnergyPulse => InfinityOn; TechInfo[] IPowerHud.Techs => TechInfo.Gojo; int IPowerHud.UnlockLevel => 1; bool IPowerHud.IsActive(TechInfo t) { return IsActive(t); } float IPowerHud.Cooldown(TechInfo t) { return Cooldown(t); } float IPowerHud.CostOf(TechInfo t) { return Cost(t); } private void Awake() { Instance = this; } internal float Cooldown(TechInfo t) { if (!cooldowns.TryGetValue(t, out var value)) { return 0f; } return Mathf.Max(0f, value); } internal bool IsActive(TechInfo t) { if ((t != TechInfo.Purple || !(PurpleCharge >= 0f)) && (t != TechInfo.Infinity || !InfinityOn)) { if (t == TechInfo.SixEyes) { return SixEyesOn; } return false; } return true; } private float Cost(TechInfo t) { if (t != TechInfo.SixEyes && t != TechInfo.Infinity) { return t.Cost * (SixEyesOn ? 0.5f : 1f); } return t.Cost; } internal void OnBlindfoldWorn() { Energy = 300f; cooldowns.Clear(); } internal void DebugRefill() { Energy = 300f; cooldowns.Clear(); } internal bool TryAbsorb(int damage) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (!HudVisible || !InfinityOn || damage <= 0) { return false; } if (Energy < (float)damage) { InfinityOn = false; return false; } Energy -= damage; Hud.Flash(new Color(0.6f, 0.85f, 1f, 0.25f), 0.2f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance)) { Vfx.Burst(((Component)instance).transform.position + Vector3.up, GojoStats.BlueCore, GojoStats.Blue, 12, 2f, 0.1f, 0.3f, 0f, Vfx.GlowMat, 0.6f); } return true; } private void Update() { try { Tick(); } catch (Exception ex) { Plugin.Log.LogError((object)("Gojo controller error: " + ex)); Cancel(notify: false); } } private void Tick() { //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; bool flag = Object.op_Implicit((Object)(object)instance) && Powers.IsGojo(instance) && SukunaController.TechniquesAllowedHere(); HudVisible = flag && !instance.deadSet; if (!flag) { Cancel(notify: false); InfinityOn = (SixEyesOn = false); return; } float deltaTime = Time.deltaTime; if ((Object)(object)LevelGenerator.Instance != (Object)(object)level) { level = LevelGenerator.Instance; Energy = 300f; cooldowns.Clear(); InfinityOn = (SixEyesOn = false); } foreach (TechInfo item in new List(cooldowns.Keys)) { cooldowns[item] -= deltaTime; } float num = (InfinityOn ? TechInfo.Infinity.Cost : 0f) + (SixEyesOn ? TechInfo.SixEyes.Cost : 0f); Energy = Mathf.Clamp(Energy + (14f * SukunaConfig.CursedEnergyRegenMultiplier.Value - num) * deltaTime, 0f, 300f); if (Energy <= 0f) { InfinityOn = (SixEyesOn = false); } if (InfinityOn) { infinityPulse -= deltaTime; if (infinityPulse <= 0f) { infinityPulse = 0.4f; SukunaNet.Send(Tech.GojoInfinity, instance, ((Component)instance).transform.position + Vector3.up, Vector3.up, 0); } } PlayerHealth playerHealth = instance.playerHealth; if (Object.op_Implicit((Object)(object)playerHealth) && playerHealth.health > 0 && playerHealth.health < playerHealth.maxHealth && Energy > 150f) { rctTimer -= deltaTime; if (rctTimer <= 0f) { rctTimer = 2.5f; Energy -= 10f; playerHealth.Heal(5, false); } } if (instance.deadSet || instance.isDisabled || !SemiFunc.NoTextInputsActive() || (Object.op_Implicit((Object)(object)MenuManager.instance) && Object.op_Implicit((Object)(object)MenuManager.instance.currentMenuPage)) || (Object.op_Implicit((Object)(object)PlayerController.instance) && PlayerController.instance.InputDisableTimer > 0f) || Keyboard.current == null) { Cancel(notify: true); return; } HandleBlue(instance); HandleRed(instance); HandleBlink(instance); HandlePurple(instance, deltaTime); HandleToggles(); HandleVoid(instance); } private static bool Pressed(TechInfo t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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) Key value = t.Key.Value; if ((int)value == 0) { return false; } try { return ((ButtonControl)Keyboard.current[value]).wasPressedThisFrame; } catch { return false; } } private static bool Held(TechInfo t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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) Key value = t.Key.Value; if ((int)value == 0) { return false; } try { return ((ButtonControl)Keyboard.current[value]).isPressed; } catch { return false; } } private static bool Aim(out Vector3 origin, out Vector3 dir) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Camera val = (Object.op_Implicit((Object)(object)GameDirector.instance) ? GameDirector.instance.MainCamera : null); if (!Object.op_Implicit((Object)(object)val)) { val = Camera.main; } if (!Object.op_Implicit((Object)(object)val)) { origin = (dir = Vector3.zero); return false; } origin = ((Component)val).transform.position; dir = ((Component)val).transform.forward; return true; } private bool CanStart(TechInfo t) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (Cooldown(t) > 0f) { return false; } if (Energy < Cost(t)) { Hud.Flash(new Color(0f, 0.1f, 0.3f, 0.25f), 0.15f); return false; } return true; } private void Spend(TechInfo t) { Energy -= Cost(t); cooldowns[t] = t.Cooldown; } private void HandleBlue(PlayerAvatar me) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) TechInfo blue = TechInfo.Blue; if (Pressed(blue) && CanStart(blue) && Aim(out var origin, out var dir)) { float extra = 14f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(origin, dir, ref val, 14f, Combat.WorldMask, (QueryTriggerInteraction)1)) { extra = Mathf.Max(1.5f, ((RaycastHit)(ref val)).distance - 0.6f); } Spend(blue); SukunaNet.Send(Tech.GojoBlue, me, origin + dir * 0.5f, dir, 0, extra); } } private void HandleRed(PlayerAvatar me) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) TechInfo red = TechInfo.Red; if (Pressed(red) && CanStart(red) && Aim(out var origin, out var dir)) { Spend(red); SukunaNet.Send(Tech.GojoRed, me, origin + dir * 0.3f, dir, 0); } } private void HandleBlink(PlayerAvatar me) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) TechInfo blink = TechInfo.Blink; if (!Pressed(blink) || !CanStart(blink) || !Aim(out var origin, out var dir)) { return; } PlayerController instance = PlayerController.instance; if (!Object.op_Implicit((Object)(object)instance)) { return; } Vector3 val = Vector3.ProjectOnPlane(dir, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 0.01f) { return; } Vector3 position = ((Component)instance).transform.position; float num = 12f; RaycastHit val2 = default(RaycastHit); if (Physics.SphereCast(origin, 0.35f, dir, ref val2, 12f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num = Mathf.Max(0f, ((RaycastHit)(ref val2)).distance - 0.5f); } RaycastHit val3 = default(RaycastHit); if (!Physics.Raycast(origin + dir * num + Vector3.up * 0.3f, Vector3.down, ref val3, 4f, Combat.WorldMask, (QueryTriggerInteraction)1)) { return; } Vector3 val4 = ((RaycastHit)(ref val3)).point + Vector3.up * 0.05f; if (!(Vector3.Distance(position, val4) < 1f)) { Spend(blink); ((Component)instance).transform.position = val4; if (Object.op_Implicit((Object)(object)instance.rb)) { instance.rb.position = val4; instance.rb.linearVelocity = Vector3.zero; } SukunaNet.Send(Tech.GojoBlink, me, position, val4 - position, 0, Vector3.Distance(position, val4)); } } private void HandlePurple(PlayerAvatar me, float dt) { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00a8: 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_00b3: 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) TechInfo purple = TechInfo.Purple; if (PurpleCharge < 0f) { if (Pressed(purple) && CanStart(purple) && Aim(out var origin, out var dir)) { PurpleCharge = 0f; SukunaNet.Send(Tech.GojoPurpleCharge, me, origin + dir * 0.8f, dir, 0); } return; } if (Held(purple)) { PurpleCharge += dt; return; } if (PurpleCharge >= 1.2f && Energy >= Cost(purple) && Aim(out var origin2, out var dir2)) { Spend(purple); SukunaNet.Send(Tech.GojoPurple, me, origin2 + dir2 * 1.2f, dir2, 0); } else { SukunaNet.Send(Tech.ChargeCancel, me, ((Component)me).transform.position, Vector3.up, 0); } PurpleCharge = -1f; } private void HandleToggles() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (Pressed(TechInfo.Infinity)) { InfinityOn = !InfinityOn && Energy > 10f; infinityPulse = 0f; Sfx.Play(SfxId.Heal, ((Component)PlayerAvatar.instance).transform.position, InfinityOn ? 0.6f : 0.3f); } if (Pressed(TechInfo.SixEyes)) { SixEyesOn = !SixEyesOn && Energy > 5f; if (SixEyesOn) { Hud.Flash(new Color(0.6f, 0.85f, 1f, 0.2f), 0.3f); } } } private void HandleVoid(PlayerAvatar me) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) TechInfo t = TechInfo.Void; if (Pressed(t) && CanStart(t) && Aim(out var _, out var dir)) { Spend(t); SukunaNet.Send(Tech.GojoVoid, me, ((Component)me).transform.position + Vector3.up, dir, 0); } } private void Cancel(bool notify) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (PurpleCharge >= 0f && notify && Object.op_Implicit((Object)(object)instance)) { SukunaNet.Send(Tech.ChargeCancel, instance, ((Component)instance).transform.position, Vector3.up, 0); } PurpleCharge = -1f; } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] internal static class InfinityPatch { private static bool Prefix(PlayerHealth __instance, int damage) { PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance) || (Object)(object)instance.playerHealth != (Object)(object)__instance || !Object.op_Implicit((Object)(object)GojoController.Instance)) { return true; } return !GojoController.Instance.TryAbsorb(damage); } } internal sealed class GojoEnemyAI : BossAI { private enum State { Spawn, Roam, Watch, Fight, Charging, Dead } private State state; private float stateTimer; private float attackTimer; private float teleportTimer; private float infinityDown; private float noSightTimer; private float redCd; private float blueCd; private float purpleCd; private float voidCd; private float strikeCd; private PlayerAvatar watched; protected override void OnSpawned() { SetState(State.Spawn); } protected override void OnSeen(PlayerAvatar p) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (!base.Aggro && Vector3.Distance(((Component)p).transform.position, ((Component)this).transform.position) < 6f) { watched = p; if (state == State.Roam) { SetState(State.Watch); } } } protected override void OnDied() { state = State.Dead; } protected override void DropLoot(Vector3 at) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)BandanaItem.Item)) { Items.SpawnItem(BandanaItem.Item, at + Vector3.up * 0.3f, Quaternion.identity); } } protected override void Provoke(PlayerAvatar who) { bool num = !base.Aggro; aggroTimer = 45f; if (Object.op_Implicit((Object)(object)who)) { target = who; } if (num) { attackTimer = 1.2f; Announce(); } if (state != State.Charging && state != State.Dead) { SetState(State.Fight); } } private void SetState(State s) { state = s; stateTimer = 0f; } private void Update() { if (!BossAI.Host || !Object.op_Implicit((Object)(object)enemy) || state == State.Dead) { return; } float deltaTime = Time.deltaTime; stateTimer += deltaTime; aggroTimer -= deltaTime; attackTimer -= deltaTime; teleportTimer -= deltaTime; infinityDown -= deltaTime; redCd -= deltaTime; blueCd -= deltaTime; purpleCd -= deltaTime; voidCd -= deltaTime; strikeCd -= deltaTime; if (base.Busy) { return; } if (infinityDown <= 0f && !enemy.IsStunned() && enemy.HasHealth) { enemy.Health.OverrideDamageResistance(0.5f, 0.25f); } if (enemy.IsStunned()) { enemy.NavMeshAgent.Stop(0.2f); return; } switch (state) { case State.Spawn: if (stateTimer > 2f) { SetState((!base.Aggro) ? State.Roam : State.Fight); } break; case State.Roam: if (base.Aggro) { SetState(State.Fight); } else { Roam(1.6f); } break; case State.Watch: Watch(); break; case State.Fight: Fight(); break; case State.Charging: Charging(); break; } Face((state == State.Fight || state == State.Charging) ? target : ((state == State.Watch) ? watched : null)); } private void Watch() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (base.Aggro) { SetState(State.Fight); return; } enemy.NavMeshAgent.Stop(0.2f); if (!Object.op_Implicit((Object)(object)watched) || stateTimer > 4f || Vector3.Distance(((Component)watched).transform.position, ((Component)this).transform.position) > 9f) { watched = null; SetState(State.Roam); } } private void Fight() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: 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_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) if (!base.Aggro) { target = null; SetState(State.Roam); return; } if (!BossAI.Valid(target)) { target = NearestPlayer(30f, needSight: false); } if (!Object.op_Implicit((Object)(object)target)) { return; } Vector3 center = base.Center; Vector3 val = BossHits.Center(target); float num = Vector3.Distance(center, val); bool flag = Combat.LineOfSight(center, val); noSightTimer = (flag ? 0f : (noSightTimer + Time.deltaTime)); if (teleportTimer <= 0f && (num > 16f || noSightTimer > 3f)) { teleportTimer = 5f; if (TeleportAround(target, 6f, Tech.EnemyTeleport)) { attackTimer = Mathf.Max(attackTimer, 0.6f); } return; } enemy.NavMeshAgent.OverrideAgent(3.2f, 12f, 0.2f); Vector3 val2; if (num > 9f) { enemy.NavMeshAgent.SetDestination(((Component)target).transform.position); } else if (num < 3.5f && strikeCd > 0f) { Vector3 position = ((Component)this).transform.position; val2 = ((Component)this).transform.position - ((Component)target).transform.position; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(position + ((Vector3)(ref val2)).normalized * 4f, ref val3, 3f, -1)) { enemy.NavMeshAgent.SetDestination(((NavMeshHit)(ref val3)).position); } } else { enemy.NavMeshAgent.Stop(0.2f); } if (!(attackTimer > 0f)) { float healthFraction = base.HealthFraction; Vector3 position2 = base.HandPoint.position; val2 = val - position2; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (num < 3.2f && strikeCd <= 0f) { strikeCd = 1.5f; attackTimer = 1f; val2 = val - center; SukunaNet.SendEnemy(Tech.EnemyStrike, this, center, ((Vector3)(ref val2)).normalized); } else if (healthFraction < 0.35f && voidCd <= 0f && num < 9f) { voidCd = 60f; attackTimer = 1.2f; infinityDown = 4f; SukunaNet.SendEnemy(Tech.EnemyVoid, this, center, normalized); } else if (healthFraction < 0.5f && purpleCd <= 0f && flag) { purpleCd = 22f; SukunaNet.SendEnemy(Tech.EnemyPurpleCharge, this, position2, normalized); SetState(State.Charging); } else if (flag && num < 14f && redCd <= 0f && (blueCd > 0f || Random.value < 0.55f)) { redCd = 4f; attackTimer = 1.4f; SukunaNet.SendEnemy(Tech.EnemyRed, this, position2, normalized); } else if (flag && num < 16f && blueCd <= 0f) { blueCd = 6f; attackTimer = 1.6f; SukunaNet.SendEnemy(Tech.EnemyFirst, this, position2, normalized, Mathf.Max(1.5f, num - 2.8f)); } } } private void Charging() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) enemy.NavMeshAgent.Stop(0.2f); if (!(stateTimer < 1.4f)) { if (BossAI.Valid(target)) { Vector3 position = base.HandPoint.position; Vector3 val = BossHits.Center(target) - position; Vector3 normalized = ((Vector3)(ref val)).normalized; SukunaNet.SendEnemy(Tech.EnemyPurple, this, position + normalized * 1f, normalized); infinityDown = 5f; } attackTimer = 2f; SetState(State.Fight); } } internal override void ProvokedFx(Cast c) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Model)) { Model.SetAggro(45f); } Vfx.Burst(c.Origin, GojoStats.BlueCore, GojoStats.Blue, 30, 4f, 0.15f, 0.8f, 0f, Vfx.GlowMat, 0.6f); Sfx.Play(SfxId.Domain, c.Origin, 0.4f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && Vector3.Distance(((Component)instance).transform.position, c.Origin) < 25f) { Hud.Banner("SATORU GOJO", "\"I alone am the honored one.\"", GojoStats.Blue, 3f); } } internal override void DefeatedFx(Cast c) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) state = State.Dead; Vfx.Burst(c.Origin, GojoStats.BlueCore, GojoStats.Purple, 60, 6f, 0.2f, 1.2f, -0.1f, Vfx.GlowMat, 0.6f); Vfx.LightFlash(c.Origin, GojoStats.Blue, 8f, 12f, 1f); Vfx.Shake(c.Origin, 6f, 0.6f); Sfx.Play(SfxId.Boom, c.Origin, 0.7f); Hud.Banner("SATORU GOJO DEFEATED", "His blindfold lies where he fell", GojoStats.Blue, 4f); } } internal sealed class GojoModel : BossModel { private Transform hips; private Transform chest; private Transform head; private Transform legL; private Transform legR; private Transform kneeL; private Transform kneeR; private Transform armL; private Transform armR; private Transform elbowL; private Transform elbowR; protected override void Build() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) Transform val = NewRoot("Gojo Model", 1.12f); Dictionary dictionary = RigFactory.Spawn("gojo", val); hips = dictionary["Hips"]; chest = dictionary["Chest"]; head = dictionary["Head"]; legL = dictionary["Leg L"]; legR = dictionary["Leg R"]; kneeL = dictionary["Leg L Lower"]; kneeR = dictionary["Leg R Lower"]; armL = dictionary["Arm L"]; armR = dictionary["Arm R"]; elbowL = dictionary["Arm L Lower"]; elbowR = dictionary["Arm R Lower"]; Hand = dictionary["Hand Point"]; BossModel.PointLight(chest, new Vector3(0f, 0.4f, 0.5f), new Color(0.45f, 0.7f, 1f), 3.5f, 1.3f); Finish(val); } private void LateUpdate() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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) //IL_00ae: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(Time.deltaTime, 0.0001f); float s; float num2 = Step(num, out s); BossModel.Legs(num2, s, legL, legR, kneeL, kneeR); hips.localPosition = new Vector3(0f, 1f + Mathf.Abs(s) * 0.03f * num2, 0f); bool fighting = base.Fighting; Quaternion val = Quaternion.Euler(10f, 0f, 12f); Quaternion val2 = Quaternion.Euler(10f, 0f, -12f); Quaternion val3 = Quaternion.Euler(-40f, 0f, 15f); Quaternion val4 = Quaternion.Euler(-30f, 0f, -10f); Quaternion val5 = Quaternion.Euler((0f - s) * 18f * num2, 0f, 0f); Quaternion val6 = Quaternion.Euler(s * 18f * num2, 0f, 0f); armL.localRotation = Quaternion.Slerp(armL.localRotation, (fighting ? val3 : val) * val5, num * 8f); Quaternion val7 = ((castTimer > 0f) ? Quaternion.Euler(-90f, 0f, 0f) : ((fighting ? val4 : val2) * val6)); armR.localRotation = Quaternion.Slerp(armR.localRotation, val7, num * ((castTimer > 0f) ? 18f : 8f)); elbowL.localRotation = Quaternion.Slerp(elbowL.localRotation, Quaternion.Euler(fighting ? (-60f) : (-25f), 0f, 0f), num * 8f); elbowR.localRotation = Quaternion.Slerp(elbowR.localRotation, Quaternion.Euler((castTimer > 0f) ? 0f : (fighting ? (-50f) : (-25f)), 0f, 0f), num * 10f); head.localRotation = Quaternion.Euler(fighting ? 5f : (-3f), Mathf.Sin(Time.time * 0.4f) * (fighting ? 0f : 10f), 0f); } } internal static class GojoStats { internal const float MaxEnergy = 300f; internal const float Regen = 14f; internal static readonly Color Blue = new Color(0.25f, 0.55f, 1f); internal static readonly Color BlueCore = new Color(0.8f, 0.92f, 1f); internal static readonly Color Red = new Color(1f, 0.12f, 0.1f); internal static readonly Color RedCore = new Color(1f, 0.8f, 0.75f); internal static readonly Color Purple = new Color(0.6f, 0.15f, 1f); internal static readonly Color PurpleCore = new Color(0.95f, 0.8f, 1f); internal static float Power => 2f * SukunaConfig.DamageMultiplier.Value; } internal sealed class BlueOrb : MonoBehaviour { private Cast c; private Vector3 target; private GameObject orb; private ParticleSystem inward; private bool pulling; private float t; private float tick; private float pullTime; private const float Radius = 6f; internal static void Run(Cast c) { //IL_0003: 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) Sfx.Play(SfxId.Chant, c.Origin, 0.6f); new GameObject("Blue").AddComponent().Init(c); } private void Init(Cast cast) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) c = cast; float num = Mathf.Max(1.5f, c.Extra); target = c.Origin + c.Dir * num; pullTime = (c.Hostile ? 2.2f : 2.6f); orb = Vfx.Orb("Blue Orb", c.Origin, 0.2f, GojoStats.BlueCore, GojoStats.Blue, 3f); orb.transform.SetParent(((Component)this).transform, true); } private void Update() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; if (!pulling) { orb.transform.position = Vector3.MoveTowards(orb.transform.position, target, 22f * deltaTime); Vector3 val = orb.transform.position - target; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { StartPull(); } return; } t += deltaTime; float num = Mathf.Clamp01(t / pullTime); orb.transform.localScale = Vector3.one * (1f + 0.9f * Mathf.Sin(num * MathF.PI * 0.5f)); tick -= deltaTime; if (tick <= 0f) { tick = 0.25f; Pull(); } if (t >= pullTime) { Collapse(); } } private void StartPull() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) pulling = true; inward = Vfx.Emitter("Blue Inward", target, ((Component)this).transform, Vfx.GlowMat, GojoStats.BlueCore, GojoStats.Blue, 90f, -9f, 0.12f, 0.5f, 4.2f, 0f, (ParticleSystemShapeType)0); Vfx.Shockwave(target, Vector3.up, 6f, 0.08f, GojoStats.Blue, 0.6f); Sfx.Play(SfxId.Domain, target, 0.35f); } private void Pull() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 dir = target - Combat.Center(item); if (!(((Vector3)(ref dir)).magnitude > 6f)) { Combat.HurtEnemy(item, 7f * GojoStats.Power, dir, 0.6f, Mathf.Min(4f, ((Vector3)(ref dir)).magnitude * 1.2f)); } } Combat.PullObjects(target, 6f, 4f); } else if (BossHits.LocalTarget(out me)) { Vector3 val = target - BossHits.Center(me); if (((Vector3)(ref val)).magnitude < 6f && Combat.LineOfSight(target, BossHits.Center(me))) { BossHits.Hurt(c, me, 2, ((Vector3)(ref val)).normalized * 5f, 0.6f); } } } private void Collapse() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_011c: 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) Vfx.Burst(target, GojoStats.BlueCore, GojoStats.Blue, 40, 6f, 0.2f, 0.6f, 0f, Vfx.GlowMat, 0.3f); Vfx.LightFlash(target, GojoStats.Blue, 6f, 10f, 0.4f); Vfx.Shake(target, 4f); Sfx.Play(SfxId.BlackFlash, target, 0.6f); PlayerAvatar me; if (!c.Hostile && Combat.IsHost) { foreach (Enemy item in Combat.Enemies()) { if (Vector3.Distance(Combat.Center(item), target) < 2.5f) { Combat.HurtEnemy(item, 30f * GojoStats.Power, Random.onUnitSphere, 1.5f, 2f); } } Combat.HitObjectsSphere(target, 2.5f, Combat.Impact.Medium, 2f); Combat.DamageDoorsSphere(target, 2.5f, 50f, target); } else if (c.Hostile && BossHits.LocalTarget(out me) && Vector3.Distance(BossHits.Center(me), target) < 2.5f) { BossHits.Hurt(c, me, 15, Vector3.up * 6f); } Vfx.StopEmitter(inward, 0.6f); Object.Destroy((Object)(object)((Component)this).gameObject); } } internal static class RedBlast { private const float Range = 13f; private const float HalfAngle = 40f; internal static void Run(Cast c) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: 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_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) GameObject orb = Vfx.Orb("Red Orb", c.Origin + c.Dir * (c.Local ? 1.6f : 0.6f), 0.15f, GojoStats.RedCore, GojoStats.Red, 4f); Vfx.Animate(orb, 0.25f, delegate(float k) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) orb.transform.localScale = Vector3.one * (1f + 1.2f * k) * (1f - k * k); }); for (int num = 0; num < 3; num++) { Vfx.Shockwave(c.Origin + c.Dir * (1.5f + (float)num * 3f), c.Dir, 2f + (float)num * 1.8f, 0.12f, GojoStats.Red, 0.45f + (float)num * 0.1f); } Vfx.Burst(c.Origin + c.Dir * 2f, GojoStats.RedCore, GojoStats.Red, 50, 16f, 0.2f, 0.5f, 0f, Vfx.GlowMat, 0.4f); Vfx.LightFlash(c.Origin + c.Dir * 2f, GojoStats.Red, 8f, 14f, 0.4f); Vfx.Shake(c.Origin, 6f, 0.4f); Sfx.Play(SfxId.FireLaunch, c.Origin, 0.8f); Sfx.Play(SfxId.BlackFlash, c.Origin, 0.7f); PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item) - c.Origin; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > 13f) && (!(magnitude > 2.5f) || !(Vector3.Angle(c.Dir, val) > 40f)) && (!(magnitude > 2.5f) || Combat.LineOfSight(c.Origin, Combat.Center(item)))) { Combat.HurtEnemy(item, 55f * GojoStats.Power * (1f - 0.4f * magnitude / 13f), val + Vector3.up * 0.3f * magnitude, 2f, 18f); } } Combat.DamageDoorsSphere(c.Origin + c.Dir * 4f, 4f, 60f, c.Origin); Combat.HitObjectsSphere(c.Origin + c.Dir * 5f, 5f, Combat.Impact.Heavy, 12f); } else if (BossHits.LocalTarget(out me)) { Vector3 val2 = BossHits.Center(me) - c.Origin; float magnitude2 = ((Vector3)(ref val2)).magnitude; if (magnitude2 < 13f && (magnitude2 < 2.5f || Vector3.Angle(c.Dir, val2) < 40f) && Combat.LineOfSight(c.Origin, BossHits.Center(me))) { BossHits.Hurt(c, me, 25, (((Vector3)(ref val2)).normalized + Vector3.up * 0.4f) * 20f, 2f); } } } } internal static class HollowPurple { private static readonly Dictionary charging = new Dictionary(); internal static void Charge(Cast c) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00b4: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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) Object key = (Object)(object)(c.Hostile ? c.Enemy : ((BossAI)(object)c.Caster)); StopCharge(key); GameObject go = new GameObject("Purple Charge"); Transform follow = (c.Hostile ? c.Enemy.HandPoint : ((Component)c.Caster).transform); go.transform.position = c.Origin; GameObject blue = Vfx.Orb("Blue", c.Origin, 0.16f, GojoStats.BlueCore, GojoStats.Blue, 2f); GameObject red = Vfx.Orb("Red", c.Origin, 0.16f, GojoStats.RedCore, GojoStats.Red, 2f); blue.transform.SetParent(go.transform, true); red.transform.SetParent(go.transform, true); bool local = c.Local; Vfx.Animate(go, c.Hostile ? 1.6f : 4f, delegate(float k) { //IL_00a1: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_008f: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)follow)) { Vector3 position = (c.Hostile ? follow.position : ((local && Object.op_Implicit((Object)(object)Camera.main)) ? (((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 0.8f) : (follow.position + Vector3.up * 1.3f + follow.forward * 0.6f))); go.transform.position = position; } float num = Mathf.Lerp(0.9f, 0.05f, Mathf.Clamp01(k * (c.Hostile ? 1f : 2.6f))); Vector3 val = (Object.op_Implicit((Object)(object)follow) ? follow.right : Vector3.right); if (local && Object.op_Implicit((Object)(object)Camera.main)) { val = ((Component)Camera.main).transform.right; } blue.transform.position = go.transform.position - val * num; red.transform.position = go.transform.position + val * num; }); charging[key] = go; Sfx.Play(SfxId.Chant, c.Origin, 0.8f); } internal static void StopCharge(Object key) { if (Object.op_Implicit(key) && charging.TryGetValue(key, out var value)) { charging.Remove(key); if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } } } internal static void Fire(Cast c) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) StopCharge((Object)(object)(c.Hostile ? c.Enemy : ((BossAI)(object)c.Caster))); if (c.Local || (Object.op_Implicit((Object)(object)c.Caster) && Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Vector3.Distance(c.Origin, ((Component)PlayerAvatar.instance).transform.position) < 20f)) { Hud.Banner("HOLLOW PURPLE", "", GojoStats.Purple, 1.6f); } else if (c.Hostile && Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Vector3.Distance(c.Origin, ((Component)PlayerAvatar.instance).transform.position) < 30f) { Hud.Banner("HOLLOW PURPLE", "", GojoStats.Purple, 1.6f); } Sfx.Play(SfxId.Tear, c.Origin); Sfx.Play(SfxId.Boom, c.Origin, 0.6f); Vfx.LightFlash(c.Origin, GojoStats.Purple, 10f, 20f, 0.6f); Vfx.Shake(c.Origin, 10f, 0.7f); new GameObject("Hollow Purple").AddComponent().Init(c); } } internal sealed class PurpleSphere : MonoBehaviour { private Cast c; private GameObject orb; private ParticleSystem trail; private float traveled; private float markAt; private bool hitLocal; private readonly HashSet hit = new HashSet(); private readonly HashSet hitObjects = new HashSet(); private const float Speed = 24f; private const float Range = 55f; private const float HitRadius = 2.4f; internal void Init(Cast cast) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0084: Unknown result type (might be due to invalid IL or missing references) c = cast; ((Component)this).transform.position = c.Origin; orb = Vfx.Orb("Purple Orb", c.Origin, 0.9f, GojoStats.PurpleCore, GojoStats.Purple, 6f); orb.transform.SetParent(((Component)this).transform, true); trail = Vfx.Emitter("Purple Trail", c.Origin, ((Component)this).transform, Vfx.GlowMat, GojoStats.PurpleCore, GojoStats.Purple, 120f, 1.5f, 0.6f, 0.7f, 0.8f, 0f, (ParticleSystemShapeType)0); } private void Update() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: 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_0204: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Vector3 val = position + c.Dir * 24f * Time.deltaTime; ((Component)this).transform.position = val; traveled += Vector3.Distance(position, val); PlayerAvatar me; if (!c.Hostile) { if (Combat.IsHost) { foreach (Enemy item in Combat.Enemies()) { if (!hit.Contains(item) && !(Combat.DistanceToSegment(Combat.Center(item), position, val) > 2.4f)) { hit.Add(item); Combat.HurtEnemy(item, 450f * GojoStats.Power, c.Dir, 3f, 12f); } } Combat.DamageDoorsCapsule(position, val, 2.4f, 100f, hitObjects); Combat.HitObjectsCapsule(position, val, 2.4f, Combat.Impact.Heavy, 8f, hitObjects); } } else if (!hitLocal && BossHits.LocalTarget(out me) && Combat.DistanceToSegment(BossHits.Center(me), position, val) < 2.2f) { hitLocal = true; BossHits.Hurt(c, me, 70, (c.Dir + Vector3.up * 0.5f) * 25f, 2.5f); } if (traveled >= markAt) { markAt += 1.5f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, 2.2f, Combat.WorldMask, (QueryTriggerInteraction)1)) { Vfx.CutMark(((RaycastHit)(ref val2)).point, ((RaycastHit)(ref val2)).normal, c.Dir, 1.8f, 10f); } } if (traveled >= 55f) { Vfx.Burst(val, GojoStats.PurpleCore, GojoStats.Purple, 50, 8f, 0.4f, 0.8f, 0f, Vfx.GlowMat, 0.8f); Vfx.StopEmitter(trail, 1f); Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal static class InfinityPulse { internal static void Run(Cast c) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) GameObject shell = Vfx.Orb("Infinity", c.Origin, 0.55f, new Color(0.7f, 0.85f, 1f, 0.05f), new Color(0.5f, 0.75f, 1f, 0.12f), 0f); Vfx.Animate(shell, 0.45f, delegate(float k) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) shell.transform.localScale = Vector3.one * (1f + 0.3f * k); }); if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item) - c.Origin; if (!(((Vector3)(ref val)).magnitude > 2.6f)) { Combat.HurtEnemy(item, 0f, val + Vector3.up * 0.2f, 0.3f, 5f); } } } } internal static class Blink { internal static void Run(Cast c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) Vector3 val = c.Origin + c.Dir * c.Extra; Vector3[] array = (Vector3[])(object)new Vector3[2] { c.Origin, val }; foreach (Vector3 val2 in array) { Vfx.Burst(val2 + Vector3.up, GojoStats.BlueCore, GojoStats.Blue, 18, 3f, 0.12f, 0.4f, 0f, Vfx.GlowMat, 0.5f); Vfx.LightFlash(val2 + Vector3.up, GojoStats.Blue, 2.5f, 5f, 0.25f); } Sfx.Play(SfxId.Slash, c.Origin, 0.4f); Sfx.Play(SfxId.Heal, val, 0.5f); } } internal sealed class VoidDomain : MonoBehaviour { internal static readonly List Active = new List(); private Cast c; private float radius; private float duration; private float t; private float tick; private Material shell; private ParticleSystem stars; private LineRenderer ring; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Unlimited Void").AddComponent().Init(c); } internal static bool LocalTrapped() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } foreach (VoidDomain item in Active) { if (Object.op_Implicit((Object)(object)item) && item.c.Hostile && item.Contains(BossHits.Center(instance))) { return true; } } return false; } internal static bool LocalInside() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } foreach (VoidDomain item in Active) { if (Object.op_Implicit((Object)(object)item) && item.Contains(BossHits.Center(instance))) { return true; } } return false; } private bool Contains(Vector3 p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (t < duration) { return Vector3.Distance(p, ((Component)this).transform.position) < radius; } return false; } private void Init(Cast cast) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008f: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00ba: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) c = cast; Active.Add(this); radius = (c.Hostile ? 10f : 11f); duration = (c.Hostile ? 3.5f : 7f); ((Component)this).transform.position = c.Origin; shell = new Material(Vfx.Unlit(new Color(0.01f, 0.01f, 0.04f, 0.9f))); Vfx.MeshObject("Void Dome", Vfx.InsideSphere, shell, c.Origin, Quaternion.identity, Vector3.one * radius * 2f).transform.SetParent(((Component)this).transform, true); ((Object)Vfx.Prim((PrimitiveType)0, ((Component)this).transform, Vector3.zero, Vector3.one * radius * 2f, Quaternion.identity, shell)).name = "Void Shell"; stars = Vfx.Emitter("Void Stars", c.Origin, ((Component)this).transform, Vfx.GlowMat, Color.white, new Color(0.6f, 0.75f, 1f), 260f, 0.25f, 0.07f, 3f, radius * 0.95f, 0f, (ParticleSystemShapeType)0); ring = Vfx.Line("Void Ring", 73, 0.08f, new Color(0.7f, 0.85f, 1f)); ((Component)ring).transform.SetParent(((Component)this).transform, false); ring.loop = true; for (int i = 0; i < 73; i++) { float num = (float)i / 72f * MathF.PI * 2f; ring.SetPosition(i, c.Origin + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * radius); } Sfx.Play(SfxId.Domain, c.Origin); Vfx.Shake(c.Origin, 5f, 1f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && (c.Local || Vector3.Distance(((Component)instance).transform.position, c.Origin) < radius * 2f)) { Hud.Banner("DOMAIN EXPANSION", "Unlimited Void", GojoStats.Blue, 3f); } } private void Update() { //IL_006c: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) t += Time.deltaTime; float num = Mathf.Clamp01(t / 0.4f) * Mathf.Clamp01((duration + 0.8f - t) / 0.8f); if (Object.op_Implicit((Object)(object)shell)) { shell.color = new Color(0.01f, 0.01f, 0.04f, 0.9f * num); } if (Object.op_Implicit((Object)(object)ring)) { LineRenderer obj = ring; LineRenderer obj2 = ring; Color val = default(Color); ((Color)(ref val))..ctor(0.7f, 0.85f, 1f, num); obj2.endColor = val; obj.startColor = val; } tick -= Time.deltaTime; if (t < duration && tick <= 0f) { tick = 0.3f; PlayerAvatar me; if (!c.Hostile) { Summon.FreezeSphere(((Component)this).transform.position, radius, 0.45f); if (Combat.IsHost) { foreach (Enemy item in Combat.Enemies()) { if (Contains(Combat.Center(item))) { if (item.HasStateStunned && Object.op_Implicit((Object)(object)item.StateStunned)) { item.StateStunned.Set(1.2f); } item.Freeze(0.4f); } } } } else if (BossHits.LocalTarget(out me) && Contains(BossHits.Center(me)) && Object.op_Implicit((Object)(object)InputManager.instance)) { InputManager.instance.DisableMovement(0.45f); InputManager.instance.DisableAiming(0.45f); } } if (t >= duration + 0.8f) { Vfx.StopEmitter(stars, 1f); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { Active.Remove(this); if (Object.op_Implicit((Object)(object)shell)) { Object.Destroy((Object)(object)shell); } } } internal static class GojoStrike { internal static void Run(Cast c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00ba: 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_00c9: 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_00d8: Unknown result type (might be due to invalid IL or missing references) Vector3 val = c.Origin + c.Dir * 1.2f; Vfx.Burst(val, Color.white, GojoStats.Blue, 20, 6f, 0.15f, 0.35f, 0f, Vfx.GlowMat, 0.2f); Vfx.Shockwave(val, c.Dir, 1.2f, 0.06f, GojoStats.BlueCore, 0.25f); Sfx.Play(SfxId.HeavySlash, val, 0.9f); if (BossHits.LocalTarget(out var me)) { Vector3 val2 = BossHits.Center(me) - c.Origin; if (((Vector3)(ref val2)).magnitude < 3.2f && Vector3.Angle(c.Dir, val2) < 70f) { BossHits.Hurt(c, me, 20, (((Vector3)(ref val2)).normalized + Vector3.up * 0.5f) * 14f, 1.2f); } } } } internal sealed class Hud : MonoBehaviour { private sealed class BannerMsg { public string Title; public string Sub; public Color Color; public float Start; public float Duration; } private sealed class FlashMsg { public Color Color; public float Start; public float Duration; } private sealed class NoticeMsg { public string Text; public float Start; public float Duration; } private static BannerMsg banner; private static readonly List flashes = new List(); private static readonly List notices = new List(); private static float worldCutStart = -100f; private static readonly string[] ChantLines = new string[3] { "Scale of the Dragon", "Recoil", "Twin Meteors" }; private static Texture2D white; private static Texture2D vignette; private GUIStyle titleStyle; private GUIStyle subStyle; private GUIStyle countStyle; private GUIStyle rowRightStyle; private GUIStyle smallRightStyle; private GUIStyle badgeStyle; private GUIStyle chantStyle; private GUIStyle noticeStyle; private int stylesFor = -1; private static readonly Vector3[] corners = (Vector3[])(object)new Vector3[4]; internal static Rect GameScreenRect() { //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) Rect result = default(Rect); ((Rect)(ref result))..ctor(0f, 0f, (float)Screen.width, (float)Screen.height); RenderTextureMain instance = RenderTextureMain.instance; if (Object.op_Implicit((Object)(object)instance)) { Transform transform = ((Component)instance).transform; RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null); if (val != null) { Canvas val2 = ((Component)val).GetComponentInParent(); if (Object.op_Implicit((Object)(object)val2)) { val2 = val2.rootCanvas; } Camera obj = ((Object.op_Implicit((Object)(object)val2) && (int)val2.renderMode != 0) ? val2.worldCamera : null); val.GetWorldCorners(corners); Vector2 val3 = RectTransformUtility.WorldToScreenPoint(obj, corners[0]); Vector2 val4 = RectTransformUtility.WorldToScreenPoint(obj, corners[2]); Rect result2 = Rect.MinMaxRect(Mathf.Max(0f, Mathf.Min(val3.x, val4.x)), Mathf.Max(0f, Mathf.Min(val3.y, val4.y)), Mathf.Min((float)Screen.width, Mathf.Max(val3.x, val4.x)), Mathf.Min((float)Screen.height, Mathf.Max(val3.y, val4.y))); if (((Rect)(ref result2)).width > (float)Screen.width * 0.3f && ((Rect)(ref result2)).height > (float)Screen.height * 0.3f) { return result2; } RenderTexture renderTexture = instance.renderTexture; if (Object.op_Implicit((Object)(object)renderTexture) && ((Texture)renderTexture).height > 0) { float num = Mathf.Min((float)Screen.width, (float)(Screen.height * ((Texture)renderTexture).width) / (float)((Texture)renderTexture).height); return new Rect(((float)Screen.width - num) * 0.5f, 0f, num, (float)Screen.height); } } } return result; } internal static void Banner(string title, string sub, Color color, float duration) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) banner = new BannerMsg { Title = title, Sub = sub, Color = color, Start = Time.unscaledTime, Duration = duration }; } internal static void Flash(Color color, float duration) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) flashes.Add(new FlashMsg { Color = color, Start = Time.unscaledTime, Duration = duration }); } internal static void Notice(string text, float duration) { notices.Add(new NoticeMsg { Text = text, Start = Time.unscaledTime, Duration = duration }); if (notices.Count > 4) { notices.RemoveAt(0); } } internal static void WorldCut() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) worldCutStart = Time.unscaledTime; Flash(new Color(1f, 1f, 1f, 0.55f), 0.35f); } private void OnGUI() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 if ((int)Event.current.type == 7) { EnsureTextures(); float s = Mathf.Max(0.5f, (float)Screen.height / 1080f); EnsureStyles(s); float unscaledTime = Time.unscaledTime; GUI.depth = -50; DrawOverlays(s, unscaledTime); IPowerHud current = PowerHud.Current; if (current != null && SukunaConfig.ShowHud.Value && !SukunaPanel.Active) { DrawPanel(current, s); } if (Object.op_Implicit((Object)(object)SukunaController.Instance)) { DrawCharge(SukunaController.Instance, s); } if (Object.op_Implicit((Object)(object)GojoController.Instance)) { DrawGojo(GojoController.Instance, s); } if (Object.op_Implicit((Object)(object)MegumiController.Instance)) { DrawMegumi(MegumiController.Instance, s); } DrawBanner(s, unscaledTime); DrawNotices(s, unscaledTime); } } private void DrawOverlays(float s, float now) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: 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_0207: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) if (ShrineDomain.LocalInside()) { float num = 0.5f + 0.05f * Mathf.Sin(now * 7f); GUI.color = new Color(0.65f, 0f, 0.03f, num); GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)vignette); } if (VoidDomain.LocalTrapped()) { GUI.color = new Color(0.01f, 0.01f, 0.05f, 0.82f); GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)white); Random random = new Random(Mathf.FloorToInt(now * 6f)); for (int i = 0; i < 90; i++) { float num2 = (float)random.NextDouble() * (float)Screen.width; float num3 = (float)random.NextDouble() * (float)Screen.height; float num4 = (1f + (float)random.NextDouble() * 3f) * s; GUI.color = new Color(0.8f, 0.9f, 1f, 0.4f + 0.6f * (float)random.NextDouble()); GUI.DrawTexture(new Rect(num2, num3, num4, num4), (Texture)(object)white); } Text(new Rect(0f, (float)Screen.height * 0.45f, (float)Screen.width, 40f * s), "Infinite information floods your mind...", subStyle, new Color(0.8f, 0.9f, 1f, 0.9f)); } else if (VoidDomain.LocalInside()) { GUI.color = new Color(0.1f, 0.2f, 0.5f, 0.35f); GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)vignette); } if (ShadowGarden.LocalInside()) { GUI.color = new Color(0.03f, 0.02f, 0.08f, 0.6f + 0.05f * Mathf.Sin(now * 3f)); GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)vignette); } for (int num5 = flashes.Count - 1; num5 >= 0; num5--) { FlashMsg flashMsg = flashes[num5]; float num6 = (now - flashMsg.Start) / flashMsg.Duration; if (num6 >= 1f) { flashes.RemoveAt(num5); } else { Color color = flashMsg.Color; color.a *= 1f - num6; GUI.color = color; GUI.DrawTexture(new Rect(0f, 0f, (float)Screen.width, (float)Screen.height), (Texture)(object)white); } } float num7 = (now - worldCutStart) / 0.7f; if (num7 >= 0f && num7 < 1f) { float num8 = 1f - num7; float num9 = (float)Screen.width * 0.5f; GUI.color = new Color(1f, 0.85f, 0.85f, 0.3f * num8); GUI.DrawTexture(new Rect(num9 - 22f * s, 0f, 44f * s, (float)Screen.height), (Texture)(object)white); GUI.color = new Color(0f, 0f, 0f, num8); GUI.DrawTexture(new Rect(num9 - 3f * s, 0f, 6f * s, (float)Screen.height), (Texture)(object)white); } GUI.color = Color.white; } private void DrawPanel(IPowerHud ctl, float s) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0133: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027c: 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_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_0507: 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) TechInfo[] techs = ctl.Techs; float num = 300f * s; float num2 = 30f * s; float num3 = 24f * s; float num4 = (82f + (float)techs.Length * 30f) * s; Rect val = GameScreenRect(); float num5 = ((Rect)(ref val)).xMax - 34f * s; float num6 = (float)Screen.height - ((Rect)(ref val)).center.y - num4 * 0.5f; if (Object.op_Implicit((Object)(object)ctl.Icon)) { GUI.color = Color.white; GUI.DrawTexture(new Rect(num5 - 46f * s, num6, 46f * s, 46f * s), ctl.Icon); } string text = Regex.Replace(ctl.CountText, "<[^>]+>", ""); Text(new Rect(num5 - 52f * s - 200f * s, num6, 200f * s, 46f * s), text, countStyle, Color.Lerp(ctl.Accent, Color.white, 0.3f)); float num7 = 190f * s; float num8 = num6 + 58f * s; GUI.color = new Color(0.05f, 0.02f, 0.02f, 0.75f); GUI.DrawTexture(new Rect(num5 - num7, num8, num7, 5f * s), (Texture)(object)white); float num9 = ((ctl.MaxEnergy > 0f) ? Mathf.Clamp01(ctl.Energy / ctl.MaxEnergy) : 0f); Color val2 = ctl.Accent; if (ctl.EnergyPulse) { val2 = Color.Lerp(val2, val2 * 0.2f, 0.5f + 0.5f * Mathf.Sin(Time.unscaledTime * 10f)); } val2.a = 1f; GUI.color = val2; GUI.DrawTexture(new Rect(num5 - num7, num8, num7 * num9, 5f * s), (Texture)(object)white); string text2 = ((ctl.EnergyTag.Length > 0) ? (ctl.EnergyTag + " ") : "") + Mathf.FloorToInt(ctl.Energy); Text(new Rect(num5 - num7 - 98f * s, num8 - 8f * s, 90f * s, 20f * s), text2, smallRightStyle, Color.Lerp(ctl.Accent, Color.white, 0.6f)); float num10 = num6 + 82f * s; TechInfo[] array = techs; Color color = default(Color); Color color2 = default(Color); Rect val3 = default(Rect); foreach (TechInfo techInfo in array) { bool flag = techInfo.Unlocked(ctl.UnlockLevel); float num11 = 0f; if (!flag) { ((Color)(ref color))..ctor(0.65f, 0.55f, 0.55f, 0.3f); ((Color)(ref color2))..ctor(0.1f, 0f, 0f, 0.25f); } else if (ctl.IsActive(techInfo)) { color = Color.Lerp(ctl.Accent, Color.white, 0.45f); ((Color)(ref color2))..ctor(0.3f, 0.1f, 0.1f, 0.75f); } else if (ctl.Cooldown(techInfo) > 0f) { num11 = Mathf.Clamp01(ctl.Cooldown(techInfo) / Mathf.Max(0.01f, techInfo.Cooldown)); ((Color)(ref color))..ctor(0.62f, 0.56f, 0.55f, 0.85f); ((Color)(ref color2))..ctor(0.08f, 0f, 0f, 0.6f); } else if (ctl.Energy < ctl.CostOf(techInfo)) { ((Color)(ref color))..ctor(0.85f, 0.38f, 0.32f, 0.9f); ((Color)(ref color2))..ctor(0.08f, 0f, 0f, 0.6f); } else { ((Color)(ref color))..ctor(0.97f, 0.92f, 0.88f); ((Color)(ref color2))..ctor(0.1f, 0f, 0f, 0.65f); } ((Rect)(ref val3))..ctor(num5 - num3, num10 + (num2 - num3) * 0.5f, num3, num3); GUI.color = color2; GUI.DrawTexture(val3, (Texture)(object)white); if (num11 > 0f) { GUI.color = new Color(0.75f, 0.04f, 0.06f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x, ((Rect)(ref val3)).yMax - ((Rect)(ref val3)).height * num11, ((Rect)(ref val3)).width, ((Rect)(ref val3)).height * num11), (Texture)(object)white); } Text(val3, flag ? techInfo.KeyName : techInfo.Unlock.ToString(), badgeStyle, (Color)(flag ? Color.white : new Color(0.75f, 0.5f, 0.45f, 0.45f))); Text(new Rect(num5 - num, num10, num - num3 - 9f * s, num2), techInfo.Name, rowRightStyle, color); num10 += num2; } GUI.color = Color.white; } private void DrawCharge(SukunaController ctl, float s) { //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) float num; string text; if (ctl.FugaCharge >= 0f) { num = Mathf.Clamp01(ctl.FugaCharge / 0.8f); text = ((num >= 1f) ? "FUGA - release!" : "Open..."); } else { if (!(ctl.ChantTime >= 0f)) { return; } num = Mathf.Clamp01(ctl.ChantTime / 1.6f); text = "World-Cutting Slash"; float num2 = 40f * s; float num3 = (float)Screen.height * 0.36f; for (int i = 0; i < ChantLines.Length; i++) { float num4 = (float)i * 0.5f; if (ctl.ChantTime < num4) { break; } float num5 = Mathf.Clamp01((ctl.ChantTime - num4) / 0.15f); Text(new Rect(0f, num3 + (float)i * num2, (float)Screen.width, num2), ChantLines[i], chantStyle, new Color(1f, 0.9f, 0.9f, num5)); } } float num6 = 260f * s; float num7 = 9f * s; float num8 = ((float)Screen.width - num6) * 0.5f; float num9 = (float)Screen.height * 0.62f; GUI.color = new Color(0f, 0f, 0f, 0.6f); GUI.DrawTexture(new Rect(num8 - 2f * s, num9 - 2f * s, num6 + 4f * s, num7 + 4f * s), (Texture)(object)white); GUI.color = ((num >= 1f) ? new Color(1f, 0.55f, 0.1f) : new Color(0.85f, 0.1f, 0.1f)); GUI.DrawTexture(new Rect(num8, num9, num6 * num, num7), (Texture)(object)white); Text(new Rect(0f, num9 + num7 + 4f * s, (float)Screen.width, 26f * s), text, subStyle, Color.white); GUI.color = Color.white; } private void DrawGojo(GojoController g, float s) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00be: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) if (!g.HudVisible) { return; } if (g.PurpleCharge >= 0f) { float num = Mathf.Clamp01(g.PurpleCharge / 1.2f); float num2 = 260f * s; float num3 = 9f * s; float num4 = ((float)Screen.width - num2) * 0.5f; float num5 = (float)Screen.height * 0.62f; GUI.color = new Color(0f, 0f, 0f, 0.6f); GUI.DrawTexture(new Rect(num4 - 2f * s, num5 - 2f * s, num2 + 4f * s, num3 + 4f * s), (Texture)(object)white); GUI.color = ((num >= 1f) ? GojoStats.Purple : Color.Lerp(GojoStats.Blue, GojoStats.Red, num)); GUI.DrawTexture(new Rect(num4, num5, num2 * num, num3), (Texture)(object)white); Text(new Rect(0f, num5 + num3 + 4f * s, (float)Screen.width, 26f * s), (num >= 1f) ? "HOLLOW PURPLE - release!" : "Blue... Red...", subStyle, Color.white); } if (!g.SixEyesOn) { return; } Camera val = (Object.op_Implicit((Object)(object)GameDirector.instance) ? GameDirector.instance.MainCamera : Camera.main); if (!Object.op_Implicit((Object)(object)val)) { return; } Rect val2 = GameScreenRect(); foreach (Enemy item in Combat.Enemies()) { Vector3 val3 = Combat.Center(item); Vector3 val4 = val.WorldToViewportPoint(val3); if (!(val4.z <= 0f) && !(val4.x < 0f) && !(val4.x > 1f) && !(val4.y < 0f) && !(val4.y > 1f)) { float num6 = ((Rect)(ref val2)).x + val4.x * ((Rect)(ref val2)).width; float num7 = (float)Screen.height - (((Rect)(ref val2)).y + val4.y * ((Rect)(ref val2)).height); float z = val4.z; float num8 = Mathf.Lerp(16f, 8f, Mathf.Clamp01(z / 40f)) * s; GUI.color = new Color(0.55f, 0.85f, 1f, 0.85f); GUIUtility.RotateAroundPivot(45f, new Vector2(num6, num7)); GUI.DrawTexture(new Rect(num6 - num8 * 0.5f, num7 - num8 * 0.5f, num8, num8), (Texture)(object)white); GUI.matrix = Matrix4x4.identity; string text = (Object.op_Implicit((Object)(object)item.EnemyParent) ? item.EnemyParent.enemyName : "?"); Text(new Rect(num6 - 100f * s, num7 + num8 * 0.6f, 200f * s, 20f * s), text + " " + Mathf.RoundToInt(z) + "m", badgeStyle, new Color(0.75f, 0.9f, 1f, 0.9f)); } } GUI.color = Color.white; } private void DrawMegumi(MegumiController m, float s) { //IL_004a: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_015e: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) if (m.HudVisible && !(m.ChantTime < 0f)) { float num = Mathf.Clamp01(m.ChantTime / 1.5f); float num2 = 40f * s; float num3 = (float)Screen.height * 0.36f; Text(new Rect(0f, num3, (float)Screen.width, num2), "With this treasure I summon...", chantStyle, new Color(0.85f, 0.85f, 1f, Mathf.Clamp01(m.ChantTime / 0.15f))); if (num > 0.55f) { Text(new Rect(0f, num3 + num2, (float)Screen.width, num2), "Eight-Handled Sword Divergent Sila Divine General", chantStyle, new Color(1f, 0.9f, 0.6f, Mathf.Clamp01((num - 0.55f) / 0.1f))); } float num4 = 260f * s; float num5 = 9f * s; float num6 = ((float)Screen.width - num4) * 0.5f; float num7 = (float)Screen.height * 0.62f; GUI.color = new Color(0f, 0f, 0f, 0.6f); GUI.DrawTexture(new Rect(num6 - 2f * s, num7 - 2f * s, num4 + 4f * s, num5 + 4f * s), (Texture)(object)white); GUI.color = ((num >= 1f) ? MegumiStats.Gold : MegumiStats.Glow); GUI.DrawTexture(new Rect(num6, num7, num4 * num, num5), (Texture)(object)white); Text(new Rect(0f, num7 + num5 + 4f * s, (float)Screen.width, 26f * s), "Keep holding...", subStyle, Color.white); GUI.color = Color.white; } } private void DrawBanner(float s, float now) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (banner == null) { return; } float num = now - banner.Start; if (num > banner.Duration) { banner = null; return; } float num2 = Mathf.Clamp01(num / 0.15f) * Mathf.Clamp01((banner.Duration - num) / 0.45f); float num3 = (float)Screen.height * 0.2f; Color color = banner.Color; color.a = num2; Text(new Rect(0f, num3, (float)Screen.width, 70f * s), banner.Title, titleStyle, color); if (!string.IsNullOrEmpty(banner.Sub)) { Text(new Rect(0f, num3 + 66f * s, (float)Screen.width, 40f * s), banner.Sub, subStyle, new Color(1f, 1f, 1f, num2)); } } private void DrawNotices(float s, float now) { //IL_00a4: 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) float num = 90f * s; for (int num2 = notices.Count - 1; num2 >= 0; num2--) { if (now - notices[num2].Start > notices[num2].Duration) { notices.RemoveAt(num2); } } foreach (NoticeMsg notice in notices) { float num3 = now - notice.Start; float num4 = Mathf.Clamp01(num3 / 0.2f) * Mathf.Clamp01((notice.Duration - num3) / 0.5f); Text(new Rect(0f, num, (float)Screen.width, 28f * s), notice.Text, noticeStyle, new Color(1f, 0.5f, 0.5f, num4)); num += 28f * s; } } private static void Text(Rect r, string text, GUIStyle style, Color color) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) Color textColor = default(Color); ((Color)(ref textColor))..ctor(0f, 0f, 0f, color.a * 0.85f); style.normal.textColor = textColor; float num = Mathf.Max(1f, (float)style.fontSize / 14f); GUI.color = Color.white; GUI.Label(new Rect(((Rect)(ref r)).x - num, ((Rect)(ref r)).y, ((Rect)(ref r)).width, ((Rect)(ref r)).height), text, style); GUI.Label(new Rect(((Rect)(ref r)).x + num, ((Rect)(ref r)).y, ((Rect)(ref r)).width, ((Rect)(ref r)).height), text, style); GUI.Label(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y - num, ((Rect)(ref r)).width, ((Rect)(ref r)).height), text, style); GUI.Label(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y + num, ((Rect)(ref r)).width, ((Rect)(ref r)).height), text, style); style.normal.textColor = color; GUI.Label(r, text, style); } private void EnsureStyles(float s) { int num = Mathf.RoundToInt(s * 100f); if (stylesFor != num || titleStyle == null) { stylesFor = num; titleStyle = Make(54, (FontStyle)1, (TextAnchor)4); subStyle = Make(24, (FontStyle)0, (TextAnchor)4); countStyle = Make(34, (FontStyle)1, (TextAnchor)5); rowRightStyle = Make(17, (FontStyle)1, (TextAnchor)5); smallRightStyle = Make(13, (FontStyle)1, (TextAnchor)5); badgeStyle = Make(14, (FontStyle)1, (TextAnchor)4); chantStyle = Make(34, (FontStyle)3, (TextAnchor)4); noticeStyle = Make(20, (FontStyle)1, (TextAnchor)4); } GUIStyle Make(int size, FontStyle fs, TextAnchor anchor) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown return new GUIStyle(GUI.skin.label) { fontSize = Mathf.RoundToInt((float)size * s), fontStyle = fs, alignment = anchor, wordWrap = false, clipping = (TextClipping)0 }; } } private static void EnsureTextures() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)white)) { white = new Texture2D(1, 1, (TextureFormat)4, false) { name = "Sukuna HUD White" }; white.SetPixel(0, 0, Color.white); white.Apply(); } if (Object.op_Implicit((Object)(object)vignette)) { return; } vignette = new Texture2D(128, 128, (TextureFormat)4, false) { name = "Sukuna Vignette", wrapMode = (TextureWrapMode)1 }; Color32[] array = (Color32[])(object)new Color32[16384]; for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { float num = ((float)j + 0.5f) / 128f * 2f - 1f; float num2 = ((float)i + 0.5f) / 128f * 2f - 1f; float num3 = Mathf.Sqrt(num * num + num2 * num2) / 1.2f; float num4 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.35f, 1f, num3)); array[i * 128 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num4 * 255f)); } } vignette.SetPixels32(array); vignette.Apply(); } } internal sealed class ItemSpec { internal string AssetName; internal string DisplayName; internal string Description; internal string IconResource; internal float ValueMax; internal Vector3 ColliderSize; internal Action BuildModel; internal Type Behaviour; } internal sealed class RuntimeItem { internal readonly ItemSpec Spec; internal Item Item; internal Texture2D Icon; private bool done; private int attempts; private float nextAttempt; internal RuntimeItem(ItemSpec spec) { Spec = spec; ItemFactory.Registered.Add(spec.AssetName); } internal void TryRegister() { if (done || Time.unscaledTime < nextAttempt) { return; } attempts++; nextAttempt = Time.unscaledTime + 2f; try { done = ItemFactory.Build(this, attempts); if (done && Object.op_Implicit((Object)(object)Item)) { Plugin.Log.LogInfo((object)(Spec.DisplayName + " registered.")); } } catch (Exception ex) { Plugin.Log.LogError((object)("Building the " + Spec.DisplayName + " failed: " + ex)); done = attempts >= 5; } } internal Sprite NewIconSprite() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)Icon)) { return null; } return Sprite.Create(Icon, new Rect(0f, 0f, (float)((Texture)Icon).width, (float)((Texture)Icon).height), new Vector2(0.5f, 0.5f)); } } internal static class ItemFactory { internal static readonly HashSet Registered = new HashSet(); internal static Material LitTemplate; private static GameObject holder; internal static Transform Holder { get { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)holder)) { return holder.transform; } holder = new GameObject("SukunaMod Prefabs"); holder.SetActive(false); ((Object)holder).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)holder); return holder.transform; } } private static List CandidateItems() { List items = new List(); HashSet seen = new HashSet(); if (Object.op_Implicit((Object)(object)StatsManager.instance)) { Add(StatsManager.instance.itemDictionary.Values); } Add(Resources.LoadAll(Object.op_Implicit((Object)(object)StatsManager.instance) ? StatsManager.instance.folderPath : "ScriptableObjects")); Add(Resources.FindObjectsOfTypeAll()); return items; void Add(IEnumerable source) { foreach (Item item in source) { if (Object.op_Implicit((Object)(object)item) && !Registered.Contains(((Object)item).name) && seen.Add(item)) { items.Add(item); } } } } private static GameObject LoadPrefab(Item it) { if (it.prefab == null || !((PrefabRef)(object)it.prefab).IsValid()) { return null; } GameObject val = null; if (Object.op_Implicit((Object)(object)RunManager.instance)) { try { val = ((PrefabRef)(object)it.prefab).Prefab; } catch (Exception ex) { Plugin.Log.LogDebug((object)("PrefabRef lookup failed for " + ((Object)it).name + ": " + ex.Message)); } } if (!Object.op_Implicit((Object)(object)val)) { val = Resources.Load(((PrefabRef)(object)it.prefab).ResourcePath); } return val; } private static bool Usable(GameObject prefab) { if (Object.op_Implicit((Object)(object)prefab) && Object.op_Implicit((Object)(object)prefab.GetComponent()) && Object.op_Implicit((Object)(object)prefab.GetComponent()) && Object.op_Implicit((Object)(object)prefab.GetComponent())) { return Object.op_Implicit((Object)(object)prefab.GetComponent()); } return false; } private static bool FindTemplate(int attempts, string forName, out Item src, out GameObject prefab) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Invalid comparison between Unknown and I4 List list = CandidateItems(); List ordered = new List(); ordered.AddRange(list.FindAll((Item i) => ((Object)i).name == "Item Health Pack Small")); ordered.AddRange(list.FindAll((Item i) => (int)i.itemType == 8 && !ordered.Contains(i))); ordered.AddRange(list.FindAll((Item i) => !ordered.Contains(i))); foreach (Item item in ordered) { GameObject val = LoadPrefab(item); if (Usable(val) && ((int)item.itemType == 8 || Object.op_Implicit((Object)(object)val.GetComponent()))) { src = item; prefab = val; return true; } } src = null; prefab = null; if (attempts == 3 || attempts % 15 == 0) { List list2 = list.FindAll((Item i) => (int)i.itemType == 8); string text = ((list2.Count == 0) ? "none" : string.Join(", ", list2.ConvertAll((Item i) => ((Object)i).name + " -> '" + ((i.prefab != null) ? ((PrefabRef)(object)i.prefab).ResourcePath : "null") + "'" + (Object.op_Implicit((Object)(object)LoadPrefab(i)) ? " (loads)" : " (doesn't load)")))); Plugin.Log.LogWarning((object)(forName + ": no item to build from yet (attempt " + attempts + ", " + list.Count + " items known, RunManager " + (Object.op_Implicit((Object)(object)RunManager.instance) ? "ready" : "not ready") + "). Health packs: " + text)); } return false; } internal static bool Build(RuntimeItem ri, int attempts) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00b9: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Expected O, but got Unknown ItemSpec spec = ri.Spec; if (!FindTemplate(attempts, spec.DisplayName, out var src, out var prefab)) { return false; } Plugin.Log.LogInfo((object)(spec.DisplayName + ": building from \"" + ((Object)src).name + "\" (" + ((PrefabRef)(object)src.prefab).ResourcePath + ").")); GameObject val = Object.Instantiate(prefab, Holder); ((Object)val).name = spec.AssetName; ItemHealthPack[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } Material baseMat; int layer; Bounds val2 = HideOriginalVisuals(val, out baseMat, out layer); Vector3 val3 = ((((Bounds)(ref val2)).size == Vector3.zero) ? Vector3.zero : ((Bounds)(ref val2)).center); if (Object.op_Implicit((Object)(object)baseMat) && !Object.op_Implicit((Object)(object)LitTemplate)) { LitTemplate = baseMat; Plugin.Log.LogInfo((object)("Item material based on '" + ((Object)baseMat).name + "' (" + (Object.op_Implicit((Object)(object)baseMat.shader) ? ((Object)baseMat.shader).name : "no shader") + ").")); } spec.BuildModel(val.transform, val3, baseMat, layer); FitCollider(val, val3, spec.ColliderSize); val.AddComponent(spec.Behaviour); Item val4 = Object.Instantiate(src); ((Object)val4).name = spec.AssetName; val4.itemName = spec.DisplayName; val4.itemNameLocalized = null; val4.description = spec.Description; val4.disabled = false; val4.status = (Status)1; val4.maxAmountInShop = 1; val4.maxPurchase = false; val4.minPlayerCount = 1; Value val5 = ScriptableObject.CreateInstance(); ((Object)val5).name = "Value - " + spec.DisplayName; val5.valueMax = spec.ValueMax; val5.valueMin = spec.ValueMax * 0.85f; val4.value = val5; val4.prefab = new PrefabRef(); ((Object)val4).hideFlags = (HideFlags)32; ((Object)val5).hideFlags = (HideFlags)32; ItemAttributes component = val.GetComponent(); component.item = val4; ri.Icon = LoadEmbeddedTexture(spec.IconResource); component.icon = ri.NewIconSprite(); if (Items.RegisterItem(component) == null) { Plugin.Log.LogError((object)("REPOLib refused the " + spec.DisplayName + ".")); return true; } ri.Item = val4; return true; } private static Bounds HideOriginalVisuals(GameObject go, out Material baseMat, out int layer) { //IL_000f: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) baseMat = null; layer = go.layer; bool flag = false; Bounds result = default(Bounds); Transform transform = go.transform; Renderer[] componentsInChildren = go.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent(true)) || val is ParticleSystemRenderer) { continue; } Material sharedMaterial = val.sharedMaterial; if (Object.op_Implicit((Object)(object)sharedMaterial) && sharedMaterial.renderQueue >= 2500) { continue; } bool flag2 = Object.op_Implicit((Object)(object)sharedMaterial) && Object.op_Implicit((Object)(object)sharedMaterial.shader) && ((Object)sharedMaterial.shader).name == "Standard"; if (val is MeshRenderer && Object.op_Implicit((Object)(object)sharedMaterial) && (!Object.op_Implicit((Object)(object)baseMat) || (flag2 && ((Object)baseMat.shader).name != "Standard"))) { baseMat = sharedMaterial; layer = ((Component)val).gameObject.layer; } MeshFilter component = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.sharedMesh)) { Bounds bounds = component.sharedMesh.bounds; for (int j = 0; j < 8; j++) { Vector3 val2 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1)))); Vector3 val3 = transform.InverseTransformPoint(((Component)component).transform.TransformPoint(val2)); if (!flag) { ((Bounds)(ref result))..ctor(val3, Vector3.zero); flag = true; } else { ((Bounds)(ref result)).Encapsulate(val3); } } } val.enabled = false; } ParticleSystem[] componentsInChildren2 = go.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Component)componentsInChildren2[i]).gameObject.SetActive(false); } Light[] componentsInChildren3 = go.GetComponentsInChildren(true); foreach (Light obj in componentsInChildren3) { obj.intensity = 0f; ((Behaviour)obj).enabled = false; } return result; } private static void FitCollider(GameObject go, Vector3 center, Vector3 size) { //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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_016e: 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) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Collider[] componentsInChildren = go.GetComponentsInChildren(true); foreach (Collider val in componentsInChildren) { if (!val.isTrigger && !Object.op_Implicit((Object)(object)((Component)val).GetComponentInParent(true))) { list.Add(val); } } if (list.Count == 0) { Plugin.Log.LogWarning((object)"Health pack template has no collider; adding one."); list.Add((Collider)(object)go.AddComponent()); } Collider? obj = list.Find((Collider c) => c is BoxCollider); BoxCollider val2 = (BoxCollider)(object)((obj is BoxCollider) ? obj : null); if (!Object.op_Implicit((Object)(object)val2)) { GameObject gameObject = ((Component)list[0]).gameObject; Object.DestroyImmediate((Object)(object)list[0]); list.RemoveAt(0); val2 = gameObject.AddComponent(); } foreach (Collider item in list) { if (Object.op_Implicit((Object)(object)item) && (Object)(object)item != (Object)(object)val2) { Object.DestroyImmediate((Object)(object)item); } } Transform transform = go.transform; Transform transform2 = ((Component)val2).transform; Vector3 val3 = transform2.InverseTransformVector(transform.TransformVector(new Vector3(size.x, 0f, 0f))); Vector3 val4 = transform2.InverseTransformVector(transform.TransformVector(new Vector3(0f, size.y, 0f))); Vector3 val5 = transform2.InverseTransformVector(transform.TransformVector(new Vector3(0f, 0f, size.z))); val2.size = new Vector3(Mathf.Abs(val3.x) + Mathf.Abs(val4.x) + Mathf.Abs(val5.x), Mathf.Abs(val3.y) + Mathf.Abs(val4.y) + Mathf.Abs(val5.y), Mathf.Abs(val3.z) + Mathf.Abs(val4.z) + Mathf.Abs(val5.z)); val2.center = transform2.InverseTransformPoint(transform.TransformPoint(center + new Vector3(0f, -0.01f, 0f))); } internal static Mesh ToMesh(ModelMeshData data, string name) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_00b7: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh { name = name }; int vertexCount = data.VertexCount; Vector3[] array = (Vector3[])(object)new Vector3[vertexCount]; Vector3[] array2 = (Vector3[])(object)new Vector3[vertexCount]; Vector2[] array3 = (Vector2[])(object)new Vector2[vertexCount]; for (int i = 0; i < vertexCount; i++) { array[i] = new Vector3(data.Positions[i * 3], data.Positions[i * 3 + 1], data.Positions[i * 3 + 2]); array2[i] = new Vector3(data.Normals[i * 3], data.Normals[i * 3 + 1], data.Normals[i * 3 + 2]); array3[i] = new Vector2(data.Uvs[i * 2], data.Uvs[i * 2 + 1]); } val.vertices = array; val.normals = array2; val.uv = array3; val.triangles = data.Triangles; val.RecalculateBounds(); val.RecalculateTangents(); ((Object)val).hideFlags = (HideFlags)32; return val; } internal static Texture2D ToTexture(byte[] rgba, int size, string name) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown Texture2D val = new Texture2D(size, size, (TextureFormat)4, true) { name = name, wrapMode = (TextureWrapMode)0, filterMode = (FilterMode)1 }; val.SetPixelData(rgba, 0, 0); val.Apply(true, true); ((Object)val).hideFlags = (HideFlags)32; return val; } internal static Material ModelMaterial(Material baseMat, Texture2D tex, Color emission, string name) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) Material val; if (Object.op_Implicit((Object)(object)baseMat)) { val = Vfx.Retexture(baseMat, (Texture)(object)tex, Color.white); if (val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", emission); } } else { val = new Material(Shader.Find("Standard") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)tex }; } ((Object)val).name = name; ((Object)val).hideFlags = (HideFlags)32; return val; } internal static GameObject ModelObject(string name, Transform parent, Vector3 localPos, Mesh mesh, Material mat, int layer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown GameObject val = new GameObject(name) { layer = layer }; val.transform.SetParent(parent, false); val.transform.localPosition = localPos; val.transform.localRotation = Quaternion.identity; val.AddComponent().sharedMesh = mesh; ((Renderer)val.AddComponent()).sharedMaterial = mat; return val; } internal static Light SmallGlow(Transform parent, Color color, float intensity, float range, int layer) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Glow") { layer = layer }; val.transform.SetParent(parent, false); val.transform.localPosition = new Vector3(0f, 0.25f, 0f); Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = color; obj.range = range; obj.intensity = intensity; obj.shadows = (LightShadows)0; return obj; } private static Texture2D LoadEmbeddedTexture(string resource) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown try { using Stream stream = typeof(ItemFactory).Assembly.GetManifestResourceStream(resource); if (stream == null) { return null; } MemoryStream memoryStream = new MemoryStream(); stream.CopyTo(memoryStream); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false) { name = resource }; if (!ImageConversion.LoadImage(val, memoryStream.ToArray())) { return null; } ((Object)val).hideFlags = (HideFlags)32; return val; } catch (Exception ex) { Plugin.Log.LogWarning((object)(resource + " not loaded: " + ex.Message)); return null; } } internal static void GiveOwnIcon(Component item, RuntimeItem ri) { ItemAttributes component = item.GetComponent(); Sprite val = ri.NewIconSprite(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)val)) { component.icon = val; } } } internal static class LevelSpawner { private static LevelGenerator handled; private static float fingerIn = -1f; private static float bossIn = -1f; private static BossDef boss; internal static void Tick() { //IL_00ed: 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_00f8: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) LevelGenerator instance = LevelGenerator.Instance; if (!Object.op_Implicit((Object)(object)instance) || !instance.Generated || !Object.op_Implicit((Object)(object)RunManager.instance) || !Object.op_Implicit((Object)(object)RunManager.instance.levelCurrent) || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } if ((Object)(object)instance != (Object)(object)handled) { handled = instance; fingerIn = (bossIn = -1f); boss = null; if (SemiFunc.RunIsLevel()) { if (Object.op_Implicit((Object)(object)FingerItem.Item) && Random.value < SukunaConfig.LevelSpawnChance.Value) { fingerIn = 4f; } boss = PickBoss(); if (boss != null) { bossIn = 30f; } } return; } if (fingerIn >= 0f && (fingerIn -= Time.deltaTime) < 0f) { fingerIn = -1f; if (PickPoint(instance, out var pos) && Object.op_Implicit((Object)(object)Items.SpawnItem(FingerItem.Item, pos + Vector3.up * 0.25f, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)))) { Plugin.Log.LogInfo((object)"A Cursed Finger was hidden somewhere in this level."); } } if (bossIn >= 0f && (bossIn -= Time.deltaTime) < 0f) { bossIn = -1f; if (boss != null && PickPoint(instance, out var pos2) && boss.Spawn(pos2)) { Plugin.Log.LogInfo((object)(boss.Name + " is somewhere in this level.")); } } } private static BossDef PickBoss() { List list = new List(Bosses.All); for (int num = list.Count - 1; num > 0; num--) { int num2 = Random.Range(0, num + 1); List list2 = list; int index = num; List list3 = list; int index2 = num2; BossDef value = list[num2]; BossDef value2 = list[num]; list2[index] = value; list3[index2] = value2; } foreach (BossDef item in list) { if (Object.op_Implicit((Object)(object)item.Setup) && Random.value < Bosses.SpawnChance(item)) { return item; } } return null; } private static bool PickPoint(LevelGenerator lg, out Vector3 pos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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) //IL_00cb: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0110: Unknown result type (might be due to invalid IL or missing references) pos = Vector3.zero; List list = new List(); foreach (LevelPoint levelPathPoint in lg.LevelPathPoints) { if (Object.op_Implicit((Object)(object)levelPathPoint) && !levelPathPoint.Truck && !levelPathPoint.inStartRoom && (!Object.op_Implicit((Object)(object)levelPathPoint.Room) || (!levelPathPoint.Room.Truck && !levelPathPoint.Room.Extraction))) { list.Add(levelPathPoint); } } if (list.Count == 0) { return false; } LevelPoint val = list[Random.Range(0, list.Count)]; pos = ((Component)val).transform.position + Vector3.up * 0.15f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)val).transform.position + Vector3.up * 1f, Vector3.down, ref val2, 3f, Combat.WorldMask, (QueryTriggerInteraction)1)) { pos = ((RaycastHit)(ref val2)).point; } return true; } } internal sealed class MegumiController : MonoBehaviour, IPowerHud { internal static MegumiController Instance; internal bool HudVisible; internal float Energy = 260f; internal float ChantTime = -1f; private readonly Dictionary cooldowns = new Dictionary(); private LevelGenerator level; bool IPowerHud.HudVisible => HudVisible; string IPowerHud.CountText => "MEGUMI"; Texture IPowerHud.Icon => (Texture)(object)TalismanItem.IconTexture; Color IPowerHud.Accent => MegumiStats.Glow; float IPowerHud.Energy => Energy; float IPowerHud.MaxEnergy => 260f; string IPowerHud.EnergyTag { get { if (!ShadowGarden.LocalInOwn()) { return ""; } return "GARDEN"; } } bool IPowerHud.EnergyPulse => ShadowGarden.LocalInOwn(); TechInfo[] IPowerHud.Techs => TechInfo.Megumi; int IPowerHud.UnlockLevel => 1; bool IPowerHud.IsActive(TechInfo t) { if (t == TechInfo.Mahoraga) { return ChantTime >= 0f; } return false; } float IPowerHud.Cooldown(TechInfo t) { return Cooldown(t); } float IPowerHud.CostOf(TechInfo t) { return Cost(t); } private void Awake() { Instance = this; } internal float Cooldown(TechInfo t) { if (!cooldowns.TryGetValue(t, out var value)) { return 0f; } return Mathf.Max(0f, value); } private static float Cost(TechInfo t) { return t.Cost * (ShadowGarden.LocalInOwn() ? 0.5f : 1f); } internal void OnTalismanUsed() { Energy = 260f; cooldowns.Clear(); } internal void DebugRefill() { Energy = 260f; cooldowns.Clear(); } private void Update() { try { Tick(); } catch (Exception ex) { Plugin.Log.LogError((object)("Megumi controller error: " + ex)); Cancel(notify: false); } } private void Tick() { PlayerAvatar instance = PlayerAvatar.instance; bool flag = Object.op_Implicit((Object)(object)instance) && Powers.IsMegumi(instance) && SukunaController.TechniquesAllowedHere(); HudVisible = flag && !instance.deadSet; if (!flag) { Cancel(notify: false); return; } float deltaTime = Time.deltaTime; if ((Object)(object)LevelGenerator.Instance != (Object)(object)level) { level = LevelGenerator.Instance; Energy = 260f; cooldowns.Clear(); } foreach (TechInfo item in new List(cooldowns.Keys)) { cooldowns[item] -= deltaTime; } float num = 12f * SukunaConfig.CursedEnergyRegenMultiplier.Value * (ShadowGarden.LocalInOwn() ? 3f : 1f); Energy = Mathf.Min(260f, Energy + num * deltaTime); if (instance.deadSet || instance.isDisabled || !SemiFunc.NoTextInputsActive() || (Object.op_Implicit((Object)(object)MenuManager.instance) && Object.op_Implicit((Object)(object)MenuManager.instance.currentMenuPage)) || (Object.op_Implicit((Object)(object)PlayerController.instance) && PlayerController.instance.InputDisableTimer > 0f) || Keyboard.current == null) { Cancel(notify: true); return; } HandleDogs(instance); HandleNue(instance); HandleShadowStep(instance); HandleToad(instance); HandleElephant(instance); HandleGarden(instance); HandleMahoraga(instance, deltaTime); Simple(instance, TechInfo.Serpent, Tech.MegumiSerpent, fromEye: true); Simple(instance, TechInfo.Rabbits, Tech.MegumiRabbits, fromEye: false); Simple(instance, TechInfo.Deer, Tech.MegumiDeer, fromEye: false); Simple(instance, TechInfo.Ox, Tech.MegumiOx, fromEye: false); Simple(instance, TechInfo.Tiger, Tech.MegumiTiger, fromEye: true); } private void Simple(PlayerAvatar me, TechInfo t, Tech tech, bool fromEye) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (Pressed(t) && CanStart(t) && Aim(out var origin, out var dir)) { Spend(t); SukunaNet.Send(tech, me, fromEye ? origin : ((Component)me).transform.position, dir, 0); } } private static bool Pressed(TechInfo t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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) Key value = t.Key.Value; if ((int)value == 0) { return false; } try { return ((ButtonControl)Keyboard.current[value]).wasPressedThisFrame; } catch { return false; } } private static bool Held(TechInfo t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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) Key value = t.Key.Value; if ((int)value == 0) { return false; } try { return ((ButtonControl)Keyboard.current[value]).isPressed; } catch { return false; } } private static bool Aim(out Vector3 origin, out Vector3 dir) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Camera val = (Object.op_Implicit((Object)(object)GameDirector.instance) ? GameDirector.instance.MainCamera : null); if (!Object.op_Implicit((Object)(object)val)) { val = Camera.main; } if (!Object.op_Implicit((Object)(object)val)) { origin = (dir = Vector3.zero); return false; } origin = ((Component)val).transform.position; dir = ((Component)val).transform.forward; return true; } private bool CanStart(TechInfo t) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (Cooldown(t) > 0f) { return false; } if (Energy < Cost(t)) { Hud.Flash(new Color(0.05f, 0f, 0.2f, 0.25f), 0.15f); return false; } return true; } private void Spend(TechInfo t) { Energy -= Cost(t); cooldowns[t] = t.Cooldown; } private void HandleDogs(PlayerAvatar me) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) TechInfo dogs = TechInfo.Dogs; if (Pressed(dogs) && CanStart(dogs) && Aim(out var _, out var dir)) { Spend(dogs); SukunaNet.Send(Tech.MegumiDogs, me, ((Component)me).transform.position, dir, 0); } } private void HandleNue(PlayerAvatar me) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) TechInfo nue = TechInfo.Nue; if (Pressed(nue) && CanStart(nue) && Aim(out var origin, out var dir)) { Spend(nue); SukunaNet.Send(Tech.MegumiNue, me, origin + dir * 0.9f + Vector3.up * 0.2f, dir, 0); } } private void HandleShadowStep(PlayerAvatar me) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00bd: 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_00cc: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) TechInfo shadowStep = TechInfo.ShadowStep; if (!Pressed(shadowStep) || !CanStart(shadowStep) || !Aim(out var origin, out var dir)) { return; } PlayerController instance = PlayerController.instance; if (!Object.op_Implicit((Object)(object)instance)) { return; } Vector3 position = ((Component)instance).transform.position; float num = 14f; RaycastHit val = default(RaycastHit); if (Physics.SphereCast(origin, 0.35f, dir, ref val, 14f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num = Mathf.Max(0f, ((RaycastHit)(ref val)).distance - 0.5f); } RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(origin + dir * num + Vector3.up * 0.3f, Vector3.down, ref val2, 4f, Combat.WorldMask, (QueryTriggerInteraction)1)) { return; } Vector3 val3 = ((RaycastHit)(ref val2)).point + Vector3.up * 0.05f; if (!(Vector3.Distance(position, val3) < 1f)) { Spend(shadowStep); ((Component)instance).transform.position = val3; if (Object.op_Implicit((Object)(object)instance.rb)) { instance.rb.position = val3; instance.rb.linearVelocity = Vector3.zero; } SukunaNet.Send(Tech.MegumiShadowStep, me, position, val3 - position, 0, Vector3.Distance(position, val3)); } } private void HandleToad(PlayerAvatar me) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) TechInfo toad = TechInfo.Toad; if (Pressed(toad) && CanStart(toad) && Aim(out var origin, out var dir)) { Spend(toad); SukunaNet.Send(Tech.MegumiToad, me, origin, dir, 0); } } private void HandleElephant(PlayerAvatar me) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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) TechInfo elephant = TechInfo.Elephant; if (Pressed(elephant) && CanStart(elephant) && Aim(out var origin, out var dir)) { Vector3 val = origin + dir * 22f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(origin, dir, ref val2, 22f, Combat.WorldMask, (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val2)).point + ((RaycastHit)(ref val2)).normal * 0.6f; } if (Vector3.Distance(Vector3.ProjectOnPlane(val - ((Component)me).transform.position, Vector3.up), Vector3.zero) < 3.5f) { val = ((Component)me).transform.position + TenShadows.Flat(dir) * 3.5f; } Spend(elephant); SukunaNet.Send(Tech.MegumiElephant, me, ShadowFx.Ground(val, 10f), TenShadows.Flat(dir), 0); } } private void HandleGarden(PlayerAvatar me) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) TechInfo garden = TechInfo.Garden; if (Pressed(garden) && CanStart(garden) && Aim(out var _, out var dir)) { Spend(garden); SukunaNet.Send(Tech.MegumiDomain, me, ((Component)me).transform.position, dir, 0); } } private void HandleMahoraga(PlayerAvatar me, float dt) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0102: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) TechInfo mahoraga = TechInfo.Mahoraga; if (ChantTime < 0f) { if (Pressed(mahoraga) && CanStart(mahoraga) && Aim(out var origin, out var dir)) { ChantTime = 0f; SukunaNet.Send(Tech.MegumiMahoragaChant, me, origin, dir, 0); } return; } if (!Held(mahoraga)) { SukunaNet.Send(Tech.ChargeCancel, me, ((Component)me).transform.position, Vector3.up, 0); ChantTime = -1f; return; } ChantTime += dt; if (ChantTime < 1.5f) { return; } ChantTime = -1f; if (!(Energy < Cost(mahoraga)) && Aim(out var _, out var dir2)) { Spend(mahoraga); Vector3 val = TenShadows.Flat(dir2); Vector3 origin3 = ((Component)me).transform.position + val * 3f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)me).transform.position + Vector3.up, val, ref val2, 3f, Combat.WorldMask, (QueryTriggerInteraction)1)) { origin3 = ((Component)me).transform.position + val * Mathf.Max(0.5f, ((RaycastHit)(ref val2)).distance - 1f); } SukunaNet.Send(Tech.MegumiMahoraga, me, origin3, val, 0); } } private void Cancel(bool notify) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (ChantTime >= 0f && notify && Object.op_Implicit((Object)(object)instance)) { SukunaNet.Send(Tech.ChargeCancel, instance, ((Component)instance).transform.position, Vector3.up, 0); } ChantTime = -1f; } } internal sealed class MegumiEnemyAI : BossAI { private enum State { Spawn, Roam, Watch, Fight, Chant, Dead } private State state; private float stateTimer; private float attackTimer; private float stepCd; private float noSightTimer; private float dogsCd; private float nueCd; private float toadCd; private float elephantCd; private float gardenCd; private float serpentCd; private float rabbitCd; private float deerCd; private float oxCd; private float tigerCd; private bool summoned; private PlayerAvatar watched; protected override void OnSpawned() { summoned = false; SetState(State.Spawn); } protected override void OnSeen(PlayerAvatar p) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (!base.Aggro && Vector3.Distance(((Component)p).transform.position, ((Component)this).transform.position) < 6f) { watched = p; if (state == State.Roam) { SetState(State.Watch); } } } protected override void OnDied() { state = State.Dead; } protected override void DropLoot(Vector3 at) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)TalismanItem.Item)) { Items.SpawnItem(TalismanItem.Item, at + Vector3.up * 0.3f, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); } } protected override void Provoke(PlayerAvatar who) { bool num = !base.Aggro; aggroTimer = 45f; if (Object.op_Implicit((Object)(object)who)) { target = who; } if (num) { attackTimer = 1f; dogsCd = 0f; Announce(); } if (state != State.Chant && state != State.Dead) { SetState(State.Fight); } } private void SetState(State s) { state = s; stateTimer = 0f; } private void Update() { //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if (!BossAI.Host || !Object.op_Implicit((Object)(object)enemy) || state == State.Dead) { return; } float deltaTime = Time.deltaTime; stateTimer += deltaTime; aggroTimer -= deltaTime; attackTimer -= deltaTime; stepCd -= deltaTime; dogsCd -= deltaTime; nueCd -= deltaTime; toadCd -= deltaTime; elephantCd -= deltaTime; gardenCd -= deltaTime; serpentCd -= deltaTime; rabbitCd -= deltaTime; deerCd -= deltaTime; oxCd -= deltaTime; tigerCd -= deltaTime; if (base.Busy) { return; } if (enemy.IsStunned()) { enemy.NavMeshAgent.Stop(0.2f); if (state == State.Chant) { SukunaNet.SendEnemy(Tech.ChargeCancel, this, ((Component)this).transform.position, Vector3.up); summoned = false; SetState(State.Fight); } return; } switch (state) { case State.Spawn: if (stateTimer > 2f) { SetState((!base.Aggro) ? State.Roam : State.Fight); } break; case State.Roam: if (base.Aggro) { SetState(State.Fight); } else { Roam(1.7f); } break; case State.Watch: Watch(); break; case State.Fight: Fight(); break; case State.Chant: Chant(); break; } Face((state == State.Fight || state == State.Chant) ? target : ((state == State.Watch) ? watched : null)); } private void Watch() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (base.Aggro) { SetState(State.Fight); return; } enemy.NavMeshAgent.Stop(0.2f); if (!Object.op_Implicit((Object)(object)watched) || stateTimer > 4f || Vector3.Distance(((Component)watched).transform.position, ((Component)this).transform.position) > 9f) { watched = null; SetState(State.Roam); } } private void Fight() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0311: 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_0417: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_05ca: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) if (!base.Aggro) { target = null; SetState(State.Roam); return; } if (!BossAI.Valid(target)) { target = NearestPlayer(30f, needSight: false); } if (!Object.op_Implicit((Object)(object)target)) { return; } Vector3 center = base.Center; Vector3 val = BossHits.Center(target); float num = Vector3.Distance(center, val); bool flag = Combat.LineOfSight(center, val); noSightTimer = (flag ? 0f : (noSightTimer + Time.deltaTime)); if (num < 3f && rabbitCd <= 0f && attackTimer <= 0f) { rabbitCd = 15f; stepCd = Mathf.Min(stepCd, 0.5f); SukunaNet.SendEnemy(Tech.MegumiRabbits, this, ((Component)this).transform.position, Vector3.forward); } if (stepCd <= 0f && (num > 18f || noSightTimer > 3f || num < 2.5f)) { stepCd = 5f; if (TeleportAround(target, 9f, Tech.MegumiShadowStep)) { attackTimer = Mathf.Max(attackTimer, 0.6f); } return; } enemy.NavMeshAgent.OverrideAgent(3.4f, 12f, 0.2f); Vector3 val2; if (num > 13f || !flag) { enemy.NavMeshAgent.SetDestination(((Component)target).transform.position); } else if (num < 7f) { Vector3 position = ((Component)this).transform.position; val2 = ((Component)this).transform.position - ((Component)target).transform.position; NavMeshHit val3 = default(NavMeshHit); if (NavMesh.SamplePosition(position + ((Vector3)(ref val2)).normalized * 5f, ref val3, 3f, -1)) { enemy.NavMeshAgent.SetDestination(((NavMeshHit)(ref val3)).position); } } else { enemy.NavMeshAgent.Stop(0.2f); } if (!(attackTimer > 0f)) { float healthFraction = base.HealthFraction; Vector3 position2 = base.HandPoint.position; val2 = val - position2; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (healthFraction < 0.25f && !summoned) { summoned = true; SukunaNet.SendEnemy(Tech.MegumiMahoragaChant, this, position2, normalized); SetState(State.Chant); } else if (healthFraction < 0.5f && gardenCd <= 0f && num < 9f) { gardenCd = 60f; attackTimer = 1.5f; SukunaNet.SendEnemy(Tech.MegumiDomain, this, ((Component)this).transform.position, normalized); } else if (healthFraction < 0.6f && deerCd <= 0f) { deerCd = 30f; attackTimer = 1f; SukunaNet.SendEnemy(Tech.MegumiDeer, this, ((Component)this).transform.position, ((Component)this).transform.forward); } else if (dogsCd <= 0f) { dogsCd = 14f; attackTimer = 1.2f; SukunaNet.SendEnemy(Tech.MegumiDogs, this, ((Component)this).transform.position, normalized); } else if (flag && elephantCd <= 0f && num < 20f && num > 4f) { elephantCd = 12f; attackTimer = 1.6f; SukunaNet.SendEnemy(Tech.MegumiElephant, this, ((Component)target).transform.position, TenShadows.Flat(((Component)target).transform.position - ((Component)this).transform.position)); } else if (serpentCd <= 0f && num < 18f) { serpentCd = 10f; attackTimer = 1.4f; SukunaNet.SendEnemy(Tech.MegumiSerpent, this, ((Component)target).transform.position, TenShadows.Flat(((Component)target).transform.position - ((Component)this).transform.position)); } else if (flag && oxCd <= 0f && num > 5f && num < 25f) { oxCd = 9f; attackTimer = 1.4f; SukunaNet.SendEnemy(Tech.MegumiOx, this, ((Component)this).transform.position, TenShadows.Flat(((Component)target).transform.position - ((Component)this).transform.position)); } else if (flag && tigerCd <= 0f && num < 16f) { tigerCd = 11f; attackTimer = 1.4f; Vector3 val4 = ((Component)target).transform.position + Vector3.up * 0.5f - ((Component)this).transform.position; SukunaNet.SendEnemy(Tech.MegumiTiger, this, ((Component)this).transform.position, ((Vector3)(ref val4)).normalized, ((Vector3)(ref val4)).magnitude); } else if (flag && toadCd <= 0f && num > 4f && num < 14f) { toadCd = 8f; attackTimer = 1.2f; SukunaNet.SendEnemy(Tech.MegumiToad, this, position2, normalized); } else if (flag && nueCd <= 0f && num < 26f) { nueCd = 5f; attackTimer = 1.2f; SukunaNet.SendEnemy(Tech.MegumiNue, this, position2 + normalized * 0.8f, normalized); } } } private void Chant() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00a8: 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) enemy.NavMeshAgent.Stop(0.2f); if (!(stateTimer < 1.8f)) { Vector3 val = TenShadows.Flat(BossAI.Valid(target) ? (((Component)target).transform.position - ((Component)this).transform.position) : ((Component)this).transform.forward); Vector3 val2 = ((Component)this).transform.position + val * 2.5f; NavMeshHit val3 = default(NavMeshHit); val2 = ((!NavMesh.SamplePosition(val2, ref val3, 2f, -1)) ? ((Component)this).transform.position : ((NavMeshHit)(ref val3)).position); SukunaNet.SendEnemy(Tech.MegumiMahoraga, this, val2, val); attackTimer = 1.5f; SetState(State.Fight); } } internal override void ProvokedFx(Cast c) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Model)) { Model.SetAggro(45f); } ShadowFx.Smoke(c.Origin, 0.5f); Sfx.Play(SfxId.Domain, c.Origin, 0.35f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && Vector3.Distance(((Component)instance).transform.position, c.Origin) < 25f) { Hud.Banner("MEGUMI FUSHIGURO", "\"I'll save people unequally.\"", MegumiStats.Glow, 3f); } } internal override void DefeatedFx(Cast c) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) state = State.Dead; Summon.DismissAll(this); ShadowFx.Pool(c.Origin, 2f, 2f); ShadowFx.Smoke(c.Origin, 0.8f, 60); Vfx.LightFlash(c.Origin, MegumiStats.Glow, 6f, 10f, 1f); Vfx.Shake(c.Origin, 5f, 0.5f); Sfx.Play(SfxId.Boom, c.Origin, 0.6f); Hud.Banner("MEGUMI FUSHIGURO DEFEATED", "His talisman lies where he fell", MegumiStats.Glow, 4f); } } internal sealed class MegumiModel : BossModel { private Transform hips; private Transform chest; private Transform head; private Transform legL; private Transform legR; private Transform kneeL; private Transform kneeR; private Transform armL; private Transform armR; private Transform elbowL; private Transform elbowR; protected override void Build() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) Transform val = NewRoot("Megumi Model", 1.05f); Dictionary dictionary = RigFactory.Spawn("megumi", val); hips = dictionary["Hips"]; chest = dictionary["Chest"]; head = dictionary["Head"]; legL = dictionary["Leg L"]; legR = dictionary["Leg R"]; kneeL = dictionary["Leg L Lower"]; kneeR = dictionary["Leg R Lower"]; armL = dictionary["Arm L"]; armR = dictionary["Arm R"]; elbowL = dictionary["Arm L Lower"]; elbowR = dictionary["Arm R Lower"]; Hand = dictionary["Hand Point"]; BossModel.PointLight(chest, new Vector3(0f, 0.4f, 0.5f), new Color(0.55f, 0.5f, 1f), 3f, 1f); Finish(val); } private void LateUpdate() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: 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) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(Time.deltaTime, 0.0001f); float s; float num2 = Step(num, out s); BossModel.Legs(num2, s, legL, legR, kneeL, kneeR); hips.localPosition = new Vector3(0f, 1f + Mathf.Abs(s) * 0.03f * num2, 0f); bool fighting = base.Fighting; Quaternion val = Quaternion.Euler((0f - s) * 20f * num2, 0f, 0f); Quaternion val2 = Quaternion.Euler(s * 20f * num2, 0f, 0f); Quaternion val3; Quaternion val4; float num3; float num4; if (castTimer > 0f) { val3 = Quaternion.Euler(-75f, 0f, -28f); val4 = Quaternion.Euler(-75f, 0f, 28f); num3 = (num4 = -45f); } else if (fighting) { val3 = Quaternion.Euler(-35f, 0f, 12f) * val; val4 = Quaternion.Euler(-35f, 0f, -12f) * val2; num3 = (num4 = -55f); } else { val3 = Quaternion.Euler(5f, 0f, 6f) * val; val4 = Quaternion.Euler(5f, 0f, -6f) * val2; num3 = (num4 = -12f); } float num5 = num * ((castTimer > 0f) ? 16f : 8f); armL.localRotation = Quaternion.Slerp(armL.localRotation, val3, num5); armR.localRotation = Quaternion.Slerp(armR.localRotation, val4, num5); elbowL.localRotation = Quaternion.Slerp(elbowL.localRotation, Quaternion.Euler(num3, 0f, 0f), num5); elbowR.localRotation = Quaternion.Slerp(elbowR.localRotation, Quaternion.Euler(num4, 0f, 0f), num5); head.localRotation = Quaternion.Euler(fighting ? 4f : 2f, Mathf.Sin(Time.time * 0.35f) * (fighting ? 0f : 10f), 0f); } } internal static class TenShadows { internal static Vector3 Flat(Vector3 d) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(d, Vector3.up); if (!(((Vector3)(ref val)).sqrMagnitude < 0.0001f)) { return ((Vector3)(ref val)).normalized; } return Vector3.forward; } internal static Enemy NearestEnemy(Vector3 from, float range) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Enemy result = null; float num = range; foreach (Enemy item in Combat.Enemies()) { float num2 = Vector3.Distance(Combat.Center(item), from); if (num2 < num) { num = num2; result = item; } } return result; } internal static PlayerAvatar PlayerInAim(Vector3 origin, Vector3 dir, float range, float maxAngle) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar result = null; float num = float.MaxValue; foreach (PlayerAvatar item in SemiFunc.PlayerGetList()) { if (!Object.op_Implicit((Object)(object)item) || item.deadSet || item.isDisabled) { continue; } Vector3 val = BossHits.Center(item) - origin; float magnitude = ((Vector3)(ref val)).magnitude; float num2 = Vector3.Angle(dir, val); if (!(magnitude > range) && !(num2 > maxAngle)) { float num3 = magnitude + num2 * 0.1f; if (num3 < num) { num = num3; result = item; } } } return result; } internal static Transform Owner(Cast c) { if (!c.Hostile) { if (!Object.op_Implicit((Object)(object)c.Caster)) { return null; } return ((Component)c.Caster).transform; } if (!Object.op_Implicit((Object)(object)c.Enemy)) { return null; } return ((Component)c.Enemy).transform; } } internal static class DivineDogs { internal static void Run(Cast c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) Vector3 val = TenShadows.Flat(c.Dir); Vector3 val2 = Vector3.Cross(Vector3.up, val); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { Vector3 val3 = ShadowFx.Ground(c.Origin + val * 1.2f + val2 * num * 0.8f); ShadowFx.Pool(val3, 0.8f, 1.2f); GameObject val4 = new GameObject("Divine Dog"); val4.transform.SetPositionAndRotation(val3 - Vector3.up * 0.8f, Quaternion.LookRotation(val)); val4.AddComponent().Init(c, num < 0f, num); } Sfx.Play(SfxId.Web, c.Origin, 0.4f); Sfx.Play(SfxId.Chant, c.Origin, 0.45f); } } internal sealed class ShadowDog : MonoBehaviour { private Summon summon; private Cast c; private ShikigamiModels.Dog m; private readonly NavFollower nav = new NavFollower(); private float life; private float t; private float bite; private float retarget; private float lunge; private float phase; private float side; private Enemy foe; private PlayerAvatar prey; private ParticleSystem trail; internal void Init(Cast cast, bool white, float s) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) c = cast; side = s; life = (c.Hostile ? 8f : 10f); m = ShikigamiModels.BuildDog(((Component)this).transform, white); m.Root.localScale = Vector3.one * 1.1f; ShikigamiModels.Layer(((Component)this).transform); trail = Vfx.Emitter("Dog Shadow", ((Component)this).transform.position, ((Component)this).transform, Vfx.SmokeMat, MegumiStats.Shadow, Color.black, 18f, 0.3f, 0.3f, 0.6f, 0.3f, -0.1f, (ParticleSystemShapeType)0); summon = Summon.Attach(((Component)this).gameObject, c, (!white) ? 1 : 0, 50f, m.Body, 0.45f); } private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) //IL_00bd: 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_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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0255: 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_021e: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_025f: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: 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_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: 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_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; if (t >= life) { ShadowFx.Pool(((Component)this).transform.position, 0.8f, 1f); ShadowFx.Smoke(((Component)this).transform.position + Vector3.up * 0.5f, 0.35f, 20); Vfx.StopEmitter(trail, 0.8f); Object.Destroy((Object)(object)((Component)this).gameObject); } else { if (Object.op_Implicit((Object)(object)summon) && summon.Frozen) { return; } Vector3 position = ((Component)this).transform.position; if (t < 0.4f) { ((Component)this).transform.position = position + Vector3.up * 2f * deltaTime; return; } retarget -= deltaTime; if (retarget <= 0f) { retarget = 0.5f; if (c.Hostile) { prey = BossHits.NearestPlayer(position, 30f); } else { foe = TenShadows.NearestEnemy(position, 25f); } } if (Object.op_Implicit((Object)(object)foe) && (!((Behaviour)foe).isActiveAndEnabled || (foe.HasHealth && foe.Health.dead))) { foe = null; } bool num = ((!c.Hostile) ? Object.op_Implicit((Object)(object)foe) : (Object.op_Implicit((Object)(object)prey) && !prey.deadSet)); Vector3 val = Vector3.zero; Vector3 goal; float stopAt; if (num) { val = (c.Hostile ? BossHits.Center(prey) : Combat.Center(foe)); goal = (c.Hostile ? ((Component)prey).transform.position : val); stopAt = 0.9f; } else { Transform val2 = TenShadows.Owner(c); goal = (Object.op_Implicit((Object)(object)val2) ? (val2.position + val2.right * side * 1.2f - val2.forward * 0.5f) : position); stopAt = 1.4f; } float num2 = (c.Hostile ? 5.2f : 8.5f); Vector3 val3 = nav.Step(position, goal, num2, deltaTime, stopAt); Vector3 val4 = val3 - position; ((Component)this).transform.position = val3; Vector3 val5 = (num ? Vector3.ProjectOnPlane(val - val3, Vector3.up) : Vector3.ProjectOnPlane(val4, Vector3.up)); if (((Vector3)(ref val5)).sqrMagnitude > 0.0001f) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Quaternion.LookRotation(val5), deltaTime * 10f); } float num3 = Mathf.Clamp01(((Vector3)(ref val4)).magnitude / Mathf.Max(deltaTime, 0.0001f) / num2); phase += deltaTime * (6f + 10f * num3); Animate(num3, deltaTime); if (!num) { return; } bite -= deltaTime; if (!(bite > 0f) && !(Vector3.Distance(val3 + Vector3.up * 0.6f, val) > 1.6f)) { bite = 0.7f; lunge = 0.25f; Sfx.Play(SfxId.HeavySlash, val, 0.35f); Vfx.Burst(val, MegumiStats.Shadow, Color.black, 8, 3f, 0.12f, 0.4f, 0f, Vfx.SmokeMat, 0.2f); Vector3 val6 = val - val3; Vector3 normalized = ((Vector3)(ref val6)).normalized; PlayerAvatar me; if (!c.Hostile) { Combat.HurtEnemy(foe, 14f * MegumiStats.Power, normalized, 0.4f, 1.5f); } else if ((Object)(object)prey == (Object)(object)PlayerAvatar.instance && BossHits.LocalTarget(out me)) { BossHits.Hurt(c, me, 6, Vector3.zero); } } } } private void Animate(float run, float dt) { //IL_0082: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(phase); for (int i = 0; i < 4; i++) { float num2 = ((i == 0 || i == 3) ? num : (0f - num)); m.Legs[i].localRotation = Quaternion.Euler(num2 * 40f * run, 0f, 0f); } m.Body.localPosition = new Vector3(0f, 0.62f + Mathf.Abs(Mathf.Cos(phase)) * 0.05f * run, 0f); lunge -= dt; float num3 = Mathf.Clamp01(lunge / 0.25f); m.Head.localPosition = new Vector3(0f, 0.22f - num3 * 0.05f, 0.5f + num3 * 0.18f); m.Head.localRotation = Quaternion.Euler(num3 * 20f, 0f, 0f); m.Tail.localRotation = Quaternion.Euler(0f, Mathf.Sin(phase * 0.7f) * 25f, 0f); } } internal sealed class NueStrike : MonoBehaviour { private const float Speed = 17f; private const float Range = 28f; private const float Radius = 3.5f; private Cast c; private Transform wingL; private Transform wingR; private Transform model; private float traveled; private float t; private float after; private bool struck; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Nue").AddComponent().Init(c); } private void Init(Cast cast) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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) c = cast; ((Component)this).transform.SetPositionAndRotation(c.Origin, Quaternion.LookRotation(c.Dir)); model = ShikigamiModels.BuildNue(((Component)this).transform, out wingL, out wingR); model.localScale = Vector3.one * 1.1f; Summon.Attach(((Component)this).gameObject, c, 0, 25f, model, 0.6f); ShikigamiModels.Layer(((Component)this).transform); ShadowFx.Smoke(c.Origin, 0.4f, 18); Sfx.Play(SfxId.Slash, c.Origin, 0.5f); } private void Update() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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) //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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; float num = Mathf.Sin(t * (struck ? 9f : 15f)) * 35f; wingL.localRotation = Quaternion.Euler(0f, 0f, 0f - num); wingR.localRotation = Quaternion.Euler(0f, 0f, num); if (struck) { after += deltaTime; Transform transform = ((Component)this).transform; transform.position += (((Component)this).transform.forward * 3f + Vector3.up * 4f) * deltaTime; model.localScale = Vector3.one * 1.1f * Mathf.Clamp01(1f - after / 0.8f); if (after >= 0.8f) { ShadowFx.Smoke(((Component)this).transform.position, 0.4f, 15); Object.Destroy((Object)(object)((Component)this).gameObject); } return; } Vector3 position = ((Component)this).transform.position; float num2 = 17f * deltaTime; RaycastHit val = default(RaycastHit); bool flag = Physics.SphereCast(position, 0.25f, c.Dir, ref val, num2, Combat.WorldMask, (QueryTriggerInteraction)1); Vector3 val2 = (flag ? (((RaycastHit)(ref val)).point - c.Dir * 0.3f) : (position + c.Dir * num2)); if (c.Hostile) { if (traveled > 1f && BossHits.AnyPlayerNear(position, val2, 1.4f, out var at)) { Strike(at); return; } } else { foreach (Enemy item in Combat.Enemies()) { Vector3 val3 = Combat.Center(item); if (Combat.DistanceToSegment(val3, position, val2) < 1.6f) { Strike(val3); return; } } } ((Component)this).transform.position = val2; traveled += Vector3.Distance(position, val2); if (flag || traveled >= 28f) { Strike(val2); } } private void Strike(Vector3 at) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0180: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) struck = true; for (int i = 0; i < 3; i++) { ShadowFx.Bolt(((Component)this).transform.position, at + Random.insideUnitSphere * 0.4f, 0.05f, 0.4f); } ShadowFx.Sparks(at, 3.5f, 7); Vfx.Shake(at, 5f); Sfx.Play(SfxId.BlackFlash, at, 0.7f); Sfx.Play(SfxId.Tear, at, 0.35f); PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item) - at; if (!(((Vector3)(ref val)).magnitude > 3.5f)) { Combat.HurtEnemy(item, 45f * MegumiStats.Power * (1f - 0.4f * ((Vector3)(ref val)).magnitude / 3.5f), val + Vector3.up, 2.5f, 3f); } } Combat.DamageDoorsSphere(at, 2f, 30f, at); Combat.HitObjectsSphere(at, 3.5f, Combat.Impact.Light, 2f); } else if (BossHits.LocalNear(at, 3.2f, needSight: false, out me)) { BossHits.Hurt(c, me, 20, c.Dir * 4f + Vector3.up * 3f, 1f); } } } internal static class ShadowStep { internal static void Run(Cast c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) Vector3 val = c.Origin + c.Dir * c.Extra; Vector3[] array = (Vector3[])(object)new Vector3[2] { c.Origin, val }; foreach (Vector3 val2 in array) { ShadowFx.Pool(val2, 0.9f, 1f); ShadowFx.Smoke(val2 + Vector3.up * 0.6f, 0.4f, 22); } Sfx.Play(SfxId.Slash, c.Origin, 0.35f); Sfx.Play(SfxId.Heal, val, 0.4f); } } internal sealed class ToadTongue : MonoBehaviour { private const float Range = 14f; private const float Extend = 0.22f; private const float Retract = 0.4f; private const float Stay = 1.4f; private Cast c; private Transform mouth; private Transform toad; private LineRenderer tongue; private Enemy foe; private PlayerAvatar prey; private Vector3 reach; private float t; private bool grabbed; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Toad").AddComponent().Init(c); } private void Init(Cast cast) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) c = cast; Vector3 val = TenShadows.Flat(c.Dir); Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 val3 = ShadowFx.Ground(c.Hostile ? (c.Origin + val * 1f) : (c.Origin + val2 * 0.8f + val * 0.9f)); ((Component)this).transform.SetPositionAndRotation(val3, Quaternion.LookRotation(val)); toad = ShikigamiModels.BuildToad(((Component)this).transform, out mouth); Summon.Attach(((Component)this).gameObject, c, 0, 40f, mouth, 0.6f); ShikigamiModels.Layer(((Component)this).transform); ShadowFx.Pool(val3, 0.7f, 1.8f); if (c.Hostile) { prey = TenShadows.PlayerInAim(c.Origin, c.Dir, 14f, 25f); } else { foe = Cleave.FindTarget(c.Origin, c.Dir, 14f, 20f); } reach = c.Origin + c.Dir * 14f; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(c.Origin, c.Dir, ref val4, 14f, Combat.WorldMask, (QueryTriggerInteraction)1)) { reach = ((RaycastHit)(ref val4)).point; } tongue = Vfx.Line("Toad Tongue", 2, 0.07f, new Color(0.85f, 0.35f, 0.45f)); ((Component)tongue).transform.SetParent(((Component)this).transform, false); ((Renderer)tongue).enabled = false; Sfx.Play(SfxId.Web, val3, 0.3f); } private Vector3 TargetPoint() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)foe)) { return Combat.Center(foe); } if (Object.op_Implicit((Object)(object)prey)) { return BossHits.Center(prey); } return reach; } private void Update() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_00fc: 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_0087: 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) t += Time.deltaTime; Vector3 position = mouth.position; if (t < 0.62f) { ((Renderer)tongue).enabled = true; Vector3 val = ((t < 0.22f) ? Vector3.Lerp(position, TargetPoint(), t / 0.22f) : Vector3.Lerp(TargetPoint(), position, (t - 0.22f) / 0.4f)); tongue.SetPosition(0, position); tongue.SetPosition(1, val); if (t >= 0.22f && !grabbed) { Grab(); } } else { ((Renderer)tongue).enabled = false; } if (t >= 1.4f) { toad.localPosition = Vector3.down * 0.8f * Mathf.Clamp01((t - 1.4f) / 0.4f); } if (t >= 1.8499999f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Grab() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) grabbed = true; Vector3 val = ((Component)this).transform.position + ((Component)this).transform.forward * 1.5f + Vector3.up * 0.8f; Vector3 val2 = TargetPoint(); Vector3 dir = val - val2; float magnitude = ((Vector3)(ref dir)).magnitude; if (Object.op_Implicit((Object)(object)foe) || Object.op_Implicit((Object)(object)prey)) { Sfx.Play(SfxId.HeavySlash, val2, 0.4f); } PlayerAvatar me; if (!c.Hostile) { if (Object.op_Implicit((Object)(object)foe)) { Combat.HurtEnemy(foe, 10f * MegumiStats.Power, dir, 1.5f, Mathf.Min(16f, magnitude * 1.5f)); } } else if (Object.op_Implicit((Object)(object)prey) && (Object)(object)prey == (Object)(object)PlayerAvatar.instance && BossHits.LocalTarget(out me)) { BossHits.Hurt(c, me, 6, ((Vector3)(ref dir)).normalized * Mathf.Min(16f, magnitude * 1.4f) + Vector3.up * 3f, 1.2f); } } } internal sealed class MaxElephant : MonoBehaviour { private const float Height = 2.7f; private const float Radius = 4.5f; private const float SprayTime = 1.6f; private const float SprayRange = 10f; private const float SprayAngle = 35f; private Cast c; private Transform model; private Transform trunkTip; private Vector3 ground; private Vector3 fwd; private float t; private float delay; private float fallFrom; private float scale; private float y; private float vy; private float tick; private bool landed; private float landedAt = -1f; private ParticleSystem spray; private GameObject marker; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Max Elephant").AddComponent().Init(c); } private void Init(Cast cast) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) c = cast; ground = ShadowFx.Ground(c.Origin); fwd = TenShadows.Flat(c.Dir); delay = (c.Hostile ? 1.2f : 0.45f); float num = 9f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(ground + Vector3.up * 0.3f, Vector3.up, ref val, 9f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num = ((RaycastHit)(ref val)).distance + 0.3f; } scale = Mathf.Clamp((num - 0.15f) / 2.7f, 0.5f, 1.1f); fallFrom = Mathf.Clamp(num - 2.7f * scale - 0.1f, 0f, 7f); ((Component)this).transform.SetPositionAndRotation(ground + Vector3.up * fallFrom, Quaternion.LookRotation(fwd)); model = ShikigamiModels.BuildElephant(((Component)this).transform, out trunkTip); model.localScale = Vector3.one * scale; ShikigamiModels.Layer(((Component)this).transform); ((Component)model).gameObject.SetActive(false); y = fallFrom; Summon.Attach(((Component)this).gameObject, c, 0, 150f, trunkTip, 1.8f); Material mat = new Material(Vfx.Unlit(MegumiStats.Shadow)); marker = Vfx.Prim((PrimitiveType)0, null, ground + Vector3.up * 0.03f, Vector3.one * 0.01f, Quaternion.identity, mat); ((Object)marker).name = "Elephant Shadow"; float grow = delay; Vfx.Animate(marker, delay + 4f, delegate(float k) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) float num2 = k * (grow + 4f); float num3 = 4.5f * Mathf.Clamp01(num2 / grow) * Mathf.Clamp01((grow + 4f - num2) / 0.8f); marker.transform.localScale = new Vector3(num3 * 2f, 0.02f, num3 * 2f); if (k >= 1f) { Object.Destroy((Object)(object)mat); } }); if (c.Hostile) { Vfx.Shockwave(ground + Vector3.up * 0.1f, Vector3.up, 4.5f, 0.1f, MegumiStats.Glow, delay); } Sfx.Play(SfxId.Chant, ground, 0.5f); } private void Update() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; if (t < delay) { return; } if (!landed) { ((Component)model).gameObject.SetActive(true); vy -= 30f * deltaTime; y += vy * deltaTime; if (y <= 0f) { y = 0f; landed = true; landedAt = t; Land(); } ((Component)this).transform.position = ground + Vector3.up * y; return; } float num = t - landedAt; if (num < 1.6f) { tick -= deltaTime; if (tick <= 0f) { tick = 0.3f; Spray(); } } else if (Object.op_Implicit((Object)(object)spray)) { Vfx.StopEmitter(spray, 1f); spray = null; } float num2 = Mathf.Clamp01((num - 1.6f - 0.2f) / 0.8f); ((Component)this).transform.position = ground - Vector3.up * 2.7f * scale * num2; if (num2 >= 1f) { ShadowFx.Smoke(ground + Vector3.up * 0.5f, 1f); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Land() { //IL_0001: 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) Vfx.Shake(ground, 12f, 0.7f); Sfx.Play(SfxId.Boom, ground); Vfx.Shockwave(ground + Vector3.up * 0.15f, Vector3.up, 6.2999997f, 0.15f, new Color(0.7f, 0.65f, 0.6f), 0.6f); Vfx.Burst(ground + Vector3.up * 0.3f, new Color(0.45f, 0.4f, 0.35f, 0.8f), new Color(0.2f, 0.18f, 0.16f, 0.7f), 60, 7f, 0.4f, 1.2f, 0.5f, Vfx.SmokeMat, 2.25f); spray = Vfx.Emitter("Elephant Water", trunkTip.position, trunkTip, Vfx.GlowMat, Color.white, MegumiStats.Water, 160f, 13f, 0.3f, 0.8f, 0.1f, 0.6f, (ParticleSystemShapeType)4); ((Component)spray).transform.rotation = Quaternion.LookRotation(fwd + Vector3.down * 0.15f); Sfx.Play(SfxId.FireLaunch, trunkTip.position, 0.5f); Vector3 val2; PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item) - ground; val2 = Vector3.ProjectOnPlane(val, Vector3.up); if (!(((Vector3)(ref val2)).magnitude > 4.5f) && !(val.y > 5f)) { float damage = 110f * MegumiStats.Power; val2 = Vector3.ProjectOnPlane(val, Vector3.up); Combat.HurtEnemy(item, damage, ((Vector3)(ref val2)).normalized + Vector3.up, 3f, 8f); } } Combat.DamageDoorsSphere(ground + Vector3.up, 4.5f, 80f, ground); Combat.HitObjectsSphere(ground, 4.5f, Combat.Impact.Heavy, 8f, 0.7f); } else if (BossHits.LocalTarget(out me)) { Vector3 val3 = BossHits.Center(me) - ground; val2 = Vector3.ProjectOnPlane(val3, Vector3.up); if (((Vector3)(ref val2)).magnitude < 4f && val3.y < 4f) { Cast cast = c; PlayerAvatar me2 = me; val2 = Vector3.ProjectOnPlane(val3, Vector3.up); BossHits.Hurt(cast, me2, 40, (((Vector3)(ref val2)).normalized + Vector3.up) * 12f, 2f); } } } private void Spray() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_00bc: 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) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) Vector3 position = trunkTip.position; PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item) - position; if (!(((Vector3)(ref val)).magnitude > 10f) && !(Vector3.Angle(fwd, val) > 35f)) { Combat.HurtEnemy(item, 6f * MegumiStats.Power, fwd + Vector3.up * 0.2f, 0.4f, 7f); } } Combat.HitObjectsSphere(position + fwd * 4f, 4f, Combat.Impact.None, 5f, 0.2f); } else if (BossHits.LocalTarget(out me)) { Vector3 val2 = BossHits.Center(me) - position; if (((Vector3)(ref val2)).magnitude < 10f && Vector3.Angle(fwd, val2) < 35f) { BossHits.Hurt(c, me, 3, fwd * 9f + Vector3.up * 2f, 0.8f); } } } } internal sealed class ShadowGarden : MonoBehaviour { internal static readonly List Active = new List(); private Cast c; private Vector3 center; private float radius; private float duration; private float t; private float tick; private Material floorMat; private LineRenderer ring; private ParticleSystem bubbles; private readonly List tendrils = new List(); internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Chimera Shadow Garden").AddComponent().Init(c); } private bool Contains(Vector3 p) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (t < duration) { Vector3 val = Vector3.ProjectOnPlane(p - center, Vector3.up); if (((Vector3)(ref val)).magnitude < radius) { return Mathf.Abs(p.y - center.y) < 4f; } } return false; } internal static bool LocalInside() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } foreach (ShadowGarden item in Active) { if (Object.op_Implicit((Object)(object)item) && item.Contains(((Component)instance).transform.position)) { return true; } } return false; } internal static bool LocalInOwn() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } foreach (ShadowGarden item in Active) { if (Object.op_Implicit((Object)(object)item) && item.c.Local && item.Contains(((Component)instance).transform.position)) { return true; } } return false; } private void Init(Cast cast) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) c = cast; Active.Add(this); radius = (c.Hostile ? 9f : 11f); duration = (c.Hostile ? 7f : 10f); center = ShadowFx.Ground(c.Origin); ((Component)this).transform.position = center; floorMat = new Material(Vfx.Unlit(new Color(0.02f, 0.015f, 0.05f, 0.92f))); ((Object)Vfx.Prim((PrimitiveType)0, ((Component)this).transform, Vector3.up * 0.03f, new Vector3(0.01f, 0.02f, 0.01f), Quaternion.identity, floorMat)).name = "Shadow Sea"; ring = Vfx.Line("Garden Boundary", 73, 0.1f, MegumiStats.Glow); ((Component)ring).transform.SetParent(((Component)this).transform, false); ring.loop = true; for (int i = 0; i < 73; i++) { float num = (float)i / 72f * MathF.PI * 2f; ring.SetPosition(i, center + new Vector3(Mathf.Cos(num) * radius, 0.06f, Mathf.Sin(num) * radius)); } bubbles = Vfx.Emitter("Garden Shadows", center, ((Component)this).transform, Vfx.SmokeMat, MegumiStats.Shadow, Color.black, 120f, 0.6f, 0.45f, 1.6f, radius, -0.25f, (ParticleSystemShapeType)0); ShapeModule shape = bubbles.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).rotation = new Vector3(-90f, 0f, 0f); Material mat = Vfx.Lit(new Color(0.02f, 0.02f, 0.03f)); Random random = new Random((int)(c.Origin.x * 13f + c.Origin.z * 7f)); for (int j = 0; j < 12; j++) { float num2 = (float)random.NextDouble() * MathF.PI * 2f; float num3 = (0.25f + 0.7f * (float)random.NextDouble()) * radius; Transform val = BossModel.Pivot("Tendril", ((Component)this).transform, new Vector3(Mathf.Cos(num2) * num3, 0f, Mathf.Sin(num2) * num3)); Vfx.Prim((PrimitiveType)1, val, new Vector3(0f, 0.8f, 0f), new Vector3(0.12f, 0.8f, 0.12f), Quaternion.identity, mat); val.localScale = new Vector3(1f, 0f, 1f); tendrils.Add(val); } Sfx.Play(SfxId.Domain, center); Vfx.Shake(center, 5f, 1f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && (c.Local || Vector3.Distance(((Component)instance).transform.position, center) < radius * 2f)) { Hud.Banner("DOMAIN EXPANSION", "Chimera Shadow Garden", MegumiStats.Glow, 3f); } } private void Update() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: 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_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; float num = Mathf.Clamp01(t / 0.6f) * Mathf.Clamp01((duration + 0.8f - t) / 0.8f); if (Object.op_Implicit((Object)(object)floorMat)) { ((Component)this).transform.GetChild(0).localScale = new Vector3(radius * 2f * Mathf.Clamp01(t / 0.6f), 0.02f, radius * 2f * Mathf.Clamp01(t / 0.6f)); floorMat.color = new Color(0.02f, 0.015f, 0.05f, 0.92f * num); } if (Object.op_Implicit((Object)(object)ring)) { Color glow = MegumiStats.Glow; glow.a = num * (0.6f + 0.4f * Mathf.Sin(t * 4f)); LineRenderer obj = ring; Color startColor = (ring.endColor = glow); obj.startColor = startColor; } for (int i = 0; i < tendrils.Count; i++) { Transform obj2 = tendrils[i]; float num2 = num * (0.7f + 0.5f * Mathf.Sin(t * 1.3f + (float)i)); obj2.localScale = new Vector3(1f, num2, 1f); obj2.localRotation = Quaternion.Euler(Mathf.Sin(t * 1.7f + (float)i * 2f) * 20f, (float)i * 30f, Mathf.Cos(t * 1.1f + (float)i) * 20f); } tick -= deltaTime; if (t < duration && tick <= 0f) { tick = 0.5f; PlayerAvatar me; if (!c.Hostile) { if (Combat.IsHost) { foreach (Enemy item in Combat.Enemies()) { if (Contains(Combat.Center(item))) { Vfx.Burst(Combat.Center(item) - Vector3.up * 0.6f, MegumiStats.Shadow, Color.black, 6, 2f, 0.2f, 0.6f, -0.2f, Vfx.SmokeMat, 0.3f); Combat.HurtEnemy(item, 8f * MegumiStats.Power, Vector3.down, 0.6f, 0f); } } } } else if (BossHits.LocalTarget(out me) && Contains(((Component)me).transform.position)) { if (Object.op_Implicit((Object)(object)PlayerController.instance)) { PlayerController.instance.OverrideSpeed(0.45f, 0.6f, -1f); } BossHits.Hurt(c, me, 3, Vector3.zero); } } if (t >= duration + 0.8f) { Vfx.StopEmitter(bubbles, 1.2f); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void OnDestroy() { Active.Remove(this); if (Object.op_Implicit((Object)(object)floorMat)) { Object.Destroy((Object)(object)floorMat); } } } internal static class Mahoraga { internal const float ChantTime = 1.5f; private static readonly Dictionary chanting = new Dictionary(); internal static void Chant(Cast c) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) StopChant(c.Key); Sfx.Play(SfxId.Chant, c.Origin, 0.8f); PlayerAvatar instance = PlayerAvatar.instance; if (!c.Local && Object.op_Implicit((Object)(object)instance) && Vector3.Distance(((Component)instance).transform.position, c.Origin) < 35f) { Hud.Banner("\"WITH THIS TREASURE I SUMMON...\"", "", MegumiStats.Glow, 1.8f); } GameObject val = new GameObject("Mahoraga Chant"); FollowHand followHand = val.AddComponent(); followHand.Target = c.Caster; if (c.Hostile) { followHand.Anchor = c.Enemy.HandPoint; } ((Component)Vfx.Emitter("Chant Shadows", val.transform.position, val.transform, Vfx.SmokeMat, MegumiStats.Shadow, Color.black, 40f, 0.8f, 0.2f, 0.7f, 0.25f, -0.2f, (ParticleSystemShapeType)0)).transform.localPosition = Vector3.zero; Object.Destroy((Object)(object)val, 3f); chanting[c.Key] = val; } internal static void StopChant(Object key) { if (Object.op_Implicit(key) && chanting.TryGetValue(key, out var value)) { chanting.Remove(key); if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } } } internal static void Summon(Cast c) { //IL_000d: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00ac: 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_00b3: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) StopChant(c.Key); Vector3 val = ShadowFx.Ground(c.Origin); ShadowFx.Pool(val, 2f, 2f); Vfx.Shake(val, 10f, 0.8f); Sfx.Play(SfxId.Boom, val, 0.7f); Sfx.Play(SfxId.Domain, val, 0.6f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && (c.Local || Vector3.Distance(((Component)instance).transform.position, val) < 35f)) { Hud.Banner("MAHORAGA", "Eight-Handled Sword Divergent Sila Divine General", MegumiStats.Gold, 3.5f); } GameObject val2 = new GameObject("Mahoraga"); val2.transform.SetPositionAndRotation(val, Quaternion.LookRotation(TenShadows.Flat(c.Dir))); val2.AddComponent().Init(c); } } internal sealed class MahoragaActor : MonoBehaviour { private Summon summon; private const float Rise = 0.8f; private const float Sink = 0.8f; private const float Windup = 0.35f; private const float Recover = 0.4f; private Cast c; private ShikigamiModels.General g; private readonly NavFollower nav = new NavFollower(); private float life; private float t; private float swing = -1f; private float strikeCd; private float retarget; private float phase; private float scale; private float wheelAngle; private float wheelTarget; private int adapted; private Enemy foe; private PlayerAvatar prey; private Vector3 ground; internal void Init(Cast cast) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) c = cast; life = (c.Hostile ? 14f : 15f); ground = ((Component)this).transform.position; float num = 5f; RaycastHit val = default(RaycastHit); if (Physics.Raycast(ground + Vector3.up * 0.3f, Vector3.up, ref val, 5f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num = ((RaycastHit)(ref val)).distance + 0.3f; } scale = Mathf.Clamp((num - 0.1f) / 2.45f, 0.95f, 1.6f); g = ShikigamiModels.BuildMahoraga(((Component)this).transform); g.Root.localScale = Vector3.one * scale; ShikigamiModels.Layer(((Component)this).transform); g.Root.localPosition = Vector3.down * 2.5f * scale; summon = Summon.Attach(((Component)this).gameObject, c, 0, 300f, g.Chest, 1f, adapts: true); BossModel.PointLight(g.Chest, new Vector3(0f, 0.4f, 0.6f), new Color(1f, 0.92f, 0.75f), 4f, 1.2f); } private void Update() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; if (Object.op_Implicit((Object)(object)summon) && summon.Frozen) { return; } if (t < 0.8f) { g.Root.localPosition = Vector3.down * 2.5f * scale * (1f - t / 0.8f); return; } if (t > life) { float num = Mathf.Clamp01((t - life) / 0.8f); g.Root.localPosition = Vector3.down * 2.5f * scale * num; if (num >= 1f) { ShadowFx.Pool(((Component)this).transform.position, 1.6f, 1.2f); Object.Destroy((Object)(object)((Component)this).gameObject); } return; } g.Root.localPosition = Vector3.zero; retarget -= deltaTime; if (retarget <= 0f) { retarget = 0.5f; if (c.Hostile) { prey = BossHits.NearestPlayer(((Component)this).transform.position + Vector3.up, 35f); } else { foe = TenShadows.NearestEnemy(((Component)this).transform.position + Vector3.up, 30f); } } if (Object.op_Implicit((Object)(object)foe) && (!((Behaviour)foe).isActiveAndEnabled || (foe.HasHealth && foe.Health.dead))) { foe = null; } bool flag = ((!c.Hostile) ? Object.op_Implicit((Object)(object)foe) : (Object.op_Implicit((Object)(object)prey) && !prey.deadSet)); Vector3 val = ((!flag) ? Vector3.zero : (c.Hostile ? BossHits.Center(prey) : Combat.Center(foe))); Transform val2 = TenShadows.Owner(c); Vector3 goal = (flag ? val : (Object.op_Implicit((Object)(object)val2) ? (val2.position - val2.forward * 2f) : ((Component)this).transform.position)); Vector3 position = ((Component)this).transform.position; float num2 = (c.Hostile ? 4.2f : 5.5f); Vector3 val3 = ((swing >= 0f) ? position : nav.Step(position, goal, num2, deltaTime, flag ? 2.2f : 2.5f)); Vector3 val4 = val3 - position; float run = Mathf.Clamp01(((Vector3)(ref val4)).magnitude / Mathf.Max(deltaTime, 0.0001f) / num2); ((Component)this).transform.position = val3; Vector3 val5 = (flag ? Vector3.ProjectOnPlane(val - val3, Vector3.up) : Vector3.ProjectOnPlane(val3 - position, Vector3.up)); if (((Vector3)(ref val5)).sqrMagnitude > 0.0001f) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Quaternion.LookRotation(val5), deltaTime * 6f); } strikeCd -= deltaTime; if (swing < 0f && flag && strikeCd <= 0f && Vector3.Distance(val3 + Vector3.up * 1.2f, val) < 3.2f) { swing = 0f; } if (swing >= 0f) { float num3 = swing; swing += deltaTime; if (num3 < 0.35f && swing >= 0.35f) { Strike(flag ? val : (val3 + ((Component)this).transform.forward * 2f + Vector3.up)); } if (swing >= 0.75f) { swing = -1f; strikeCd = 1.1f; } } Animate(run, deltaTime); } private void Strike(Vector3 at) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0058: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_016f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(at - ((Component)this).transform.position, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; Vfx.SlashLine(at, Quaternion.AngleAxis(60f, normalized) * Vector3.up, 3.2f, 0.16f, Color.white, 0.4f); Vfx.Burst(at, Color.white, MegumiStats.Gold, 18, 6f, 0.15f, 0.4f, 0f, Vfx.GlowMat, 0.3f); Vfx.Shake(at, 7f, 0.35f); Sfx.Play(SfxId.HeavySlash, at); Sfx.Play(SfxId.BlackFlash, at, 0.5f); float num = 1f + 0.25f * (float)adapted; adapted++; wheelTarget += 45f; Sfx.Play(SfxId.Chant, ((Component)this).transform.position + Vector3.up * 3f, 0.25f); PlayerAvatar me; if (!c.Hostile) { if (Combat.IsHost) { if (Object.op_Implicit((Object)(object)foe) && Vector3.Distance(Combat.Center(foe), at) < 3.2f) { Combat.HurtEnemy(foe, 140f * MegumiStats.Power * num, normalized + Vector3.up * 0.3f, 2.5f, 10f); } Combat.DamageDoorsSphere(at, 2f, 80f, ((Component)this).transform.position); Combat.HitObjectsSphere(at, 2.5f, Combat.Impact.Heavy, 8f); } } else if (BossHits.LocalNear(at, 3f, needSight: false, out me)) { BossHits.Hurt(c, me, Mathf.RoundToInt(30f * Mathf.Min(num, 1.6f)), normalized * 14f + Vector3.up * 4f); } } private void Animate(float run, float dt) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) phase += dt * (3f + run * 5f); float num = Mathf.Sin(phase); g.LegL.localRotation = Quaternion.Euler(num * 28f * run, 0f, 0f); g.LegR.localRotation = Quaternion.Euler((0f - num) * 28f * run, 0f, 0f); g.KneeL.localRotation = Quaternion.Euler((0f - Mathf.Max(0f, 0f - num)) * 35f * run, 0f, 0f); g.KneeR.localRotation = Quaternion.Euler((0f - Mathf.Max(0f, num)) * 35f * run, 0f, 0f); g.ArmL.localRotation = Quaternion.Slerp(g.ArmL.localRotation, Quaternion.Euler(-30f + num * 15f * run, 0f, 15f), dt * 8f); g.ElbowL.localRotation = Quaternion.Euler(-40f, 0f, 0f); Quaternion val = Quaternion.Euler(-20f - num * 10f * run, 0f, -10f); if (swing >= 0f) { val = ((swing < 0.35f) ? Quaternion.Euler(-150f, 0f, -20f) : Quaternion.Euler(-40f, 0f, 30f)); } g.ArmR.localRotation = Quaternion.Slerp(g.ArmR.localRotation, val, dt * ((swing >= 0f) ? 20f : 8f)); g.ElbowR.localRotation = Quaternion.Slerp(g.ElbowR.localRotation, Quaternion.Euler((swing >= 0f && swing < 0.35f) ? (-30f) : (-10f), 0f, 0f), dt * 12f); wheelAngle = Mathf.MoveTowards(wheelAngle, wheelTarget, dt * 180f); g.Wheel.localRotation = Quaternion.Euler(-6f, wheelAngle, 0f); } } [BepInDependency("REPOLib", "4.3.0")] [BepInPlugin("com.kpcnre.repo.sukuna", "JJK Cursed Techniques", "1.2.5")] public class Plugin : BaseUnityPlugin { public const string ModId = "com.kpcnre.repo.sukuna"; public const string ModName = "JJK Cursed Techniques"; public const string Version = "1.2.5"; internal static ManualLogSource Log; private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; SukunaConfig.Bind(((BaseUnityPlugin)this).Config); TechInfo.Init(); try { new Harmony("com.kpcnre.repo.sukuna").PatchAll(); } catch (Exception ex) { Log.LogError((object)("Harmony patches failed, fingers may not save or show in the shop: " + ex)); } SukunaNet.Init(); Sfx.Init(); FingerItem.TryRegister(); GameObject val = new GameObject("Sukuna Controller") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); val.AddComponent(); val.AddComponent(); val.AddComponent(); val.AddComponent(); val.AddComponent(); val.AddComponent(); Log.LogInfo((object)"JJK Cursed Techniques 1.2.5 loaded. Sukuna, Gojo and Megumi await."); } } internal interface IPowerHud { bool HudVisible { get; } string CountText { get; } Texture Icon { get; } Color Accent { get; } float Energy { get; } float MaxEnergy { get; } string EnergyTag { get; } bool EnergyPulse { get; } TechInfo[] Techs { get; } int UnlockLevel { get; } bool IsActive(TechInfo t); float Cooldown(TechInfo t); float CostOf(TechInfo t); } internal static class PowerHud { internal static IPowerHud Current { get { if (Object.op_Implicit((Object)(object)SukunaController.Instance) && SukunaController.Instance.HudVisible) { return SukunaController.Instance; } if (Object.op_Implicit((Object)(object)GojoController.Instance) && GojoController.Instance.HudVisible) { return GojoController.Instance; } if (Object.op_Implicit((Object)(object)MegumiController.Instance) && MegumiController.Instance.HudVisible) { return MegumiController.Instance; } return null; } } } internal static class RigFactory { private sealed class Built { public Rig Rig; public readonly Dictionary<(string, int), Mesh> Meshes = new Dictionary<(string, int), Mesh>(); public Material[] Mats; } private static readonly Dictionary cache = new Dictionary(); private static readonly Dictionary textures = new Dictionary(); internal static Dictionary Spawn(string key, Transform parent, bool shadows = true) { //IL_004a: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) Built built = Get(key); Dictionary dictionary = new Dictionary(); int layer = (Object.op_Implicit((Object)(object)parent) ? ((Component)parent).gameObject.layer : 0); foreach (RigPart part in built.Rig.Parts) { Transform transform = new GameObject(part.Name).transform; Transform value; Transform val = ((part.Parent != null && dictionary.TryGetValue(part.Parent, out value)) ? value : parent); transform.SetParent(val, false); transform.localPosition = new Vector3(part.Pos.X, part.Pos.Y, part.Pos.Z); transform.localRotation = Quaternion.Euler(part.Euler.X, part.Euler.Y, part.Euler.Z); ((Component)transform).gameObject.layer = layer; dictionary[part.Name] = transform; foreach (int key2 in part.Geo.Keys) { if (built.Meshes.TryGetValue((part.Name, key2), out var value2)) { GameObject val2 = new GameObject(built.Rig.Mats[key2].Name) { layer = layer }; val2.transform.SetParent(transform, false); val2.AddComponent().sharedMesh = value2; MeshRenderer obj = val2.AddComponent(); ((Renderer)obj).sharedMaterial = built.Mats[key2]; bool unlit = built.Rig.Mats[key2].Unlit; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)((shadows && !unlit) ? 1 : 0); ((Renderer)obj).receiveShadows = !unlit; } } } return dictionary; } private static Built Get(string key) { if (cache.TryGetValue(key, out var value) && value.Mats != null && value.Mats.Length != 0 && Object.op_Implicit((Object)(object)value.Mats[0])) { return value; } value = new Built { Rig = RigCatalog.All[key]() }; foreach (RigPart part in value.Rig.Parts) { foreach (KeyValuePair item in part.Geo) { if (!item.Value.Empty) { Mesh val = ItemFactory.ToMesh(item.Value.Build(), value.Rig.Name + " " + part.Name); ((Object)val).hideFlags = (HideFlags)32; value.Meshes[(part.Name, item.Key)] = val; } } } value.Mats = (Material[])(object)new Material[value.Rig.Mats.Count]; for (int i = 0; i < value.Mats.Length; i++) { value.Mats[i] = MakeMaterial(value.Rig.Mats[i], value.Rig.Name); } cache[key] = value; return value; } internal static Texture2D Texture(string kind) { if (textures.TryGetValue(kind, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } value = ItemFactory.ToTexture(TexGen.Make(kind), 128, "Rig " + kind); ((Texture)value).anisoLevel = 4; textures[kind] = value; return value; } private static Material MakeMaterial(RigMat m, string rig) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(m.R, m.G, m.B, m.A); if (m.Unlit) { return Vfx.Unlit(val); } Material litTemplate = ItemFactory.LitTemplate; Material val2 = (Material)((!Object.op_Implicit((Object)(object)litTemplate)) ? ((object)new Material(Shader.Find("Standard")) { color = val, mainTexture = (Texture)(object)Texture(m.Tex) }) : ((object)Vfx.Retexture(litTemplate, (Texture)(object)Texture(m.Tex), val))); ((Object)val2).name = rig + " " + m.Name; if (m.ER + m.EG + m.EB > 0f && val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", new Color(m.ER, m.EG, m.EB)); } string[] array = new string[2] { "_Glossiness", "_Smoothness" }; foreach (string text in array) { if (val2.HasProperty(text)) { val2.SetFloat(text, m.Gloss); } } ((Object)val2).hideFlags = (HideFlags)(((Object)val2).hideFlags | 0x20); return val2; } } internal sealed class DynamicTube : MonoBehaviour { private Mesh mesh; private MeshFilter filter; internal static DynamicTube Create(Transform parent, string materialKind, Color color, Color emission) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Tube"); val.transform.SetParent(parent, false); DynamicTube dynamicTube = val.AddComponent(); dynamicTube.filter = val.AddComponent(); MeshRenderer obj = val.AddComponent(); Material litTemplate = ItemFactory.LitTemplate; Material val2 = (Material)(Object.op_Implicit((Object)(object)litTemplate) ? ((object)Vfx.Retexture(litTemplate, (Texture)(object)RigFactory.Texture(materialKind), color)) : ((object)new Material(Shader.Find("Standard")) { color = color })); if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", emission); } ((Renderer)obj).sharedMaterial = val2; dynamicTube.mesh = new Mesh { name = "Dynamic Tube" }; dynamicTube.mesh.MarkDynamic(); dynamicTube.filter.sharedMesh = dynamicTube.mesh; return dynamicTube; } internal void Set(IList pts, IList radii) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.SetPositionAndRotation(Vector3.zero, Quaternion.identity); ((Component)this).transform.localScale = Vector3.one; if (Object.op_Implicit((Object)(object)((Component)this).transform.parent)) { ((Component)this).transform.localScale = new Vector3(1f / ((Component)this).transform.parent.lossyScale.x, 1f / ((Component)this).transform.parent.lossyScale.y, 1f / ((Component)this).transform.parent.lossyScale.z); } MeshBuilder meshBuilder = new MeshBuilder(); List list = new List(pts.Count); foreach (Vector3 pt in pts) { list.Add(new V3(pt.x, pt.y, pt.z)); } meshBuilder.Tube(list, radii, radii, V3.Up, 14, 0.6f, 1f, (int ring, float th) => 1f + 0.03f * Mathf.Sin(th * 6f + (float)ring), closedLoop: false, doubleSided: false, 3f, 3f); ModelMeshData modelMeshData = meshBuilder.Build(); int vertexCount = modelMeshData.VertexCount; Vector3[] array = (Vector3[])(object)new Vector3[vertexCount]; Vector3[] array2 = (Vector3[])(object)new Vector3[vertexCount]; Vector2[] array3 = (Vector2[])(object)new Vector2[vertexCount]; for (int num = 0; num < vertexCount; num++) { array[num] = new Vector3(modelMeshData.Positions[num * 3], modelMeshData.Positions[num * 3 + 1], modelMeshData.Positions[num * 3 + 2]); array2[num] = new Vector3(modelMeshData.Normals[num * 3], modelMeshData.Normals[num * 3 + 1], modelMeshData.Normals[num * 3 + 2]); array3[num] = new Vector2(modelMeshData.Uvs[num * 2], modelMeshData.Uvs[num * 2 + 1]); } mesh.Clear(); mesh.vertices = array; mesh.normals = array2; mesh.uv = array3; mesh.triangles = modelMeshData.Triangles; mesh.RecalculateBounds(); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)mesh)) { Object.Destroy((Object)(object)mesh); } MeshRenderer component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)((Renderer)component).sharedMaterial)) { Object.Destroy((Object)(object)((Renderer)component).sharedMaterial); } } } internal enum SfxId { Slash, HeavySlash, Web, FireCharge, FireLaunch, Boom, Domain, BlackFlash, Heal, Tear, Chant, Eat } internal static class Sfx { private struct OnePole { private float y; internal float Low(float x, float cutoff) { float num = 1f - Mathf.Exp(MathF.PI * -2f * cutoff / 44100f); y += num * (x - y); return y; } } private struct Biquad { private float x1; private float x2; private float y1; private float y2; internal float BandPass(float x, float freq, float q) { float num = MathF.PI * 2f * Mathf.Clamp(freq, 20f, 19845f) / 44100f; float num2 = Mathf.Sin(num) / (2f * q); float num3 = 0f - num2; float num4 = 1f + num2; float num5 = -2f * Mathf.Cos(num); float num6 = 1f - num2; float result = (num2 * x + num3 * x2 - num5 * y1 - num6 * y2) / num4; x2 = x1; x1 = x; y2 = y1; y1 = result; return result; } } private const int Rate = 44100; private static readonly Dictionary sounds = new Dictionary(); private static bool built; internal static void Init() { if (built) { return; } built = true; try { Add(SfxId.Slash, Slash(1), 0.55f, (AudioType)0, 0.08f); Add(SfxId.HeavySlash, HeavySlash(2), 0.7f, (AudioType)0, 0.06f); Add(SfxId.Web, Web(3), 0.75f, (AudioType)6, 0.05f); Add(SfxId.FireCharge, FireCharge(4), 0.5f, (AudioType)0, 0.03f); Add(SfxId.FireLaunch, FireLaunch(5), 0.75f, (AudioType)0, 0.05f); Add(SfxId.Boom, Boom(6), 1f, (AudioType)6, 0.05f); Add(SfxId.Domain, Domain(7), 0.9f, (AudioType)6, 0f); Add(SfxId.BlackFlash, BlackFlash(8), 0.9f, (AudioType)0, 0.04f); Add(SfxId.Heal, Heal(9), 0.35f, (AudioType)0, 0.08f); Add(SfxId.Tear, Tear(10), 1f, (AudioType)6, 0f); Add(SfxId.Chant, Chant(11), 0.6f, (AudioType)0, 0f); Add(SfxId.Eat, Eat(12), 0.8f, (AudioType)0, 0.05f); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Sukuna sounds could not be generated: " + ex.Message)); } } internal static void Play(SfxId id, Vector3 at, float volume = 1f) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)AudioManager.instance) || !sounds.TryGetValue(id, out var value)) { return; } try { value.Play(at, volume, 1f, 1f, 1f); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Sound " + id.ToString() + " failed: " + ex.Message)); } } private static void Add(SfxId id, float[] data, float volume, AudioType type, float pitchRandom) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) Normalize(data, 0.9f); AudioClip val = AudioClip.Create("Sukuna " + id, data.Length, 1, 44100, false); val.SetData(data, 0); ((Object)val).hideFlags = (HideFlags)32; Dictionary dictionary = sounds; SfxId key = id; Sound val2 = new Sound(); val2.Sounds = (AudioClip[])(object)new AudioClip[1] { val }; val2.Type = type; val2.Volume = volume; val2.VolumeRandom = 0.05f; val2.Pitch = 1f; val2.PitchRandom = pitchRandom; val2.SpatialBlend = 1f; val2.Doppler = 0f; val2.ReverbMix = 1f; val2.FalloffMultiplier = 1f; dictionary[key] = val2; } private static float[] Buffer(float seconds) { return new float[(int)(seconds * 44100f)]; } private static float Noise(Random r) { return (float)(r.NextDouble() * 2.0 - 1.0); } private static float Env(float t, float attack, float decay) { return ((attack > 0f) ? Mathf.Clamp01(t / attack) : 1f) * Mathf.Exp((0f - t) * decay); } private static void Normalize(float[] d, float peak) { float num = 1E-06f; for (int i = 0; i < d.Length; i++) { num = Mathf.Max(num, Mathf.Abs(d[i])); } float num2 = peak / num; for (int j = 0; j < d.Length; j++) { d[j] *= num2; } int num3 = Mathf.Min(d.Length / 2, 132); for (int k = 0; k < num3; k++) { d[k] *= (float)k / (float)num3; d[d.Length - 1 - k] *= (float)k / (float)num3; } } private static float[] Slash(int seed) { Random r = new Random(seed); float[] array = Buffer(0.32f); Biquad biquad = default(Biquad); float num = 0f; for (int i = 0; i < array.Length; i++) { float num2 = (float)i / 44100f; float num3 = biquad.BandPass(Noise(r), Mathf.Lerp(7000f, 2500f, num2 / 0.32f), 1.2f) * Env(num2, 0.004f, 18f); num += MathF.PI * 2f * Mathf.Lerp(5200f, 3100f, Mathf.Clamp01(num2 / 0.2f)) / 44100f; float num4 = Mathf.Sin(num) * Env(num2, 0.002f, 16f) * 0.35f; float num5 = biquad.BandPass(Noise(r), 1500f, 0.7f) * Mathf.Clamp01(num2 / 0.03f) * Mathf.Exp((0f - num2) * 30f) * 0.5f; array[i] = num3 * 1.4f + num4 + num5; } return array; } private static float[] HeavySlash(int seed) { Random r = new Random(seed); float[] array = Buffer(0.5f); OnePole onePole = default(OnePole); Biquad biquad = default(Biquad); float num = 0f; float num2 = 0f; for (int i = 0; i < array.Length; i++) { float num3 = (float)i / 44100f; float num4 = biquad.BandPass(Noise(r), Mathf.Lerp(5000f, 1200f, num3 / 0.5f), 0.9f) * Env(num3, 0.003f, 11f); num += MathF.PI * 2f * Mathf.Lerp(150f, 55f, Mathf.Clamp01(num3 / 0.15f)) / 44100f; float num5 = Mathf.Sin(num) * Env(num3, 0.002f, 16f) * 0.9f; num2 += 0.26358035f; float num6 = Mathf.Sin(num2) * Env(num3, 0.003f, 9f) * 0.12f; float num7 = onePole.Low(Noise(r), 700f) * Env(num3, 0.002f, 20f) * 1.5f; array[i] = num4 * 1.3f + num5 + num6 + num7; } return array; } private static float[] Web(int seed) { Random random = new Random(seed); float[] array = Buffer(1.1f); float[] array2 = Slash(seed + 100); for (int i = 0; i < 9; i++) { int num = (int)((0.02f + 0.07f * (float)i + 0.03f * (float)random.NextDouble()) * 44100f); float num2 = 0.6f - 0.04f * (float)i; for (int j = 0; j < array2.Length && num + j < array.Length; j++) { array[num + j] += array2[j] * num2; } } OnePole onePole = default(OnePole); for (int k = 0; k < array.Length; k++) { float t = (float)k / 44100f; array[k] += onePole.Low(Noise(random), 220f) * Env(t, 0.01f, 3.2f) * 3.5f; } return array; } private static float[] FireCharge(int seed) { Random random = new Random(seed); float[] array = Buffer(1.4f); OnePole onePole = default(OnePole); OnePole onePole2 = default(OnePole); float num = 0f; for (int i = 0; i < array.Length; i++) { float num2 = (float)i / 44100f; float num3 = Mathf.Clamp01(num2 / 1.1f); float num4 = onePole.Low(Noise(random), Mathf.Lerp(300f, 1400f, num3)) * (0.4f + 0.8f * num3); if (random.NextDouble() < 0.0012 + 0.002 * (double)num3) { num = (float)(random.NextDouble() * 0.8 + 0.2); } num *= 0.985f; float num5 = onePole2.Low(Noise(random), 4000f) * num; array[i] = (num4 * 2.2f + num5) * Mathf.Clamp01((1.4f - num2) / 0.15f); } return array; } private static float[] FireLaunch(int seed) { Random r = new Random(seed); float[] array = Buffer(0.9f); Biquad biquad = default(Biquad); OnePole onePole = default(OnePole); for (int i = 0; i < array.Length; i++) { float num = (float)i / 44100f; float num2 = Mathf.Sin(Mathf.Clamp01(num / 0.9f) * MathF.PI); float num3 = biquad.BandPass(Noise(r), Mathf.Lerp(400f, 1800f, num / 0.9f), 0.8f) * num2; float num4 = onePole.Low(Noise(r), 500f) * Env(num, 0.01f, 3f) * 2.5f; array[i] = num3 * 1.6f + num4; } return array; } private static float[] Boom(int seed) { Random r = new Random(seed); float[] array = Buffer(2.4f); OnePole onePole = default(OnePole); OnePole onePole2 = default(OnePole); float num = 0f; for (int i = 0; i < array.Length; i++) { float num2 = (float)i / 44100f; num += MathF.PI * 2f * Mathf.Lerp(70f, 32f, Mathf.Clamp01(num2 / 0.8f)) / 44100f; float num3 = Mathf.Sin(num) * Env(num2, 0.003f, 2.5f); float num4 = onePole.Low(Noise(r), 900f) * Env(num2, 0.002f, 2.2f) * 3f; float num5 = onePole2.Low(Noise(r), 6000f) * Env(num2, 0.001f, 25f); float num6 = num3 * 1.2f + num4 + num5; array[i] = (float)Math.Tanh((double)num6 * 1.8); } return array; } private static float[] Domain(int seed) { Random r = new Random(seed); float[] array = Buffer(4.5f); OnePole onePole = default(OnePole); for (int i = 0; i < array.Length; i++) { float num = (float)i / 44100f; float num2 = Mathf.Clamp01(num / 0.4f) * Mathf.Clamp01((4.5f - num) / 1.4f); float num3 = 0f; for (int j = 1; j <= 6; j++) { num3 += Mathf.Sin(MathF.PI * 110f * (float)j * num) / (float)j + Mathf.Sin(366.30972f * (float)j * num) / ((float)j * 1.5f); } num3 *= 0.35f * (0.8f + 0.2f * Mathf.Sin(4.3982296f * num)); float num4 = (Mathf.Sin(MathF.PI * 184f * num) + 0.6f * Mathf.Sin(MathF.PI * 278f * num + 0.4f) + 0.35f * Mathf.Sin(MathF.PI * 442f * num + 1.1f)) * Env(num, 0.004f, 1.1f); float num5 = onePole.Low(Noise(r), 120f) * 3f; array[i] = (num3 + num5) * num2 + num4 * 0.9f; } return array; } private static float[] BlackFlash(int seed) { Random r = new Random(seed); float[] array = Buffer(0.8f); Biquad biquad = default(Biquad); float num = 0f; for (int i = 0; i < array.Length; i++) { float num2 = (float)i / 44100f; float num3 = ((num2 < 0.003f) ? (Noise(r) * 2f) : 0f); float num4 = biquad.BandPass(Noise(r), Mathf.Lerp(9000f, 2000f, Mathf.Clamp01(num2 / 0.25f)), 1.5f) * Env(num2, 0.001f, 14f) * 2f; num += MathF.PI * 2f * Mathf.Lerp(90f, 40f, Mathf.Clamp01(num2 / 0.3f)) / 44100f; float num5 = Mathf.Sin(num) * Env(num2, 0.001f, 7f) * 1.3f; float num6 = Mathf.Sign(Mathf.Sin(MathF.PI * 440f * num2)) * Env(num2, 0.001f, 22f) * 0.25f; array[i] = (float)Math.Tanh((double)(num3 + num4 + num5 + num6) * 1.5); } return array; } private static float[] Heal(int seed) { float[] array = Buffer(0.9f); for (int i = 0; i < array.Length; i++) { float num = (float)i / 44100f; float num2 = Env(num, 0.06f, 4f); float num3 = 0.8f + 0.2f * Mathf.Sin(MathF.PI * 18f * num); array[i] = (Mathf.Sin(MathF.PI * 2093f * num) + 0.6f * Mathf.Sin(MathF.PI * 3136f * num) + 0.3f * Mathf.Sin(MathF.PI * 4186f * num)) * num2 * num3; } return array; } private static float[] Tear(int seed) { Random r = new Random(seed); float[] array = Buffer(2.6f); Biquad biquad = default(Biquad); OnePole onePole = default(OnePole); float num = 0f; float num2 = 0f; for (int i = 0; i < array.Length; i++) { float num3 = (float)i / 44100f; float num4 = biquad.BandPass(Noise(r), Mathf.Lerp(250f, 7000f, Mathf.Clamp01(num3 / 0.22f)), 2f) * Env(num3, 0.01f, 4f) * 2.2f; num += MathF.PI * 2f * Mathf.Lerp(60f, 28f, Mathf.Clamp01(num3 / 1.2f)) / 44100f; float num5 = Mathf.Sin(num) * Env(Mathf.Max(0f, num3 - 0.15f), 0.01f, 1.4f) * ((num3 > 0.15f) ? 1.2f : 0f); num2 += 0.44879898f; float num6 = Mathf.Sin(num2) * Env(num3, 0.002f, 2f) * 0.18f; float num7 = onePole.Low(Noise(r), 600f) * Env(Mathf.Max(0f, num3 - 0.15f), 0.01f, 1.8f) * 2f; array[i] = (float)Math.Tanh((double)(num4 + num5 + num6 + num7) * 1.4); } return array; } private static float[] Chant(int seed) { Random r = new Random(seed); float[] array = Buffer(1.7f); OnePole onePole = default(OnePole); for (int i = 0; i < array.Length; i++) { float num = (float)i / 44100f; float num2 = Mathf.Clamp01(num / 1.4f); float num3 = Mathf.Sin(MathF.PI * 196f * num) + 0.5f * Mathf.Sin(MathF.PI * 294f * num) + 0.25f * Mathf.Sin(MathF.PI * 392f * num + 0.3f); float num4 = onePole.Low(Noise(r), 900f) * 1.5f; array[i] = (num3 * 0.6f + num4) * (0.2f + 0.8f * num2) * Mathf.Clamp01((1.7f - num) / 0.1f); } return array; } private static float[] Eat(int seed) { Random random = new Random(seed); float[] array = Buffer(1.1f); OnePole onePole = default(OnePole); Biquad biquad = default(Biquad); float num = 0f; for (int i = 0; i < array.Length; i++) { float num2 = (float)i / 44100f; float num3 = 0f; for (int j = 0; j < 3; j++) { float num4 = num2 - 0.05f - 0.22f * (float)j; if (num4 >= 0f && num4 < 0.12f) { num3 += biquad.BandPass(Noise(random) * ((random.NextDouble() < 0.08) ? 3f : 1f), 1800f, 0.6f) * Env(num4, 0.002f, 30f) * 2f; } } float num5 = 1f + 0.06f * Mathf.Sin(MathF.PI * 12f * num2); num += MathF.PI * 144f * num5 / 44100f; float num6 = (Mathf.Sin(num) + 0.5f * Mathf.Sin(num * 2f) + 0.3f * Mathf.Sign(Mathf.Sin(num))) * 0.35f * Mathf.Clamp01((num2 - 0.5f) / 0.15f) * Mathf.Clamp01((1.1f - num2) / 0.3f); float num7 = onePole.Low(Noise(random), 400f) * num6 * 2f; array[i] = num3 + num6 + num7; } return array; } } internal static class MegumiStats { internal const float MaxEnergy = 260f; internal const float Regen = 12f; internal static readonly Color Shadow = new Color(0.05f, 0.04f, 0.1f, 0.95f); internal static readonly Color Glow = new Color(0.55f, 0.5f, 1f); internal static readonly Color Lightning = new Color(0.75f, 0.88f, 1f); internal static readonly Color Water = new Color(0.6f, 0.8f, 1f, 0.8f); internal static readonly Color Gold = new Color(0.85f, 0.68f, 0.3f); internal static float Power => 1.6f * SukunaConfig.DamageMultiplier.Value; } internal static class ShadowFx { internal static Vector3 Ground(Vector3 p, float down = 6f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(p + Vector3.up * 0.8f, Vector3.down, ref val, down, Combat.WorldMask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return p; } internal static void Pool(Vector3 at, float radius, float life) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00b7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Ground(at) + Vector3.up * 0.02f; Material mat = new Material(Vfx.Unlit(MegumiStats.Shadow)); GameObject disk = Vfx.Prim((PrimitiveType)0, null, val, new Vector3(0.01f, 0.01f, 0.01f), Quaternion.identity, mat); ((Object)disk).name = "Shadow Pool"; Vfx.Animate(disk, life, delegate(float k) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp01(k * 6f) * Mathf.Clamp01((1f - k) * 4f); disk.transform.localScale = new Vector3(radius * 2f * num, 0.02f, radius * 2f * num); if (k >= 1f) { Object.Destroy((Object)(object)mat); } }); Vfx.Burst(val + Vector3.up * 0.1f, MegumiStats.Shadow, Color.black, 14, 1.2f, 0.25f, 0.9f, -0.15f, Vfx.SmokeMat, radius * 0.6f); } internal static void Smoke(Vector3 at, float size, int count = 30) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Vfx.Burst(at, MegumiStats.Shadow, new Color(0.15f, 0.12f, 0.3f, 0.8f), count, 2.5f, size, 1.1f, -0.2f, Vfx.SmokeMat, size); } internal static void Bolt(Vector3 a, Vector3 b, float width, float life) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) LineRenderer core = Vfx.Line("Nue Bolt", 10, width, Color.white); LineRenderer glow = Vfx.Line("Nue Bolt Glow", 10, width * 3.5f, new Color(MegumiStats.Lightning.r, MegumiStats.Lightning.g, MegumiStats.Lightning.b, 0.35f)); Vfx.Animate(((Component)core).gameObject, life, delegate(float k) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; for (int i = 0; i < 10; i++) { float num = (float)i / 9f; Vector3 val2 = a + val * num + ((i == 0 || i == 9) ? Vector3.zero : (Random.insideUnitSphere * ((Vector3)(ref val)).magnitude * 0.08f)); core.SetPosition(i, val2); if (Object.op_Implicit((Object)(object)glow)) { glow.SetPosition(i, val2); } } bool enabled = Random.value > 0.3f; float num2 = 1f - k; ((Renderer)core).enabled = enabled; LineRenderer obj = core; LineRenderer obj2 = core; Color val3 = default(Color); ((Color)(ref val3))..ctor(1f, 1f, 1f, num2); obj2.endColor = val3; obj.startColor = val3; if (Object.op_Implicit((Object)(object)glow)) { ((Renderer)glow).enabled = enabled; LineRenderer obj3 = glow; LineRenderer obj4 = glow; ((Color)(ref val3))..ctor(MegumiStats.Lightning.r, MegumiStats.Lightning.g, MegumiStats.Lightning.b, 0.35f * num2); obj4.endColor = val3; obj3.startColor = val3; if (k >= 1f) { Object.Destroy((Object)(object)((Component)glow).gameObject); } } }); } internal static void Sparks(Vector3 at, float radius, int bolts) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bolts; i++) { Bolt(at, at + Random.onUnitSphere * radius * Random.Range(0.5f, 1f), 0.035f, 0.35f); } Vfx.Burst(at, Color.white, MegumiStats.Lightning, 25, 8f, 0.12f, 0.35f, 0f, Vfx.GlowMat, 0.3f); Vfx.LightFlash(at, MegumiStats.Lightning, 6f, radius * 3f, 0.35f); } } internal sealed class NavFollower { private readonly NavMeshPath path = new NavMeshPath(); private int corner; private float repath; private Vector3 lastGoal; internal Vector3 Step(Vector3 pos, Vector3 goal, float speed, float dt, float stopAt = 0f) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_00cd: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) repath -= dt; Vector3 val; if (!(repath <= 0f)) { val = goal - lastGoal; if (!(((Vector3)(ref val)).sqrMagnitude > 4f)) { goto IL_00a8; } } repath = 0.35f; lastGoal = goal; corner = 1; NavMeshHit val2 = default(NavMeshHit); NavMeshHit val3 = default(NavMeshHit); if (!NavMesh.SamplePosition(pos, ref val2, 2.5f, -1) || !NavMesh.SamplePosition(goal, ref val3, 3f, -1) || !NavMesh.CalculatePath(((NavMeshHit)(ref val2)).position, ((NavMeshHit)(ref val3)).position, -1, path) || path.corners.Length <= 1) { path.ClearCorners(); } goto IL_00a8; IL_00a8: Vector3[] corners = path.corners; Vector3 val4 = goal; if (corners.Length > corner) { val4 = corners[corner]; val = Vector3.ProjectOnPlane(val4 - pos, Vector3.up); if (((Vector3)(ref val)).magnitude < 0.3f && corner < corners.Length - 1) { corner++; val4 = corners[corner]; } if (corner == corners.Length - 1) { val4 = goal; } } Vector3 val5 = Vector3.ProjectOnPlane(goal - pos, Vector3.up); if (corner >= corners.Length - 1 && ((Vector3)(ref val5)).magnitude < stopAt) { return pos; } Vector3 val6 = Vector3.MoveTowards(pos, new Vector3(val4.x, pos.y, val4.z), speed * dt); RaycastHit val7 = default(RaycastHit); if (Physics.Raycast(val6 + Vector3.up * 0.9f, Vector3.down, ref val7, 2.5f, Combat.WorldMask, (QueryTriggerInteraction)1)) { val6.y = Mathf.Lerp(val6.y, ((RaycastHit)(ref val7)).point.y, Mathf.Clamp01(dt * 15f)); } return val6; } } internal static class ShikigamiModels { internal sealed class Dog { internal Transform Root; internal Transform Body; internal Transform Head; internal Transform Tail; internal readonly Transform[] Legs = (Transform[])(object)new Transform[4]; } internal sealed class General { internal Transform Root; internal Transform Hips; internal Transform Chest; internal Transform Head; internal Transform Wheel; internal Transform LegL; internal Transform LegR; internal Transform KneeL; internal Transform KneeR; internal Transform ArmL; internal Transform ArmR; internal Transform ElbowL; internal Transform ElbowR; internal Transform Blade; } private static Transform Holder(string name, Transform parent) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return BossModel.Pivot(name, parent, Vector3.zero); } internal static Dog BuildDog(Transform parent, bool white) { Dog dog = new Dog { Root = Holder(white ? "White Dog" : "Black Dog", parent) }; Dictionary dictionary = RigFactory.Spawn(white ? "dog_white" : "dog_black", dog.Root); dog.Body = dictionary["Body"]; dog.Head = dictionary["Head"]; dog.Tail = dictionary["Tail"]; for (int i = 0; i < 4; i++) { dog.Legs[i] = dictionary["Leg " + i]; } return dog; } internal static Transform BuildNue(Transform parent, out Transform wingL, out Transform wingR) { Transform val = Holder("Nue", parent); Dictionary dictionary = RigFactory.Spawn("nue", val); wingL = dictionary["Wing L"]; wingR = dictionary["Wing R"]; return val; } internal static Transform BuildToad(Transform parent, out Transform mouth) { Transform val = Holder("Toad", parent); mouth = RigFactory.Spawn("toad", val)["Mouth"]; return val; } internal static Transform BuildElephant(Transform parent, out Transform trunkTip) { Transform val = Holder("Max Elephant", parent); trunkTip = RigFactory.Spawn("elephant", val)["Trunk Tip"]; return val; } internal static General BuildMahoraga(Transform parent) { General general = new General { Root = Holder("Mahoraga", parent) }; Dictionary dictionary = RigFactory.Spawn("mahoraga", general.Root); general.Hips = dictionary["Hips"]; general.Chest = dictionary["Chest"]; general.Head = dictionary["Head"]; general.Wheel = dictionary["Wheel"]; general.LegL = dictionary["Leg L"]; general.LegR = dictionary["Leg R"]; general.KneeL = dictionary["Leg L Lower"]; general.KneeR = dictionary["Leg R Lower"]; general.ArmL = dictionary["Arm L"]; general.ArmR = dictionary["Arm R"]; general.ElbowL = dictionary["Arm L Lower"]; general.ElbowR = dictionary["Arm R Lower"]; general.Blade = dictionary["Sword of Extermination"]; return general; } internal static void Layer(Transform root, int layer = 0) { Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((Component)componentsInChildren[i]).gameObject.layer = layer; } } } internal sealed class ShrineDomain : MonoBehaviour { internal static readonly List Active = new List(); private const float Rise = 1.1f; private const float Sink = 1.2f; private const float TickRate = 0.3f; private Cast c; private float radius; private float t; private float tick; private float shrineHeight; private float duration; private int ticks; private Transform shrine; private Vector3 center; private Vector3 shrineBase; private Material diskMat; private LineRenderer ring; private Light redLight; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Malevolent Shrine").AddComponent().Init(c); } internal static bool LocalInside() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } foreach (ShrineDomain item in Active) { if (Object.op_Implicit((Object)(object)item) && item.Contains(((Component)instance).transform.position) && item.t < 1.1f + item.duration) { return true; } } return false; } private bool Contains(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(p - center, Vector3.up); if (((Vector3)(ref val)).magnitude <= radius) { return Mathf.Abs(p.y - center.y) < 6f; } return false; } private void Init(Cast cast) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00cc: 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_00db: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Expected O, but got Unknown //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) c = cast; Active.Add(this); radius = SukunaStats.ShrineRadius(c.Fingers); duration = (c.Hostile ? 7f : 10f); center = Ground(c.Origin); ((Component)this).transform.position = center; Vector3 val = Vector3.ProjectOnPlane(c.Dir, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.forward; } ((Vector3)(ref val)).Normalize(); shrineBase = Ground(center - val * 3.4f); float num = 12f; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(shrineBase + Vector3.up * 0.3f, Vector3.up, ref val2, 12f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num = ((RaycastHit)(ref val2)).distance + 0.3f; } float num2 = Mathf.Clamp((num - 0.2f) / 7.4f, 0.35f, 1.25f); shrineHeight = 7.4f * num2; shrine = ShrineModel.Build(((Component)this).transform).transform; shrine.rotation = Quaternion.LookRotation(val); shrine.localScale = Vector3.one * num2; shrine.position = shrineBase - Vector3.up * shrineHeight; diskMat = new Material(Vfx.LineMat) { name = "Shrine Disk" }; Vfx.MeshObject("Shrine Ground", Vfx.Disk, diskMat, center + Vector3.up * 0.04f, Quaternion.identity, new Vector3(radius, 1f, radius)).transform.SetParent(((Component)this).transform, true); ring = Vfx.Line("Shrine Boundary", 73, 0.12f, Vfx.Red); ((Component)ring).transform.SetParent(((Component)this).transform, false); ring.loop = true; ring.alignment = (LineAlignment)1; ((Component)ring).transform.rotation = Quaternion.LookRotation(Vector3.up); for (int i = 0; i < 73; i++) { float num3 = (float)i / 72f * MathF.PI * 2f; ring.SetPosition(i, center + new Vector3(Mathf.Cos(num3) * radius, 0.06f, Mathf.Sin(num3) * radius)); } GameObject val3 = new GameObject("Shrine Light"); val3.transform.SetParent(((Component)this).transform, false); val3.transform.position = center + Vector3.up * 2.5f; redLight = val3.AddComponent(); redLight.type = (LightType)2; redLight.color = new Color(1f, 0.05f, 0.05f); redLight.range = radius * 1.6f; redLight.intensity = 0f; redLight.shadows = (LightShadows)0; Sfx.Play(SfxId.Domain, center); Vfx.Shake(center, 6f, 1.2f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && (c.Local || Vector3.Distance(((Component)instance).transform.position, center) < radius * 2.5f)) { Hud.Banner("DOMAIN EXPANSION", "Malevolent Shrine", Vfx.Red, 3.2f); } if (Combat.IsHost) { Combat.DamageDoorsSphere(center + Vector3.up, radius, 100f, center); } } private static Vector3 Ground(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(p + Vector3.up * 1f, Vector3.down, ref val, 6f, Combat.WorldMask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return p; } private void Update() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; float num = Mathf.Clamp01(t / 1.1f); float num2 = Mathf.Clamp01((t - 1.1f - duration) / 1.2f); float num3 = (1f - Mathf.Pow(1f - num, 3f)) * (1f - num2 * num2); if (Object.op_Implicit((Object)(object)shrine)) { shrine.position = shrineBase - Vector3.up * (shrineHeight * (1f - num3)); } if (num < 1f && Random.value < deltaTime * 20f) { Vfx.Burst(shrineBase + Random.insideUnitSphere * 2f, new Color(0.3f, 0.25f, 0.2f, 0.8f), new Color(0.1f, 0.08f, 0.08f, 0.6f), 6, 3f, 0.3f, 1f, 0.6f, Vfx.SmokeMat, 1f); } float num4 = Mathf.Clamp01(t / 0.6f) * (1f - num2); if (Object.op_Implicit((Object)(object)diskMat)) { diskMat.color = new Color(1f, 1f, 1f, num4); } if (Object.op_Implicit((Object)(object)ring)) { Color red = Vfx.Red; red.a = num4 * (0.7f + 0.3f * Mathf.Sin(t * 6f)); LineRenderer obj = ring; Color startColor = (ring.endColor = red); obj.startColor = startColor; } if (Object.op_Implicit((Object)(object)redLight)) { redLight.intensity = 2.8f * num4; } if (t >= 0.77f && t < 1.1f + duration) { int num5 = Mathf.FloorToInt(deltaTime * 22f) + ((Random.value < deltaTime * 22f % 1f) ? 1 : 0); for (int i = 0; i < num5; i++) { Vector2 val2 = Random.insideUnitCircle * radius; Vfx.SlashLine(center + new Vector3(val2.x, Random.Range(0.3f, 2.6f), val2.y), Random.onUnitSphere, Random.Range(0.8f, 2.2f), 0.05f, Vfx.Red, 0.25f); } tick -= deltaTime; if (tick <= 0f) { tick = 0.3f; Tick(); } } if (t >= 1.1f + duration + 1.2f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Tick() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) ticks++; bool flag = false; if (c.Hostile && BossHits.LocalTarget(out var me) && Contains(((Component)me).transform.position)) { Vfx.SlashBurst(BossHits.Center(me), 2, 1.2f, Vfx.Red, 0.3f, 0.03f); BossHits.Hurt(c, me, 3, Vector3.zero); } if (!c.Hostile) { foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item); if (Contains(val)) { Vfx.SlashBurst(val, 3, 1.4f, Vfx.Red, 0.3f, 0.03f); Vfx.Burst(val, Vfx.Blood, Vfx.DarkRed, 6, 3f, 0.1f, 0.5f, 1f, Vfx.SmokeMat); if (!flag) { Sfx.Play(SfxId.Slash, val, 0.5f); flag = true; } Combat.HurtEnemy(item, 11f * c.Power, Random.onUnitSphere, 0.5f, 1.2f); } } } if (!flag && ticks % 2 == 0) { Sfx.Play(SfxId.Slash, center + Random.insideUnitSphere * radius * 0.5f, 0.35f); } if (Combat.IsHost && ticks % 3 == 0) { Combat.HitObjectsSphere(center, radius, Combat.Impact.Light, 1.2f); } if (Combat.CanTakeFriendlyFire(c, out var me2) && Contains(((Component)me2).transform.position)) { Combat.HurtLocalPlayer(me2, 3); } } private void OnDestroy() { Active.Remove(this); if (Object.op_Implicit((Object)(object)diskMat)) { Object.Destroy((Object)(object)diskMat); } } } internal static class ShrineModel { internal const float Height = 7.4f; internal static GameObject Build(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown GameObject val = new GameObject("Shrine Model"); val.transform.SetParent(parent, false); RigFactory.Spawn("shrine", val.transform); return val; } } internal static class SukunaConfig { internal static ConfigEntry DismantleKey; internal static ConfigEntry CleaveKey; internal static ConfigEntry SpiderwebKey; internal static ConfigEntry FugaKey; internal static ConfigEntry RctKey; internal static ConfigEntry ShrineKey; internal static ConfigEntry WorldSlashKey; internal static ConfigEntry BlueKey; internal static ConfigEntry RedKey; internal static ConfigEntry BlinkKey; internal static ConfigEntry PurpleKey; internal static ConfigEntry InfinityKey; internal static ConfigEntry VoidKey; internal static ConfigEntry SixEyesKey; internal static ConfigEntry DogsKey; internal static ConfigEntry NueKey; internal static ConfigEntry ShadowStepKey; internal static ConfigEntry ElephantKey; internal static ConfigEntry ToadKey; internal static ConfigEntry GardenKey; internal static ConfigEntry MahoragaKey; internal static ConfigEntry SerpentKey; internal static ConfigEntry RabbitKey; internal static ConfigEntry DeerKey; internal static ConfigEntry OxKey; internal static ConfigEntry TigerKey; internal static ConfigEntry GojoSpawnChance; internal static ConfigEntry GojoHealth; internal static ConfigEntry SukunaSpawnChance; internal static ConfigEntry SukunaHealth; internal static ConfigEntry SukunaFingerDrop; internal static ConfigEntry MegumiSpawnChance; internal static ConfigEntry MegumiHealth; internal static ConfigEntry MaxFingers; internal static ConfigEntry ShopChance; internal static ConfigEntry ShopPrice; internal static ConfigEntry LevelSpawnChance; internal static ConfigEntry DamageMultiplier; internal static ConfigEntry CursedEnergyRegenMultiplier; internal static ConfigEntry FriendlyFire; internal static ConfigEntry DamageItems; internal static ConfigEntry CutDoors; internal static ConfigEntry DismantleUnlock; internal static ConfigEntry CleaveUnlock; internal static ConfigEntry RctUnlock; internal static ConfigEntry SpiderwebUnlock; internal static ConfigEntry FugaUnlock; internal static ConfigEntry ShrineUnlock; internal static ConfigEntry WorldSlashUnlock; internal static ConfigEntry ShowHud; internal static ConfigEntry TestKeys; private static void Migrate(ConfigEntry e, float oldDefault, float newDefault) { if (Math.Abs(e.Value - oldDefault) < 0.0001f) { e.Value = newDefault; } } internal static void Bind(ConfigFile cfg) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Expected O, but got Unknown //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Expected O, but got Unknown //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Expected O, but got Unknown //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Expected O, but got Unknown //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_042c: Expected O, but got Unknown //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Expected O, but got Unknown //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Expected O, but got Unknown //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Expected O, but got Unknown //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Expected O, but got Unknown //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Expected O, but got Unknown //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Expected O, but got Unknown //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Expected O, but got Unknown //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Expected O, but got Unknown //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Expected O, but got Unknown //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Expected O, but got Unknown //IL_0685: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Expected O, but got Unknown //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Expected O, but got Unknown //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06dc: Expected O, but got Unknown //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_0703: Expected O, but got Unknown DismantleKey = cfg.Bind("Keys", "Dismantle", (Key)32, "Tap: fire a Dismantle slash. Hold: Dismantle barrage."); CleaveKey = cfg.Bind("Keys", "Cleave", (Key)20, "Cleave the enemy in front of you. Damage adapts to the target's toughness. Can trigger Black Flash."); SpiderwebKey = cfg.Bind("Keys", "Spiderweb", (Key)44, "Dismantle: Spiderweb. Slash the ground around you in a web pattern."); if ((int)SpiderwebKey.Value == 21) { SpiderwebKey.Value = (Key)44; } FugaKey = cfg.Bind("Keys", "Fuga", (Key)17, "Hold to draw the flame arrow (\"Open\"), release to fire Fuga."); RctKey = cfg.Bind("Keys", "ReverseCursedTechnique", (Key)22, "Hold to heal yourself with Reverse Cursed Technique."); ShrineKey = cfg.Bind("Keys", "MalevolentShrine", (Key)38, "Domain Expansion: Malevolent Shrine."); WorldSlashKey = cfg.Bind("Keys", "WorldCuttingSlash", (Key)40, "Hold to chant, keep holding to unleash the World-Cutting Slash."); BlueKey = cfg.Bind("Gojo Keys", "Blue", (Key)32, "Blue (Lapse): an orb that pulls everything around it in and crushes it."); RedKey = cfg.Bind("Gojo Keys", "Red", (Key)20, "Red (Reversal): a blast that throws everything in front of you away."); BlinkKey = cfg.Bind("Gojo Keys", "Blink", (Key)44, "Teleport to where you look."); PurpleKey = cfg.Bind("Gojo Keys", "HollowPurple", (Key)17, "Hold to merge Blue and Red, release to fire Hollow Purple."); InfinityKey = cfg.Bind("Gojo Keys", "Infinity", (Key)22, "Toggle Infinity: nothing can touch you while your cursed energy lasts."); VoidKey = cfg.Bind("Gojo Keys", "UnlimitedVoid", (Key)38, "Domain Expansion: Unlimited Void."); SixEyesKey = cfg.Bind("Gojo Keys", "SixEyes", (Key)40, "Toggle the Six Eyes: see enemies through walls, techniques cost half."); DogsKey = cfg.Bind("Megumi Keys", "DivineDogs", (Key)32, "Divine Dogs: two shadow wolves hunt down the nearest enemies."); NueKey = cfg.Bind("Megumi Keys", "Nue", (Key)20, "Nue: a shadow bird swoops where you aim and strikes with lightning."); ShadowStepKey = cfg.Bind("Megumi Keys", "ShadowTravel", (Key)44, "Sink into your shadow and come out where you look."); ElephantKey = cfg.Bind("Megumi Keys", "MaxElephant", (Key)17, "Max Elephant: drops a giant elephant where you aim, then floods the area in front of it."); ToadKey = cfg.Bind("Megumi Keys", "Toad", (Key)22, "Toad: its tongue snatches the enemy you aim at and drags it to you."); GardenKey = cfg.Bind("Megumi Keys", "ChimeraShadowGarden", (Key)38, "Domain Expansion: Chimera Shadow Garden."); MahoragaKey = cfg.Bind("Megumi Keys", "Mahoraga", (Key)40, "Hold to chant, keep holding to summon the Divine General Mahoraga."); SerpentKey = cfg.Bind("Megumi Keys", "GreatSerpent", (Key)36, "Great Serpent: bursts out of the floor under the enemy you aim at and seizes it."); RabbitKey = cfg.Bind("Megumi Keys", "RabbitEscape", (Key)45, "Rabbit Escape: a flood of rabbits hides you; enemies around you lose track and you run faster."); DeerKey = cfg.Bind("Megumi Keys", "RoundDeer", (Key)46, "Round Deer: heals you and everyone standing near it."); OxKey = cfg.Bind("Megumi Keys", "PiercingOx", (Key)16, "Piercing Ox: charges straight ahead, hitting harder the further it runs."); TigerKey = cfg.Bind("Megumi Keys", "TigerFuneral", (Key)28, "Tiger Funeral: pounces on the enemy you aim at."); SukunaSpawnChance = cfg.Bind("Sukuna Enemy", "SpawnChance", 0.01f, new ConfigDescription("Chance that Ryomen Sukuna appears in a level (host setting). He hunts anyone he sees. At most one boss appears per level.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); SukunaHealth = cfg.Bind("Sukuna Enemy", "Health", 1400, new ConfigDescription("Sukuna's health (vanilla enemies have 10 to 600). He heals a quarter of it once with Reverse Cursed Technique (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(100, 10000), Array.Empty())); SukunaFingerDrop = cfg.Bind("Sukuna Enemy", "FingersDropped", 3, new ConfigDescription("How many Cursed Fingers Sukuna drops when he's beaten (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(1, 10), Array.Empty())); MegumiSpawnChance = cfg.Bind("Megumi Enemy", "SpawnChance", 0.05f, new ConfigDescription("Chance that Megumi Fushiguro appears in a level (host setting). He leaves you alone unless you attack him.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); MegumiHealth = cfg.Bind("Megumi Enemy", "Health", 1000, new ConfigDescription("Megumi's health (vanilla enemies have 10 to 600) (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(100, 10000), Array.Empty())); GojoSpawnChance = cfg.Bind("Gojo Enemy", "SpawnChance", 0.03f, new ConfigDescription("Chance that Satoru Gojo appears in a level (host setting). He leaves you alone unless you attack him.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); GojoHealth = cfg.Bind("Gojo Enemy", "Health", 1200, new ConfigDescription("Gojo's health (vanilla enemies have 10 to 600). Infinity halves damage he takes unless it's down (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(100, 10000), Array.Empty())); MaxFingers = cfg.Bind("Cursed Finger", "MaxFingers", 20, new ConfigDescription("How many Cursed Fingers one player can consume. Every finger makes Sukuna stronger.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 20), Array.Empty())); ShopChance = cfg.Bind("Cursed Finger", "ShopChance", 0.05f, new ConfigDescription("Chance that a Cursed Finger is for sale in a shop visit (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ShopPrice = cfg.Bind("Cursed Finger", "ShopPrice", 100, new ConfigDescription("Approximate shop price in thousands of dollars (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); LevelSpawnChance = cfg.Bind("Cursed Finger", "LevelSpawnChance", 0.1f, new ConfigDescription("Chance that a Cursed Finger is hidden somewhere in a level (host setting).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); DamageMultiplier = cfg.Bind("Balance", "DamageMultiplier", 1f, new ConfigDescription("Multiplies the damage of every technique.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); CursedEnergyRegenMultiplier = cfg.Bind("Balance", "CursedEnergyRegenMultiplier", 1f, new ConfigDescription("Multiplies how fast cursed energy comes back.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); FriendlyFire = cfg.Bind("Balance", "FriendlyFire", false, "Techniques can hurt other players."); DamageItems = cfg.Bind("Balance", "DamageItems", true, "Techniques damage what they hit: valuables lose value or break, items take damage, everything gets knocked around. Off: valuables are left alone and other props are only pushed (host setting)."); CutDoors = cfg.Bind("Balance", "CutDoors", true, "Techniques damage doors: a few Dismantle slashes (or one big technique) break a door off its hinges (host setting)."); AcceptableValueRange val = new AcceptableValueRange(1, 20); DismantleUnlock = cfg.Bind("Unlocks", "Dismantle", 1, new ConfigDescription("Fingers eaten before Dismantle (and its barrage) can be used.", (AcceptableValueBase)(object)val, Array.Empty())); CleaveUnlock = cfg.Bind("Unlocks", "Cleave", 2, new ConfigDescription("Fingers needed for Cleave (and Black Flash).", (AcceptableValueBase)(object)val, Array.Empty())); RctUnlock = cfg.Bind("Unlocks", "ReverseCursedTechnique", 3, new ConfigDescription("Fingers needed for Reverse Cursed Technique.", (AcceptableValueBase)(object)val, Array.Empty())); SpiderwebUnlock = cfg.Bind("Unlocks", "Spiderweb", 5, new ConfigDescription("Fingers needed for Spiderweb.", (AcceptableValueBase)(object)val, Array.Empty())); FugaUnlock = cfg.Bind("Unlocks", "Fuga", 7, new ConfigDescription("Fingers needed for Fuga.", (AcceptableValueBase)(object)val, Array.Empty())); ShrineUnlock = cfg.Bind("Unlocks", "MalevolentShrine", 10, new ConfigDescription("Fingers needed for Domain Expansion: Malevolent Shrine.", (AcceptableValueBase)(object)val, Array.Empty())); WorldSlashUnlock = cfg.Bind("Unlocks", "WorldCuttingSlash", 15, new ConfigDescription("Fingers needed for the World-Cutting Slash. Set everything to 1 to get the whole moveset from the first finger.", (AcceptableValueBase)(object)val, Array.Empty())); ShowHud = cfg.Bind("Interface", "ShowHud", true, "Show the cursed energy bar and technique list."); Migrate(ShopChance, 0.6f, 0.05f); Migrate(SukunaSpawnChance, 0.08f, 0.01f); Migrate(GojoSpawnChance, 0.1f, 0.03f); Migrate(MegumiSpawnChance, 0.1f, 0.05f); if (ShopPrice.Value == 10) { ShopPrice.Value = 100; } TestKeys = cfg.Bind("Testing", "TestKeys", false, "Shortcuts for trying the mod out. F8 (host): eat a finger. F7 (host): spawn a Cursed Finger in front of you to hand to someone. F6: refill cursed energy and reset cooldowns. F9 (host): spawn a boss in front of you (Gojo, Sukuna, Megumi in turn). F10 (host): become Gojo, then Megumi. Leave off for normal games."); } } internal sealed class SukunaController : MonoBehaviour, IPowerHud { internal const float FugaChargeTime = 0.8f; internal const float ChantDuration = 1.6f; internal static SukunaController Instance; internal int FingerCount; internal float Energy; internal float MaxEnergy; internal float ZoneTime; internal float FugaCharge = -1f; internal float ChantTime = -1f; internal bool HudVisible; private readonly Dictionary cooldowns = new Dictionary(); private float dismantleHeld = -1f; private float barrageTimer; private bool barrage; private bool rctActive; private float rctHeal; private float rctPulse; private LevelGenerator level; private ParticleSystem handFlame; private Light handLight; bool IPowerHud.HudVisible => HudVisible; string IPowerHud.CountText => FingerCount + " / " + SukunaConfig.MaxFingers.Value + ""; Texture IPowerHud.Icon => (Texture)(object)FingerItem.IconTexture; Color IPowerHud.Accent => new Color(0.85f, 0.06f, 0.08f); float IPowerHud.Energy => Energy; float IPowerHud.MaxEnergy => MaxEnergy; string IPowerHud.EnergyTag { get { if (!(ZoneTime > 0f)) { return ""; } return "ZONE"; } } bool IPowerHud.EnergyPulse => ZoneTime > 0f; TechInfo[] IPowerHud.Techs => TechInfo.All; int IPowerHud.UnlockLevel => FingerCount; bool IPowerHud.IsActive(TechInfo t) { return IsActive(t); } float IPowerHud.Cooldown(TechInfo t) { return Cooldown(t); } float IPowerHud.CostOf(TechInfo t) { return t.Cost; } private void Awake() { Instance = this; } internal float Cooldown(TechInfo t) { if (!cooldowns.TryGetValue(t, out var value)) { return 0f; } return Mathf.Max(0f, value); } internal bool IsActive(TechInfo t) { if ((t != TechInfo.Fuga || !(FugaCharge >= 0f)) && (t != TechInfo.WorldSlash || !(ChantTime >= 0f))) { if (t == TechInfo.Rct) { return rctActive; } return false; } return true; } internal void DebugRefill() { Energy = MaxEnergy; cooldowns.Clear(); } internal void OnFingerEaten(int fingers) { FingerCount = fingers; MaxEnergy = SukunaStats.MaxEnergy(fingers); Energy = MaxEnergy; } private void Update() { try { Tick(); } catch (Exception ex) { Plugin.Log.LogError((object)("Sukuna controller error: " + ex)); CancelAll(notify: false); } } private void Tick() { Powers.EnsureRegistered(); FingerItem.TryRegister(); BandanaItem.TryRegister(); TalismanItem.TryRegister(); Bosses.TryRegister(); LevelSpawner.Tick(); PlayerAvatar instance = PlayerAvatar.instance; FingerCount = (Object.op_Implicit((Object)(object)instance) ? Fingers.Get(instance) : 0); bool flag = Object.op_Implicit((Object)(object)instance) && Powers.IsSukuna(instance) && TechniquesAllowedHere(); HudVisible = flag && !instance.deadSet; if (!flag) { CancelAll(notify: false); return; } float deltaTime = Time.deltaTime; MaxEnergy = SukunaStats.MaxEnergy(FingerCount); if ((Object)(object)LevelGenerator.Instance != (Object)(object)level) { level = LevelGenerator.Instance; Energy = MaxEnergy; cooldowns.Clear(); ZoneTime = 0f; } if (ZoneTime > 0f) { ZoneTime -= deltaTime; } if (!rctActive) { Energy = Mathf.Min(MaxEnergy, Energy + SukunaStats.EnergyRegen(FingerCount) * ((ZoneTime > 0f) ? 2f : 1f) * deltaTime); } foreach (TechInfo item in new List(cooldowns.Keys)) { cooldowns[item] -= deltaTime; } if (instance.deadSet || instance.isDisabled || !SemiFunc.NoTextInputsActive() || (Object.op_Implicit((Object)(object)MenuManager.instance) && Object.op_Implicit((Object)(object)MenuManager.instance.currentMenuPage)) || (Object.op_Implicit((Object)(object)PlayerController.instance) && PlayerController.instance.InputDisableTimer > 0f) || Keyboard.current == null) { CancelAll(notify: true); return; } HandleDismantle(instance, deltaTime); HandleCleave(instance); HandleSpiderweb(instance); HandleFuga(instance, deltaTime); HandleRct(instance, deltaTime); HandleShrine(instance); HandleWorldSlash(instance, deltaTime); } internal static bool TechniquesAllowedHere() { if (!Object.op_Implicit((Object)(object)RunManager.instance) || !Object.op_Implicit((Object)(object)RunManager.instance.levelCurrent)) { return false; } if (!Object.op_Implicit((Object)(object)LevelGenerator.Instance) || !LevelGenerator.Instance.Generated) { return false; } if (!SemiFunc.RunIsLevel()) { return SemiFunc.RunIsArena(); } return true; } private static bool Pressed(TechInfo t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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) Key value = t.Key.Value; if ((int)value == 0) { return false; } try { return ((ButtonControl)Keyboard.current[value]).wasPressedThisFrame; } catch { return false; } } private static bool Held(TechInfo t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //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) Key value = t.Key.Value; if ((int)value == 0) { return false; } try { return ((ButtonControl)Keyboard.current[value]).isPressed; } catch { return false; } } private static bool Aim(out Vector3 origin, out Vector3 dir) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Camera val = (Object.op_Implicit((Object)(object)GameDirector.instance) ? GameDirector.instance.MainCamera : null); if (!Object.op_Implicit((Object)(object)val)) { val = Camera.main; } if (!Object.op_Implicit((Object)(object)val)) { origin = (dir = Vector3.zero); return false; } origin = ((Component)val).transform.position; dir = ((Component)val).transform.forward; return true; } private bool CanStart(TechInfo t) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (!t.Unlocked(FingerCount) || Cooldown(t) > 0f) { return false; } if (Energy < t.Cost) { Hud.Flash(new Color(0.3f, 0f, 0f, 0.25f), 0.15f); return false; } return true; } private void Spend(TechInfo t, float cooldown = -1f) { Energy -= t.Cost; cooldowns[t] = ((cooldown >= 0f) ? cooldown : t.Cooldown); } private void HandleDismantle(PlayerAvatar me, float dt) { //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) TechInfo dismantle = TechInfo.Dismantle; if (dismantleHeld < 0f) { if (Pressed(dismantle) && CanStart(dismantle) && Aim(out var origin, out var dir)) { Spend(dismantle); float extra = ((Random.value < 0.25f) ? Random.Range(70f, 110f) : Random.Range(-35f, 35f)); SukunaNet.Send(Tech.Dismantle, me, origin + dir * 0.4f, dir, FingerCount, extra); dismantleHeld = 0f; barrage = false; barrageTimer = 0f; } return; } if (!Held(dismantle)) { if (barrage) { cooldowns[dismantle] = 1.2f; } dismantleHeld = -1f; barrage = false; return; } dismantleHeld += dt; if (dismantleHeld < 0.35f) { return; } barrage = true; barrageTimer -= dt; if (!(barrageTimer > 0f)) { if (Energy < 4f || !Aim(out var origin2, out var dir2)) { cooldowns[dismantle] = 1.2f; dismantleHeld = -1f; barrage = false; return; } Energy -= 4f; barrageTimer = 0.09f; Vector3 val = dir2 + Random.insideUnitSphere * 0.06f; dir2 = ((Vector3)(ref val)).normalized; val = Vector3.Cross(Vector3.up, dir2); Vector3 val2 = ((Vector3)(ref val)).normalized * Random.Range(-0.5f, 0.5f); SukunaNet.Send(Tech.DismantleBarrage, me, origin2 + dir2 * 0.4f + val2, dir2, FingerCount, Random.Range(0f, 360f)); } } private void HandleCleave(PlayerAvatar me) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) TechInfo cleave = TechInfo.Cleave; if (Pressed(cleave) && CanStart(cleave) && Aim(out var origin, out var dir)) { Spend(cleave); bool flag = Random.value < SukunaStats.BlackFlashChance(FingerCount, ZoneTime > 0f); if (flag) { ZoneTime = 12f; Energy = Mathf.Min(MaxEnergy, Energy + cleave.Cost); } SukunaNet.Send(Tech.Cleave, me, origin, dir, FingerCount, 0f, flag ? 1 : 0); } } private void HandleSpiderweb(PlayerAvatar me) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) TechInfo spiderweb = TechInfo.Spiderweb; if (Pressed(spiderweb) && CanStart(spiderweb) && Aim(out var _, out var dir)) { Spend(spiderweb); SukunaNet.Send(Tech.Spiderweb, me, ((Component)me).transform.position, dir, FingerCount, Random.Range(0f, 1000f)); } } private void HandleFuga(PlayerAvatar me, float dt) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0058: 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) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) TechInfo fuga = TechInfo.Fuga; if (FugaCharge < 0f) { if (Pressed(fuga) && CanStart(fuga) && Aim(out var origin, out var dir)) { FugaCharge = 0f; StartHandFlame(); SukunaNet.Send(Tech.FugaCharge, me, origin, dir, FingerCount); Sfx.Play(SfxId.FireCharge, origin, 0.8f); } } else if (Held(fuga)) { FugaCharge += dt; UpdateHandFlame(Mathf.Clamp01(FugaCharge / 0.8f)); } else { if (FugaCharge >= 0.8f && Energy >= fuga.Cost && Aim(out var origin2, out var dir2)) { Spend(fuga); SukunaNet.Send(Tech.Fuga, me, origin2 + dir2 * 0.7f, dir2, FingerCount, FugaCharge); } else { SukunaNet.Send(Tech.ChargeCancel, me, ((Component)me).transform.position, Vector3.up, FingerCount); } FugaCharge = -1f; StopHandFlame(); } } private void HandleRct(PlayerAvatar me, float dt) { //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) TechInfo rct = TechInfo.Rct; PlayerHealth playerHealth = me.playerHealth; if (!rct.Unlocked(FingerCount) || !Held(rct) || !Object.op_Implicit((Object)(object)playerHealth) || playerHealth.health <= 0 || playerHealth.health >= playerHealth.maxHealth || !(Energy > 1f)) { if (rctActive && rctHeal >= 1f && Object.op_Implicit((Object)(object)playerHealth)) { playerHealth.Heal(Mathf.FloorToInt(rctHeal), false); } rctActive = false; rctHeal = 0f; return; } bool flag = !rctActive; rctActive = true; Energy -= rct.Cost * dt; rctHeal += (9f + 0.6f * (float)(FingerCount - 1)) * dt; if (rctHeal >= 5f) { int num = Mathf.FloorToInt(rctHeal); playerHealth.Heal(num, false); rctHeal -= num; } rctPulse -= dt; if (flag || rctPulse <= 0f) { rctPulse = 0.5f; SukunaNet.Send(Tech.Rct, me, ((Component)me).transform.position + Vector3.up * 1f, Vector3.up, FingerCount, flag ? 1f : 0f); } } private void HandleShrine(PlayerAvatar me) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) TechInfo shrine = TechInfo.Shrine; if (Pressed(shrine) && CanStart(shrine) && Aim(out var _, out var dir)) { Spend(shrine); Vector3 val = Vector3.ProjectOnPlane(dir, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = ((Component)me).transform.forward; } SukunaNet.Send(Tech.Shrine, me, ((Component)me).transform.position, ((Vector3)(ref val)).normalized, FingerCount); } } private void HandleWorldSlash(PlayerAvatar me, float dt) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) TechInfo worldSlash = TechInfo.WorldSlash; if (ChantTime < 0f) { if (Pressed(worldSlash) && CanStart(worldSlash) && Aim(out var origin, out var dir)) { ChantTime = 0f; SukunaNet.Send(Tech.WorldSlashChant, me, origin, dir, FingerCount); } return; } if (!Held(worldSlash)) { SukunaNet.Send(Tech.ChargeCancel, me, ((Component)me).transform.position, Vector3.up, FingerCount, 1f); ChantTime = -1f; return; } ChantTime += dt; if (!(ChantTime < 1.6f)) { ChantTime = -1f; if (!(Energy < worldSlash.Cost) && Aim(out var origin2, out var dir2)) { Spend(worldSlash); SukunaNet.Send(Tech.WorldSlash, me, origin2, dir2, FingerCount); } } } private void CancelAll(bool notify) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar instance = PlayerAvatar.instance; if ((FugaCharge >= 0f || ChantTime >= 0f) && notify && Object.op_Implicit((Object)(object)instance)) { SukunaNet.Send(Tech.ChargeCancel, instance, ((Component)instance).transform.position, Vector3.up, FingerCount); } FugaCharge = -1f; ChantTime = -1f; StopHandFlame(); dismantleHeld = -1f; barrage = false; rctActive = false; rctHeal = 0f; } private void StartHandFlame() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) StopHandFlame(); Camera val = (Object.op_Implicit((Object)(object)GameDirector.instance) ? GameDirector.instance.MainCamera : Camera.main); if (Object.op_Implicit((Object)(object)val)) { handFlame = Vfx.Emitter("Fuga Hand Flames", ((Component)val).transform.position, ((Component)val).transform, Vfx.FireMat, Vfx.FireYellow, Vfx.FireOrange, 70f, 0.35f, 0.09f, 0.35f, 0.04f, -0.3f, (ParticleSystemShapeType)0); ((Component)handFlame).transform.localPosition = new Vector3(0.22f, -0.2f, 0.55f); MainModule main = handFlame.main; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0; handLight = ((Component)handFlame).gameObject.AddComponent(); handLight.type = (LightType)2; handLight.color = Vfx.FireOrange; handLight.range = 4f; handLight.intensity = 1f; handLight.shadows = (LightShadows)0; } } private void UpdateHandFlame(float charge) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)handFlame)) { ((Component)handFlame).transform.localScale = Vector3.one * (0.6f + 0.9f * charge); if (Object.op_Implicit((Object)(object)handLight)) { handLight.intensity = 1f + 3f * charge; } } } private void StopHandFlame() { if (Object.op_Implicit((Object)(object)handFlame)) { Object.Destroy((Object)(object)((Component)handFlame).gameObject); handFlame = null; handLight = null; } } } internal sealed class SukunaEnemyAI : BossAI { private enum State { Spawn, Hunt, Fight, Fuga, Chant, Dead } private const int Level = 8; private State state; private float stateTimer; private float attackTimer; private float lookTimer; private float dismantleCd; private float cleaveCd; private float webCd; private float fugaCd; private float shrineCd; private float slashCd; private float barrageCd; private int barrageLeft; private float barrageTick; private bool healed; protected override void OnSpawned() { healed = false; SetState(State.Spawn); } protected override void OnSeen(PlayerAvatar p) { Provoke(p); } protected override void OnDied() { state = State.Dead; } protected override void DropLoot(Vector3 at) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)FingerItem.Item)) { int value = SukunaConfig.SukunaFingerDrop.Value; for (int i = 0; i < value; i++) { Vector3 val = Quaternion.Euler(0f, (float)i * 360f / (float)value, 0f) * Vector3.forward * 0.35f; Items.SpawnItem(FingerItem.Item, at + Vector3.up * 0.3f + val, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); } } } protected override void Provoke(PlayerAvatar who) { if (BossAI.Valid(who) || BossAI.Valid(target)) { bool flag = !base.Aggro; aggroTimer = 30f; if (BossAI.Valid(who) && (flag || !BossAI.Valid(target))) { target = who; } if (flag) { attackTimer = 1f; Announce(); } if (state == State.Hunt) { SetState(State.Fight); } } } private void SetState(State s) { state = s; stateTimer = 0f; } private void Update() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) if (!BossAI.Host || !Object.op_Implicit((Object)(object)enemy) || state == State.Dead) { return; } float deltaTime = Time.deltaTime; stateTimer += deltaTime; aggroTimer -= deltaTime; attackTimer -= deltaTime; dismantleCd -= deltaTime; cleaveCd -= deltaTime; webCd -= deltaTime; fugaCd -= deltaTime; shrineCd -= deltaTime; slashCd -= deltaTime; barrageCd -= deltaTime; if (base.Busy) { return; } if (enemy.IsStunned()) { enemy.NavMeshAgent.Stop(0.2f); barrageLeft = 0; if (state == State.Fuga || state == State.Chant) { SukunaNet.SendEnemy(Tech.ChargeCancel, this, ((Component)this).transform.position, Vector3.up); SetState(State.Fight); } return; } switch (state) { case State.Spawn: if (stateTimer > 2f) { SetState((!base.Aggro) ? State.Hunt : State.Fight); } break; case State.Hunt: Hunt(); break; case State.Fight: Fight(deltaTime); break; case State.Fuga: DrawFuga(); break; case State.Chant: Chant(); break; } Face((state == State.Hunt) ? null : target); } private void Hunt() { if (base.Aggro) { SetState(State.Fight); return; } Roam(2.2f); lookTimer -= Time.deltaTime; if (!(lookTimer > 0f)) { lookTimer = 0.5f; PlayerAvatar val = NearestPlayer(9f, needSight: true); if (Object.op_Implicit((Object)(object)val)) { Provoke(val); } } } private void Fight(float dt) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031b: 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_031d: 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_0326: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) if (!base.Aggro || !BossAI.Valid(target)) { target = NearestPlayer(35f, needSight: false); if (!base.Aggro || !Object.op_Implicit((Object)(object)target)) { target = null; SetState(State.Hunt); return; } } Vector3 center = base.Center; Vector3 val = BossHits.Center(target); float num = Vector3.Distance(center, val); bool flag = Combat.LineOfSight(center, val); if (flag) { aggroTimer = Mathf.Max(aggroTimer, 10f); } enemy.NavMeshAgent.OverrideAgent(4.2f, 14f, 0.2f); if (num > 4.5f || !flag) { enemy.NavMeshAgent.SetDestination(((Component)target).transform.position); } else { enemy.NavMeshAgent.Stop(0.2f); } Vector3 position = base.HandPoint.position; Vector3 val2 = val - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (barrageLeft > 0) { barrageTick -= dt; if (!(barrageTick > 0f)) { barrageTick = 0.1f; barrageLeft--; val2 = normalized + Random.insideUnitSphere * 0.07f; Vector3 normalized2 = ((Vector3)(ref val2)).normalized; val2 = Vector3.Cross(Vector3.up, normalized2); Vector3 val3 = ((Vector3)(ref val2)).normalized * Random.Range(-0.5f, 0.5f); SukunaNet.SendEnemy(Tech.DismantleBarrage, this, position + val3, normalized2, Random.Range(0f, 360f), 0, 8); } } else if (!(attackTimer > 0f)) { float healthFraction = base.HealthFraction; if (healthFraction < 0.3f && !healed) { healed = true; attackTimer = 1f; enemy.Health.Heal(enemy.Health.health / 4); SukunaNet.SendEnemy(Tech.Rct, this, center, Vector3.up, 1f, 0, 8); } else if (healthFraction < 0.4f && slashCd <= 0f && flag) { slashCd = 35f; SukunaNet.SendEnemy(Tech.WorldSlashChant, this, position, normalized, 0f, 0, 8); SetState(State.Chant); } else if (healthFraction < 0.65f && shrineCd <= 0f && num < 12f) { shrineCd = 50f; attackTimer = 2f; val2 = Vector3.ProjectOnPlane(((Component)this).transform.forward, Vector3.up); Vector3 normalized3 = ((Vector3)(ref val2)).normalized; SukunaNet.SendEnemy(Tech.Shrine, this, ((Component)this).transform.position, normalized3, 0f, 0, 8); } else if (num < 3.2f && cleaveCd <= 0f) { cleaveCd = 2.2f; attackTimer = 0.9f; bool flag2 = Random.value < 0.2f; val2 = val - center; SukunaNet.SendEnemy(Tech.Cleave, this, center, ((Vector3)(ref val2)).normalized, 0f, flag2 ? 1 : 0, 8); } else if (num < 7f && webCd <= 0f) { webCd = 9f; attackTimer = 1.2f; SukunaNet.SendEnemy(Tech.Spiderweb, this, ((Component)this).transform.position, normalized, Random.Range(0f, 1000f), 0, 8); } else if (flag && fugaCd <= 0f && num > 6f && num < 30f) { fugaCd = 15f; SukunaNet.SendEnemy(Tech.FugaCharge, this, position, normalized, 0f, 0, 8); SetState(State.Fuga); } else if (flag && barrageCd <= 0f && num < 20f) { barrageCd = 8f; barrageLeft = 8; barrageTick = 0f; attackTimer = 1.4f; } else if (flag && dismantleCd <= 0f && num < 30f) { dismantleCd = 1.4f; attackTimer = 0.6f; float extra = ((Random.value < 0.25f) ? Random.Range(70f, 110f) : Random.Range(-35f, 35f)); SukunaNet.SendEnemy(Tech.Dismantle, this, position, normalized, extra, 0, 8); } } } private void DrawFuga() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) enemy.NavMeshAgent.Stop(0.2f); if (!(stateTimer < 1.1f)) { if (BossAI.Valid(target)) { Vector3 position = base.HandPoint.position; Vector3 val = BossHits.Center(target) - position; Vector3 normalized = ((Vector3)(ref val)).normalized; SukunaNet.SendEnemy(Tech.Fuga, this, position + normalized * 0.6f, normalized, 1f, 0, 8); } else { SukunaNet.SendEnemy(Tech.ChargeCancel, this, ((Component)this).transform.position, Vector3.up); } attackTimer = 1.5f; SetState(State.Fight); } } private void Chant() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_005a: Unknown result type (might be due to invalid IL or missing references) enemy.NavMeshAgent.Stop(0.2f); if (!(stateTimer < 1.8000001f)) { if (BossAI.Valid(target)) { Vector3 position = base.HandPoint.position; Vector3 val = BossHits.Center(target) - position; Vector3 normalized = ((Vector3)(ref val)).normalized; SukunaNet.SendEnemy(Tech.WorldSlash, this, position, normalized, 0f, 0, 8); } else { SukunaNet.SendEnemy(Tech.ChargeCancel, this, ((Component)this).transform.position, Vector3.up); } attackTimer = 2f; SetState(State.Fight); } } internal override void ProvokedFx(Cast c) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Model)) { Model.SetAggro(30f); } Vfx.Burst(c.Origin, new Color(0.6f, 0f, 0.05f, 0.9f), new Color(0.05f, 0f, 0f, 0.9f), 40, 4f, 0.2f, 1f, -0.1f, Vfx.SmokeMat, 0.5f); Sfx.Play(SfxId.Domain, c.Origin, 0.5f); PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && Vector3.Distance(((Component)instance).transform.position, c.Origin) < 30f) { Hud.Banner("RYOMEN SUKUNA", "\"Know your place, fool.\"", Vfx.Red, 3f); Hud.Flash(new Color(0.5f, 0f, 0.02f, 0.4f), 0.6f); } } internal override void DefeatedFx(Cast c) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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) state = State.Dead; Vfx.Burst(c.Origin, Vfx.Red, Color.black, 70, 6f, 0.25f, 1.3f, -0.1f, Vfx.SmokeMat, 0.6f); Vfx.BlackLightning(c.Origin, 8, 2f, 0.6f); Vfx.LightFlash(c.Origin, Vfx.Red, 8f, 12f, 1f); Vfx.Shake(c.Origin, 6f, 0.6f); Sfx.Play(SfxId.Boom, c.Origin, 0.7f); Hud.Banner("RYOMEN SUKUNA DEFEATED", SukunaConfig.SukunaFingerDrop.Value + " of his fingers lie where he fell", Vfx.Red, 4f); } } internal sealed class SukunaModel : BossModel { private Transform hips; private Transform chest; private Transform head; private Transform legL; private Transform legR; private Transform kneeL; private Transform kneeR; private readonly Transform[] arms = (Transform[])(object)new Transform[4]; private readonly Transform[] elbows = (Transform[])(object)new Transform[4]; protected override void Build() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) Transform val = NewRoot("Sukuna Model", 1.15f); Dictionary dictionary = RigFactory.Spawn("sukuna", val); hips = dictionary["Hips"]; chest = dictionary["Chest"]; head = dictionary["Head"]; legL = dictionary["Leg L"]; legR = dictionary["Leg R"]; kneeL = dictionary["Leg L Lower"]; kneeR = dictionary["Leg R Lower"]; for (int i = 0; i < 4; i++) { arms[i] = dictionary["Arm " + i]; elbows[i] = dictionary["Arm " + i + " Lower"]; } Hand = dictionary["Hand Point"]; BossModel.PointLight(chest, new Vector3(0f, 0.5f, 0.6f), new Color(1f, 0.25f, 0.2f), 3.5f, 1.1f); Finish(val); } private void LateUpdate() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0258: 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_00aa: 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_00f9: 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_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(Time.deltaTime, 0.0001f); float s; float num2 = Step(num, out s); BossModel.Legs(num2, s, legL, legR, kneeL, kneeR); hips.localPosition = new Vector3(0f, 1f + Mathf.Abs(s) * 0.03f * num2, 0f); bool fighting = base.Fighting; for (int i = 0; i < 4; i++) { float num3 = ((i % 2 == 0) ? (-1f) : 1f); bool flag = i < 2; Quaternion val = (flag ? Quaternion.Euler(-8f, 0f, num3 * 10f) : Quaternion.Euler(-25f, num3 * 30f, num3 * 18f)); Quaternion val2 = (flag ? Quaternion.Euler(-55f, 0f, num3 * 25f) : Quaternion.Euler(-35f, 0f, num3 * 40f)); Quaternion val3 = Quaternion.Euler(s * num3 * 15f * num2, 0f, 0f); Quaternion val4 = (fighting ? val2 : val) * val3; if (castTimer > 0f && i == 3) { val4 = Quaternion.Euler(-95f, 0f, 0f); } if (castTimer > 0f && i == 1) { val4 = Quaternion.Euler(-60f, 0f, 30f); } arms[i].localRotation = Quaternion.Slerp(arms[i].localRotation, val4, num * ((castTimer > 0f) ? 16f : 8f)); float num4 = ((castTimer > 0f && i == 3) ? 0f : (fighting ? (-55f) : (flag ? (-15f) : (-70f)))); elbows[i].localRotation = Quaternion.Slerp(elbows[i].localRotation, Quaternion.Euler(num4, 0f, 0f), num * 10f); } chest.localRotation = Quaternion.Euler(fighting ? 6f : 0f, 0f, 0f); head.localRotation = Quaternion.Euler(fighting ? 4f : (-6f), Mathf.Sin(Time.time * 0.3f) * (fighting ? 0f : 12f), 0f); } } internal enum Tech : byte { Dismantle = 1, DismantleBarrage = 2, Cleave = 3, Spiderweb = 4, FugaCharge = 5, Fuga = 6, Rct = 7, Shrine = 8, WorldSlashChant = 9, WorldSlash = 10, FingerEaten = 11, FingerRejected = 12, ChargeCancel = 13, BlindfoldWorn = 40, BlindfoldRejected = 41, GojoBlue = 42, GojoRed = 43, GojoPurpleCharge = 44, GojoPurple = 45, GojoBlink = 46, GojoInfinity = 47, GojoVoid = 48, TalismanUsed = 60, TalismanRejected = 61, MegumiDogs = 62, MegumiNue = 63, MegumiShadowStep = 64, MegumiToad = 65, MegumiElephant = 66, MegumiDomain = 67, MegumiMahoragaChant = 68, MegumiMahoraga = 69, MegumiSerpent = 70, MegumiRabbits = 71, MegumiDeer = 72, MegumiOx = 73, MegumiTiger = 74, SummonHit = 75, SummonKilled = 76, EnemyFirst = 80, EnemyBlue = 80, EnemyRed = 81, EnemyPurpleCharge = 82, EnemyPurple = 83, EnemyStrike = 84, EnemyVoid = 85, EnemyTeleport = 86, EnemyProvoked = 87, EnemyDefeated = 88 } internal struct Cast { public Tech Tech; public PlayerAvatar Caster; public BossAI Enemy; public bool Local; public Vector3 Origin; public Vector3 Dir; public int Fingers; public float Extra; public int Flags; public float Power => SukunaStats.Power(Fingers); public bool Hostile => (Object)(object)Enemy != (Object)null; public Object Key { get { if (!Hostile) { return (Object)(object)Caster; } return (Object)(object)Enemy; } } } internal static class SukunaNet { private static NetworkedEvent castEvent; internal const int EnemyFlag = 1048576; internal static void Init() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown castEvent = new NetworkedEvent("SukunaMod Cast", (Action)OnEvent); } internal static void Send(Tech tech, PlayerAvatar caster, Vector3 origin, Vector3 dir, int fingers, float extra = 0f, int flags = 0) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (castEvent != null && Object.op_Implicit((Object)(object)caster)) { Raise(tech, caster.photonView.ViewID, origin, dir, fingers, extra, flags); } } internal static void SendEnemy(Tech tech, BossAI boss, Vector3 origin, Vector3 dir, float extra = 0f, int flags = 0, int level = 0) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (castEvent != null && Object.op_Implicit((Object)(object)boss)) { Raise(tech, boss.NetId, origin, dir, level, extra, flags | 0x100000); } } private static void Raise(Tech tech, int id, Vector3 origin, Vector3 dir, int fingers, float extra, int flags) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) object[] array = new object[7] { (byte)tech, id, origin, dir, fingers, extra, flags }; castEvent.RaiseEvent((object)array, NetworkingEvents.RaiseAll, SendOptions.SendReliable); } internal static void SendFingerEvent(Tech tech, PlayerAvatar eater, int fingers, Vector3 at) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) Send(tech, eater, at, Vector3.up, fingers); } private static void OnEvent(EventData e) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) try { if (!(e.CustomData is object[] array) || array.Length < 7) { return; } Cast c = new Cast { Tech = (Tech)(byte)array[0], Origin = (Vector3)array[2], Dir = (Vector3)array[3], Fingers = (int)array[4], Extra = (float)array[5], Flags = (int)array[6] }; int num = (int)array[1]; if ((int)c.Tech >= 80 || (c.Flags & 0x100000) != 0) { c.Enemy = BossAI.Find(num); if (!Object.op_Implicit((Object)(object)c.Enemy)) { return; } } else { c.Caster = (SemiFunc.IsMultiplayer() ? SemiFunc.PlayerAvatarGetFromPhotonID(num) : PlayerAvatar.instance); if (!Object.op_Implicit((Object)(object)c.Caster)) { return; } c.Local = (Object)(object)c.Caster == (Object)(object)PlayerAvatar.instance; } if (((Vector3)(ref c.Dir)).sqrMagnitude < 1E-06f) { c.Dir = Vector3.forward; } ((Vector3)(ref c.Dir)).Normalize(); Techniques.Execute(c); } catch (Exception ex) { Plugin.Log.LogError((object)("Sukuna cast failed: " + ex)); } } } internal sealed class SukunaPanel : MonoBehaviour { private sealed class Row { public TechInfo Tech; public TextMeshProUGUI Name; public TextMeshProUGUI Key; public Image BadgeBg; public RectTransform Cool; public RectTransform BadgeRect; public string NameText; public string KeyText; public Color NameColor; public Color KeyColor; public Color BadgeColor; } internal static bool Active; private const float Width = 360f; private const float Margin = 34f; private const float RowH = 34f; private const float Badge = 28f; private const float BarW = 210f; private const float BarH = 6f; private const float RowsTop = 92f; private Canvas canvas; private RectTransform root; private float u = 1f; private int layer; private TMP_FontAsset font; private Material material; private TextMeshProUGUI countText; private TextMeshProUGUI energyText; private RectTransform energyFill; private Image energyFillImage; private RawImage iconImage; private Row[] rows; private string countString; private string energyString; private int lastFingers = -1; private IPowerHud lastPower; private readonly Dictionary unlockedAt = new Dictionary(); private void Update() { IPowerHud current = PowerHud.Current; if (current == null || !SukunaConfig.ShowHud.Value || (Object.op_Implicit((Object)(object)HUD.instance) && HUD.instance.hidden)) { if (Object.op_Implicit((Object)(object)root)) { ((Component)root).gameObject.SetActive(false); } Active = Object.op_Implicit((Object)(object)root); return; } if (!EnsureBuilt()) { Active = false; return; } Active = true; if (!((Component)root).gameObject.activeSelf) { ((Component)root).gameObject.SetActive(true); } FitToGamePicture(); Refresh(current); } private bool EnsureBuilt() { if (Object.op_Implicit((Object)(object)root)) { return true; } TextMeshProUGUI val = (Object.op_Implicit((Object)(object)GoalUI.instance) ? GoalUI.instance.Text : null); if (!Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)HaulUI.instance)) { val = HaulUI.instance.Text; } if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)((TMP_Text)val).font)) { return false; } if (Object.op_Implicit((Object)(object)material)) { Object.Destroy((Object)(object)material); } try { Build(val); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Sukuna panel could not be built, using the simple one: " + ex.Message)); if (Object.op_Implicit((Object)(object)root)) { Object.Destroy((Object)(object)((Component)root).gameObject); } root = null; return false; } return true; } private void EnsureCanvas() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)canvas)) { GameObject val = new GameObject("Sukuna Overlay"); Object.DontDestroyOnLoad((Object)(object)val); canvas = val.AddComponent(); canvas.renderMode = (RenderMode)0; canvas.sortingOrder = 50; CanvasScaler obj = val.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); obj.screenMatchMode = (ScreenMatchMode)0; obj.matchWidthOrHeight = 1f; layer = val.layer; } } private void Build(TextMeshProUGUI style) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_0318: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0533: 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_057e: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) EnsureCanvas(); u = 1f; font = ((TMP_Text)style).font; material = new Material(Object.op_Implicit((Object)(object)((TMP_Asset)font).material) ? ((TMP_Asset)font).material : ((TMP_Text)style).fontSharedMaterial) { name = "Sukuna Panel Text" }; material.EnableKeyword(ShaderUtilities.Keyword_Outline); material.SetFloat(ShaderUtilities.ID_OutlineWidth, 0.22f); material.SetColor(ShaderUtilities.ID_OutlineColor, new Color(0.05f, 0f, 0f, 1f)); material.EnableKeyword(ShaderUtilities.Keyword_Underlay); material.SetColor(ShaderUtilities.ID_UnderlayColor, new Color(0f, 0f, 0f, 0.7f)); material.SetFloat(ShaderUtilities.ID_UnderlayOffsetX, 0.6f); material.SetFloat(ShaderUtilities.ID_UnderlayOffsetY, -0.6f); material.SetFloat(ShaderUtilities.ID_UnderlaySoftness, 0.4f); countString = (energyString = null); lastFingers = -1; root = NewRect("Sukuna Panel", ((Component)canvas).transform); RectTransform obj = root; RectTransform obj2 = root; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(1f, 0.5f); obj2.anchorMax = val; obj.anchorMin = val; root.pivot = new Vector2(1f, 0.5f); int num = Mathf.Max(TechInfo.All.Length, Mathf.Max(TechInfo.Gojo.Length, TechInfo.Megumi.Length)); float num2 = 92f + (float)num * 34f; root.sizeDelta = new Vector2(360f * u, num2 * u); root.anchoredPosition = new Vector2(-34f * u, 0f); ((Transform)root).SetAsLastSibling(); RectTransform val2 = Place(NewRect("Finger Icon", (Transform)(object)root), 0f, 0f, 54f, 54f); iconImage = ((Component)val2).gameObject.AddComponent(); ((Graphic)iconImage).raycastTarget = false; lastPower = null; countText = Text((Transform)(object)root, "Finger Count", 46f, (TextAlignmentOptions)516); Place(((TMP_Text)countText).rectTransform, 60f, -2f, 220f, 58f); ((Graphic)countText).color = new Color(1f, 0.45f, 0.15f); RectTransform val3 = Place(NewRect("Energy Bar", (Transform)(object)root), 0f, 66f, 210f, 6f); ((Graphic)((Component)val3).gameObject.AddComponent()).color = new Color(0.12f, 0f, 0.01f, 0.75f); ((Graphic)((Component)val3).GetComponent()).raycastTarget = false; energyFill = NewRect("Energy Fill", (Transform)(object)val3); RectTransform obj3 = energyFill; RectTransform obj4 = energyFill; ((Vector2)(ref val))..ctor(0f, 0.5f); obj4.anchorMax = val; obj3.anchorMin = val; energyFill.pivot = new Vector2(0f, 0.5f); energyFill.anchoredPosition = Vector2.zero; energyFill.sizeDelta = new Vector2(210f * u, 6f * u); energyFillImage = ((Component)energyFill).gameObject.AddComponent(); ((Graphic)energyFillImage).raycastTarget = false; energyText = Text((Transform)(object)root, "Energy Value", 18f, (TextAlignmentOptions)516); Place(((TMP_Text)energyText).rectTransform, 220f, 57f, 110f, 24f); rows = new Row[num]; for (int i = 0; i < rows.Length; i++) { float num3 = 92f + (float)i * 34f; Row row = new Row { Tech = TechInfo.All[Mathf.Min(i, TechInfo.All.Length - 1)] }; RectTransform val4 = (row.BadgeRect = Place(NewRect("Badge", (Transform)(object)root), 0f, num3 + 3f, 28f, 28f)); row.BadgeBg = ((Component)val4).gameObject.AddComponent(); ((Graphic)row.BadgeBg).raycastTarget = false; row.Cool = NewRect("Cooldown", (Transform)(object)val4); row.Cool.anchorMin = new Vector2(0f, 0f); row.Cool.anchorMax = new Vector2(1f, 0f); row.Cool.pivot = new Vector2(0.5f, 0f); row.Cool.anchoredPosition = Vector2.zero; row.Cool.sizeDelta = new Vector2(0f, 0f); Image obj5 = ((Component)row.Cool).gameObject.AddComponent(); ((Graphic)obj5).color = new Color(0.75f, 0.04f, 0.06f, 0.6f); ((Graphic)obj5).raycastTarget = false; row.Key = Text((Transform)(object)val4, "Key", 19f, (TextAlignmentOptions)514); RectTransform rectTransform = ((TMP_Text)row.Key).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; val = (rectTransform.offsetMin = (rectTransform.offsetMax = Vector2.zero)); row.Name = Text((Transform)(object)root, "Name", 23f, (TextAlignmentOptions)516); Place(((TMP_Text)row.Name).rectTransform, 38f, num3, 322f, 34f); rows[i] = row; } } private void FitToGamePicture() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) float num = (Object.op_Implicit((Object)(object)canvas) ? canvas.scaleFactor : 1f); if (num <= 0f) { num = 1f; } Rect val = Hud.GameScreenRect(); float num2 = ((float)Screen.width - ((Rect)(ref val)).xMax) / num; float num3 = (((Rect)(ref val)).center.y - (float)Screen.height * 0.5f) / num; root.anchoredPosition = new Vector2(0f - (34f + num2), num3); } private void Refresh(IPowerHud ctl) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: 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_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_074d: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0746: Unknown result type (might be due to invalid IL or missing references) //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_075f: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_0794: Unknown result type (might be due to invalid IL or missing references) if (ctl != lastPower) { lastPower = ctl; lastFingers = -1; iconImage.texture = ctl.Icon; ((Behaviour)iconImage).enabled = Object.op_Implicit((Object)(object)ctl.Icon); ((Graphic)countText).color = (Color)((ctl is SukunaController) ? new Color(1f, 0.45f, 0.15f) : Color.Lerp(ctl.Accent, Color.white, 0.55f)); TechInfo[] techs = ctl.Techs; float num = ((techs.Length > 8) ? 28f : 34f); float num2 = ((techs.Length > 8) ? 24f : 28f); root.sizeDelta = new Vector2(360f * u, (92f + (float)techs.Length * num) * u); for (int i = 0; i < rows.Length; i++) { Row row = rows[i]; bool flag = i < techs.Length; ((Component)row.BadgeRect).gameObject.SetActive(flag); ((Component)row.Name).gameObject.SetActive(flag); row.Tech = (flag ? techs[i] : null); row.NameText = (row.KeyText = null); if (flag) { float num3 = 92f + (float)i * num; Place(row.BadgeRect, 0f, num3 + (num - num2) * 0.5f, num2, num2); Place(((TMP_Text)row.Name).rectTransform, 38f, num3, 322f, num); ((TMP_Text)row.Name).fontSize = ((techs.Length > 8) ? 20f : 23f) * u; } } countString = (energyString = null); } int unlockLevel = ctl.UnlockLevel; if (lastFingers >= 0 && unlockLevel > lastFingers) { TechInfo[] techs2 = ctl.Techs; foreach (TechInfo techInfo in techs2) { if (techInfo.Unlock > lastFingers && techInfo.Unlock <= unlockLevel) { unlockedAt[techInfo] = Time.unscaledTime; } } } lastFingers = unlockLevel; string text = ctl.CountText; if (text != countString) { countString = text; ((TMP_Text)countText).text = text; } float num4 = ((ctl.MaxEnergy > 0f) ? Mathf.Clamp01(ctl.Energy / ctl.MaxEnergy) : 0f); energyFill.sizeDelta = new Vector2(210f * u * num4, 6f * u); Color val = ctl.Accent; if (ctl.EnergyPulse) { val = Color.Lerp(val, val * 0.2f, 0.5f + 0.5f * Mathf.Sin(Time.unscaledTime * 10f)); } val.a = 1f; ((Graphic)energyFillImage).color = val; string energyTag = ctl.EnergyTag; string text2 = ((energyTag.Length > 0) ? ("" + energyTag + " ") : "") + Mathf.FloorToInt(ctl.Energy); if (text2 != energyString) { energyString = text2; ((TMP_Text)energyText).text = text2; ((Graphic)energyText).color = Color.Lerp(ctl.Accent, Color.white, 0.6f); } Row[] array = rows; Color val2 = default(Color); Color white = default(Color); Color val3 = default(Color); foreach (Row row2 in array) { TechInfo tech = row2.Tech; if (tech != null) { bool num5 = tech.Unlocked(unlockLevel); string text3 = string.Concat(str1: (tech.Hint == "hold" || tech.Hint == "toggle") ? (" " + tech.Hint + "") : "", str0: tech.Name); string text4 = tech.KeyName; float num6 = 0f; if (!num5) { text4 = tech.Unlock.ToString(); ((Color)(ref val2))..ctor(0.7f, 0.62f, 0.6f, 0.5f); ((Color)(ref white))..ctor(0.8f, 0.55f, 0.5f, 0.6f); ((Color)(ref val3))..ctor(0.1f, 0f, 0f, 0.35f); } else if (ctl.IsActive(tech)) { val2 = Color.Lerp(ctl.Accent, Color.white, 0.45f); white = Color.white; val3 = Color.Lerp(ctl.Accent, Color.black, 0.35f); val3.a = 0.8f; } else if (ctl.Cooldown(tech) > 0f) { num6 = Mathf.Clamp01(ctl.Cooldown(tech) / Mathf.Max(0.01f, tech.Cooldown)); ((Color)(ref val2))..ctor(0.62f, 0.56f, 0.55f, 0.85f); ((Color)(ref white))..ctor(0.75f, 0.7f, 0.7f); ((Color)(ref val3))..ctor(0.08f, 0f, 0f, 0.6f); } else if (ctl.Energy < ctl.CostOf(tech)) { ((Color)(ref val2))..ctor(0.85f, 0.38f, 0.32f, 0.9f); ((Color)(ref white))..ctor(0.85f, 0.5f, 0.45f); ((Color)(ref val3))..ctor(0.08f, 0f, 0f, 0.6f); } else { ((Color)(ref val2))..ctor(0.97f, 0.92f, 0.88f); white = Color.white; ((Color)(ref val3))..ctor(0.1f, 0f, 0f, 0.65f); } if (num5 && unlockedAt.TryGetValue(tech, out var value) && Time.unscaledTime - value < 5f) { float num7 = 0.5f + 0.5f * Mathf.Sin((Time.unscaledTime - value) * 8f); val2 = Color.Lerp(val2, new Color(1f, 0.45f, 0.15f), num7); val3 = Color.Lerp(val3, new Color(0.8f, 0.1f, 0.05f, 0.9f), num7); } if (text3 != row2.NameText) { row2.NameText = text3; ((TMP_Text)row2.Name).text = text3; } if (text4 != row2.KeyText) { row2.KeyText = text4; ((TMP_Text)row2.Key).text = text4; } if (val2 != row2.NameColor) { row2.NameColor = val2; ((Graphic)row2.Name).color = val2; } if (white != row2.KeyColor) { row2.KeyColor = white; ((Graphic)row2.Key).color = white; } if (val3 != row2.BadgeColor) { row2.BadgeColor = val3; ((Graphic)row2.BadgeBg).color = val3; } row2.Cool.sizeDelta = new Vector2(0f, row2.BadgeRect.sizeDelta.y * num6); } } } private RectTransform NewRect(string name, Transform parent) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown RectTransform val = (RectTransform)new GameObject(name, new Type[1] { typeof(RectTransform) }) { layer = layer }.transform; ((Transform)val).SetParent(parent, false); ((Transform)val).localScale = Vector3.one; return val; } private RectTransform Place(RectTransform rt, float fromRight, float fromTop, float w, float h) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(1f, 1f); rt.anchorMax = val; rt.anchorMin = val; rt.pivot = new Vector2(1f, 1f); rt.anchoredPosition = new Vector2((0f - fromRight) * u, (0f - fromTop) * u); rt.sizeDelta = new Vector2(w * u, h * u); return rt; } private TextMeshProUGUI Text(Transform parent, string name, float size, TextAlignmentOptions align) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI obj = ((Component)NewRect(name, parent)).gameObject.AddComponent(); ((TMP_Text)obj).font = font; ((TMP_Text)obj).fontSharedMaterial = material; ((TMP_Text)obj).fontSize = size * u; ((TMP_Text)obj).alignment = align; ((TMP_Text)obj).textWrappingMode = (TextWrappingModes)0; ((TMP_Text)obj).overflowMode = (TextOverflowModes)0; ((Graphic)obj).raycastTarget = false; ((TMP_Text)obj).richText = true; return obj; } private void OnDestroy() { Active = false; if (Object.op_Implicit((Object)(object)root)) { Object.Destroy((Object)(object)((Component)root).gameObject); } if (Object.op_Implicit((Object)(object)material)) { Object.Destroy((Object)(object)material); } } } internal static class SukunaStats { internal static float Power(int fingers) { return (1f + 0.1f * (float)(Mathf.Max(1, fingers) - 1)) * SukunaConfig.DamageMultiplier.Value; } internal static float MaxEnergy(int fingers) { return 100f + 10f * (float)(Mathf.Max(1, fingers) - 1); } internal static float EnergyRegen(int fingers) { return (7f + 0.6f * (float)(Mathf.Max(1, fingers) - 1)) * SukunaConfig.CursedEnergyRegenMultiplier.Value; } internal static float ShrineRadius(int fingers) { return 11f + 0.4f * (float)(Mathf.Max(1, fingers) - 1); } internal static float BlackFlashChance(int fingers, bool inZone) { return Mathf.Min(0.6f, 0.15f + 0.01f * (float)fingers + (inZone ? 0.15f : 0f)); } } internal sealed class TechInfo { internal readonly string Name; internal readonly ConfigEntry Key; internal readonly float Cost; internal readonly float Cooldown; internal readonly ConfigEntry UnlockEntry; internal readonly string Hint; internal static TechInfo Dismantle; internal static TechInfo Cleave; internal static TechInfo Spiderweb; internal static TechInfo Fuga; internal static TechInfo Rct; internal static TechInfo Shrine; internal static TechInfo WorldSlash; internal static TechInfo[] All; internal static TechInfo Blue; internal static TechInfo Red; internal static TechInfo Blink; internal static TechInfo Purple; internal static TechInfo Infinity; internal static TechInfo Void; internal static TechInfo SixEyes; internal static TechInfo[] Gojo; internal static TechInfo Dogs; internal static TechInfo Nue; internal static TechInfo ShadowStep; internal static TechInfo Elephant; internal static TechInfo Toad; internal static TechInfo Garden; internal static TechInfo Mahoraga; internal static TechInfo Serpent; internal static TechInfo Rabbits; internal static TechInfo Deer; internal static TechInfo Ox; internal static TechInfo Tiger; internal static TechInfo[] Megumi; internal int Unlock { get { if (UnlockEntry == null) { return 1; } return UnlockEntry.Value; } } internal string KeyName { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if ((int)Key.Value == 0) { return "-"; } string text = ((object)Key.Value/*cast due to .constrained prefix*/).ToString(); if (text.StartsWith("Digit")) { text = text.Substring(5); } else if (text.StartsWith("Numpad") && text.Length == 7) { text = "Num" + text.Substring(6); } return text.ToUpperInvariant(); } } internal TechInfo(string name, ConfigEntry key, float cost, float cooldown, ConfigEntry unlock, string hint) { Name = name; Key = key; Cost = cost; Cooldown = cooldown; UnlockEntry = unlock; Hint = hint; } internal bool Unlocked(int fingers) { return fingers >= Unlock; } internal static void Init() { Dismantle = new TechInfo("Dismantle", SukunaConfig.DismantleKey, 12f, 0.5f, SukunaConfig.DismantleUnlock, "tap / hold"); Cleave = new TechInfo("Cleave", SukunaConfig.CleaveKey, 20f, 2f, SukunaConfig.CleaveUnlock, ""); Rct = new TechInfo("Reverse Cursed Technique", SukunaConfig.RctKey, 16f, 0f, SukunaConfig.RctUnlock, "hold"); Spiderweb = new TechInfo("Spiderweb", SukunaConfig.SpiderwebKey, 35f, 7f, SukunaConfig.SpiderwebUnlock, ""); Fuga = new TechInfo("Fuga", SukunaConfig.FugaKey, 50f, 12f, SukunaConfig.FugaUnlock, "hold"); Shrine = new TechInfo("Malevolent Shrine", SukunaConfig.ShrineKey, 90f, 60f, SukunaConfig.ShrineUnlock, ""); WorldSlash = new TechInfo("World-Cutting Slash", SukunaConfig.WorldSlashKey, 75f, 40f, SukunaConfig.WorldSlashUnlock, "hold"); All = new TechInfo[7] { Dismantle, Cleave, Rct, Spiderweb, Fuga, Shrine, WorldSlash }; Blue = new TechInfo("Blue", SukunaConfig.BlueKey, 25f, 2.5f, null, ""); Red = new TechInfo("Red", SukunaConfig.RedKey, 30f, 3f, null, ""); Blink = new TechInfo("Blink", SukunaConfig.BlinkKey, 15f, 0.8f, null, ""); Purple = new TechInfo("Hollow Purple", SukunaConfig.PurpleKey, 120f, 25f, null, "hold"); Infinity = new TechInfo("Infinity", SukunaConfig.InfinityKey, 6f, 0f, null, "toggle"); Void = new TechInfo("Unlimited Void", SukunaConfig.VoidKey, 200f, 75f, null, ""); SixEyes = new TechInfo("Six Eyes", SukunaConfig.SixEyesKey, 1.5f, 0f, null, "toggle"); Gojo = new TechInfo[7] { Blue, Red, Blink, Purple, Infinity, Void, SixEyes }; Dogs = new TechInfo("Divine Dogs", SukunaConfig.DogsKey, 30f, 10f, null, ""); Nue = new TechInfo("Nue", SukunaConfig.NueKey, 25f, 3.5f, null, ""); ShadowStep = new TechInfo("Shadow Travel", SukunaConfig.ShadowStepKey, 15f, 1f, null, ""); Elephant = new TechInfo("Max Elephant", SukunaConfig.ElephantKey, 60f, 12f, null, ""); Toad = new TechInfo("Toad", SukunaConfig.ToadKey, 20f, 4f, null, ""); Garden = new TechInfo("Chimera Shadow Garden", SukunaConfig.GardenKey, 150f, 70f, null, ""); Mahoraga = new TechInfo("Mahoraga", SukunaConfig.MahoragaKey, 220f, 120f, null, "hold"); Serpent = new TechInfo("Great Serpent", SukunaConfig.SerpentKey, 40f, 8f, null, ""); Rabbits = new TechInfo("Rabbit Escape", SukunaConfig.RabbitKey, 25f, 14f, null, ""); Deer = new TechInfo("Round Deer", SukunaConfig.DeerKey, 45f, 20f, null, ""); Ox = new TechInfo("Piercing Ox", SukunaConfig.OxKey, 35f, 7f, null, ""); Tiger = new TechInfo("Tiger Funeral", SukunaConfig.TigerKey, 45f, 9f, null, ""); Megumi = new TechInfo[12] { Dogs, Nue, Serpent, Toad, Elephant, Rabbits, Deer, Ox, Tiger, Mahoraga, ShadowStep, Garden }; } } internal sealed class Summon : MonoBehaviour { internal static readonly List Active = new List(); internal int Id; internal BossAI Owner; private Transform center; private float radius; private float hp; private float frozenUntil; private float lastHitFx = -10f; private int hitsTaken; private bool adapts; private bool dying; private readonly Dictionary weaponCooldown = new Dictionary(); internal bool Frozen => Time.time < frozenUntil; internal Vector3 Center { get { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)center)) { return ((Component)this).transform.position; } return center.position; } } internal static int IdFor(Cast c, int index) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) return ((((((int)c.Tech * 73856093) ^ (Mathf.RoundToInt(c.Origin.x * 100f) * 19349663) ^ (Mathf.RoundToInt(c.Origin.y * 100f) * 83492791) ^ (Mathf.RoundToInt(c.Origin.z * 100f) * 50331653)) & 0x3FFFFF) << 2) | (index & 3)) & 0xFFFFFF; } internal static Summon Attach(GameObject go, Cast c, int index, float health, Transform center, float radius, bool adapts = false) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) if (!c.Hostile) { return null; } Summon summon = go.AddComponent(); summon.Id = IdFor(c, index); summon.Owner = c.Enemy; summon.hp = health * (float)Mathf.Max(1, SemiFunc.PlayerGetList().Count) / 2f + health * 0.5f; summon.center = (Object.op_Implicit((Object)(object)center) ? center : go.transform); summon.radius = radius; summon.adapts = adapts; GameObject val = new GameObject("Shikigami Hitbox"); if (VanillaHits.EnemyLayer >= 0) { val.layer = VanillaHits.EnemyLayer; } val.transform.SetParent(summon.center, false); SphereCollider obj = val.AddComponent(); ((Collider)obj).isTrigger = true; obj.radius = radius / Mathf.Max(0.01f, summon.center.lossyScale.x); return summon; } private void OnEnable() { Active.Add(this); } private void OnDisable() { Active.Remove(this); } internal static void HurtSphere(Vector3 c, float r, float damage, HashSet once) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) HurtWhere((Summon s) => Vector3.Distance(s.Center, c) < r + s.radius, damage, once); } internal static void HurtCapsule(Vector3 a, Vector3 b, float r, float damage, HashSet once) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) HurtWhere((Summon s) => Combat.DistanceToSegment(s.Center, a, b) < r + s.radius, damage, once); } internal static void HurtBox(Vector3 c, Vector3 half, Quaternion rot, float damage) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Quaternion inv = Quaternion.Inverse(rot); HurtWhere(delegate(Summon s) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = inv * (s.Center - c); return Mathf.Abs(val.x) < half.x + s.radius && Mathf.Abs(val.y) < half.y + s.radius && Mathf.Abs(val.z) < half.z + s.radius; }, damage, null); } private static void HurtWhere(Func inside, float damage, HashSet once) { if (!Combat.IsHost || damage <= 0f || Active.Count == 0) { return; } Summon[] array = Active.ToArray(); foreach (Summon summon in array) { if (Object.op_Implicit((Object)(object)summon) && !summon.dying && inside(summon) && (once == null || once.Add((Object)(object)summon))) { summon.TakeDamage(damage); } } } private void TakeDamage(float damage) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00ba: Unknown result type (might be due to invalid IL or missing references) if (adapts) { damage *= 1f - Mathf.Min(0.6f, (float)hitsTaken * 0.08f); hitsTaken++; } hp -= damage; PlayerAvatar instance = PlayerAvatar.instance; if (hp <= 0f) { dying = true; if (Object.op_Implicit((Object)(object)instance)) { SukunaNet.Send(Tech.SummonKilled, instance, Center, Vector3.up, 0, Id); } else { Kill(); } } else if (Time.time - lastHitFx > 0.2f && Object.op_Implicit((Object)(object)instance)) { lastHitFx = Time.time; SukunaNet.Send(Tech.SummonHit, instance, Center, Vector3.up, 0, Id); } } private void Update() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!Combat.IsHost || dying || VanillaHits.Active.Count == 0) { return; } foreach (HurtCollider item in VanillaHits.Touching(Center, radius)) { float num = Mathf.Max(0.2f, item.enemyDamageCooldown); if (!weaponCooldown.TryGetValue(item, out var value) || !(Time.time < value)) { weaponCooldown[item] = Time.time + num; TakeDamage(item.enemyDamage); if (dying) { break; } } } } private static Summon Find(int id) { foreach (Summon item in Active) { if (Object.op_Implicit((Object)(object)item) && item.Id == id) { return item; } } return null; } internal static void Hit(Cast c) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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) Summon summon = Find(Mathf.RoundToInt(c.Extra)); Vector3 val = (Object.op_Implicit((Object)(object)summon) ? summon.Center : c.Origin); Vfx.Burst(val, MegumiStats.Shadow, Color.white, 10, 3f, 0.15f, 0.4f, 0f, Vfx.SmokeMat, 0.3f); Sfx.Play(SfxId.Slash, val, 0.3f); } internal static void Killed(Cast c) { Summon summon = Find(Mathf.RoundToInt(c.Extra)); if (Object.op_Implicit((Object)(object)summon)) { summon.Kill(); } } internal static void DismissAll(BossAI owner) { Summon[] array = Active.ToArray(); foreach (Summon summon in array) { if (Object.op_Implicit((Object)(object)summon) && ((Object)(object)summon.Owner == (Object)(object)owner || !Object.op_Implicit((Object)(object)summon.Owner))) { summon.Kill(); } } } internal static void FreezeSphere(Vector3 c, float r, float time) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) foreach (Summon item in Active) { if (Object.op_Implicit((Object)(object)item) && Vector3.Distance(item.Center, c) < r) { item.frozenUntil = Mathf.Max(item.frozenUntil, Time.time + time); } } } internal void Kill() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)this)) { Vector3 val = Center; ShadowFx.Pool(val, 1.2f, 1.2f); ShadowFx.Smoke(val, 0.6f, 40); Vfx.LightFlash(val, MegumiStats.Glow, 3f, 5f, 0.4f); Sfx.Play(SfxId.HeavySlash, val, 0.6f); Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal static class TalismanItem { internal static readonly RuntimeItem Runtime = new RuntimeItem(new ItemSpec { AssetName = "Item Ten Shadows Talisman", DisplayName = "Ten Shadows Talisman", Description = "Megumi Fushiguro's talisman. Use it and your shadow will answer with the Ten Shadows' shikigami.", IconResource = "talisman_icon.png", ValueMax = 10000f, ColliderSize = new Vector3(0.085f, 0.03f, 0.22f), BuildModel = BuildModel, Behaviour = typeof(TenShadowsTalismanItem) }); internal static Item Item => Runtime.Item; internal static Texture2D IconTexture => Runtime.Icon; internal static void TryRegister() { Runtime.TryRegister(); } private static void BuildModel(Transform parent, Vector3 center, Material baseMat, int layer) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) Mesh mesh = ItemFactory.ToMesh(TalismanModel.BuildMesh(), "Ten Shadows Talisman"); Texture2D tex = ItemFactory.ToTexture(TalismanModel.BuildTexture(), 256, "Ten Shadows Talisman"); Material mat = ItemFactory.ModelMaterial(baseMat, tex, new Color(0.006f, 0.005f, 0.012f), "Ten Shadows Talisman"); ItemFactory.SmallGlow(ItemFactory.ModelObject("Ten Shadows Talisman Model", parent, center, mesh, mat, layer).transform, new Color(0.5f, 0.45f, 1f), 0.4f, 1.3f, layer); } } public class TenShadowsTalismanItem : MonoBehaviour { private ItemToggle toggle; private ItemAttributes attributes; private PhysGrabObject physGrabObject; private bool used; private float rejectCooldown; private void Awake() { ItemFactory.GiveOwnIcon((Component)(object)this, TalismanItem.Runtime); } private void Start() { toggle = ((Component)this).GetComponent(); attributes = ((Component)this).GetComponent(); physGrabObject = ((Component)this).GetComponent(); NotValuableObject component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.hasHealth = false; } } private void Update() { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (rejectCooldown > 0f) { rejectCooldown -= Time.deltaTime; } if (used || !Object.op_Implicit((Object)(object)toggle) || !toggle.toggleState || SemiFunc.RunIsShop() || RunManager.instance.levelIsShop || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } PlayerAvatar val = SemiFunc.PlayerAvatarGetFromPhotonID(toggle.playerTogglePhotonID); if (!Object.op_Implicit((Object)(object)val)) { return; } if (Shadows.Get(val) > 0) { toggle.ToggleItem(false, -1); if (rejectCooldown <= 0f) { rejectCooldown = 1f; SukunaNet.SendFingerEvent(Tech.TalismanRejected, val, 1, ((Component)this).transform.position); } return; } used = true; Powers.Grant(val, Powers.Kind.Megumi); if (Object.op_Implicit((Object)(object)attributes) && !string.IsNullOrEmpty(attributes.instanceName)) { StatsManager.instance.ItemRemove(attributes.instanceName); } toggle.ToggleDisable(true); SukunaNet.SendFingerEvent(Tech.TalismanUsed, val, Fingers.Get(val), ((Component)this).transform.position); physGrabObject.DestroyPhysGrabObject(); } } internal static class Techniques { internal static void Execute(Cast c) { //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) if (c.Hostile && Object.op_Implicit((Object)(object)c.Enemy.Model) && c.Tech != Tech.EnemyDefeated) { if (c.Tech != Tech.EnemyTeleport && c.Tech != Tech.EnemyProvoked) { c.Enemy.Model.OnCast(); } c.Enemy.Model.SetAggro(45f); } switch (c.Tech) { case Tech.Dismantle: Dismantle.Run(c, barrage: false); break; case Tech.DismantleBarrage: Dismantle.Run(c, barrage: true); break; case Tech.Cleave: Cleave.Run(c); break; case Tech.Spiderweb: Spiderweb.Run(c); break; case Tech.FugaCharge: Fuga.Charge(c); break; case Tech.Fuga: Fuga.Fire(c); break; case Tech.Rct: ReverseCursedTechnique.Pulse(c); break; case Tech.Shrine: ShrineDomain.Run(c); break; case Tech.WorldSlashChant: WorldSlash.Chant(c); break; case Tech.WorldSlash: WorldSlash.Run(c); break; case Tech.ChargeCancel: Fuga.StopCharge(c.Key); WorldSlash.StopChant(c.Key); HollowPurple.StopCharge(c.Key); Mahoraga.StopChant(c.Key); break; case Tech.FingerEaten: FingerEvents.Eaten(c); break; case Tech.FingerRejected: FingerEvents.Rejected(c); break; case Tech.BlindfoldWorn: FingerEvents.BlindfoldWorn(c); break; case Tech.BlindfoldRejected: if (c.Local) { Hud.Banner("YOU ALREADY SEE WITH THE SIX EYES", "", GojoStats.Blue, 2.5f); } break; case Tech.GojoBlue: case Tech.EnemyFirst: BlueOrb.Run(c); break; case Tech.GojoRed: case Tech.EnemyRed: RedBlast.Run(c); break; case Tech.GojoPurpleCharge: case Tech.EnemyPurpleCharge: HollowPurple.Charge(c); break; case Tech.GojoPurple: case Tech.EnemyPurple: HollowPurple.Fire(c); break; case Tech.GojoBlink: case Tech.EnemyTeleport: Blink.Run(c); break; case Tech.GojoInfinity: InfinityPulse.Run(c); break; case Tech.GojoVoid: case Tech.EnemyVoid: VoidDomain.Run(c); break; case Tech.EnemyStrike: GojoStrike.Run(c); break; case Tech.EnemyProvoked: c.Enemy.ProvokedFx(c); break; case Tech.EnemyDefeated: c.Enemy.DefeatedFx(c); break; case Tech.TalismanUsed: FingerEvents.TalismanUsed(c); break; case Tech.TalismanRejected: if (c.Local) { Hud.Banner("THE TEN SHADOWS ALREADY ANSWER YOU", "", MegumiStats.Shadow, 2.5f); } break; case Tech.MegumiDogs: DivineDogs.Run(c); break; case Tech.MegumiNue: NueStrike.Run(c); break; case Tech.MegumiShadowStep: ShadowStep.Run(c); break; case Tech.MegumiToad: ToadTongue.Run(c); break; case Tech.MegumiElephant: MaxElephant.Run(c); break; case Tech.MegumiDomain: ShadowGarden.Run(c); break; case Tech.MegumiMahoragaChant: Mahoraga.Chant(c); break; case Tech.MegumiMahoraga: Mahoraga.Summon(c); break; case Tech.MegumiSerpent: GreatSerpent.Run(c); break; case Tech.MegumiRabbits: RabbitEscape.Run(c); break; case Tech.MegumiDeer: RoundDeer.Run(c); break; case Tech.MegumiOx: PiercingOx.Run(c); break; case Tech.MegumiTiger: TigerFuneral.Run(c); break; case Tech.SummonHit: Summon.Hit(c); break; case Tech.SummonKilled: Summon.Killed(c); break; case (Tech)14: case (Tech)15: case (Tech)16: case (Tech)17: case (Tech)18: case (Tech)19: case (Tech)20: case (Tech)21: case (Tech)22: case (Tech)23: case (Tech)24: case (Tech)25: case (Tech)26: case (Tech)27: case (Tech)28: case (Tech)29: case (Tech)30: case (Tech)31: case (Tech)32: case (Tech)33: case (Tech)34: case (Tech)35: case (Tech)36: case (Tech)37: case (Tech)38: case (Tech)39: case (Tech)49: case (Tech)50: case (Tech)51: case (Tech)52: case (Tech)53: case (Tech)54: case (Tech)55: case (Tech)56: case (Tech)57: case (Tech)58: case (Tech)59: case (Tech)77: case (Tech)78: case (Tech)79: break; } } } internal static class FingerEvents { internal static void Eaten(Cast c) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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) Fingers.SetLocal(c.Caster.steamID, c.Fingers); Blindfold.Stat.SetLocal(c.Caster.steamID, 0); Shadows.Stat.SetLocal(c.Caster.steamID, 0); Vfx.Burst(c.Origin, new Color(0.6f, 0f, 0.05f, 0.9f), new Color(0.05f, 0f, 0f, 0.9f), 40, 3f, 0.18f, 1.2f, -0.2f, Vfx.SmokeMat, 0.2f); Vfx.LightFlash(c.Origin, Vfx.Red, 4f, 5f, 0.8f); Sfx.Play(SfxId.Eat, c.Origin); int value = SukunaConfig.MaxFingers.Value; if (c.Local) { if (Object.op_Implicit((Object)(object)SukunaController.Instance)) { SukunaController.Instance.OnFingerEaten(c.Fingers); } Hud.Flash(new Color(0.5f, 0f, 0.02f, 0.6f), 0.8f); Hud.Banner((c.Fingers == 1) ? "RYOMEN SUKUNA HAS AWAKENED" : "CURSED FINGER CONSUMED", "Finger " + c.Fingers + " / " + value + " - " + UnlockText(c.Fingers, value), Vfx.Red, 5f); } else { Hud.Notice(SemiFunc.PlayerGetName(c.Caster) + " ate a Cursed Finger (" + c.Fingers + " / " + value + ")", 4f); } } private static string UnlockText(int fingers, int max) { List list = new List(); TechInfo techInfo = null; TechInfo[] all = TechInfo.All; foreach (TechInfo techInfo2 in all) { if (techInfo2.Unlock == fingers) { list.Add(techInfo2.Name + " [" + techInfo2.KeyName + "]"); } else if (techInfo2.Unlock > fingers && techInfo2.Unlock <= max && (techInfo == null || techInfo2.Unlock < techInfo.Unlock)) { techInfo = techInfo2; } } if (list.Count > 0) { return "Unlocked: " + string.Join(", ", list); } if (techInfo != null) { return "Next technique: " + techInfo.Name + " at " + techInfo.Unlock + " fingers"; } return "The King of Curses grows stronger"; } internal static void BlindfoldWorn(Cast c) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) Blindfold.Stat.SetLocal(c.Caster.steamID, 1); Shadows.Stat.SetLocal(c.Caster.steamID, 0); if (!c.Local) { Vfx.Burst(c.Origin, GojoStats.BlueCore, GojoStats.Blue, 40, 3f, 0.15f, 1.2f, -0.2f, Vfx.GlowMat, 0.2f); Vfx.LightFlash(c.Origin, GojoStats.Blue, 4f, 6f, 0.8f); } Sfx.Play(SfxId.Heal, c.Origin); if (c.Local) { if (Object.op_Implicit((Object)(object)GojoController.Instance)) { GojoController.Instance.OnBlindfoldWorn(); } Hud.Flash(new Color(0.6f, 0.85f, 1f, 0.6f), 0.8f); Hud.Banner("THE SIX EYES OPEN", "You wield Limitless" + ((c.Fingers > 0) ? " - Sukuna sleeps until you eat another finger" : "") + " - techniques are listed on the right", GojoStats.Blue, 5f); } else { Hud.Notice(SemiFunc.PlayerGetName(c.Caster) + " put on Gojo's blindfold", 4f); } } internal static void TalismanUsed(Cast c) { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) Shadows.Stat.SetLocal(c.Caster.steamID, 1); Blindfold.Stat.SetLocal(c.Caster.steamID, 0); if (!c.Local) { Vfx.Burst(c.Origin, MegumiStats.Shadow, Color.black, 40, 3f, 0.2f, 1.2f, 0.3f, Vfx.SmokeMat, 0.3f); Vfx.LightFlash(c.Origin, MegumiStats.Glow, 3f, 5f, 0.8f); } Sfx.Play(SfxId.Chant, c.Origin, 0.7f); if (c.Local) { if (Object.op_Implicit((Object)(object)MegumiController.Instance)) { MegumiController.Instance.OnTalismanUsed(); } Hud.Flash(new Color(0f, 0f, 0.02f, 0.75f), 0.9f); Hud.Banner("THE TEN SHADOWS ANSWER YOU", "Your shadow holds Megumi's shikigami" + ((c.Fingers > 0) ? " - Sukuna sleeps until you eat another finger" : "") + " - techniques are listed on the right", MegumiStats.Glow, 5f); } else { Hud.Notice(SemiFunc.PlayerGetName(c.Caster) + " took up the Ten Shadows", 4f); } } internal static void Rejected(Cast c) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (c.Local) { Hud.Banner("YOUR BODY CAN'T HOLD MORE", "You already carry " + c.Fingers + " of Sukuna's fingers", Vfx.Red, 2.5f); } } } internal static class Dismantle { internal static void Run(Cast c, bool barrage) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) float num = (barrage ? 1f : 1.35f) + 0.02f * (float)c.Fingers; Quaternion rot = Quaternion.LookRotation(c.Dir) * Quaternion.Euler(0f, 0f, c.Extra); Vfx.MeshObject("Dismantle", Vfx.Crescent, Vfx.LineMat, c.Origin, rot, Vector3.one * num).AddComponent().Init(c, barrage, num); Sfx.Play(SfxId.Slash, c.Origin, barrage ? 0.55f : 1f); } } internal sealed class SlashProjectile : MonoBehaviour { private Cast c; private bool barrage; private float speed = 48f; private float range; private float radius; private float damage; private float stun; private float traveled; private float fade = 1f; private float width; private bool dying; private bool friendlyFireDone; private Vector3 cutAxis; private readonly HashSet hit = new HashSet(); private readonly HashSet hitObjects = new HashSet(); internal void Init(Cast cast, bool isBarrage, float w) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) c = cast; barrage = isBarrage; width = w; range = (barrage ? 24f : 34f); radius = 0.55f * w; damage = (barrage ? 18f : 36f) * c.Power; stun = (barrage ? 0.35f : 1f); cutAxis = ((Component)this).transform.right; } private void Update() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) //IL_00ab: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_043b: 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_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; if (dying) { fade -= deltaTime * 7f; ((Component)this).transform.localScale = Vector3.one * width * (1f + (1f - fade) * 0.4f); if (fade <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } Vector3 position = ((Component)this).transform.position; float num = speed * deltaTime; RaycastHit val = default(RaycastHit); bool flag = Physics.SphereCast(position, 0.06f, c.Dir, ref val, num, Combat.WorldMask, (QueryTriggerInteraction)1); Vector3 val2 = (flag ? ((RaycastHit)(ref val)).point : (position + c.Dir * num)); if (c.Hostile) { if (!friendlyFireDone && BossHits.LocalTarget(out var me) && Combat.DistanceToSegment(BossHits.Center(me), position, val2) < radius + 0.35f) { friendlyFireDone = true; Vfx.SlashLine(BossHits.Center(me), cutAxis, 1.4f, 0.08f, Vfx.Red); BossHits.Hurt(c, me, barrage ? 4 : 12, c.Dir * (barrage ? 2f : 6f), 0.6f); } } else { foreach (Enemy item in Combat.Enemies()) { if (hit.Contains(item)) { continue; } Vector3 val3 = Combat.Center(item); if (!(Combat.DistanceToSegment(val3, position, val2) > radius + 0.5f)) { hit.Add(item); Vfx.SlashLine(val3, cutAxis, 1.7f, 0.09f, Vfx.Red); Vfx.Burst(val3, Vfx.Blood, Vfx.DarkRed, barrage ? 6 : 14, 4f, 0.12f, 0.6f, 1f, Vfx.SmokeMat); if (!barrage) { Sfx.Play(SfxId.HeavySlash, val3, 0.6f); } Combat.HurtEnemy(item, damage, c.Dir, stun, barrage ? 1f : 3f); } } } if (Combat.IsHost) { Combat.DamageDoorsCapsule(position, val2, radius * 0.7f, barrage ? 13f : 34f, hitObjects); Combat.HitObjectsCapsule(position, val2, radius * 0.8f, barrage ? Combat.Impact.Light : Combat.Impact.Medium, barrage ? 1.5f : 3f, hitObjects); } if (!friendlyFireDone && !c.Hostile && Combat.CanTakeFriendlyFire(c, out var me2) && Combat.DistanceToSegment(Combat.LocalPlayerCenter(out var _), position, val2) < radius + 0.3f) { friendlyFireDone = true; Combat.HurtLocalPlayer(me2, barrage ? 5 : 12); } ((Component)this).transform.position = val2; traveled += Vector3.Distance(position, val2); if (flag) { Vfx.CutMark(((RaycastHit)(ref val)).point, ((RaycastHit)(ref val)).normal, cutAxis, 1.3f * width); Vfx.Burst(((RaycastHit)(ref val)).point, new Color(0.5f, 0.45f, 0.4f, 0.8f), new Color(0.25f, 0.2f, 0.2f, 0.6f), 8, 2.5f, 0.07f, 0.6f, 1f, Vfx.SmokeMat); if (!barrage) { Sfx.Play(SfxId.Slash, ((RaycastHit)(ref val)).point, 0.45f); } dying = true; } else if (traveled >= range) { dying = true; } } } internal static class Cleave { internal const int BlackFlashFlag = 1; internal static Enemy FindTarget(Vector3 origin, Vector3 dir, float range, float maxAngle) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) Enemy result = null; float num = float.MaxValue; foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item); Vector3 val2 = val - origin; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude > range + 0.7f) { continue; } float num2 = Vector3.Angle(dir, val2); if ((!(num2 > maxAngle) || !(magnitude > 1.3f)) && (!(magnitude > 1.3f) || Combat.LineOfSight(origin, val))) { float num3 = magnitude + num2 * 0.03f; if (num3 < num) { num = num3; result = item; } } } return result; } internal static void Run(Cast c) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_014a: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) bool flag = (c.Flags & 1) != 0; if (c.Hostile) { RunHostile(c, flag); return; } Enemy val = FindTarget(c.Origin, c.Dir, 5f, 50f); Vector3 val2 = (Object.op_Implicit((Object)(object)val) ? Combat.Center(val) : (c.Origin + c.Dir * 2.2f)); Vfx.SlashBurst(val2, flag ? 5 : 3, 1.5f, Vfx.Red, 0.35f, 0.05f); Sfx.Play(SfxId.HeavySlash, val2); if (Object.op_Implicit((Object)(object)val)) { Vfx.Burst(val2, Vfx.Blood, Vfx.DarkRed, 22, 5f, 0.14f, 0.7f, 1.2f, Vfx.SmokeMat); } if (flag) { BlackFlash(c, val2); } if (Combat.IsHost) { if (Object.op_Implicit((Object)(object)val)) { float damage = (25f + 0.22f * (float)Combat.MaxHealth(val)) * c.Power * (flag ? 2.5f : 1f); Combat.HurtEnemy(val, damage, c.Dir, flag ? 4f : 2.2f, flag ? 16f : 5f, flag ? 0.25f : 0f); } Combat.DamageDoorsSphere(val2, 1.4f, flag ? 100f : 50f, c.Origin); Combat.HitObjectsSphere(val2, flag ? 2.5f : 1.3f, flag ? Combat.Impact.Heavy : Combat.Impact.Medium, flag ? 8f : 4f); } } private static void RunHostile(Cast c, bool blackFlash) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00b3: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_00f8: 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_0111: Unknown result type (might be due to invalid IL or missing references) PlayerAvatar val = BossHits.NearestPlayer(c.Origin + c.Dir * 1.8f, 3.2f); Vector3 val2 = (Object.op_Implicit((Object)(object)val) ? BossHits.Center(val) : (c.Origin + c.Dir * 2.2f)); Vfx.SlashBurst(val2, blackFlash ? 5 : 3, 1.5f, Vfx.Red, 0.35f, 0.05f); Sfx.Play(SfxId.HeavySlash, val2); if (blackFlash) { BlackFlash(c, val2); } if (Object.op_Implicit((Object)(object)val) && (Object)(object)val == (Object)(object)PlayerAvatar.instance && BossHits.LocalTarget(out var me)) { Vfx.Burst(val2, Vfx.Blood, Vfx.DarkRed, 16, 5f, 0.14f, 0.7f, 1.2f, Vfx.SmokeMat); BossHits.Hurt(c, me, blackFlash ? 45 : 24, (c.Dir + Vector3.up * 0.5f) * (blackFlash ? 18f : 9f), blackFlash ? 2f : 1f); } if (Combat.IsHost) { Combat.DamageDoorsSphere(val2, 1.4f, blackFlash ? 100f : 50f, c.Origin); Combat.HitObjectsSphere(val2, 1.3f, Combat.Impact.Medium, 4f); } } private static void BlackFlash(Cast c, Vector3 at) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) Vfx.BlackLightning(at, 8, 1.7f, 0.45f); Vfx.Burst(at, Color.black, Vfx.Red, 30, 7f, 0.2f, 0.5f, 0f, Vfx.SmokeMat, 0.2f); Vfx.LightFlash(at, Vfx.Red, 8f, 8f, 0.35f); Vfx.Shake(at, 6f, 0.35f); Sfx.Play(SfxId.BlackFlash, at); if (c.Local) { Hud.Flash(new Color(0f, 0f, 0f, 0.6f), 0.12f); Hud.Flash(new Color(0.7f, 0f, 0.05f, 0.35f), 0.35f); Hud.Banner("BLACK FLASH", "Cursed energy surges - Black Flash chance up", Vfx.Red, 1.6f); } } } internal static class Spiderweb { internal static void Run(Cast c) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_00db: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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) //IL_01a6: 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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: 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_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: 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_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0310: 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_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) float num = 6.5f + 0.1f * (float)c.Fingers; Vector3 val = c.Origin; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val + Vector3.up * 0.6f, Vector3.down, ref val2, 3f, Combat.WorldMask, (QueryTriggerInteraction)1)) { val = ((RaycastHit)(ref val2)).point; } Vector3 val3 = Vector3.ProjectOnPlane(c.Dir, Vector3.up); if (((Vector3)(ref val3)).sqrMagnitude < 0.0001f) { val3 = Vector3.forward; } ((Vector3)(ref val3)).Normalize(); Random random = new Random((int)(c.Extra * 1000f)); Vector3[] array = (Vector3[])(object)new Vector3[10]; float[] array2 = new float[10]; for (int i = 0; i < 10; i++) { float num2 = (float)i * 36f + (float)(random.NextDouble() * 16.0 - 8.0); array[i] = Quaternion.AngleAxis(num2, Vector3.up) * val3; array2[i] = num * (0.85f + 0.2f * (float)random.NextDouble()); } Vector3 val4 = Vector3.up * 0.03f; for (int j = 0; j < 10; j++) { Vector3[] array3 = (Vector3[])(object)new Vector3[6]; for (int k = 0; k < 6; k++) { float num3 = (float)k / 5f; Vector3 val5 = Vector3.Cross(Vector3.up, array[j]) * ((float)(random.NextDouble() - 0.5) * 0.25f * num3); array3[k] = val + val4 + array[j] * (array2[j] * num3) + val5; } GroundLine(array3, 0.08f, 0f); Vfx.SlashLine(array3[5] + Vector3.up * 0.6f, Vector3.up + array[j] * 0.3f, 1.4f, 0.07f, Vfx.Red, 0.4f, 0.15f); } float[] array4 = new float[3] { 0.35f, 0.65f, 0.95f }; foreach (float num4 in array4) { Vector3[] array5 = (Vector3[])(object)new Vector3[21]; for (int m = 0; m < 10; m++) { Vector3 val6 = val + array[m] * (array2[m] * num4); Vector3 val7 = val + array[(m + 1) % 10] * (array2[(m + 1) % 10] * num4); Vector3 val8 = Vector3.Lerp(val6, val7, 0.5f); val8 = val + (val8 - val) * 0.86f; array5[m * 2] = val6 + val4; array5[m * 2 + 1] = val8 + val4; } array5[20] = array5[0]; GroundLine(array5, 0.05f, 0.06f + num4 * 0.12f); } Sfx.Play(SfxId.Web, val); Vfx.Shake(val, 5f, 0.4f); Vfx.Burst(val + Vector3.up * 0.2f, new Color(0.45f, 0.4f, 0.35f, 0.8f), new Color(0.2f, 0.15f, 0.15f, 0.7f), 45, 6f, 0.25f, 1.2f, 0.8f, Vfx.SmokeMat, num * 0.4f); Vfx.LightFlash(val + Vector3.up, Vfx.Red, 5f, num * 1.5f, 0.6f); if (c.Hostile && BossHits.LocalTarget(out var me)) { Vector3 val9 = BossHits.Center(me) - val; Vector3 val10 = Vector3.ProjectOnPlane(val9, Vector3.up); if (((Vector3)(ref val10)).magnitude < num && Mathf.Abs(val9.y) < 3f) { Vfx.SlashBurst(BossHits.Center(me), 2, 1.3f, Vfx.Red); BossHits.Hurt(c, me, 22, (((Vector3)(ref val10)).normalized + Vector3.up * 0.9f) * 12f, 1.4f); } } if (!c.Hostile) { foreach (Enemy item in Combat.Enemies()) { Vector3 val11 = Combat.Center(item); Vector3 val12 = val11 - val; Vector3 val13 = Vector3.ProjectOnPlane(val12, Vector3.up); if (!(((Vector3)(ref val13)).magnitude > num) && !(Mathf.Abs(val12.y) > 3f)) { Vfx.SlashBurst(val11, 2, 1.3f, Vfx.Red); if (Combat.IsHost) { float num5 = 1f - 0.4f * ((Vector3)(ref val13)).magnitude / num; Vector3 val14 = ((Vector3)(ref val13)).normalized + Vector3.up * 0.8f; Vector3 normalized = ((Vector3)(ref val14)).normalized; Combat.HurtEnemy(item, 50f * c.Power * num5, normalized, 2f, 6f); } } } } if (Combat.IsHost) { Combat.DamageDoorsSphere(val + Vector3.up, num * 0.8f, 45f, val); Combat.HitObjectsSphere(val, num, Combat.Impact.Medium, 5f, 0.8f); } if (!c.Hostile && Combat.CanTakeFriendlyFire(c, out var me2) && Vector3.Distance(((Component)me2).transform.position, val) < num) { Combat.HurtLocalPlayer(me2, 15); } } private static void GroundLine(Vector3[] pts, float width, float delay) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) LineRenderer lr = Vfx.Line("Spiderweb Cut", pts.Length, width, Color.white); lr.alignment = (LineAlignment)1; ((Component)lr).transform.rotation = Quaternion.LookRotation(Vector3.up); ((Renderer)lr).enabled = false; Vfx.Animate(((Component)lr).gameObject, 1.8f, delegate(float k) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) ((Renderer)lr).enabled = true; int num = Mathf.Clamp(Mathf.CeilToInt((float)pts.Length * Mathf.Clamp01(k * 8f)), 2, pts.Length); lr.positionCount = num; for (int i = 0; i < num; i++) { lr.SetPosition(i, pts[i]); } Color val = Color.Lerp(new Color(1f, 0.7f, 0.65f), Vfx.Red, Mathf.Clamp01(k * 4f)); val = Color.Lerp(val, new Color(0.15f, 0f, 0f), Mathf.Clamp01((k - 0.4f) * 2f)); val.a = ((k < 0.7f) ? 1f : ((1f - k) / 0.3f)); LineRenderer obj = lr; Color startColor = (lr.endColor = val); obj.startColor = startColor; }, delay); } } internal static class ReverseCursedTechnique { internal static void Pulse(Cast c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) Vfx.Burst(c.Origin, new Color(0.85f, 1f, 0.9f, 0.7f), new Color(0.6f, 0.9f, 1f, 0.5f), 10, 0.6f, 0.08f, 1f, -0.25f, Vfx.GlowMat, 0.45f); if (c.Extra > 0.5f) { Sfx.Play(SfxId.Heal, c.Origin, c.Local ? 0.7f : 0.5f); } } } internal static class BeastModels { internal sealed class Beast { internal Transform Root; internal Transform Body; internal Transform Head; internal Transform Tail; internal readonly Transform[] Legs = (Transform[])(object)new Transform[4]; internal float LegLen; } private static Beast Spawn(Transform parent, string name, string key, float legLen) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) Beast beast = new Beast { Root = BossModel.Pivot(name, parent, Vector3.zero), LegLen = legLen }; Dictionary dictionary = RigFactory.Spawn(key, beast.Root); beast.Body = dictionary["Body"]; beast.Head = dictionary["Head"]; beast.Tail = dictionary["Tail"]; for (int i = 0; i < 4; i++) { beast.Legs[i] = dictionary["Leg " + i]; } return beast; } internal static void Run(Beast b, float phase, float run, float lift = 0f) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sin(phase); for (int i = 0; i < 4; i++) { float num2 = ((i == 0 || i == 3) ? num : (0f - num)); b.Legs[i].localRotation = Quaternion.Euler(num2 * 40f * run - lift * ((i < 2) ? 50f : (-40f)), 0f, 0f); } } internal static Beast Ox(Transform parent) { return Spawn(parent, "Piercing Ox", "ox", 0.55f); } internal static Beast Tiger(Transform parent) { return Spawn(parent, "Tiger Funeral", "tiger", 0.55f); } internal static Beast Deer(Transform parent) { return Spawn(parent, "Round Deer", "deer", 0.8f); } internal static Transform Rabbit(Transform parent) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Transform val = BossModel.Pivot("Rabbit", parent, Vector3.zero); RigFactory.Spawn("rabbit", val, shadows: false); return val; } internal static Transform Serpent(Transform parent, out Transform head, out Transform jaw, out Transform[] segments, out DynamicTube body) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_009b: Unknown result type (might be due to invalid IL or missing references) Transform val = BossModel.Pivot("Great Serpent", parent, Vector3.zero); Dictionary dictionary = RigFactory.Spawn("serpent", val); head = dictionary["Head"]; jaw = dictionary["Jaw"]; segments = (Transform[])(object)new Transform[12]; for (int i = 0; i < segments.Length; i++) { segments[i] = BossModel.Pivot("Segment " + i, val, Vector3.zero); } body = DynamicTube.Create(val, "scales", new Color(0.05f, 0.05f, 0.07f), new Color(0.03f, 0.025f, 0.07f)); return val; } } internal sealed class GreatSerpent : MonoBehaviour { private const float Rise = 0.35f; private const float Hold = 1.6f; private const float Dive = 0.5f; private const float Height = 2.6f; private Cast c; private Transform head; private Transform jaw; private Transform[] segments; private DynamicTube body; private readonly List bodyPts = new List(); private readonly List bodyRadii = new List(); private Vector3 ground; private Vector3 back; private float t; private float delay; private bool struck; private Enemy foe; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Great Serpent").AddComponent().Init(c); } private void Init(Cast cast) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) c = cast; Vector3 p = c.Origin + c.Dir * 20f; if (!c.Hostile) { foe = Cleave.FindTarget(c.Origin, c.Dir, 20f, 20f); RaycastHit val = default(RaycastHit); if (Object.op_Implicit((Object)(object)foe)) { p = Combat.Center(foe); } else if (Physics.Raycast(c.Origin, c.Dir, ref val, 20f, Combat.WorldMask, (QueryTriggerInteraction)1)) { p = ((RaycastHit)(ref val)).point + ((RaycastHit)(ref val)).normal * 0.5f; } } else { p = c.Origin; } ground = ShadowFx.Ground(p, 8f); ((Component)this).transform.position = ground; back = -TenShadows.Flat(c.Dir); delay = (c.Hostile ? 0.8f : 0.2f); BeastModels.Serpent(((Component)this).transform, out head, out jaw, out segments, out body); Summon.Attach(((Component)this).gameObject, c, 0, 90f, head, 0.7f); Place(0f, 0f); ShadowFx.Pool(ground, 1.6f, delay + 0.35f + 1.6f + 0.5f); if (c.Hostile) { Vfx.Shockwave(ground + Vector3.up * 0.1f, Vector3.up, 2f, 0.08f, MegumiStats.Glow, delay); } Sfx.Play(SfxId.Web, ground, 0.5f); } private void Place(float k, float bite) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0113: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ground + Vector3.up * (2.6f * k); head.position = val; head.rotation = Quaternion.LookRotation(Vector3.Lerp(Vector3.up, -back, 0.35f + 0.4f * bite), back); jaw.localRotation = Quaternion.Euler(40f * (1f - bite), 0f, 0f); bodyPts.Clear(); bodyRadii.Clear(); bodyPts.Add(head.position - head.forward * 0.3f); bodyRadii.Add(0.3f); for (int i = 0; i < segments.Length; i++) { float num = ((float)i + 1f) / (float)segments.Length; Vector3 val2 = val - head.forward * 0.3f - Vector3.up * (3.3799996f * num) + back * Mathf.Sin(num * MathF.PI) * 0.8f; segments[i].position = val2; if (val2.y < ground.y - 0.6f) { break; } bodyPts.Add(val2); bodyRadii.Add(Mathf.Lerp(0.34f, 0.3f, num)); } ((Component)body).gameObject.SetActive(bodyPts.Count >= 2 && k > 0.02f); if (bodyPts.Count >= 2) { body.Set(bodyPts, bodyRadii); } } private void Update() { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) t += Time.deltaTime; float num = t - delay; if (num < 0f) { Place(0f, 0f); } else if (num < 0.35f) { Place(Mathf.Sin(num / 0.35f * MathF.PI * 0.5f), 0f); } else if (num < 1.95f) { if (!struck) { Strike(); } Place(1f + 0.03f * Mathf.Sin(num * 12f), 1f); if (Object.op_Implicit((Object)(object)foe) && Combat.IsHost && foe.HasRigidbody && Object.op_Implicit((Object)(object)foe.Rigidbody.rb)) { foe.Rigidbody.rb.AddForce((head.position - Combat.Center(foe)) * 3f, (ForceMode)5); } } else if (num < 2.45f) { Place(1f - (num - 0.35f - 1.6f) / 0.5f, 0.5f); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Strike() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0110: Unknown result type (might be due to invalid IL or missing references) struck = true; Vfx.Shake(ground, 8f, 0.4f); Sfx.Play(SfxId.HeavySlash, ground + Vector3.up * 1.5f); Vfx.Burst(ground + Vector3.up * 0.3f, new Color(0.4f, 0.36f, 0.32f, 0.8f), Color.black, 40, 6f, 0.3f, 0.9f, 0.6f, Vfx.SmokeMat, 1f); Vector3 val2; PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val = Combat.Center(item) - ground; val2 = Vector3.ProjectOnPlane(val, Vector3.up); if (!(((Vector3)(ref val2)).magnitude > 2.2f) && !(val.y > 4f)) { Combat.HurtEnemy(item, 60f * MegumiStats.Power, Vector3.up, 2.5f, 6f); } } Combat.HitObjectsSphere(ground + Vector3.up, 2f, Combat.Impact.Medium, 6f, 1f); } else if (BossHits.LocalTarget(out me)) { Vector3 val3 = BossHits.Center(me) - ground; val2 = Vector3.ProjectOnPlane(val3, Vector3.up); if (((Vector3)(ref val2)).magnitude < 2f && val3.y < 3.5f) { BossHits.Hurt(c, me, 18, Vector3.up * 9f + back * 2f, 2f); } } } } internal sealed class RabbitEscape : MonoBehaviour { private sealed class Hopper { public Transform T; public Vector3 From; public Vector3 To; public float Start; public float Len; } private const float Life = 6f; private const float Radius = 9f; private readonly List hoppers = new List(); private Cast c; private float t; private float tick; private Random rnd; private Vector3 Center { get { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)TenShadows.Owner(c))) { return ((Component)this).transform.position; } return TenShadows.Owner(c).position; } } internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Rabbit Escape").AddComponent().Init(c); } private void Init(Cast cast) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) c = cast; ((Component)this).transform.position = ShadowFx.Ground(c.Origin); rnd = new Random((int)(c.Origin.x * 31f + c.Origin.z * 17f)); ShadowFx.Pool(((Component)this).transform.position, 1.4f, 1.5f); for (int i = 0; i < 36; i++) { Transform val = BeastModels.Rabbit(((Component)this).transform); val.position = ((Component)this).transform.position; hoppers.Add(new Hopper { T = val, From = ((Component)this).transform.position, To = ((Component)this).transform.position, Start = -1f, Len = 0.3f }); } ShikigamiModels.Layer(((Component)this).transform); Summon.Attach(((Component)this).gameObject, c, 0, 40f, ((Component)this).transform, 2.5f); Sfx.Play(SfxId.Web, ((Component)this).transform.position, 0.3f); if (c.Local) { Hud.Notice("Rabbit Escape: enemies lose track of you", 2f); } } private void Update() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0153: 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_015d: 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_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: 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_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; Vector3 center = Center; foreach (Hopper hopper in hoppers) { float num = (t - hopper.Start) / hopper.Len; if (num >= 1f || hopper.Start < 0f) { hopper.From = hopper.T.position; float num2 = (float)rnd.NextDouble() * MathF.PI * 2f; float num3 = (float)rnd.NextDouble() * 9f * Mathf.Min(1f, t * 2f + 0.2f); hopper.To = ShadowFx.Ground(center + new Vector3(Mathf.Cos(num2) * num3, 0f, Mathf.Sin(num2) * num3), 3f); hopper.Start = t; hopper.Len = 0.25f + (float)rnd.NextDouble() * 0.2f; num = 0f; } Vector3 position = Vector3.Lerp(hopper.From, hopper.To, num) + Vector3.up * Mathf.Sin(num * MathF.PI) * 0.5f; Vector3 val = Vector3.ProjectOnPlane(hopper.To - hopper.From, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { hopper.T.rotation = Quaternion.LookRotation(val); } hopper.T.position = position; float num4 = Mathf.Clamp01(t / 0.3f) * Mathf.Clamp01((6f - t) / 0.4f); hopper.T.localScale = Vector3.one * num4; } if (c.Local && Object.op_Implicit((Object)(object)PlayerController.instance)) { PlayerController.instance.OverrideSpeed(1.4f, 0.2f, -1f); } tick -= deltaTime; if (tick <= 0f && t < 6f) { tick = 1f; PlayerAvatar me; if (!c.Hostile) { if (Combat.IsHost) { foreach (Enemy item in Combat.Enemies()) { if (Vector3.Distance(Combat.Center(item), center) < 9f) { Combat.HurtEnemy(item, 0f, Random.onUnitSphere, 0.7f, 0f); } } } } else if (BossHits.LocalTarget(out me) && Vector3.Distance(((Component)me).transform.position, center) < 9f && Object.op_Implicit((Object)(object)PlayerController.instance)) { PlayerController.instance.OverrideSpeed(0.65f, 1.1f, -1f); } } if (t >= 6f) { ShadowFx.Smoke(center + Vector3.up * 0.3f, 1.2f); Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal sealed class RoundDeer : MonoBehaviour { private const float Life = 5f; private const float Radius = 7f; private Cast c; private BeastModels.Beast deer; private float t; private float tick; private float phase; private ParticleSystem motes; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Round Deer").AddComponent().Init(c); } private void Init(Cast cast) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0171: Unknown result type (might be due to invalid IL or missing references) c = cast; Vector3 val = TenShadows.Flat(c.Dir); Vector3 val2 = ShadowFx.Ground(c.Origin + Vector3.Cross(Vector3.up, val) * 1.8f + val * 0.3f); ((Component)this).transform.SetPositionAndRotation(val2, Quaternion.LookRotation(val)); deer = BeastModels.Deer(((Component)this).transform); Summon.Attach(((Component)this).gameObject, c, 0, 70f, deer.Body, 0.7f); ShikigamiModels.Layer(((Component)this).transform); BossModel.PointLight(deer.Body, new Vector3(0f, 0.6f, 0f), new Color(0.75f, 1f, 0.8f), 6f, 0.9f); motes = Vfx.Emitter("Deer Light", val2 + Vector3.up, ((Component)this).transform, Vfx.GlowMat, new Color(0.85f, 1f, 0.9f), new Color(0.5f, 0.9f, 0.6f), 40f, 0.4f, 0.12f, 1.6f, 4.9f, -0.1f, (ParticleSystemShapeType)0); ShadowFx.Pool(val2, 1.1f, 5.5f); Sfx.Play(SfxId.Heal, val2, 0.8f); } private void Update() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; t += deltaTime; phase += deltaTime * 2f; float num = Mathf.Clamp01(t / 0.5f) * Mathf.Clamp01((5f - t) / 0.5f); deer.Root.localPosition = Vector3.down * 1.6f * (1f - num); deer.Head.localRotation = Quaternion.Euler(Mathf.Sin(phase) * 8f, 0f, 0f); tick -= deltaTime; if (tick <= 0f && t < 5f) { tick = 0.5f; if (!c.Hostile) { PlayerAvatar instance = PlayerAvatar.instance; if (Object.op_Implicit((Object)(object)instance) && !instance.deadSet && Object.op_Implicit((Object)(object)instance.playerHealth) && Vector3.Distance(((Component)instance).transform.position, ((Component)this).transform.position) < 7f && instance.playerHealth.health < instance.playerHealth.maxHealth) { instance.playerHealth.Heal(4, false); Vfx.Burst(((Component)instance).transform.position + Vector3.up, new Color(0.85f, 1f, 0.9f), new Color(0.5f, 0.9f, 0.6f), 4, 0.6f, 0.08f, 0.8f, -0.2f, Vfx.GlowMat, 0.3f); } } else if (Combat.IsHost && Object.op_Implicit((Object)(object)c.Enemy) && Object.op_Implicit((Object)(object)c.Enemy.enemy) && c.Enemy.enemy.HasHealth) { c.Enemy.enemy.Health.Heal(12); } } if (t >= 5.3f) { Vfx.StopEmitter(motes); Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal sealed class PiercingOx : MonoBehaviour { private Summon summon; private const float Range = 30f; private Cast c; private BeastModels.Beast ox; private Vector3 fwd; private float speed = 7f; private float traveled; private float phase; private float end = -1f; private ParticleSystem dust; private readonly HashSet hit = new HashSet(); private readonly HashSet hitObjects = new HashSet(); private bool hitLocal; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Piercing Ox").AddComponent().Init(c); } private void Init(Cast cast) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) c = cast; fwd = TenShadows.Flat(c.Dir); Vector3 val = ShadowFx.Ground(c.Origin + fwd * 1.5f); ((Component)this).transform.SetPositionAndRotation(val, Quaternion.LookRotation(fwd)); ox = BeastModels.Ox(((Component)this).transform); summon = Summon.Attach(((Component)this).gameObject, c, 0, 110f, ox.Body, 0.8f); ShikigamiModels.Layer(((Component)this).transform); ShadowFx.Pool(val, 1.2f, 1f); dust = Vfx.Emitter("Ox Dust", val, ((Component)this).transform, Vfx.SmokeMat, new Color(0.35f, 0.3f, 0.28f, 0.7f), new Color(0.1f, 0.08f, 0.1f, 0.6f), 50f, 1.5f, 0.4f, 0.8f, 0.5f, -0.1f, (ParticleSystemShapeType)0); Sfx.Play(SfxId.FireLaunch, val, 0.5f); } private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_00b9: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: 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) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) float deltaTime = Time.deltaTime; if (end >= 0f) { end += deltaTime; Transform transform = ((Component)this).transform; transform.position -= Vector3.up * deltaTime * 2f; if (end > 0.8f) { Vfx.StopEmitter(dust, 1f); Object.Destroy((Object)(object)((Component)this).gameObject); } } else { if (Object.op_Implicit((Object)(object)summon) && summon.Frozen) { return; } speed = Mathf.Min(24f, speed + 22f * deltaTime); Vector3 position = ((Component)this).transform.position; Vector3 val = position + Vector3.up * 0.9f; float num = speed * deltaTime; RaycastHit val2 = default(RaycastHit); bool flag = Physics.SphereCast(val, 0.4f, fwd, ref val2, num, Combat.WorldMask, (QueryTriggerInteraction)1); Vector3 val3 = ShadowFx.Ground(position + fwd * (flag ? Mathf.Max(0f, ((RaycastHit)(ref val2)).distance - 0.2f) : num), 3f); float num2 = 1f + traveled / 10f; PlayerAvatar me; if (!c.Hostile) { foreach (Enemy item in Combat.Enemies()) { if (!hit.Contains(item) && !(Combat.DistanceToSegment(Combat.Center(item), val, val3 + Vector3.up * 0.9f) > 1.5f)) { hit.Add(item); Vfx.Burst(Combat.Center(item), Color.white, new Color(0.6f, 0.55f, 0.5f), 20, 6f, 0.15f, 0.4f, 0f, Vfx.GlowMat, 0.3f); Sfx.Play(SfxId.HeavySlash, Combat.Center(item)); Combat.HurtEnemy(item, 35f * MegumiStats.Power * num2, fwd + Vector3.up * 0.3f, 1.5f, 8f + 2f * num2); } } if (Combat.IsHost) { Combat.DamageDoorsCapsule(val, val3 + Vector3.up * 0.9f, 0.8f, 60f, hitObjects); Combat.HitObjectsCapsule(val, val3 + Vector3.up * 0.9f, 1f, Combat.Impact.Medium, 6f, hitObjects); } } else if (!hitLocal && BossHits.LocalTarget(out me) && Combat.DistanceToSegment(BossHits.Center(me), val, val3 + Vector3.up * 0.9f) < 1.3f) { hitLocal = true; BossHits.Hurt(c, me, Mathf.RoundToInt(12f + 3f * traveled / 2f), fwd * (10f + 2f * num2) + Vector3.up * 4f, 1.6f); } traveled += Vector3.Distance(position, val3); ((Component)this).transform.position = val3; phase += deltaTime * (8f + speed); BeastModels.Run(ox, phase, 1f); ox.Head.localRotation = Quaternion.Euler(15f, 0f, 0f); if (flag || traveled >= 30f) { Vfx.Shake(val3, 8f, 0.4f); Sfx.Play(SfxId.Boom, val3, 0.5f); Vfx.Burst(val3 + Vector3.up + fwd * 0.8f, new Color(0.45f, 0.4f, 0.35f, 0.8f), Color.black, 30, 5f, 0.3f, 0.8f, 0.5f, Vfx.SmokeMat, 0.6f); end = 0f; } } } } internal sealed class TigerFuneral : MonoBehaviour { private Summon summon; private const float Crouch = 0.35f; private const float Leap = 0.55f; private const float Stay = 0.8f; private const float Radius = 3f; private Cast c; private BeastModels.Beast tiger; private Vector3 from; private Vector3 to; private float t; private float phase; private bool landed; internal static void Run(Cast c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) new GameObject("Tiger Funeral").AddComponent().Init(c); } private void Init(Cast cast) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_0152: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) c = cast; Vector3 val = TenShadows.Flat(c.Dir); Vector3 p; if (c.Hostile) { p = c.Origin + c.Dir * c.Extra; } else { Enemy val2 = Cleave.FindTarget(c.Origin, c.Dir, 18f, 25f); p = (Object.op_Implicit((Object)(object)val2) ? Combat.Center(val2) : (c.Origin + c.Dir * 12f)); RaycastHit val3 = default(RaycastHit); if (!Object.op_Implicit((Object)(object)val2) && Physics.Raycast(c.Origin, c.Dir, ref val3, 18f, Combat.WorldMask, (QueryTriggerInteraction)1)) { p = ((RaycastHit)(ref val3)).point + ((RaycastHit)(ref val3)).normal * 0.6f; } } Vector3 p2 = (c.Hostile ? c.Origin : (c.Origin + Vector3.Cross(Vector3.up, val) * -0.9f)); from = ShadowFx.Ground(p2); to = ShadowFx.Ground(p, 8f); Vector3 val4 = TenShadows.Flat(to - from); ((Component)this).transform.SetPositionAndRotation(from, Quaternion.LookRotation(val4)); tiger = BeastModels.Tiger(((Component)this).transform); summon = Summon.Attach(((Component)this).gameObject, c, 0, 90f, tiger.Body, 0.6f); ShikigamiModels.Layer(((Component)this).transform); ShadowFx.Pool(from, 1f, 1f); if (c.Hostile) { Vfx.Shockwave(to + Vector3.up * 0.1f, Vector3.up, 3f, 0.08f, MegumiStats.Glow, 0.9f); } Sfx.Play(SfxId.Web, from, 0.35f); } private void Update() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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) float deltaTime = Time.deltaTime; t += deltaTime; if (Object.op_Implicit((Object)(object)summon) && summon.Frozen) { t -= deltaTime; return; } if (t < 0.35f) { tiger.Body.localPosition = new Vector3(0f, tiger.LegLen + 0.25f - 0.2f * (t / 0.35f), 0f); return; } if (t < 0.9f) { float num = (t - 0.35f) / 0.55f; float num2 = Mathf.Min(3f, Vector3.Distance(from, to) * 0.3f); ((Component)this).transform.position = Vector3.Lerp(from, to, num) + Vector3.up * Mathf.Sin(num * MathF.PI) * num2; BeastModels.Run(tiger, 0f, 0f, Mathf.Sin(num * MathF.PI)); tiger.Body.localPosition = new Vector3(0f, tiger.LegLen + 0.25f, 0f); return; } if (!landed) { Land(); } phase += deltaTime * 6f; float num3 = Mathf.Clamp01((t - 0.35f - 0.55f - 0.8f) / 0.4f); ((Component)this).transform.position = to - Vector3.up * 1.4f * num3; if (num3 >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Land() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) landed = true; ((Component)this).transform.position = to; BeastModels.Run(tiger, 0f, 0f); Vector3 val = to + Vector3.up * 0.8f; Vfx.SlashBurst(val, 6, 2.4f, Color.white); Vfx.Shake(to, 7f, 0.35f); Sfx.Play(SfxId.HeavySlash, to); Sfx.Play(SfxId.Slash, to, 0.7f); PlayerAvatar me; if (!c.Hostile) { if (!Combat.IsHost) { return; } foreach (Enemy item in Combat.Enemies()) { Vector3 val2 = Combat.Center(item) - val; if (!(((Vector3)(ref val2)).magnitude > 3f)) { Vfx.Burst(Combat.Center(item), Vfx.Blood, Vfx.DarkRed, 14, 4f, 0.12f, 0.6f, 1f, Vfx.SmokeMat); Combat.HurtEnemy(item, 80f * MegumiStats.Power, val2 + Vector3.up, 2.5f, 5f); } } Combat.DamageDoorsSphere(val, 2f, 50f, from); Combat.HitObjectsSphere(val, 3f, Combat.Impact.Medium, 5f); } else if (BossHits.LocalNear(val, 2.6f, needSight: false, out me)) { Cast cast = c; PlayerAvatar me2 = me; Vector3 val3 = BossHits.Center(me) - val; BossHits.Hurt(cast, me2, 22, ((Vector3)(ref val3)).normalized * 8f + Vector3.up * 3f, 1.4f); } } } internal static class VanillaHits { internal static readonly HashSet Active = new HashSet(); private static int enemyLayer = -2; internal static int EnemyLayer { get { if (enemyLayer == -2) { enemyLayer = LayerMask.NameToLayer("Enemy"); } return enemyLayer; } } internal static IEnumerable Touching(Vector3 center, float radius) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) foreach (HurtCollider item in Active) { if (!Object.op_Implicit((Object)(object)item) || !((Behaviour)item).isActiveAndEnabled || !item.enemyLogic || item.enemyDamage <= 0) { continue; } Collider collider = item.Collider; if (Object.op_Implicit((Object)(object)collider)) { Bounds bounds = collider.bounds; if (((Bounds)(ref bounds)).SqrDistance(center) <= radius * radius) { yield return item; } } } } } [HarmonyPatch(typeof(HurtCollider), "OnEnable")] internal static class HurtColliderEnablePatch { private static void Postfix(HurtCollider __instance) { VanillaHits.Active.Add(__instance); } } [HarmonyPatch(typeof(HurtCollider), "OnDisable")] internal static class HurtColliderDisablePatch { private static void Postfix(HurtCollider __instance) { VanillaHits.Active.Remove(__instance); } } internal sealed class BossHitbox : MonoBehaviour { private Transform follow; private float lift; internal static void Add(Enemy enemy, Transform model, float height, float radius) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)enemy) && enemy.HasRigidbody && Object.op_Implicit((Object)(object)enemy.Rigidbody) && Object.op_Implicit((Object)(object)model)) { Collider componentInChildren = ((Component)enemy.Rigidbody).GetComponentInChildren(true); GameObject val = new GameObject("Boss Body Hitbox") { layer = (Object.op_Implicit((Object)(object)componentInChildren) ? ((Component)componentInChildren).gameObject.layer : LayerMask.NameToLayer("PhysGrabObject")), tag = "Phys Grab Object" }; val.transform.SetParent(((Component)enemy.Rigidbody).transform, false); CapsuleCollider obj = val.AddComponent(); ((Collider)obj).isTrigger = true; obj.direction = 1; obj.height = height; obj.radius = radius; BossHitbox bossHitbox = val.AddComponent(); bossHitbox.follow = model; bossHitbox.lift = height * 0.5f; } } private void LateUpdate() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)follow)) { ((Component)this).transform.SetPositionAndRotation(follow.position + Vector3.up * lift, Quaternion.identity); } } } internal sealed class VfxAnim : MonoBehaviour { internal float Life = 1f; internal float Delay; internal Action Step; private float t; private void Update() { if (Delay > 0f) { Delay -= Time.deltaTime; return; } t += Time.deltaTime; float num = ((Life > 0f) ? (t / Life) : 1f); try { Step?.Invoke(Mathf.Min(num, 1f)); } catch (Exception ex) { Plugin.Log.LogWarning((object)("Effect step failed: " + ex.Message)); num = 1f; } if (num >= 1f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal static class Vfx { internal static readonly Color Red = new Color(1f, 0.08f, 0.1f); internal static readonly Color DarkRed = new Color(0.4f, 0f, 0.03f); internal static readonly Color Blood = new Color(0.55f, 0.01f, 0.03f); internal static readonly Color FireOrange = new Color(1f, 0.45f, 0.08f); internal static readonly Color FireYellow = new Color(1f, 0.85f, 0.4f); private static Shader spriteShader; private static Shader additiveShader; private static Material lineMat; private static Material glowMat; private static Material fireMat; private static Texture2D softDot; private static Mesh crescent; private static Mesh disk; private static GameObject explosionPrefab; private static readonly Dictionary litCache = new Dictionary(); private static Material smokeMat; private static readonly AnimationCurve Taper = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(0.5f, 1f), new Keyframe(1f, 0f) }); private static readonly Dictionary unlitCache = new Dictionary(); private static Mesh insideSphere; private static Shader SpriteShader { get { if (!Object.op_Implicit((Object)(object)spriteShader)) { spriteShader = Shader.Find("Sprites/Default") ?? Shader.Find("Hidden/Internal-Colored"); } return spriteShader; } } private static Shader AdditiveShader { get { if (!Object.op_Implicit((Object)(object)additiveShader)) { additiveShader = Shader.Find("Legacy Shaders/Particles/Additive") ?? Shader.Find("Particles/Additive") ?? Shader.Find("Mobile/Particles/Additive") ?? SpriteShader; } return additiveShader; } } internal static Material LineMat { get { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)lineMat)) { lineMat = Keep(new Material(SpriteShader) { name = "Sukuna Line" }); } return lineMat; } } internal static Texture2D SoftDot { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_00c1: 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.op_Implicit((Object)(object)softDot)) { return softDot; } softDot = new Texture2D(64, 64, (TextureFormat)4, false) { name = "Sukuna Soft Dot", wrapMode = (TextureWrapMode)1 }; Color32[] array = (Color32[])(object)new Color32[4096]; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = ((float)j + 0.5f) / 64f * 2f - 1f; float num2 = ((float)i + 0.5f) / 64f * 2f - 1f; float num3 = Mathf.Clamp01(1f - Mathf.Sqrt(num * num + num2 * num2)); array[i * 64 + j] = new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, (byte)(num3 * num3 * 255f)); } } softDot.SetPixels32(array); softDot.Apply(); return Keep(softDot); } } internal static Material GlowMat { get { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)glowMat)) { return glowMat; } glowMat = Keep(new Material(AdditiveShader) { name = "Sukuna Glow", mainTexture = (Texture)(object)SoftDot }); if (glowMat.HasProperty("_TintColor")) { glowMat.SetColor("_TintColor", new Color(0.5f, 0.5f, 0.5f, 0.5f)); } return glowMat; } } internal static Material SmokeMat { get { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)smokeMat)) { smokeMat = Keep(new Material(SpriteShader) { name = "Sukuna Smoke", mainTexture = (Texture)(object)SoftDot }); } return smokeMat; } } private static GameObject ExplosionPrefab { get { if (!Object.op_Implicit((Object)(object)explosionPrefab)) { explosionPrefab = Resources.Load("Effects/Part Prefab Explosion"); } return explosionPrefab; } } internal static Material FireMat { get { if (Object.op_Implicit((Object)(object)fireMat)) { return fireMat; } GameObject val = ExplosionPrefab; ParticlePrefabExplosion val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent() : null); ParticleSystemRenderer val3 = ((Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.particleFire)) ? ((Component)val2.particleFire).GetComponent() : null); fireMat = ((Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)((Renderer)val3).sharedMaterial)) ? ((Renderer)val3).sharedMaterial : GlowMat); return fireMat; } } internal static Mesh Crescent { get { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)crescent)) { return crescent; } List list = new List(); List list2 = new List(); List list3 = new List(); Vector3 val = default(Vector3); for (int i = 0; i <= 28; i++) { float num = (float)i / 28f; float num2 = Mathf.Lerp(-62f, 62f, num) * (MathF.PI / 180f); float num3 = Mathf.Sin(num * MathF.PI) * 0.085f + 0.004f; ((Vector3)(ref val))..ctor(Mathf.Sin(num2), (Mathf.Cos(num2) - 1f) * 0.55f, (0f - (1f - Mathf.Cos(num2))) * 0.9f); Vector3 val2 = new Vector3(0.55f * Mathf.Sin(num2), Mathf.Cos(num2), 0f); Vector3 normalized = ((Vector3)(ref val2)).normalized; float num4 = Mathf.Sin(num * MathF.PI); list.Add(val + normalized * num3); list2.Add(new Color(1f, 0.15f, 0.15f, 0f)); list.Add(val); list2.Add(new Color(1f, 0.95f, 0.95f, num4)); list.Add(val - normalized * num3 * 0.7f); list2.Add(new Color(1f, 0.1f, 0.12f, 0f)); } for (int j = 0; j < 28; j++) { int num5 = j * 3; int num6 = num5 + 3; list3.AddRange(new int[6] { num5, num6, num6 + 1, num5, num6 + 1, num5 + 1 }); list3.AddRange(new int[6] { num5 + 1, num6 + 1, num6 + 2, num5 + 1, num6 + 2, num5 + 2 }); } crescent = Keep(new Mesh { name = "Dismantle Crescent" }); crescent.SetVertices(list); crescent.SetColors(list2); crescent.SetTriangles(list3, 0); crescent.RecalculateBounds(); return crescent; } } internal static Mesh Disk { get { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)disk)) { return disk; } List list = new List { Vector3.zero }; List list2 = new List { new Color(0.6f, 0f, 0.02f, 0.05f) }; List list3 = new List(); for (int i = 1; i <= 2; i++) { float num = ((i == 1) ? 0.8f : 1f); float num2 = ((i == 1) ? 0.18f : 0.5f); for (int j = 0; j < 72; j++) { float num3 = (float)j / 72f * MathF.PI * 2f; list.Add(new Vector3(Mathf.Cos(num3) * num, 0f, Mathf.Sin(num3) * num)); list2.Add(new Color(0.75f, 0.02f, 0.04f, num2)); } } for (int k = 0; k < 72; k++) { int num4 = 1 + k; int num5 = 1 + (k + 1) % 72; int num6 = 73 + k; int num7 = 73 + (k + 1) % 72; list3.AddRange(new int[3] { 0, num5, num4 }); list3.AddRange(new int[6] { num4, num5, num7, num4, num7, num6 }); } disk = Keep(new Mesh { name = "Shrine Disk" }); disk.SetVertices(list); disk.SetColors(list2); disk.SetTriangles(list3, 0); disk.RecalculateBounds(); return disk; } } internal static Mesh InsideSphere { get { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)insideSphere)) { return insideSphere; } GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); Mesh sharedMesh = obj.GetComponent().sharedMesh; Object.DestroyImmediate((Object)(object)obj); insideSphere = Keep(Object.Instantiate(sharedMesh)); ((Object)insideSphere).name = "Inside Sphere"; int[] triangles = insideSphere.triangles; for (int i = 0; i < triangles.Length; i += 3) { int num = triangles[i]; triangles[i] = triangles[i + 1]; triangles[i + 1] = num; } insideSphere.triangles = triangles; Vector3[] normals = insideSphere.normals; for (int j = 0; j < normals.Length; j++) { normals[j] = -normals[j]; } insideSphere.normals = normals; return insideSphere; } } internal static string Describe(Material m) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected I4, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); Shader shader = m.shader; stringBuilder.Append("shader '").Append(Object.op_Implicit((Object)(object)shader) ? ((Object)shader).name : "null").Append("', keywords [") .Append(string.Join(",", m.shaderKeywords)) .Append("]"); if (!Object.op_Implicit((Object)(object)shader)) { return stringBuilder.ToString(); } for (int i = 0; i < shader.GetPropertyCount(); i++) { string propertyName = shader.GetPropertyName(i); stringBuilder.Append("\n ").Append(propertyName).Append(" (") .Append(shader.GetPropertyType(i)) .Append(") = "); ShaderPropertyType propertyType = shader.GetPropertyType(i); switch ((int)propertyType) { case 4: { Texture texture = m.GetTexture(propertyName); stringBuilder.Append(Object.op_Implicit((Object)(object)texture) ? ((Object)texture).name : "none"); break; } case 0: stringBuilder.Append(m.GetColor(propertyName)); break; case 1: stringBuilder.Append(m.GetVector(propertyName)); break; default: stringBuilder.Append(m.GetFloat(propertyName)); break; } } return stringBuilder.ToString(); } internal static Material Retexture(Material source, Texture albedo, Color tint) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(source); string text = null; string[] texturePropertyNames = val.GetTexturePropertyNames(); foreach (string text2 in texturePropertyNames) { string text3 = text2.ToLowerInvariant(); bool flag = text3 == "_maintex" || text3.Contains("albedo") || text3.Contains("basemap") || text3.Contains("basecolor") || text3.Contains("diffuse"); if (text == null && flag) { text = text2; } else { val.SetTexture(text2, (Texture)null); } } if (text != null) { val.SetTexture(text, albedo); } else { val.mainTexture = albedo; } texturePropertyNames = new string[2] { "_Color", "_BaseColor" }; foreach (string text4 in texturePropertyNames) { if (val.HasProperty(text4)) { val.SetColor(text4, tint); } } if (val.HasProperty("_EmissionColor")) { val.SetColor("_EmissionColor", Color.black); } if (val.HasProperty("_Metallic")) { val.SetFloat("_Metallic", 0f); } if (val.HasProperty("_Glossiness")) { val.SetFloat("_Glossiness", 0.25f); } if (val.HasProperty("_Smoothness")) { val.SetFloat("_Smoothness", 0.25f); } return val; } internal static Material Lit(Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (litCache.TryGetValue(c, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } Material litTemplate = ItemFactory.LitTemplate; if (Object.op_Implicit((Object)(object)litTemplate)) { value = Retexture(litTemplate, (Texture)(object)Texture2D.whiteTexture, c); ((Object)value).name = "Sukuna Lit"; } else { value = new Material(Shader.Find("Standard") ?? SpriteShader) { name = "Sukuna Lit", color = c }; } litCache[c] = Keep(value); return value; } internal static Material LitGlow(Color c, Color emission) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) Material val = Keep(new Material(Lit(c)) { name = "Sukuna Lit Glow" }); if (val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", emission); } return val; } private static T Keep(T asset) where T : Object { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) T val = asset; ? hideFlags = ((Object)val).hideFlags | 0x20; ((Object)val).hideFlags = (HideFlags)hideFlags; return asset; } internal static VfxAnim Animate(GameObject go, float life, Action step, float delay = 0f) { VfxAnim vfxAnim = go.AddComponent(); vfxAnim.Life = life; vfxAnim.Step = step; vfxAnim.Delay = delay; return vfxAnim; } internal static void Shake(Vector3 at, float strength, float time = 0.3f) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) GameDirector instance = GameDirector.instance; if (Object.op_Implicit((Object)(object)instance)) { if (Object.op_Implicit((Object)(object)instance.CameraShake)) { instance.CameraShake.ShakeDistance(strength, 3f, 25f, at, time); } if (Object.op_Implicit((Object)(object)instance.CameraImpact)) { instance.CameraImpact.ShakeDistance(strength * 0.6f, 3f, 20f, at, 0.15f); } } } internal static LineRenderer Line(string name, int points, float width, Color c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) LineRenderer obj = new GameObject(name).AddComponent(); ((Renderer)obj).sharedMaterial = LineMat; obj.positionCount = points; obj.useWorldSpace = true; obj.widthMultiplier = width; obj.startColor = c; obj.endColor = c; obj.numCapVertices = 2; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } internal static void SlashLine(Vector3 center, Vector3 axis, float length, float width, Color tint, float life = 0.35f, float delay = 0f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) axis = ((((Vector3)(ref axis)).sqrMagnitude < 1E-06f) ? Vector3.right : ((Vector3)(ref axis)).normalized); LineRenderer lr = Line("Sukuna Slash", 3, width, Color.white); lr.widthCurve = Taper; ((Renderer)lr).enabled = delay <= 0f; for (int i = 0; i < 3; i++) { lr.SetPosition(i, center); } Animate(((Component)lr).gameObject, life, delegate(float k) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) ((Renderer)lr).enabled = true; float num = Mathf.Clamp01(k * 7f); lr.SetPosition(0, center - axis * (length * 0.5f * num)); lr.SetPosition(1, center); lr.SetPosition(2, center + axis * (length * 0.5f * num)); Color val = Color.Lerp(Color.white, tint, Mathf.Clamp01(k * 2.5f)); val.a = 1f - k * k; lr.startColor = val; lr.endColor = val; lr.widthMultiplier = width * (1f - 0.6f * k); }, delay); } internal static void SlashBurst(Vector3 center, int count, float size, Color tint, float life = 0.35f, float stagger = 0.04f) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < count; i++) { Vector3 onUnitSphere = Random.onUnitSphere; Vector3 val = Random.insideUnitSphere * size * 0.25f; SlashLine(center + val, onUnitSphere, size * Random.Range(0.8f, 1.3f), 0.06f + 0.02f * size, tint, life, (float)i * stagger); } } internal static void BlackLightning(Vector3 center, int bolts, float radius, float life = 0.4f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bolts; i++) { Vector3 dir = Random.onUnitSphere; float len = radius * Random.Range(0.6f, 1.2f); LineRenderer black = Line("Black Flash Bolt", 9, 0.07f, Color.black); LineRenderer red = Line("Black Flash Edge", 9, 0.025f, Red); Animate(((Component)black).gameObject, life, delegate(float k) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(dir, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.right; } for (int j = 0; j < 9; j++) { float num = (float)j / 8f; Vector3 val2 = center + dir * (len * num) + Random.insideUnitSphere * (0.12f * radius * Mathf.Sin(num * MathF.PI)); black.SetPosition(j, val2); if (Object.op_Implicit((Object)(object)red)) { red.SetPosition(j, val2 + ((Vector3)(ref val)).normalized * 0.02f); } } float num2 = ((k < 0.7f) ? 1f : ((1f - k) / 0.3f)); bool enabled = Random.value > 0.25f; ((Renderer)black).enabled = enabled; LineRenderer obj = black; LineRenderer obj2 = black; Color val3 = default(Color); ((Color)(ref val3))..ctor(0f, 0f, 0f, num2); obj2.endColor = val3; obj.startColor = val3; if (Object.op_Implicit((Object)(object)red)) { ((Renderer)red).enabled = enabled; LineRenderer obj3 = red; LineRenderer obj4 = red; ((Color)(ref val3))..ctor(Red.r, Red.g, Red.b, num2); obj4.endColor = val3; obj3.startColor = val3; if (k >= 1f) { Object.Destroy((Object)(object)((Component)red).gameObject); } } }); } } internal static void CutMark(Vector3 point, Vector3 normal, Vector3 along, float length, float life = 8f) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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) //IL_00ae: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) along = Vector3.ProjectOnPlane(along, normal); if (((Vector3)(ref along)).sqrMagnitude < 0.0001f) { along = Vector3.ProjectOnPlane(Vector3.right, normal); } ((Vector3)(ref along)).Normalize(); LineRenderer lr = Line("Sukuna Cut Mark", 3, 0.05f, Red); lr.alignment = (LineAlignment)1; ((Component)lr).transform.rotation = Quaternion.LookRotation(-normal); lr.widthCurve = Taper; Vector3 val = point + normal * 0.012f; lr.SetPosition(0, val - along * length * 0.5f); lr.SetPosition(1, val); lr.SetPosition(2, val + along * length * 0.5f); Animate(((Component)lr).gameObject, life, delegate(float k) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_0092: Unknown result type (might be due to invalid IL or missing references) Color val2 = Color.Lerp(new Color(1f, 0.6f, 0.5f), Red, Mathf.Clamp01(k * 20f)); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.08f, 0.01f, 0.01f, 0.9f); Color val4 = Color.Lerp(val2, val3, Mathf.Clamp01((k - 0.05f) * 6f)); if (k > 0.8f) { val4.a *= (1f - k) / 0.2f; } LineRenderer obj = lr; Color startColor = (lr.endColor = val4); obj.startColor = startColor; }); } internal static GameObject MeshObject(string name, Mesh mesh, Material mat, Vector3 pos, Quaternion rot, Vector3 scale) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetPositionAndRotation(pos, rot); val.transform.localScale = scale; val.AddComponent().sharedMesh = mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = mat; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return val; } internal static GameObject Prim(PrimitiveType type, Transform parent, Vector3 localPos, Vector3 localScale, Quaternion localRot, Material mat) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive(type); Collider component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)component); } obj.transform.SetParent(parent, false); obj.transform.localPosition = localPos; obj.transform.localRotation = localRot; obj.transform.localScale = localScale; ((Renderer)obj.GetComponent()).sharedMaterial = mat; return obj; } private static ParticleSystem NewSystem(string name, Vector3 pos, Transform parent, Material mat) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.SetActive(false); if (Object.op_Implicit((Object)(object)parent)) { val.transform.SetParent(parent, false); } val.transform.position = pos; ParticleSystem val2 = val.AddComponent(); ParticleSystemRenderer component = val.GetComponent(); ((Renderer)component).sharedMaterial = (Object.op_Implicit((Object)(object)mat) ? mat : GlowMat); component.renderMode = (ParticleSystemRenderMode)0; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; MainModule main = val2.main; ((MainModule)(ref main)).playOnAwake = false; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; return val2; } private static Gradient FadeGradient(Color a, Color b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(a, 0f), new GradientColorKey(b, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.8f, 0.5f), new GradientAlphaKey(0f, 1f) }); return val; } internal static void Burst(Vector3 pos, Color a, Color b, int count, float speed, float size, float life, float gravity = 0f, Material mat = null, float radius = 0.1f) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = NewSystem("Sukuna Burst", pos, null, mat); MainModule main = val.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).duration = life; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(life * 0.5f, life); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(speed * 0.3f, speed); ((MainModule)(ref main)).startSize = new MinMaxCurve(size * 0.5f, size); ((MainModule)(ref main)).startColor = new MinMaxGradient(a, b); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(gravity); ((MainModule)(ref main)).maxParticles = count + 8; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).enabled = false; ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = radius; ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(FadeGradient(Color.white, Color.white)); SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 1f), new Keyframe(1f, 0.2f) })); ((Component)val).gameObject.SetActive(true); val.Emit(count); val.Play(); Object.Destroy((Object)(object)((Component)val).gameObject, life + 0.5f); } internal static ParticleSystem Emitter(string name, Vector3 pos, Transform parent, Material mat, Color a, Color b, float rate, float speed, float size, float life, float radius, float gravity = 0f, ParticleSystemShapeType shape = (ParticleSystemShapeType)0) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) ParticleSystem val = NewSystem(name, pos, parent, mat); MainModule main = val.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).duration = 1f; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(life * 0.6f, life); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(speed * 0.4f, speed); ((MainModule)(ref main)).startSize = new MinMaxCurve(size * 0.6f, size); ((MainModule)(ref main)).startColor = new MinMaxGradient(a, b); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(gravity); ((MainModule)(ref main)).maxParticles = Mathf.CeilToInt(rate * life * 1.5f) + 10; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(rate); ShapeModule shape2 = val.shape; ((ShapeModule)(ref shape2)).shapeType = shape; ((ShapeModule)(ref shape2)).radius = radius; ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(FadeGradient(Color.white, Color.white)); SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.6f), new Keyframe(0.3f, 1f), new Keyframe(1f, 0.1f) })); ((Component)val).gameObject.SetActive(true); val.Play(); return val; } internal static void StopEmitter(ParticleSystem ps, float linger = 1.5f) { if (Object.op_Implicit((Object)(object)ps)) { ((Component)ps).transform.SetParent((Transform)null, true); ps.Stop(true, (ParticleSystemStopBehavior)1); Object.Destroy((Object)(object)((Component)ps).gameObject, linger); } } internal static void MakeAura(GameObject go, float size, float speed, float spread) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) ParticleSystem obj = go.AddComponent(); ParticleSystemRenderer component = go.GetComponent(); ((Renderer)component).sharedMaterial = SmokeMat; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; MainModule main = obj.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).duration = 1f; ((MainModule)(ref main)).playOnAwake = true; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.6f, 1.2f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(speed * 0.3f, speed); ((MainModule)(ref main)).startSize = new MinMaxCurve(size * 0.5f, size); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.55f, 0f, 0.05f, 0.8f), new Color(0.05f, 0f, 0f, 0.7f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.05f); ((MainModule)(ref main)).maxParticles = 40; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(14f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(0.05f, 0.04f, spread); ColorOverLifetimeModule colorOverLifetime = obj.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(FadeGradient(Color.white, Color.white)); } internal static void LightFlash(Vector3 pos, Color c, float intensity, float range, float life) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Sukuna Flash"); val.transform.position = pos; Light l = val.AddComponent(); l.type = (LightType)2; l.color = c; l.range = range; l.intensity = intensity; l.shadows = (LightShadows)0; Animate(val, life, delegate(float k) { l.intensity = intensity * (1f - k) * (1f - k); }); } internal static void Explosion(Vector3 pos, float size) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) GameObject val = ExplosionPrefab; if (!Object.op_Implicit((Object)(object)val)) { Burst(pos, FireYellow, FireOrange, 80, 9f, 1.2f, 1f, -0.2f, FireMat, 0.5f); return; } ParticlePrefabExplosion component = Object.Instantiate(val, pos, Quaternion.identity).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.onlyParticleEffect = true; component.explosionSize = size; component.explosionDamage = 0; component.explosionDamageEnemy = 0; if (Object.op_Implicit((Object)(object)component.HurtCollider)) { ((Component)component.HurtCollider).gameObject.SetActive(false); } Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[4] { new GradientColorKey(new Color(1f, 0.95f, 0.75f), 0f), new GradientColorKey(FireOrange, 0.25f), new GradientColorKey(new Color(0.85f, 0.1f, 0.05f), 0.6f), new GradientColorKey(new Color(0.2f, 0.02f, 0.02f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 0.6f), new GradientAlphaKey(0f, 1f) }); Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(new Color(0.25f, 0.06f, 0.05f), 0f), new GradientColorKey(new Color(0.08f, 0.05f, 0.05f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.8f, 0f), new GradientAlphaKey(0f, 1f) }); if (Object.op_Implicit((Object)(object)component.particleFire)) { ColorOverLifetimeModule colorOverLifetime = component.particleFire.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); } if (Object.op_Implicit((Object)(object)component.particleSmoke)) { ColorOverLifetimeModule colorOverLifetime2 = component.particleSmoke.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = MinMaxGradient.op_Implicit(val3); } component.lightColorOverTime = val2; } } internal static Material Unlit(Color c) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (unlitCache.TryGetValue(c, out var value) && Object.op_Implicit((Object)(object)value)) { return value; } value = Keep(new Material(SpriteShader) { name = "Sukuna Unlit", color = c }); unlitCache[c] = value; return value; } internal static GameObject Orb(string name, Vector3 pos, float radius, Color core, Color shell, float light) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.position = pos; Prim((PrimitiveType)0, val.transform, Vector3.zero, Vector3.one * radius * 2f, Quaternion.identity, Unlit(core)); Color val2 = shell; val2.a = Mathf.Min(val2.a, 0.35f); Prim((PrimitiveType)0, val.transform, Vector3.zero, Vector3.one * radius * 3.2f, Quaternion.identity, Unlit(val2)); if (light > 0f) { Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = shell; obj.range = radius * 10f + 3f; obj.intensity = light; obj.shadows = (LightShadows)0; } return val; } internal static void Shockwave(Vector3 center, Vector3 normal, float radius, float width, Color color, float life) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_0093: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) LineRenderer lr = Line("Shockwave", 49, width, color); lr.loop = true; lr.alignment = (LineAlignment)1; ((Component)lr).transform.rotation = Quaternion.LookRotation(normal); Vector3 a = Vector3.Cross(normal, Vector3.up); if (((Vector3)(ref a)).sqrMagnitude < 0.01f) { a = Vector3.Cross(normal, Vector3.right); } ((Vector3)(ref a)).Normalize(); Vector3 val = Vector3.Cross(normal, a); Vector3 b = ((Vector3)(ref val)).normalized; Animate(((Component)lr).gameObject, life, delegate(float k) { //IL_003e: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) float num = radius * (1f - (1f - k) * (1f - k)); for (int i = 0; i < 49; i++) { float num2 = (float)i / 48f * MathF.PI * 2f; lr.SetPosition(i, center + (a * Mathf.Cos(num2) + b * Mathf.Sin(num2)) * num); } Color val2 = color; val2.a *= 1f - k; LineRenderer obj = lr; Color startColor = (lr.endColor = val2); obj.startColor = startColor; lr.widthMultiplier = width * (1f - 0.5f * k); }); } } internal static class WorldSlash { private const float Length = 70f; private const float HalfHeight = 14f; private const float HalfThickness = 2.2f; private static readonly Dictionary chanting = new Dictionary(); internal static void Chant(Cast c) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) StopChant(c.Key); Sfx.Play(SfxId.Chant, c.Origin, c.Local ? 0.8f : 0.6f); if (!c.Local) { if (c.Hostile && Object.op_Implicit((Object)(object)PlayerAvatar.instance) && Vector3.Distance(((Component)PlayerAvatar.instance).transform.position, c.Origin) < 40f) { Hud.Banner("\"SCALE OF THE DRAGON. RECOIL. TWIN METEORS.\"", "Get off his line of sight!", Vfx.Red, 1.8f); } GameObject val = new GameObject("World Slash Chant"); FollowHand followHand = val.AddComponent(); followHand.Target = c.Caster; if (c.Hostile) { followHand.Anchor = c.Enemy.HandPoint; } ((Component)Vfx.Emitter("Chant Energy", val.transform.position, val.transform, Vfx.SmokeMat, new Color(0.6f, 0f, 0.05f, 0.9f), new Color(0f, 0f, 0f, 0.9f), 40f, 0.8f, 0.12f, 0.6f, 0.2f, -0.2f, (ParticleSystemShapeType)0)).transform.localPosition = Vector3.zero; Object.Destroy((Object)(object)val, 2.5f); chanting[c.Key] = val; } } internal static void StopChant(Object p) { if (Object.op_Implicit(p) && chanting.TryGetValue(p, out var value)) { chanting.Remove(p); if (Object.op_Implicit((Object)(object)value)) { Object.Destroy((Object)(object)value); } } } internal static void Run(Cast c) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0153: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_0302: 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_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) StopChant(c.Key); Vector3 origin = c.Origin; Vector3 dir = c.Dir; Vector3 val = Vector3.Cross(Vector3.up, dir); if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.Cross(Vector3.forward, dir); } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(dir, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; RaycastHit val4 = default(RaycastHit); RaycastHit val5 = default(RaycastHit); for (int i = 0; i < 24; i++) { float num = 1.5f + (float)i * 3f; Vector3 val3 = origin + dir * num; float num2 = 14f; float num3 = 14f; if (Physics.Raycast(val3, normalized, ref val4, 14f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num2 = ((RaycastHit)(ref val4)).distance; } if (Physics.Raycast(val3, -normalized, ref val5, 14f, Combat.WorldMask, (QueryTriggerInteraction)1)) { num3 = ((RaycastHit)(ref val5)).distance; } Vfx.SlashLine(val3 + normalized * ((num2 - num3) * 0.5f), normalized, num2 + num3, 0.12f, Vfx.Red, 0.7f, num / 260f); } RaycastHit val7 = default(RaycastHit); for (int j = -4; j <= 4; j++) { Vector3 val6 = Quaternion.AngleAxis((float)j * 15f, val) * dir; if (Physics.Raycast(origin, val6, ref val7, 70f, Combat.WorldMask, (QueryTriggerInteraction)1)) { Vector3 along = Vector3.Cross(val, ((RaycastHit)(ref val7)).normal); Vfx.CutMark(((RaycastHit)(ref val7)).point, ((RaycastHit)(ref val7)).normal, along, 4f, 12f); } } Sfx.Play(SfxId.Tear, origin); Sfx.Play(SfxId.Tear, origin + dir * 25f, 0.8f); Vfx.Shake(origin + dir * 10f, 12f, 0.9f); Vfx.LightFlash(origin + dir * 4f, Color.white, 6f, 20f, 0.4f); if (c.Local) { Hud.WorldCut(); } if (c.Hostile && BossHits.LocalTarget(out var me)) { Vector3 val8 = BossHits.Center(me) - origin; float num4 = Vector3.Dot(val8, dir); if (num4 > -1f && num4 < 70f && Mathf.Abs(Vector3.Dot(val8, val)) < 2.2f && Mathf.Abs(Vector3.Dot(val8, normalized)) < 14f) { Hud.WorldCut(); BossHits.Hurt(c, me, 60, val * Mathf.Sign(Vector3.Dot(val8, val) + 0.001f) * 14f, 2f); } } if (!c.Hostile) { foreach (Enemy item in Combat.Enemies()) { Vector3 val9 = Combat.Center(item); Vector3 val10 = val9 - origin; float num5 = Vector3.Dot(val10, dir); if (!(num5 < -1f) && !(num5 > 70f) && !(Mathf.Abs(Vector3.Dot(val10, val)) > 2.2f) && !(Mathf.Abs(Vector3.Dot(val10, normalized)) > 14f)) { Vfx.SlashLine(val9, normalized, 3.5f, 0.15f, Vfx.Red, 0.6f, num5 / 260f); Vfx.Burst(val9, Vfx.Blood, Vfx.DarkRed, 30, 6f, 0.16f, 0.9f, 1.2f, Vfx.SmokeMat, 0.3f); Combat.HurtEnemy(item, 450f * c.Power, val * Mathf.Sign(Vector3.Dot(val10, val) + 0.001f), 3f, 8f, 0.4f); } } } if (Combat.IsHost) { Vector3 center = origin + dir * 35f; Vector3 halfExtents = default(Vector3); ((Vector3)(ref halfExtents))..ctor(2.2f, 14f, 35f); Quaternion rot = Quaternion.LookRotation(dir, normalized); Combat.DamageDoorsBox(center, halfExtents, rot, 100f, origin); Combat.HitObjectsBox(center, halfExtents, rot, Combat.Impact.Heavy, 6f, origin); } if (Combat.CanTakeFriendlyFire(c, out var me2)) { PlayerAvatar me3; Vector3 val11 = Combat.LocalPlayerCenter(out me3) - origin; float num6 = Vector3.Dot(val11, dir); if (num6 > -1f && num6 < 70f && Mathf.Abs(Vector3.Dot(val11, val)) < 2.2f) { Combat.HurtLocalPlayer(me2, 50); } } } } } namespace SukunaMod.Model { public static class BandanaModel { public const int TexSize = 256; public const float Rx = 0.1f; public const float Rz = 0.085f; public const float Height = 0.05f; public static ModelMeshData BuildMesh() { MeshBuilder meshBuilder = new MeshBuilder(); meshBuilder.Sheet(144, 6, delegate(float a, float num20) { float num14 = a * 2f * MathF.PI; float num15 = 0.06f * (float)Math.Sin(num14 * 7f + 0.8f) + 0.03f * (float)Math.Sin(num14 * 13f); float num16 = 0.1f * (1f + num15 * 0.3f); float num17 = 0.085f * (1f + num15 * 0.3f); float num18 = 1f - 0.35f * (0.5f + 0.5f * (float)Math.Sin(num14)); float num19 = -0.02f + num20 * 0.05f * num18 + 0.004f * (float)Math.Sin(num14 * 5f + num20 * 3f); float num21 = (num20 - 0.5f) * 0.012f * (float)Math.Cos(num14 * 3f); return new float[3] { (float)Math.Cos(num14) * (num16 + num21), num19, (float)Math.Sin(num14) * (num17 + num21) }; }, 0f, 0.75f, 0f, 1f); float kx = 0f; float num = 0f; float kz = -0.091f; int count = meshBuilder.Count; for (int num2 = 0; num2 <= 14; num2++) { float num3 = -MathF.PI / 2f + MathF.PI * (float)num2 / 14f; for (int num4 = 0; num4 <= 22; num4++) { float num5 = MathF.PI * 2f * (float)num4 / 22f; float num6 = 0.022f * (1f + 0.15f * (float)Math.Sin(num5 * 3f + num3 * 2f)); meshBuilder.Vertex(kx + num6 * 1.3f * (float)(Math.Cos(num3) * Math.Cos(num5)), num + num6 * 0.8f * (float)Math.Sin(num3), kz + num6 * (float)(Math.Cos(num3) * Math.Sin(num5)), 0.8f + 0.15f * (float)num4 / 22f, 0.1f + 0.2f * (float)num2 / 14f); } } for (int num7 = 0; num7 < 14; num7++) { for (int num8 = 0; num8 < 22; num8++) { int num9 = count + num7 * 23 + num8; int num10 = num9 + 1; int num11 = num9 + 22 + 1; int b = num11 + 1; meshBuilder.Tri(num9, num10, num11); meshBuilder.Tri(num10, b, num11); } } float[] array = new float[2] { -1f, 1f }; foreach (float num13 in array) { meshBuilder.Blob(Xf.Rot(new V3(num13 * 0.024f, 0.004f, kz - 0.004f), 0f, num13 * 25f, num13 * 30f), 0.02f, 0.008f, 0.013f, 16, 10, 2f, (V3 d) => 1f + 0.12f * (float)Math.Sin(Math.Atan2(d.Z, d.X) * 3.0)); } array = new float[2] { -1f, 1f }; foreach (float side in array) { meshBuilder.Sheet(40, 5, delegate(float a, float num21) { float num14 = 0.16f; float num15 = side * (0.45f + 0.35f * a); float num16 = kx + side * 0.012f + (float)Math.Sin(num15) * num14 * a; float num17 = kz - (float)Math.Cos(num15) * num14 * a * 0.9f; float num18 = 0.042f - 0.01f * a; float num19 = side * 0.6f * a; float num20 = (num21 - 0.5f) * num18; float num22 = (float)Math.Cos(num15) * num20; float num23 = (float)Math.Sin(num15) * num20; float num24 = -0.022f + 0.012f * (1f - a) + num20 * (float)Math.Sin(num19) * 0.5f + 0.003f * (float)Math.Sin(a * 9f); return new float[3] { num16 + num22 * (float)Math.Cos(num19), num24, num17 + num23 * (float)Math.Cos(num19) }; }, 0.76f, 0.99f, 0.35f, 0.95f); } return meshBuilder.Build(); } public static byte[] BuildTexture() { int num = 256; byte[] array = new byte[num * num * 4]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = ((float)j + 0.5f) / (float)num; float num3 = ((float)i + 0.5f) / (float)num; float num4 = 0.5f + 0.25f * (float)Math.Sin((double)(num2 * 2f) * Math.PI * 90.0) * (float)Math.Sin((double)(num3 * 2f) * Math.PI * 24.0); float num5 = 0.85f + 0.15f * (float)Math.Sin((double)(num2 * 2f) * Math.PI * 7.0 + (double)num3 * 2.5); float num6 = ((num3 < 0.08f || num3 > 0.92f) ? 0.75f : 1f); float v; float num7 = (v = (0.05f + 0.035f * num4) * num5 * num6); float v2 = num7 * 1.02f; float v3 = num7 * 1.25f; int num8 = (i * num + j) * 4; array[num8] = ToByte(v); array[num8 + 1] = ToByte(v2); array[num8 + 2] = ToByte(v3); array[num8 + 3] = byte.MaxValue; } } return array; } private static byte ToByte(float v) { return (byte)Math.Max(0, Math.Min(255, (int)(v * 255f + 0.5f))); } } public static class BeastRigs { private static int Shadow(Rig r, string tex = "fur") { return r.Mat("Shadow", 0.05f, 0.05f, 0.07f, 0.03f, 0.025f, 0.07f, tex, 0.35f); } private static int Pale(Rig r, string tex = "fur") { return r.Mat("Pale", 0.9f, 0.9f, 0.93f, 0.12f, 0.12f, 0.16f, tex, 0.3f); } private static int Eyes(Rig r) { return r.Mat("Eyes", 0.9f, 0.92f, 1f, 0.9f, 0.9f, 1f); } private static void Trunk(MeshBuilder g, float[] zs, float[] ys, float[] hs, float[] ws, float cap0 = 1f, float cap1 = 1f, Func mod = null) { List list = new List(); for (int i = 0; i < zs.Length; i++) { list.Add(new V3(0f, ys[i], zs[i])); } g.Tube(list, hs, ws, V3.Up, 18, cap0, cap1, mod, closedLoop: false, doubleSided: false, 4f, 4f); } private static void Leg(MeshBuilder g, V3[] joints, float r0, float r1) { List list = new List(); for (int i = 0; i < joints.Length; i++) { list.Add(r0 + (r1 - r0) * (float)i / ((float)joints.Length - 1f)); } g.Tube(joints, list, list, V3.Fwd, 10, 0.5f, 0.6f, null, closedLoop: false, doubleSided: false, 4f, 4f); } public static Rig Dog(bool white) { Rig rig = new Rig(white ? "White Dog" : "Black Dog"); int mat = (white ? Pale(rig) : Shadow(rig)); int mat2 = (white ? Shadow(rig, "plain") : Pale(rig, "plain")); int mat3 = Eyes(rig); int mat4 = rig.Mat("Nose", 0.03f, 0.03f, 0.04f, 0f, 0f, 0f, "plain", 0.7f); rig.Part("Body", null, new V3(0f, 0.62f, 0f)); rig.Part("Head", "Body", new V3(0f, 0.22f, 0.5f)); rig.Part("Tail", "Body", new V3(0f, 0.08f, -0.5f)); for (int i = 0; i < 4; i++) { rig.Part("Leg " + i, "Body", new V3((i % 2 == 0) ? (-0.12f) : 0.12f, -0.1f, (i < 2) ? 0.3f : (-0.32f))); } MeshBuilder meshBuilder = rig.G("Body", mat); Trunk(meshBuilder, new float[6] { -0.46f, -0.3f, -0.08f, 0.14f, 0.32f, 0.44f }, new float[6] { 0.02f, 0.02f, 0.03f, 0f, -0.02f, 0.02f }, new float[6] { 0.13f, 0.155f, 0.125f, 0.165f, 0.19f, 0.15f }, new float[6] { 0.12f, 0.135f, 0.11f, 0.135f, 0.15f, 0.12f }); meshBuilder.Tube(new V3[3] { new V3(0f, 0.04f, 0.36f), new V3(0f, 0.14f, 0.45f), new V3(0f, 0.22f, 0.5f) }, new float[3] { 0.13f, 0.11f, 0.09f }, new float[3] { 0.11f, 0.095f, 0.08f }, V3.Fwd, 14, 0.5f, 0.5f); Random random = new Random(white ? 3 : 4); for (int j = 0; j < 22; j++) { double num = (double)j / 22.0 * 2.0 * Math.PI; V3 v = new V3((float)Math.Cos(num), (float)Math.Sin(num) * 0.9f, 0f); V3 v2 = new V3(0f, 0.08f, 0.38f) + new V3(v.X * 0.12f, v.Y * 0.13f, 0f); V3 v3 = v2 + (v * 0.6f + V3.Back * 0.8f).Norm * (0.1f + 0.05f * (float)random.NextDouble()); meshBuilder.Spike(v2, V3.Lerp(v2, v3, 0.5f) + v * 0.02f, v3, 0.035f, 5, 4); } for (int k = 0; k < 7; k++) { V3 v4 = new V3(0f, 0.15f, 0.25f - (float)k * 0.1f); meshBuilder.Spike(v4, v4 + new V3(0f, 0.03f, -0.04f), v4 + new V3(0f, 0.06f, -0.1f), 0.03f, 5, 4); } MeshBuilder meshBuilder2 = rig.G("Head", mat); meshBuilder2.Blob(Xf.At(0f, 0.02f, -0.02f), 0.11f, 0.105f, 0.13f, 18, 12); meshBuilder2.Tube(new V3[3] { new V3(0f, -0.005f, 0.06f), new V3(0f, -0.03f, 0.16f), new V3(0f, -0.045f, 0.25f) }, new float[3] { 0.065f, 0.048f, 0.034f }, new float[3] { 0.06f, 0.044f, 0.03f }, V3.Up, 12, 0f, 0.8f); meshBuilder2.Blob(Xf.At(0f, -0.07f, 0.13f), 0.045f, 0.022f, 0.09f, 12, 6); rig.G("Head", mat4).Blob(Xf.At(0f, -0.035f, 0.262f), 0.026f, 0.02f, 0.02f, 10, 8); float[] array = new float[2] { -1f, 1f }; foreach (float num2 in array) { V3 v5 = new V3(num2 * 0.065f, 0.09f, -0.03f); meshBuilder2.Spike(v5, v5 + new V3(num2 * 0.02f, 0.08f, -0.01f), v5 + new V3(num2 * 0.035f, 0.16f, -0.04f), 0.035f, 6, 5); rig.G("Head", mat3).Blob(Xf.Rot(new V3(num2 * 0.058f, 0.04f, 0.085f), 0f, num2 * 25f, 0f), 0.018f, 0.011f, 0.01f, 8, 6); rig.G("Head", mat2).Tube(new V3[3] { new V3(num2 * 0.03f, 0.075f, 0.09f), new V3(num2 * 0.07f, 0.085f, 0.06f), new V3(num2 * 0.1f, 0.07f, 0f) }, new float[3] { 0.007f, 0.008f, 0.004f }, V3.Up, 5); } for (int m = 0; m < 4; m++) { bool flag = m < 2; V3[] joints = ((!flag) ? new V3[4] { new V3(0f, 0.06f, 0f), new V3(0f, -0.16f, -0.07f), new V3(0f, -0.34f, -0.04f), new V3(0f, -0.5f, 0f) } : new V3[4] { new V3(0f, 0.05f, 0f), new V3(0f, -0.2f, 0.02f), new V3(0f, -0.4f, 0f), new V3(0f, -0.5f, 0.01f) }); Leg(rig.G("Leg " + m, mat), joints, flag ? 0.078f : 0.09f, 0.04f); if (!flag) { rig.G("Leg " + m, mat).Blob(Xf.At(0f, -0.04f, -0.02f), 0.075f, 0.13f, 0.1f, 12, 8); } rig.G("Leg " + m, mat).Blob(Xf.At(0f, -0.515f, 0.035f), 0.04f, 0.025f, 0.06f, 10, 6); } V3[] pts = new V3[4] { new V3(0f, 0f, 0f), new V3(0f, -0.04f, -0.14f), new V3(0f, -0.16f, -0.28f), new V3(0f, -0.3f, -0.34f) }; rig.G("Tail", mat).Tube(pts, new float[4] { 0.045f, 0.07f, 0.065f, 0.03f }, new float[4] { 0.045f, 0.065f, 0.06f, 0.03f }, V3.Up, 10, 0.5f); return rig; } public static Rig Nue() { Rig rig = new Rig("Nue"); int mat = Shadow(rig, "feather"); int mat2 = Pale(rig, "feather"); int mat3 = Eyes(rig); int mat4 = rig.Mat("Beak", 0.85f, 0.68f, 0.3f, 0.15f, 0.1f, 0.02f, "metal", 0.6f); rig.Part("Body", null, V3.Zero); rig.Part("Wing L", "Body", new V3(-0.14f, 0.08f, 0.05f)); rig.Part("Wing R", "Body", new V3(0.14f, 0.08f, 0.05f)); MeshBuilder meshBuilder = rig.G("Body", mat); Trunk(meshBuilder, new float[4] { -0.32f, -0.1f, 0.15f, 0.3f }, new float[4] { 0f, 0f, 0.03f, 0.08f }, new float[4] { 0.12f, 0.17f, 0.17f, 0.12f }, new float[4] { 0.13f, 0.18f, 0.17f, 0.12f }); meshBuilder.Blob(Xf.At(0f, 0.11f, 0.3f), 0.15f, 0.14f, 0.14f, 18, 12); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { meshBuilder.Spike(new V3(num * 0.08f, 0.2f, 0.3f), new V3(num * 0.11f, 0.27f, 0.28f), new V3(num * 0.14f, 0.33f, 0.24f), 0.03f, 5, 5); } rig.G("Body", mat2).Blob(Xf.At(0f, 0.1f, 0.41f), 0.125f, 0.115f, 0.03f, 18, 10, 2f, (V3 d) => 1f - 0.18f * Math.Max(0f, 0f - d.Y) * (1f - Math.Abs(d.X))); array = new float[2] { -1f, 1f }; foreach (float num2 in array) { rig.G("Body", mat3).Blob(Xf.At(num2 * 0.05f, 0.12f, 0.44f), 0.025f, 0.02f, 0.01f, 10, 6); } rig.G("Body", mat4).Spike(new V3(0f, 0.09f, 0.43f), new V3(0f, 0.07f, 0.47f), new V3(0f, 0.03f, 0.46f), 0.018f, 6, 4); for (int num3 = -3; num3 <= 3; num3++) { meshBuilder.Blob(Xf.Rot(new V3((float)num3 * 0.04f, 0.01f, -0.45f), 8f, (float)num3 * 9f, 0f), 0.03f, 0.008f, 0.16f, 10, 4, 2.2f); } array = new float[2] { -1f, 1f }; foreach (float num4 in array) { for (int num5 = -1; num5 <= 1; num5++) { V3 v = new V3(num4 * 0.07f, -0.14f, 0.04f); rig.G("Body", mat4).Spike(v, v + new V3((float)num5 * 0.02f, -0.06f, 0.02f), v + new V3((float)num5 * 0.04f, -0.08f, 0.07f), 0.012f, 5, 4); } } string[] array2 = new string[2] { "L", "R" }; foreach (string text in array2) { float num6 = ((text == "L") ? (-1f) : 1f); string part = "Wing " + text; rig.G(part, mat).Tube(new V3[3] { V3.Zero, new V3(num6 * 0.45f, 0.03f, 0.02f), new V3(num6 * 0.95f, 0f, -0.05f) }, new float[3] { 0.05f, 0.035f, 0.02f }, V3.Up, 8, 0.5f); rig.G(part, mat2).Tube(new V3[3] { new V3(num6 * 0.05f, 0.015f, 0.04f), new V3(num6 * 0.45f, 0.04f, 0.05f), new V3(num6 * 0.92f, 0.01f, -0.02f) }, new float[3] { 0.012f, 0.012f, 0.008f }, V3.Up, 6, 0.5f); for (int num7 = 0; num7 < 14; num7++) { float num8 = (float)num7 / 13f; V3 v2 = new V3(num6 * (0.08f + 0.85f * num8), 0f, -0.02f - 0.04f * num8); float num9 = 0.2f + 0.22f * num8; float ey = num6 * (10f + 70f * num8 * num8); rig.G(part, mat).Blob(Xf.Rot(v2 + V3.Euler(new V3(0f, 0f, (0f - num9) * 0.9f), 0f, ey, 0f), 0f, ey, num6 * 4f), 0.06f, 0.008f, num9, 10, 4, 2.2f); } for (int num10 = 0; num10 < 8; num10++) { float num11 = (float)num10 / 7f; V3 v3 = new V3(num6 * (0.06f + 0.7f * num11), 0.012f, 0f); rig.G(part, mat).Blob(Xf.Rot(v3 + new V3(0f, 0f, -0.07f), 0f, num6 * 15f * num11, 0f), 0.05f, 0.007f, 0.1f, 10, 4, 2.2f); } } return rig; } public static Rig Toad() { Rig rig = new Rig("Toad"); int mat = Shadow(rig, "skin"); int mat2 = Pale(rig, "skin"); int mat3 = Eyes(rig); int mat4 = rig.Mat("Mouth", 0.25f, 0.06f, 0.1f); rig.Part("Body", null, V3.Zero); rig.Part("Mouth", "Body", new V3(0f, 0.38f, 0.38f)); MeshBuilder meshBuilder = rig.G("Body", mat); meshBuilder.Blob(Xf.At(0f, 0.32f, 0f), 0.4f, 0.27f, 0.37f, 28, 18, 2.2f, (V3 d) => 1f + 0.035f * (float)(Math.Sin(d.X * 23f) * Math.Sin(d.Z * 19f) * Math.Sin(d.Y * 17f)) - ((d.Y < -0.3f) ? 0.1f : 0f)); rig.G("Body", mat2).Blob(Xf.At(0f, 0.25f, 0.1f), 0.33f, 0.18f, 0.29f, 20, 12); rig.G("Body", mat4).Tube(new V3[5] { new V3(-0.3f, 0.33f, 0.2f), new V3(-0.16f, 0.36f, 0.33f), new V3(0f, 0.37f, 0.37f), new V3(0.16f, 0.36f, 0.33f), new V3(0.3f, 0.33f, 0.2f) }, new float[5] { 0.008f, 0.012f, 0.012f, 0.012f, 0.008f }, V3.Up, 6); float[] array = new float[2] { -1f, 1f }; foreach (float num2 in array) { meshBuilder.Blob(Xf.At(num2 * 0.19f, 0.54f, 0.19f), 0.1f, 0.085f, 0.1f, 14); rig.G("Body", mat3).Blob(Xf.At(num2 * 0.21f, 0.57f, 0.27f), 0.06f, 0.05f, 0.035f, 12, 8); meshBuilder.Tube(new V3[3] { new V3(num2 * 0.25f, 0.28f, 0.2f), new V3(num2 * 0.33f, 0.14f, 0.26f), new V3(num2 * 0.35f, 0.03f, 0.3f) }, new float[3] { 0.07f, 0.055f, 0.045f }, V3.Fwd, 10); meshBuilder.Blob(Xf.At(num2 * 0.36f, 0.02f, 0.36f), 0.09f, 0.02f, 0.08f, 12, 6, 2f, (V3 d) => 1f + 0.25f * (float)Math.Abs(Math.Sin(Math.Atan2(d.Z, d.X) * 2.0))); meshBuilder.Blob(Xf.Rot(new V3(num2 * 0.34f, 0.18f, -0.18f), 0f, num2 * 20f, 0f), 0.15f, 0.12f, 0.24f); meshBuilder.Blob(Xf.At(num2 * 0.42f, 0.03f, -0.05f), 0.1f, 0.025f, 0.15f, 12, 6); } return rig; } public static Rig Elephant() { Rig rig = new Rig("Max Elephant"); int mat = Shadow(rig, "stone"); int mat2 = Pale(rig, "plain"); int mat3 = Eyes(rig); int mat4 = rig.Mat("Ivory", 0.92f, 0.88f, 0.78f, 0.1f, 0.1f, 0.08f, "plain", 0.5f); rig.Part("Body", null, V3.Zero); V3[] array = new V3[6] { V3.Zero, new V3(0f, -0.3f, 0.12f), new V3(0f, -0.62f, 0.2f), new V3(0f, -0.92f, 0.32f), new V3(0f, -1.1f, 0.5f), new V3(0f, -1.12f, 0.66f) }; rig.Part("Trunk", "Body", new V3(0f, 1.6f, 2f)); rig.Part("Trunk Tip", "Trunk", array[^1]); MeshBuilder meshBuilder = rig.G("Body", mat); Trunk(meshBuilder, new float[5] { -1.4f, -0.9f, 0f, 0.9f, 1.35f }, new float[5] { 1.55f, 1.6f, 1.6f, 1.7f, 1.75f }, new float[5] { 0.7f, 0.82f, 0.85f, 0.82f, 0.65f }, new float[5] { 0.78f, 0.95f, 1f, 0.95f, 0.75f }); meshBuilder.Blob(Xf.At(0f, 1.95f, 1.5f), 0.6f, 0.62f, 0.55f, 22, 16, 2f, (V3 d) => (!(d.Y > 0.6f)) ? 1f : 1.05f); float[] array2 = new float[2] { -1f, 1f }; foreach (float s in array2) { rig.G("Body", mat).Panel(10, 10, delegate(float u, float v) { float x = s * (0.42f + 0.85f * u * (1f - 0.25f * v)); float y = 2.5f - 1.3f * v * (0.75f + 0.25f * (1f - Math.Abs(u - 0.5f) * 2f)); float z2 = 1.42f - 0.3f * u + 0.07f * (float)Math.Sin(v * 9f + u * 4f); return new V3(x, y, z2); }, 2f, 2f, new V3(0f, 0f, -1f), (s > 0f) ? (-0.04f) : 0.04f); rig.G("Body", mat3).Blob(Xf.At(s * 0.36f, 2.13f, 1.94f), 0.06f, 0.04f, 0.035f, 10, 6); rig.G("Body", mat4).Spike(new V3(s * 0.28f, 1.55f, 1.92f), new V3(s * 0.34f, 1.15f, 2.3f), new V3(s * 0.26f, 1.2f, 2.75f), 0.07f, 10, 8, 0.15f); float[] array3 = new float[2] { 0.85f, -0.85f }; foreach (float num3 in array3) { Leg(meshBuilder, new V3[3] { new V3(s * 0.55f, 1.2f, num3), new V3(s * 0.56f, 0.6f, num3 + 0.03f), new V3(s * 0.56f, 0.02f, num3) }, 0.32f, 0.27f); for (int num4 = -1; num4 <= 1; num4++) { rig.G("Body", mat4).Blob(Xf.At(s * 0.56f + (float)num4 * 0.12f, 0.05f, num3 + 0.25f), 0.06f, 0.05f, 0.04f, 8, 6); } } } for (int num5 = 0; num5 < 4; num5++) { float z = 0.6f - (float)num5 * 0.5f; rig.G("Body", mat2).Tube(new V3[3] { new V3(-0.55f, 2.25f, z), new V3(0f, 2.47f, z), new V3(0.55f, 2.25f, z) }, new float[3] { 0.04f, 0.05f, 0.04f }, V3.Fwd, 6); } meshBuilder.Tube(new V3[3] { new V3(0f, 1.9f, -1.5f), new V3(0f, 1.5f, -1.62f), new V3(0f, 1.05f, -1.6f) }, new float[3] { 0.06f, 0.04f, 0.03f }, V3.Fwd, 8); List list = new List(); for (int num6 = 0; num6 < array.Length; num6++) { list.Add(0.21f - 0.13f * (float)num6 / ((float)array.Length - 1f)); } rig.G("Trunk", mat).Tube(array, list, list, V3.Fwd, 14, 0.5f, 0.6f, (int ring, float th) => 1f + 0.03f * (float)Math.Sin((float)ring * 3.1f + th * 0f)); return rig; } public static Rig SerpentHead() { Rig rig = new Rig("Great Serpent"); int mat = Shadow(rig, "scales"); int mat2 = Pale(rig, "scales"); int mat3 = Eyes(rig); int mat4 = rig.Mat("Fangs", 0.92f, 0.9f, 0.82f, 0.1f, 0.1f, 0.08f, "plain", 0.5f); int mat5 = rig.Mat("Mouth", 0.3f, 0.06f, 0.1f); rig.Part("Head", null, V3.Zero); rig.Part("Jaw", "Head", new V3(0f, -0.15f, -0.2f)); MeshBuilder meshBuilder = rig.G("Head", mat); Trunk(meshBuilder, new float[5] { -0.4f, -0.12f, 0.15f, 0.45f, 0.66f }, new float[5] { 0f, 0.03f, 0.04f, 0.02f, 0f }, new float[5] { 0.2f, 0.21f, 0.18f, 0.12f, 0.075f }, new float[5] { 0.4f, 0.46f, 0.38f, 0.24f, 0.13f }, 0.5f, 0.6f); rig.G("Head", mat2).Tube(new V3[3] { new V3(0f, 0.22f, -0.3f), new V3(0f, 0.24f, 0.1f), new V3(0f, 0.15f, 0.45f) }, new float[3] { 0.025f, 0.035f, 0.02f }, new float[3] { 0.08f, 0.1f, 0.05f }, V3.Up, 8); rig.G("Head", mat5).Blob(Xf.At(0f, -0.12f, 0.15f), 0.3f, 0.05f, 0.45f, 14, 6); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { meshBuilder.Blob(Xf.At(num * 0.26f, 0.13f, 0.16f), 0.09f, 0.05f, 0.14f, 12, 8); rig.G("Head", mat3).Blob(Xf.Rot(new V3(num * 0.3f, 0.1f, 0.24f), 0f, num * 30f, 0f), 0.05f, 0.03f, 0.05f, 10, 6); rig.G("Head", mat4).Spike(new V3(num * 0.15f, -0.08f, 0.5f), new V3(num * 0.15f, -0.18f, 0.52f), new V3(num * 0.13f, -0.28f, 0.48f), 0.03f, 6, 5, 0.1f); } Trunk(rig.G("Jaw", mat), new float[4] { -0.05f, 0.3f, 0.65f, 0.8f }, new float[4] { 0f, -0.02f, -0.01f, 0.02f }, new float[4] { 0.09f, 0.08f, 0.06f, 0.04f }, new float[4] { 0.3f, 0.28f, 0.18f, 0.1f }, 0.5f, 0.8f); for (int j = 0; j < 6; j++) { float num2 = (float)j / 5f; float num3 = 0.25f + 0.45f * num2; float num4 = 0.22f - 0.12f * num2; array = new float[2] { -1f, 1f }; foreach (float num5 in array) { rig.G("Jaw", mat4).Spike(new V3(num5 * num4, 0.05f, num3), new V3(num5 * num4, 0.1f, num3), new V3(num5 * num4 * 0.95f, 0.14f, num3 + 0.01f), 0.015f, 5, 3, 0.1f); } } return rig; } private static void Pivots(Rig r, float len, float girth, float legLen, float headSize) { r.Part("Body", null, new V3(0f, legLen + girth * 0.4f, 0f)); r.Part("Head", "Body", new V3(0f, girth * 0.35f, len * 0.5f + headSize * 0.2f)); r.Part("Tail", "Body", new V3(0f, girth * 0.2f, (0f - len) * 0.5f)); for (int i = 0; i < 4; i++) { r.Part("Leg " + i, "Body", new V3(((i % 2 == 0) ? (-1f) : 1f) * girth * 0.32f, (0f - girth) * 0.25f, ((i < 2) ? 1f : (-1f)) * len * 0.36f)); } } public static Rig Ox() { Rig rig = new Rig("Piercing Ox"); int mat = Shadow(rig); int mat2 = Pale(rig, "plain"); int mat3 = Eyes(rig); int mat4 = rig.Mat("Horn", 0.88f, 0.82f, 0.7f, 0.1f, 0.09f, 0.07f, "wood", 0.5f); int mat5 = rig.Mat("Hooves", 0.06f, 0.05f, 0.05f, 0f, 0f, 0f, "plain", 0.6f); Pivots(rig, 1.5f, 0.9f, 0.55f, 0.55f); MeshBuilder meshBuilder = rig.G("Body", mat); Trunk(meshBuilder, new float[6] { -0.78f, -0.5f, -0.1f, 0.3f, 0.62f, 0.8f }, new float[6] { 0f, 0f, 0.02f, 0.12f, 0.12f, 0.08f }, new float[6] { 0.32f, 0.4f, 0.42f, 0.55f, 0.5f, 0.36f }, new float[6] { 0.32f, 0.38f, 0.4f, 0.45f, 0.42f, 0.32f }); meshBuilder.Blob(Xf.At(0f, -0.25f, 0.55f), 0.16f, 0.2f, 0.18f, 12, 8); MeshBuilder meshBuilder2 = rig.G("Head", mat); meshBuilder2.Blob(Xf.At(0f, 0f, 0f), 0.24f, 0.24f, 0.27f, 18, 12); meshBuilder2.Blob(Xf.At(0f, -0.1f, 0.25f), 0.18f, 0.14f, 0.13f, 14, 10, 2.4f); rig.G("Head", mat2).Blob(Xf.At(0f, 0.12f, 0.2f), 0.12f, 0.02f, 0.08f, 12, 6); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { rig.G("Head", mat4).Spike(new V3(num * 0.18f, 0.16f, 0.05f), new V3(num * 0.42f, 0.22f, 0.08f), new V3(num * 0.45f, 0.36f, 0.42f), 0.075f, 10, 10); rig.G("Head", mat3).Blob(Xf.At(num * 0.17f, 0.06f, 0.2f), 0.035f, 0.025f, 0.02f, 8, 6); rig.G("Head", mat5).Blob(Xf.At(num * 0.06f, -0.11f, 0.37f), 0.025f, 0.02f, 0.01f, 8, 6); } for (int j = 0; j < 4; j++) { Leg(rig.G("Leg " + j, mat), new V3[3] { new V3(0f, 0.12f, 0f), new V3(0f, -0.22f, (j < 2) ? 0.03f : (-0.06f)), new V3(0f, -0.52f, 0f) }, 0.16f, 0.09f); rig.G("Leg " + j, mat5).Blob(Xf.At(0f, -0.56f, 0.02f), 0.1f, 0.05f, 0.12f, 10, 6, 2.6f); } rig.G("Tail", mat).Tube(new V3[3] { V3.Zero, new V3(0f, -0.2f, -0.06f), new V3(0f, -0.45f, -0.05f) }, new float[3] { 0.045f, 0.03f, 0.025f }, V3.Fwd, 8); rig.G("Tail", mat).Blob(Xf.At(0f, -0.5f, -0.05f), 0.05f, 0.09f, 0.05f, 10, 8); return rig; } public static Rig Tiger() { Rig rig = new Rig("Tiger Funeral"); int mat = rig.Mat("Coat", 0.9f, 0.88f, 0.92f, 0.08f, 0.07f, 0.12f, "stripes", 0.35f); int mat2 = Shadow(rig); int mat3 = Eyes(rig); int mat4 = rig.Mat("Claws", 0.92f, 0.9f, 0.85f, 0.1f, 0.1f, 0.1f); Pivots(rig, 1.6f, 0.62f, 0.55f, 0.48f); Trunk(rig.G("Body", mat), new float[6] { -0.82f, -0.55f, -0.15f, 0.25f, 0.6f, 0.82f }, new float[6] { 0f, 0f, -0.02f, 0f, 0.04f, 0.06f }, new float[6] { 0.24f, 0.3f, 0.26f, 0.31f, 0.33f, 0.24f }, new float[6] { 0.22f, 0.27f, 0.22f, 0.27f, 0.28f, 0.2f }); MeshBuilder meshBuilder = rig.G("Head", mat); meshBuilder.Blob(Xf.At(0f, 0f, 0f), 0.2f, 0.18f, 0.2f, 18, 12); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { meshBuilder.Blob(Xf.At(num * 0.12f, -0.05f, 0.12f), 0.1f, 0.08f, 0.09f, 12, 8); meshBuilder.Blob(Xf.Rot(new V3(num * 0.12f, 0.16f, -0.03f), 0f, 0f, num * -15f), 0.05f, 0.06f, 0.025f, 10, 6); rig.G("Head", mat3).Blob(Xf.Rot(new V3(num * 0.08f, 0.05f, 0.17f), 0f, num * 20f, 0f), 0.03f, 0.016f, 0.012f, 8, 6); } rig.G("Head", mat2).Blob(Xf.At(0f, -0.06f, 0.2f), 0.09f, 0.07f, 0.07f, 12, 8, 2.3f); rig.G("Head", mat2).Blob(Xf.At(0f, -0.03f, 0.265f), 0.03f, 0.022f, 0.015f, 8, 6); for (int j = 0; j < 4; j++) { bool flag = j < 2; Leg(rig.G("Leg " + j, mat), (!flag) ? new V3[4] { new V3(0f, 0.12f, 0f), new V3(0f, -0.15f, -0.1f), new V3(0f, -0.35f, -0.05f), new V3(0f, -0.5f, 0f) } : new V3[3] { new V3(0f, 0.1f, 0f), new V3(0f, -0.2f, 0.02f), new V3(0f, -0.5f, 0f) }, flag ? 0.13f : 0.15f, 0.075f); rig.G("Leg " + j, mat).Blob(Xf.At(0f, -0.53f, 0.04f), 0.075f, 0.04f, 0.09f, 12, 6); for (int k = -1; k <= 1; k++) { rig.G("Leg " + j, mat4).Spike(new V3((float)k * 0.035f, -0.54f, 0.11f), new V3((float)k * 0.035f, -0.55f, 0.14f), new V3((float)k * 0.035f, -0.57f, 0.15f), 0.01f, 5, 3); } } V3[] pts = new V3[5] { V3.Zero, new V3(0f, -0.1f, -0.25f), new V3(0f, -0.3f, -0.45f), new V3(0f, -0.25f, -0.7f), new V3(0f, -0.05f, -0.85f) }; rig.G("Tail", mat).Tube(pts, new float[5] { 0.06f, 0.05f, 0.045f, 0.04f, 0.035f }, new float[5] { 0.06f, 0.05f, 0.045f, 0.04f, 0.035f }, V3.Up, 10); return rig; } public static Rig Deer() { Rig rig = new Rig("Round Deer"); int mat = rig.Mat("Coat", 0.78f, 0.88f, 0.8f, 0.1f, 0.16f, 0.12f, "fur", 0.3f); int mat2 = rig.Mat("Antlers", 0.88f, 0.84f, 0.74f, 0.12f, 0.12f, 0.1f, "wood", 0.4f); int mat3 = rig.Mat("Eyes", 0.2f, 0.25f, 0.22f, 0.3f, 0.5f, 0.35f); int mat4 = rig.Glow("Halo", 0.8f, 1f, 0.85f, 0.4f); Pivots(rig, 1.2f, 0.55f, 0.8f, 0.36f); rig["Head"].Pos = new V3(0f, 0.65f, 0.75f); MeshBuilder meshBuilder = rig.G("Body", mat); Trunk(meshBuilder, new float[5] { -0.6f, -0.35f, 0f, 0.35f, 0.58f }, new float[5] { 0f, 0f, -0.02f, 0.02f, 0.06f }, new float[5] { 0.2f, 0.25f, 0.22f, 0.26f, 0.2f }, new float[5] { 0.17f, 0.21f, 0.19f, 0.21f, 0.16f }); meshBuilder.Tube(new V3[3] { new V3(0f, 0.1f, 0.45f), new V3(0f, 0.38f, 0.62f), new V3(0f, 0.6f, 0.72f) }, new float[3] { 0.12f, 0.09f, 0.075f }, new float[3] { 0.1f, 0.075f, 0.065f }, V3.Fwd, 12, 0.5f, 0.5f); MeshBuilder meshBuilder2 = rig.G("Head", mat); meshBuilder2.Blob(Xf.At(0f, 0f, 0f), 0.1f, 0.1f, 0.12f); meshBuilder2.Tube(new V3[3] { new V3(0f, -0.01f, 0.06f), new V3(0f, -0.04f, 0.17f), new V3(0f, -0.06f, 0.25f) }, new float[3] { 0.06f, 0.045f, 0.035f }, new float[3] { 0.055f, 0.04f, 0.03f }, V3.Up, 12, 0f, 0.8f); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { meshBuilder2.Blob(Xf.Rot(new V3(num * 0.1f, 0.06f, -0.04f), 0f, 0f, num * -50f), 0.025f, 0.07f, 0.015f, 10, 6); rig.G("Head", mat3).Blob(Xf.At(num * 0.065f, 0.03f, 0.07f), 0.022f, 0.018f, 0.014f, 8, 6); MeshBuilder meshBuilder3 = rig.G("Head", mat2); V3 v = new V3(num * 0.045f, 0.09f, -0.02f); V3 v2 = v + new V3(num * 0.1f, 0.16f, -0.05f); V3 v3 = v + new V3(num * 0.2f, 0.36f, -0.02f); meshBuilder3.Spike(v, v2, v3, 0.022f, 6, 8, 0.25f); meshBuilder3.Spike(v2, v2 + new V3(num * 0.01f, 0.06f, 0.07f), v2 + new V3(num * 0.02f, 0.13f, 0.12f), 0.013f, 5, 5, 0.2f); V3 v4 = V3.Lerp(v2, v3, 0.55f); meshBuilder3.Spike(v4, v4 + new V3(num * 0.07f, 0.03f, 0f), v4 + new V3(num * 0.15f, 0.08f, 0.04f), 0.012f, 5, 5, 0.2f); meshBuilder3.Spike(v3, v3 + new V3(num * -0.02f, 0.05f, 0.04f), v3 + new V3(num * -0.03f, 0.09f, 0.1f), 0.01f, 5, 4, 0.2f); } for (int j = 0; j < 4; j++) { bool flag = j < 2; Leg(rig.G("Leg " + j, mat), flag ? new V3[3] { new V3(0f, 0.1f, 0f), new V3(0f, -0.35f, 0.02f), new V3(0f, -0.78f, 0f) } : new V3[4] { new V3(0f, 0.12f, 0f), new V3(0f, -0.25f, -0.1f), new V3(0f, -0.5f, -0.04f), new V3(0f, -0.78f, 0f) }, flag ? 0.07f : 0.09f, 0.03f); rig.G("Leg " + j, mat2).Blob(Xf.At(0f, -0.8f, 0.01f), 0.035f, 0.03f, 0.04f, 8, 6); } rig.G("Tail", mat).Blob(Xf.At(0f, 0.02f, -0.04f), 0.05f, 0.07f, 0.05f, 10, 8); rig.G("Body", mat4).Torus(Xf.Look(new V3(0f, 0.55f, -0.15f), V3.Down, V3.Fwd), 0.78f, 0.022f, 48, 6); return rig; } public static Rig Rabbit() { Rig rig = new Rig("Rabbit"); int mat = Pale(rig); int mat2 = rig.Mat("Eyes", 0.1f, 0.1f, 0.15f, 0.2f, 0.2f, 0.5f); rig.Part("Body", null, V3.Zero); MeshBuilder meshBuilder = rig.G("Body", mat); meshBuilder.Blob(Xf.At(0f, 0.12f, -0.02f), 0.1f, 0.095f, 0.13f, 14); meshBuilder.Blob(Xf.At(0f, 0.22f, 0.11f), 0.065f, 0.065f, 0.07f, 12, 8); meshBuilder.Ball(new V3(0f, 0.13f, -0.15f), 0.035f, 8, 6); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { meshBuilder.Blob(Xf.Rot(new V3(num * 0.025f, 0.34f, 0.08f), -15f, 0f, num * 10f), 0.018f, 0.09f, 0.03f, 10, 6); rig.G("Body", mat2).Blob(Xf.At(num * 0.04f, 0.235f, 0.16f), 0.012f, 0.012f, 0.008f, 6, 4); meshBuilder.Blob(Xf.At(num * 0.06f, 0.04f, -0.05f), 0.035f, 0.04f, 0.07f, 8, 6); } return rig; } } public static class CharacterRigs { private static readonly float[] TorsoY = new float[8] { -0.3f, -0.12f, 0.02f, 0.2f, 0.38f, 0.52f, 0.62f, 0.68f }; private static readonly float[] TorsoDepth = new float[8] { 0.115f, 0.115f, 0.104f, 0.124f, 0.13f, 0.12f, 0.098f, 0.062f }; private static readonly float[] TorsoWidth = new float[8] { 0.165f, 0.172f, 0.152f, 0.188f, 0.212f, 0.222f, 0.17f, 0.072f }; internal const float HS = 1.12f; private static float Interp(float[] ys, float[] vs, float y) { if (y <= ys[0]) { return vs[0]; } for (int i = 1; i < ys.Length; i++) { if (y <= ys[i]) { return vs[i - 1] + (vs[i] - vs[i - 1]) * (y - ys[i - 1]) / (ys[i] - ys[i - 1]); } } return vs[^1]; } internal static float FrontZ(float y, float bulk = 1f) { return Interp(TorsoY, TorsoDepth, y) * bulk; } private static void Torso(MeshBuilder g, float bulk, float taper = 1f, Func mod = null) { List list = new List(); List list2 = new List(); List list3 = new List(); for (int i = 0; i < TorsoY.Length; i++) { float num = ((TorsoY[i] < 0.3f) ? taper : 1f); list.Add(new V3(0f, TorsoY[i], 0f)); list2.Add(TorsoDepth[i] * bulk); list3.Add(TorsoWidth[i] * bulk * ((i < TorsoY.Length - 1) ? num : 1f)); } g.Tube(list, list2, list3, V3.Fwd, 20, 0.5f, 0.3f, mod, closedLoop: false, doubleSided: false, 4f, 4f); } private static void Segment(MeshBuilder g, float len, float r0, float r1, float depthScale = 1f, float bend = 0f, int sides = 12, float cap0 = 0.8f) { List list = new List(); List list2 = new List(); List list3 = new List(); for (int i = 0; i <= 4; i++) { float num = (float)i / 4f; float num2 = r0 + (r1 - r0) * num + (float)Math.Sin((double)num * Math.PI) * (r0 - r1) * 0.25f; list.Add(new V3(0f, 0.02f - (len + 0.02f) * num, bend * (float)Math.Sin((double)num * Math.PI))); list2.Add(num2 * depthScale); list3.Add(num2); } g.Tube(list, list2, list3, V3.Fwd, sides, cap0, 0.8f, null, closedLoop: false, doubleSided: false, 4f, 4f); } private static void Hand(MeshBuilder g, float side, float y0, float size = 1f, bool fist = false) { float num = 0f - side; g.Blob(Xf.At(num * 0.004f * size, y0 - 0.045f * size, 0.004f), 0.021f * size, 0.05f * size, 0.044f * size, 12, 8, 2.6f); for (int i = 0; i < 4; i++) { float z = (0.028f - (float)i * 0.019f) * size; float num2 = i switch { 3 => 0.055f, 1 => 0.075f, _ => 0.068f, } * size; V3 v = new V3(num * 0.003f * size, y0 - 0.088f * size, z); V3 v2 = (fist ? new V3(num * 0.035f * size, 0.03f * size, 0f) : new V3(num * 0.012f * size, 0f, 0.004f * size)); V3 v3 = v + new V3(0f, (0f - num2) * 0.55f, 0f) + v2 * 0.4f; V3 v4 = v + new V3(0f, 0f - num2, 0f) + v2; g.Tube(new V3[3] { v, v3, v4 }, new float[3] { 0.0105f * size, 0.0095f * size, 0.008f * size }, new float[3] { 0.0105f * size, 0.0095f * size, 0.008f * size }, V3.Right, 7, 0.6f); } V3 v5 = new V3(num * 0.008f * size, y0 - 0.03f * size, 0.035f * size); g.Tube(new V3[3] { v5, v5 + new V3(num * 0.01f, -0.025f, 0.018f) * size, v5 + new V3(num * 0.018f, -0.05f, 0.022f) * size }, new float[3] { 0.012f * size, 0.01f * size, 0.0085f * size }, new float[3] { 0.012f * size, 0.01f * size, 0.0085f * size }, V3.Right, 7, 0.6f); } private static V3 HeadPoint(V3 d, float scale) { float x = d.X * 0.098f * ((d.Y < 0f) ? (1f - 0.3f * (float)Math.Pow(0f - d.Y, 1.3)) : 1f); float y = d.Y * ((d.Y < 0f) ? 0.134f : 0.118f); float z = d.Z * 0.108f * ((d.Z > 0f && d.Y < 0f) ? (1f + 0.1f * (0f - d.Y)) : 1f) * ((d.Z < 0f) ? 1.08f : 1f); return new V3(x, y, z) * scale; } internal static V3 OnFace(float x, float y, float lift = 0.003f, float scale = 1.12f) { float num = x / (0.098f * scale); float num2 = y / (((y < 0f) ? 0.134f : 0.118f) * scale); float val = 1f - num * num - num2 * num2; float num3 = (float)Math.Sqrt(Math.Max(0.02f, val)) * 0.108f * scale * ((y < 0f) ? (1f + 0.1f * Math.Min(1f, 0f - num2)) : 1f); return new V3(x, y, num3 + lift); } private static void Skull(MeshBuilder g, float scale = 1.12f) { g.Grid(24, 16, delegate(float u, float v) { double num = (double)(u * 2f) * Math.PI; double num2 = ((double)v - 0.5) * Math.PI; return HeadPoint(new V3((float)(Math.Cos(num2) * Math.Cos(num)), (float)Math.Sin(num2), (float)(Math.Cos(num2) * Math.Sin(num))), scale); }, 2.5f, 1.5f); } private static void Face(Rig r, string head, int skin, int white, int iris, int lips, bool eyes, float scale = 1.12f) { MeshBuilder meshBuilder = r.G(head, skin); Skull(meshBuilder, scale); meshBuilder.Blob(Xf.Rot(new V3(0f, -0.012f, 0.112f) * scale, -12f, 0f, 0f), 0.014f * scale, 0.03f * scale, 0.022f * scale, 10, 8); meshBuilder.Blob(Xf.At(new V3(0f, -0.004f, 0.1f) * scale), 0.024f * scale, 0.008f * scale, 0.01f * scale, 10, 6); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { meshBuilder.Blob(Xf.Rot(new V3(num * 0.097f, -0.005f, -0.004f) * scale, 0f, num * -10f, 0f), 0.012f * scale, 0.031f * scale, 0.022f * scale, 10, 8); meshBuilder.Blob(Xf.At(OnFace(num * 0.036f, 0.037f, -0.004f, scale)), 0.026f * scale, 0.007f * scale, 0.012f * scale, 10, 6); meshBuilder.Blob(Xf.At(OnFace(num * 0.055f, -0.045f, -0.006f, scale)), 0.02f * scale, 0.018f * scale, 0.01f * scale, 8, 6); } r.G(head, lips).Tube(new V3[3] { OnFace(-0.024f, -0.062f, 0f, scale), OnFace(0f, -0.066f, 0.001f, scale), OnFace(0.024f, -0.062f, 0f, scale) }, new float[3] { 0.0035f * scale, 0.004f * scale, 0.0035f * scale }, V3.Up, 6); if (eyes) { array = new float[2] { -1f, 1f }; for (int i = 0; i < array.Length; i++) { V3 v = OnFace(array[i] * 0.037f, 0.017f, -0.006f, scale); r.G(head, white).Blob(Xf.At(v), 0.017f * scale, 0.0095f * scale, 0.008f * scale, 10, 6); r.G(head, iris).Blob(Xf.At(v + new V3(0f, 0f, 0.006f * scale)), 0.0075f * scale, 0.0075f * scale, 0.004f * scale, 8, 6); } } } private static void Neck(MeshBuilder g, float r = 0.052f) { g.Tube(new V3[3] { new V3(0f, -0.22f, -0.005f), new V3(0f, -0.13f, -0.01f), new V3(0f, -0.06f, -0.012f) }, new float[3] { r * 1.1f, r, r * 0.95f }, new float[3] { r * 1.15f, r, r * 0.95f }, V3.Fwd, 12, 0f, 0f); } private static void Hair(MeshBuilder g, int count, float len0, float len1, float radius, V3 bias, float spread, int seed, float minY = -0.15f, int fringe = 0, float scale = 1.12f) { Random random = new Random(seed); g.Blob(Xf.At(new V3(0f, 0.022f, -0.012f) * scale), 0.106f * scale, 0.108f * scale, 0.12f * scale, 20, 12, 2f, (V3 d) => (!(d.Z > 0.35f) || !(d.Y < 0.5f)) ? ((!(d.Y < -0.2f)) ? 1f : 0.95f) : 0.92f); double num = Math.PI * (3.0 - Math.Sqrt(5.0)); for (int num2 = 0; num2 < count; num2++) { float num3 = 1f - ((float)num2 + 0.5f) / (float)count * (1f - minY); float num4 = (float)Math.Sqrt(Math.Max(0f, 1f - num3 * num3)); double num5 = (double)num2 * num; V3 v = new V3((float)Math.Cos(num5) * num4, num3, (float)Math.Sin(num5) * num4); if (!(v.Z > 0.45f) || !(v.Y < 0.55f)) { V3 v2 = HeadPoint(v, scale) + new V3(0f, 0.015f, -0.005f) * scale; V3 norm = (v * spread + bias).Norm; float num6 = (len0 + (float)random.NextDouble() * (len1 - len0)) * scale; V3 to = v2 + norm * num6 + new V3((float)(random.NextDouble() - 0.5), 0f, (float)(random.NextDouble() - 0.5)) * num6 * 0.25f; V3 mid = v2 + (v * 0.6f + norm * 0.4f).Norm * num6 * 0.5f; g.Spike(v2 - v * 0.012f * scale, mid, to, radius * scale * (0.8f + 0.4f * (float)random.NextDouble())); } } for (int num7 = 0; num7 < fringe; num7++) { float num8 = (-0.07f + (float)num7 * 0.14f / (float)Math.Max(1, fringe - 1)) * scale; V3 v3 = new V3(num8, 0.085f * scale, 0.085f * scale); V3 to2 = v3 + new V3(num8 * 0.4f, -0.09f - 0.02f * (float)random.NextDouble(), 0.05f) * scale; g.Spike(v3, v3 + new V3(num8 * 0.2f, -0.02f, 0.045f) * scale, to2, radius * 0.85f * scale); } } private static void Shoe(MeshBuilder upper, MeshBuilder sole, float y, float size = 1f) { upper.Blob(Xf.At(0f, y + 0.012f, 0.045f), 0.055f * size, 0.05f * size, 0.125f * size, 16, 10, 2.6f, (V3 d) => (!(d.Y < 0f)) ? ((!(d.Z < 0f)) ? 0.92f : 1.05f) : 1f); sole.Blob(Xf.At(0f, y - 0.03f, 0.045f), 0.06f * size, 0.016f * size, 0.13f * size, 16, 6, 3.5f); } private static void Skeleton(Rig r, float shoulder, float hipX, float upperArm = 0.32f) { r.Part("Hips", null, new V3(0f, 1f, 0f)); r.Part("Chest", "Hips", new V3(0f, 0.08f, 0f)); r.Part("Head", "Chest", new V3(0f, 0.86f, 0f)); string[] array = new string[2] { "L", "R" }; foreach (string text in array) { float num = ((text == "L") ? (-1f) : 1f); r.Part("Leg " + text, "Hips", new V3(num * hipX, 0f, 0f)); r.Part("Leg " + text + " Lower", "Leg " + text, new V3(0f, -0.5f, 0f)); r.Part("Arm " + text, "Chest", new V3(num * shoulder, 0.55f, 0f)); r.Part("Arm " + text + " Lower", "Arm " + text, new V3(0f, 0f - upperArm, 0f)); } r.Part("Hand Point", "Arm R Lower", new V3(0f, -0.4f, 0f)); } private static void Uniform(Rig r, int jacket, int trousers, int skin, int shoe, int sole, float coatLen, float bulk) { Torso(r.G("Chest", jacket), bulk); r.G("Chest", trousers).Blob(Xf.At(0f, -0.2f, -0.015f), 0.15f * bulk, 0.09f, 0.105f * bulk); r.G("Chest", jacket).Tube(new V3[3] { new V3(0f, -0.02f, 0f), new V3(0f, -0.02f - coatLen * 0.5f, -0.004f), new V3(0f, -0.02f - coatLen, -0.01f) }, new float[3] { 0.115f * bulk, 0.13f * bulk, 0.14f * bulk }, new float[3] { 0.17f * bulk, 0.2f * bulk, 0.218f * bulk }, V3.Fwd, 20, 0f, 0.15f, null, closedLoop: false, doubleSided: false, 4f, 4f); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { r.G("Chest", jacket).Blob(Xf.At(num * 0.245f * bulk, 0.56f, 0f), 0.095f, 0.068f, 0.08f, 14); } string[] array2 = new string[2] { "L", "R" }; foreach (string text in array2) { float side = ((text == "L") ? (-1f) : 1f); Segment(r.G("Leg " + text, trousers), 0.5f, 0.088f, 0.07f, 1.05f, 0f, 12, 0.3f); Segment(r.G("Leg " + text + " Lower", trousers), 0.44f, 0.072f, 0.054f, 1f, -0.004f); Shoe(r.G("Leg " + text + " Lower", shoe), r.G("Leg " + text + " Lower", sole), -0.47f); Segment(r.G("Arm " + text, jacket), 0.32f, 0.064f, 0.053f, 1.05f, 0f, 12, 0.5f); Segment(r.G("Arm " + text + " Lower", jacket), 0.27f, 0.054f, 0.046f); r.G("Arm " + text + " Lower", jacket).Torus(Xf.At(0f, -0.265f, 0f), 0.046f, 0.008f, 16, 6); Hand(r.G("Arm " + text + " Lower", skin), side, -0.275f); } Neck(r.G("Head", skin)); } private static void Collar(MeshBuilder g, float y0, float y1, float r0, float r1) { g.Tube(new V3[3] { new V3(0f, y0, 0f), new V3(0f, (y0 + y1) * 0.5f, 0f), new V3(0f, y1, 0f) }, new float[3] { r0 * 0.95f, (r0 + r1) * 0.48f, r1 * 0.95f }, new float[3] { r0, (r0 + r1) * 0.5f, r1 }, V3.Fwd, 20, 0f, 0f, null, closedLoop: false, doubleSided: true, 4f, 4f); } public static Rig Gojo() { Rig rig = new Rig("Gojo"); int num = rig.Mat("Uniform", 0.05f, 0.06f, 0.1f, 0f, 0f, 0f, "cloth"); int num2 = rig.Mat("Skin", 0.95f, 0.82f, 0.74f, 0f, 0f, 0f, "skin", 0.3f); int mat = rig.Mat("Hair", 0.95f, 0.96f, 1f, 0.18f, 0.22f, 0.3f, "hair", 0.4f); int mat2 = rig.Mat("Blindfold", 0.02f, 0.02f, 0.025f, 0f, 0f, 0f, "cloth"); int shoe = rig.Mat("Shoes", 0.025f, 0.025f, 0.03f, 0f, 0f, 0f, "plain", 0.6f); int sole = rig.Mat("Soles", 0.08f, 0.08f, 0.08f); int mat3 = rig.Mat("Gold", 0.85f, 0.65f, 0.28f, 0.12f, 0.08f, 0.02f, "metal", 0.7f); int lips = rig.Mat("Lips", 0.75f, 0.55f, 0.52f, 0f, 0f, 0f, "skin"); Skeleton(rig, 0.3f, 0.12f); Uniform(rig, num, num, num2, shoe, sole, 0.42f, 1f); Collar(rig.G("Chest", num), 0.6f, 0.78f, 0.088f, 0.094f); rig.G("Chest", mat3).Torus(Xf.Look(new V3(0f, 0.7f, 0.096f), V3.Down, V3.Fwd), 0.017f, 0.004f, 16, 6); rig.G("Chest", mat3).Torus(Xf.Look(new V3(0f, 0.7f, 0.098f), V3.Down, V3.Fwd), 0.008f, 0.003f, 12, 6); Face(rig, "Head", num2, num2, num2, lips, eyes: false); List list = new List(); List list2 = new List(); List list3 = new List(); for (int i = 0; i < 32; i++) { double num3 = (double)i / 32.0 * 2.0 * Math.PI; list.Add(new V3((float)Math.Cos(num3) * 0.104f, 0.02f, (float)Math.Sin(num3) * ((Math.Sin(num3) > 0.0) ? 0.113f : 0.118f)) * 1.12f); list2.Add(0.028f); list3.Add(0.007f); } rig.G("Head", mat2).Tube(list, list2, list3, V3.Up, 6, 0f, 0f, null, closedLoop: true); rig.G("Head", mat2).Blob(Xf.At(0f, 0.022f, -0.134f), 0.024f, 0.022f, 0.015f, 10, 8); Hair(rig.G("Head", mat), 46, 0.12f, 0.2f, 0.024f, new V3(0f, 1.1f, -0.35f), 0.7f, 7, -0.05f, 6); return rig; } public static Rig Megumi() { Rig rig = new Rig("Megumi"); int num = rig.Mat("Uniform", 0.045f, 0.05f, 0.085f, 0f, 0f, 0f, "cloth"); int skin = rig.Mat("Skin", 0.93f, 0.8f, 0.72f, 0f, 0f, 0f, "skin", 0.3f); int mat = rig.Mat("Hair", 0.035f, 0.035f, 0.05f, 0.04f, 0.035f, 0.1f, "hair", 0.45f); int white = rig.Mat("Eye White", 0.92f, 0.92f, 0.9f); int iris = rig.Mat("Iris", 0.08f, 0.26f, 0.3f, 0.02f, 0.06f, 0.07f); int shoe = rig.Mat("Sneakers", 0.07f, 0.08f, 0.12f, 0f, 0f, 0f, "cloth"); int sole = rig.Mat("Soles", 0.88f, 0.88f, 0.86f); int mat2 = rig.Mat("Buttons", 0.8f, 0.64f, 0.3f, 0.08f, 0.06f, 0.02f, "metal", 0.7f); int lips = rig.Mat("Lips", 0.72f, 0.52f, 0.5f, 0f, 0f, 0f, "skin"); Skeleton(rig, 0.29f, 0.12f); Uniform(rig, num, num, skin, shoe, sole, 0.14f, 0.96f); Collar(rig.G("Chest", num), 0.6f, 0.73f, 0.084f, 0.088f); for (int i = 0; i < 4; i++) { float y = 0.52f - (float)i * 0.15f; rig.G("Chest", mat2).Blob(Xf.At(0f, y, FrontZ(y, 0.96f) + 0.004f), 0.013f, 0.013f, 0.006f, 10, 6); } Face(rig, "Head", skin, white, iris, lips, eyes: true); Hair(rig.G("Head", mat), 56, 0.12f, 0.22f, 0.03f, new V3(0f, 0.6f, -0.15f), 1f, 5, -0.25f, 4); return rig; } public static Rig Sukuna() { Rig rig = new Rig("Sukuna"); int num = rig.Mat("Kimono", 0.88f, 0.86f, 0.82f, 0f, 0f, 0f, "silk", 0.35f); int num2 = rig.Mat("Under Kimono", 0.07f, 0.05f, 0.05f, 0f, 0f, 0f, "silk"); int mat = rig.Mat("Obi", 0.06f, 0.05f, 0.05f, 0f, 0f, 0f, "cloth"); int mat2 = rig.Mat("Hakama", 0.8f, 0.78f, 0.74f, 0f, 0f, 0f, "cloth"); int num3 = rig.Mat("Skin", 0.93f, 0.78f, 0.68f, 0f, 0f, 0f, "skin", 0.3f); int mat3 = rig.Mat("Hair", 0.95f, 0.55f, 0.62f, 0.2f, 0.06f, 0.08f, "hair", 0.4f); int mat4 = rig.Mat("Markings", 0.08f, 0.02f, 0.03f); int num4 = rig.Mat("Eyes", 0.9f, 0.05f, 0.05f, 1f, 0.05f, 0.05f); int mat5 = rig.Mat("Sandals", 0.2f, 0.15f, 0.1f, 0f, 0f, 0f, "wood"); int lips = rig.Mat("Lips", 0.55f, 0.3f, 0.3f, 0f, 0f, 0f, "skin"); rig.Part("Hips", null, new V3(0f, 1f, 0f)); rig.Part("Chest", "Hips", new V3(0f, 0.08f, 0f)); rig.Part("Head", "Chest", new V3(0f, 0.86f, 0f)); string[] array = new string[2] { "L", "R" }; foreach (string text in array) { float num5 = ((text == "L") ? (-1f) : 1f); rig.Part("Leg " + text, "Hips", new V3(num5 * 0.13f, 0f, 0f)); rig.Part("Leg " + text + " Lower", "Leg " + text, new V3(0f, -0.5f, 0f)); } for (int j = 0; j < 4; j++) { float num6 = ((j % 2 == 0) ? (-1f) : 1f); bool flag = j < 2; rig.Part("Arm " + j, "Chest", new V3(num6 * 0.31f, flag ? 0.56f : 0.3f, flag ? 0f : (-0.02f))); rig.Part("Arm " + j + " Lower", "Arm " + j, new V3(0f, -0.32f, 0f)); } rig.Part("Hand Point", "Arm 3 Lower", new V3(0f, -0.4f, 0f)); Torso(rig.G("Chest", num), 1.08f); float[] array2 = new float[2] { -1f, 1f }; foreach (float num7 in array2) { rig.G("Chest", num).Blob(Xf.At(num7 * 0.26f, 0.565f, 0f), 0.1f, 0.07f, 0.088f, 14); } rig.G("Chest", num2).Blob(Xf.At(0f, 0.47f, FrontZ(0.47f, 1.08f) - 0.012f), 0.06f, 0.16f, 0.022f, 12); array2 = new float[2] { 1f, -1f }; foreach (float num8 in array2) { List list = new List(); for (int k = 0; k <= 8; k++) { float num9 = (float)k / 8f; float y = 0.68f - 0.66f * num9; float x = num8 * (-0.055f + 0.16f * num9); list.Add(new V3(x, y, FrontZ(y, 1.08f) + 0.006f + ((num8 > 0f) ? 0.004f : 0f))); } List list2 = new List(); List list3 = new List(); foreach (V3 item in list) { _ = item; list2.Add(0.03f); list3.Add(0.007f); } rig.G("Chest", (num8 > 0f) ? num : num2).Tube(list, list2, list3, V3.Right, 6, 0.5f, 0.5f); } List list4 = new List(); List list5 = new List(); List list6 = new List(); for (int l = 0; l < 32; l++) { double num10 = (double)l / 32.0 * 2.0 * Math.PI; list4.Add(new V3((float)Math.Cos(num10) * 0.172f * 1.08f, 0.04f, (float)Math.Sin(num10) * 0.118f * 1.08f)); list5.Add(0.07f); list6.Add(0.014f); } rig.G("Chest", mat).Tube(list4, list5, list6, V3.Up, 6, 0f, 0f, null, closedLoop: true); rig.G("Chest", mat).Blob(Xf.At(0f, 0.05f, -0.135f), 0.08f, 0.05f, 0.035f, 12, 8, 2.6f); rig.G("Chest", num).Tube(new V3[3] { new V3(0f, 0f, 0f), new V3(0f, -0.18f, -0.005f), new V3(0f, -0.34f, -0.01f) }, new float[3] { 0.125f, 0.135f, 0.14f }, new float[3] { 0.18f, 0.195f, 0.205f }, V3.Fwd, 20, 0f, 0.2f, null, closedLoop: false, doubleSided: false, 4f, 4f); Func mod = (int ring, float th) => 1f + 0.05f * (float)Math.Abs(Math.Sin(th * 5f)); array = new string[2] { "L", "R" }; foreach (string text2 in array) { V3[] pts = new V3[3] { new V3(0f, 0.04f, 0f), new V3(0f, -0.25f, 0f), new V3(0f, -0.56f, 0f) }; rig.G("Leg " + text2, mat2).Tube(pts, new float[3] { 0.12f, 0.135f, 0.15f }, new float[3] { 0.12f, 0.135f, 0.15f }, V3.Fwd, 16, 0.4f, 0f, mod, closedLoop: false, doubleSided: false, 4f, 4f); V3[] pts2 = new V3[3] { new V3(0f, 0.04f, 0f), new V3(0f, -0.2f, 0.005f), new V3(0f, -0.42f, 0.01f) }; rig.G("Leg " + text2 + " Lower", mat2).Tube(pts2, new float[3] { 0.15f, 0.17f, 0.19f }, new float[3] { 0.15f, 0.17f, 0.19f }, V3.Fwd, 16, 0f, 0.12f, mod, closedLoop: false, doubleSided: false, 4f, 4f); rig.G("Leg " + text2 + " Lower", num3).Blob(Xf.At(0f, -0.46f, 0.04f), 0.045f, 0.035f, 0.1f, 12, 8, 2.4f); rig.G("Leg " + text2 + " Lower", mat5).Blob(Xf.At(0f, -0.5f, 0.045f), 0.058f, 0.015f, 0.13f, 14, 6, 4f); } for (int num11 = 0; num11 < 4; num11++) { float side = ((num11 % 2 == 0) ? (-1f) : 1f); bool num12 = num11 < 2; string text3 = "Arm " + num11; string part = text3 + " Lower"; if (num12) { Segment(rig.G(text3, num), 0.32f, 0.07f, 0.058f); rig.G(text3, num).Tube(new V3[4] { new V3(0f, 0.03f, 0f), new V3(0f, -0.2f, -0.02f), new V3(0f, -0.42f, -0.06f), new V3(0f, -0.5f, -0.08f) }, new float[4] { 0.09f, 0.15f, 0.19f, 0.2f }, new float[4] { 0.082f, 0.095f, 0.105f, 0.108f }, V3.Fwd, 14, 0.4f, 0f, null, closedLoop: false, doubleSided: true, 4f, 4f); Segment(rig.G(part, num3), 0.27f, 0.05f, 0.04f); } else { Segment(rig.G(text3, num3), 0.32f, 0.062f, 0.05f); Segment(rig.G(part, num3), 0.27f, 0.05f, 0.04f); array2 = new float[2] { -0.1f, -0.18f }; foreach (float y2 in array2) { rig.G(text3, mat4).Torus(Xf.At(0f, y2, 0f), 0.061f, 0.0045f, 16, 5); } array2 = new float[2] { -0.07f, -0.14f }; foreach (float y3 in array2) { rig.G(part, mat4).Torus(Xf.At(0f, y3, 0f), 0.048f, 0.004f, 16, 5); } } Hand(rig.G(part, num3), side, -0.275f, 1.05f); } Neck(rig.G("Head", num3), 0.056f); Face(rig, "Head", num3, num4, num4, lips, eyes: true); array2 = new float[2] { -1f, 1f }; foreach (float num13 in array2) { rig.G("Head", num4).Blob(Xf.At(OnFace(num13 * 0.05f, -0.008f, -0.004f)), 0.013f, 0.0065f, 0.006f, 8, 6); V3[] pts3 = new V3[3] { OnFace(num13 * 0.028f, -0.022f, 0.001f), OnFace(num13 * 0.06f, -0.03f, 0.001f), OnFace(num13 * 0.085f, -0.022f, 0.001f) }; rig.G("Head", mat4).Tube(pts3, new float[3] { 0.0028f, 0.0032f, 0.0022f }, V3.Up, 5); V3[] pts4 = new V3[2] { OnFace(num13 * 0.07f, -0.05f, 0.001f), OnFace(num13 * 0.085f, -0.065f, 0.001f) }; rig.G("Head", mat4).Tube(pts4, new float[2] { 0.003f, 0.002f }, V3.Up, 5); } rig.G("Head", mat4).Tube(new V3[3] { OnFace(-0.035f, 0.07f, 0.001f), OnFace(0f, 0.075f, 0.001f), OnFace(0.035f, 0.07f, 0.001f) }, new float[3] { 0.0025f, 0.0032f, 0.0025f }, V3.Up, 5); Hair(rig.G("Head", mat3), 40, 0.07f, 0.12f, 0.026f, new V3(0f, 0.9f, -0.45f), 0.8f, 13, 0f); return rig; } public static Rig Mahoraga() { Rig rig = new Rig("Mahoraga"); int mat = rig.Mat("Body", 0.84f, 0.81f, 0.78f, 0.08f, 0.08f, 0.09f, "skin", 0.35f); int mat2 = rig.Mat("Cloth", 0.09f, 0.08f, 0.09f, 0f, 0f, 0f, "cloth"); int mat3 = rig.Mat("Gold", 0.86f, 0.68f, 0.3f, 0.25f, 0.18f, 0.04f, "metal", 0.75f); int mat4 = rig.Mat("Blade", 0.86f, 0.89f, 0.93f, 0.22f, 0.24f, 0.3f, "metal", 0.85f); int mat5 = rig.Mat("Wings", 0.9f, 0.88f, 0.85f, 0.08f, 0.08f, 0.08f, "feather"); rig.Part("Hips", null, new V3(0f, 1f, 0f)); rig.Part("Chest", "Hips", new V3(0f, 0.08f, 0f)); rig.Part("Head", "Chest", new V3(0f, 0.86f, 0f)); rig.Part("Wheel", "Head", new V3(0f, 0.26f, -0.01f), -6f); string[] array = new string[2] { "L", "R" }; foreach (string text in array) { float num = ((text == "L") ? (-1f) : 1f); rig.Part("Leg " + text, "Hips", new V3(num * 0.16f, 0f, 0f)); rig.Part("Leg " + text + " Lower", "Leg " + text, new V3(0f, -0.5f, 0f)); rig.Part("Arm " + text, "Chest", new V3(num * 0.42f, 0.56f, 0f)); rig.Part("Arm " + text + " Lower", "Arm " + text, new V3(0f, -0.36f, 0f)); } rig.Part("Sword of Extermination", "Arm R Lower", new V3(0.04f, -0.3f, 0f)); MeshBuilder meshBuilder = rig.G("Chest", mat); Torso(meshBuilder, 1.32f, 0.78f); float[] array2 = new float[2] { -1f, 1f }; foreach (float num2 in array2) { meshBuilder.Blob(Xf.At(num2 * 0.36f, 0.56f, 0f), 0.12f, 0.11f, 0.11f, 14); meshBuilder.Blob(Xf.Rot(new V3(num2 * 0.1f, 0.45f, FrontZ(0.45f, 1.32f) - 0.03f), 0f, 0f, num2 * -8f), 0.12f, 0.065f, 0.04f, 14, 10, 2.6f); meshBuilder.Blob(Xf.At(num2 * 0.15f, 0.69f, -0.02f), 0.1f, 0.05f, 0.07f, 12, 8); for (int j = 0; j < 3; j++) { meshBuilder.Blob(Xf.At(num2 * 0.042f, 0.25f - (float)j * 0.095f, FrontZ(0.25f - (float)j * 0.095f, 1.32f) * 0.95f - 0.012f), 0.042f, 0.042f, 0.016f, 10, 8, 2.8f); } } List list = new List(); List list2 = new List(); List list3 = new List(); for (int k = 0; k < 32; k++) { double num3 = (double)k / 32.0 * 2.0 * Math.PI; list.Add(new V3((float)Math.Cos(num3) * 0.185f, -0.07f, (float)Math.Sin(num3) * 0.15f)); list2.Add(0.03f); list3.Add(0.012f); } rig.G("Chest", mat3).Tube(list, list2, list3, V3.Up, 6, 0f, 0f, null, closedLoop: true); rig.G("Chest", mat2).Blob(Xf.At(0f, -0.2f, -0.005f), 0.21f, 0.14f, 0.155f); array2 = new float[2] { 1f, -1f }; foreach (float z in array2) { rig.G("Chest", mat2).Panel(6, 6, (float u, float num10) => new V3(-0.12f + 0.24f * u, -0.08f - 0.42f * num10, z * (0.15f + 0.03f * num10)), 1f, 2f, new V3(0f, 0f, 0f - z), 0.012f); } Neck(rig.G("Head", mat), 0.075f); MeshBuilder meshBuilder2 = rig.G("Head", mat); meshBuilder2.Blob(Xf.At(0f, 0f, 0f), 0.1f, 0.12f, 0.11f, 20, 14, 2f, (V3 d) => (!(d.Y < 0f)) ? 1f : (1f - 0.15f * (0f - d.Y))); meshBuilder2.Blob(Xf.At(0f, -0.08f, 0.05f), 0.06f, 0.04f, 0.06f, 12, 8); array2 = new float[2] { -1f, 1f }; foreach (float num4 in array2) { for (int num5 = 0; num5 < 5; num5++) { V3 v = new V3(num4 * (0.03f + (float)num5 * 0.02f), 0.025f + (float)num5 * 0.022f, 0.1f - (float)num5 * 0.025f); rig.G("Head", mat5).Blob(Xf.Rot(v + new V3(num4 * 0.07f, 0.01f, -0.04f), -20f - (float)num5 * 6f, num4 * (35f + (float)num5 * 8f), num4 * (20f + (float)num5 * 10f)), 0.09f - (float)num5 * 0.008f, 0.006f, 0.03f, 12, 4, 2.2f); } } MeshBuilder meshBuilder3 = rig.G("Wheel", mat3); meshBuilder3.Torus(Xf.At(V3.Zero), 0.18900001f, 0.0168f, 48, 10, 0.021f); meshBuilder3.Torus(Xf.At(0f, 0.0084f, 0f), 0.042f, 0.0098f, 20, 6); for (int num6 = 0; num6 < 8; num6++) { double num7 = ((double)num6 + 0.5) / 8.0 * 2.0 * Math.PI; V3 v2 = new V3((float)Math.Cos(num7), 0f, (float)Math.Sin(num7)); meshBuilder3.Tube(new V3[3] { (v2 * 0.065f + V3.Up * 0.012f) * 0.7f, (v2 * 0.15f + V3.Up * 0.006f) * 0.7f, v2 * 0.26f * 0.7f }, new float[3] { 0.0062999995f, 0.0056000003f, 0.0062999995f }, V3.Up, 6, 0.4f, 0.4f); V3 v3 = v2 * 0.27f * 0.7f; V3 v4 = v2 * 0.35f * 0.7f; meshBuilder3.Tube(new V3[3] { v3, V3.Lerp(v3, v4, 0.5f), v4 }, new float[3] { 0.0098f, 0.0077f, 0.0084f }, V3.Up, 8, 0f, 0f); meshBuilder3.Blob(Xf.Look(V3.Lerp(v3, v4, 0.55f), v2, V3.Up), 0.0139999995f, 0.0139999995f, 0.0056000003f, 10, 6); meshBuilder3.Blob(Xf.At(v4 + v2 * 0.02f * 0.7f), 0.0196f, 0.0196f, 0.0196f, 12, 8); } array = new string[2] { "L", "R" }; foreach (string text2 in array) { float side = ((text2 == "L") ? (-1f) : 1f); Segment(rig.G("Arm " + text2, mat), 0.36f, 0.095f, 0.075f, 1f, 0f, 12, 0.5f); rig.G("Arm " + text2, mat).Blob(Xf.At(0f, -0.15f, 0.04f), 0.07f, 0.11f, 0.06f, 12, 8); Segment(rig.G("Arm " + text2 + " Lower", mat), 0.3f, 0.075f, 0.055f); Hand(rig.G("Arm " + text2 + " Lower", mat), side, -0.3f, 1.4f, fist: true); Segment(rig.G("Leg " + text2, mat), 0.5f, 0.12f, 0.09f, 1.1f, 0f, 12, 0.3f); Segment(rig.G("Leg " + text2 + " Lower", mat), 0.44f, 0.09f, 0.06f, 1.05f, -0.01f); rig.G("Leg " + text2 + " Lower", mat).Blob(Xf.At(0f, -0.15f, -0.035f), 0.07f, 0.12f, 0.06f, 12, 8); rig.G("Leg " + text2 + " Lower", mat).Blob(Xf.At(0f, -0.47f, 0.05f), 0.06f, 0.04f, 0.13f, 14, 8, 2.4f); } rig.G("Sword of Extermination", mat3).Blob(Xf.At(0f, 0.06f, 0f), 0.06f, 0.05f, 0.08f, 12, 8, 3f); List list4 = new List(); List list5 = new List(); List list6 = new List(); for (int num8 = 0; num8 <= 6; num8++) { float num9 = (float)num8 / 6f; list4.Add(new V3(0f, -0.95f * num9, 0.012f * (float)Math.Sin((double)num9 * Math.PI))); list5.Add(0.06f * (1f - 0.75f * num9 * num9) + 0.004f); list6.Add(0.012f * (1f - 0.6f * num9) + 0.002f); } rig.G("Sword of Extermination", mat4).Tube(list4, list5, list6, V3.Fwd, 8, 0.2f); return rig; } } public sealed class ModelMeshData { public float[] Positions; public float[] Normals; public float[] Uvs; public int[] Triangles; public int VertexCount => Positions.Length / 3; } public static class FingerModel { public const float Length = 0.3f; public const float Radius = 0.032f; public const int Rings = 128; public const int Sides = 40; public const int TexSize = 256; private const float TubeV0 = 0.25f; private const float StumpU = 0.125f; private const float StumpV = 0.125f; private const float StumpR = 0.11f; private const float TwoPi = MathF.PI * 2f; public static ModelMeshData BuildMesh() { List list = new List(); List list2 = new List(); List list3 = new List(); for (int i = 0; i <= 128; i++) { float num = (float)i / 128f; for (int j = 0; j <= 40; j++) { float num2 = (float)j / 40f; Surface(num, num2, out var x, out var y, out var z); list.Add(x); list.Add(y); list.Add(z); list2.Add(num2); list2.Add(0.25f + 0.75f * num); } } int num3 = 41; for (int k = 0; k < 128; k++) { for (int l = 0; l < 40; l++) { int num4 = k * num3 + l; int item = num4 + 1; int num5 = num4 + num3; int item2 = num5 + 1; list3.Add(num4); list3.Add(item); list3.Add(num5); list3.Add(item); list3.Add(item2); list3.Add(num5); } } int num6 = list.Count / 3; list.Add(0f); list.Add(-0.002f); list.Add(-0.14600001f); list2.Add(0.125f); list2.Add(0.125f); for (int m = 0; m <= 40; m++) { float num7 = (float)m / 40f; Surface(0f, num7, out var x2, out var y2, out var z2); float num8 = num7 * (MathF.PI * 2f); float num9 = 0.0025f * (float)Math.Sin(num8 * 7f + 0.7f) + 0.0015f * (float)Math.Sin(num8 * 13f); list.Add(x2); list.Add(y2); list.Add(z2 + num9); list2.Add(0.125f + 0.11f * (float)Math.Cos(num8)); list2.Add(0.125f + 0.11f * (float)Math.Sin(num8)); } for (int n = 0; n < 40; n++) { list3.Add(num6); list3.Add(num6 + 2 + n); list3.Add(num6 + 1 + n); } ModelMeshData modelMeshData = new ModelMeshData { Positions = list.ToArray(), Uvs = list2.ToArray(), Triangles = list3.ToArray() }; modelMeshData.Normals = ComputeNormals(modelMeshData.Positions, modelMeshData.Triangles); for (int num10 = 0; num10 <= 128; num10++) { int num11 = num10 * num3; int num12 = num11 + 40; for (int num13 = 0; num13 < 3; num13++) { float num14 = 0.5f * (modelMeshData.Normals[num11 * 3 + num13] + modelMeshData.Normals[num12 * 3 + num13]); modelMeshData.Normals[num11 * 3 + num13] = num14; modelMeshData.Normals[num12 * 3 + num13] = num14; } } for (int num15 = 0; num15 <= 40; num15++) { int num16 = 128 * num3 + num15; modelMeshData.Normals[num16 * 3] = 0f; modelMeshData.Normals[num16 * 3 + 1] = 0.25f; modelMeshData.Normals[num16 * 3 + 2] = 0.97f; } for (int num17 = num6; num17 < modelMeshData.VertexCount; num17++) { modelMeshData.Normals[num17 * 3] = 0f; modelMeshData.Normals[num17 * 3 + 1] = 0f; modelMeshData.Normals[num17 * 3 + 2] = -1f; } Normalize(modelMeshData.Normals); return modelMeshData; } private static void Surface(float s, float u, out float x, out float y, out float z) { float num = u * (MathF.PI * 2f); float num2 = 0.032f * Profile(s) * Lumps(s, num) * Wrinkles(s, num); float num3 = NailMask(s, num); num2 += 0.00224f * num3; float num4 = (float)Math.Cos(num); float num5 = (float)Math.Sin(num); float num6 = ((num5 > 0f) ? (0.9f - 0.1f * num3) : 0.8f); float num7 = Bump(s, 0.34f, 0.06f) + Bump(s, 0.66f, 0.05f); if (num5 > 0f) { num6 += 0.12f * num7 * num5; } x = num2 * num4; y = num2 * num5 * num6; x += 0.006f * (float)Math.Sin((double)s * Math.PI * 1.3); y += -0.036000002f * s * s; z = -0.15f + s * 0.3f; } private static float Profile(float s) { float num = 1f - 0.22f * s; num += 0.17f * Bump(s, 0.34f, 0.065f); num += 0.13f * Bump(s, 0.66f, 0.055f); num -= 0.09f * Bump(s, 0.5f, 0.07f); num -= 0.08f * Bump(s, 0.18f, 0.08f); num -= 0.05f * Bump(s, 0.81f, 0.05f); num += 0.07f * Bump(s, 0f, 0.05f); if (s > 0.9f) { float num2 = (s - 0.9f) / 0.1f; num *= (float)Math.Sqrt(Math.Max(0f, 1f - num2 * num2)); } return num; } private static float Wrinkles(float s, float theta) { float num = Bump(s, 0.34f, 0.06f) + 0.8f * Bump(s, 0.66f, 0.05f); float num2 = (float)Math.Pow(Math.Abs(Math.Sin(((double)(s * 44f) + 0.25 * Math.Sin(theta * 3f)) * Math.PI)), 3.0); return 1f - (0.012f + 0.035f * num) * num2; } private static float Lumps(float s, float theta) { float num = 0.5f * (float)Math.Sin(theta * 3f + s * 17f + 1.3f) + 0.3f * (float)Math.Sin(theta * 5f - s * 29f + 0.4f) + 0.2f * (float)Math.Sin(theta * 2f + s * 41f + 2.1f); return 1f + 0.035f * num; } private static float NailMask(float s, float theta) { float num = Math.Abs(AngleDiff(theta, MathF.PI / 2f)); float num2 = Smooth(1f - num / 0.9f); float num3 = Smooth((s - 0.71f) / 0.04f) * Smooth((0.975f - s) / 0.03f); return num2 * num3; } public static byte[] BuildTexture() { int num = 256; byte[] array = new byte[num * num * 4]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = ((float)j + 0.5f) / (float)num; float num3 = ((float)i + 0.5f) / (float)num; float r; float g; float b; if (num3 >= 0.25f) { SkinColor((num3 - 0.25f) / 0.75f, num2, out r, out g, out b); } else if (num2 < 0.25f) { float num4 = (num2 - 0.125f) / 0.11f; float num5 = (num3 - 0.125f) / 0.11f; StumpColor((float)Math.Sqrt(num4 * num4 + num5 * num5), (float)Math.Atan2(num5, num4), out r, out g, out b); } else { r = 0.3f; g = 0.19f; b = 0.16f; } int num6 = (i * num + j) * 4; array[num6] = ToByte(r); array[num6 + 1] = ToByte(g); array[num6 + 2] = ToByte(b); array[num6 + 3] = byte.MaxValue; } } return array; } private static void SkinColor(float s, float u, out float r, out float g, out float b) { float num = u * (MathF.PI * 2f); float num2 = (float)Math.Sin(num); float num3 = Fbm(u * 8f, s * 12f, 8); r = Lerp(0.1f, 0.4f, 0.2f + 0.6f * num3); g = Lerp(0.07f, 0.29f, 0.2f + 0.6f * num3); b = Lerp(0.07f, 0.25f, 0.2f + 0.6f * num3); float t = Smooth((Fbm(u * 4f + 11f, s * 6f, 4) - 0.45f) * 4f) * 0.55f; r = Lerp(r, 0.24f, t); g = Lerp(g, 0.09f, t); b = Lerp(b, 0.17f, t); float t2 = Smooth((Fbm(u * 6f + 3f, s * 9f + 5f, 6) - 0.6f) * 5f) * 0.35f; r = Lerp(r, 0.46f, t2); g = Lerp(g, 0.38f, t2); b = Lerp(b, 0.33f, t2); float num4 = 0.5f + 0.5f * num2; float num5 = Bump(s, 0.34f, 0.06f) + Bump(s, 0.66f, 0.05f); float num6 = 0.35f * (float)Math.Sin(num * 3f) + 0.6f * Fbm(u * 10f, s * 4f, 10); float num7 = (float)Math.Pow(Math.Abs(Math.Sin((double)(s * 44f + num6 * 0.5f) * Math.PI)), 8.0); float num8 = (float)Math.Pow(Math.Abs(Math.Sin((double)(s * 110f + num6) * Math.PI)), 6.0); float num9 = 1f - 0.25f * num7 - 0.55f * num5 * num8 * (0.4f + 0.6f * num4); float num10 = Math.Max(0f, 0f - num2); float val = Bump(s, 0.3f, 0.008f) + Bump(s, 0.37f, 0.006f) + Bump(s, 0.63f, 0.007f); num9 *= 1f - 0.7f * Math.Min(1f, val) * num10; float n = Fbm(u * 26f + 7f, s * 26f, 26); num9 *= 1f - 0.45f * Ridge(n, 0.5f, 0.018f); num9 *= 1f - 0.4f * Bump(s, 0f, 0.07f) - 0.2f * Bump(s, 1f, 0.05f); num9 *= 1f + 0.18f * num5 * num4; r *= num9; g *= num9; b *= num9; float num11 = NailMask(s, num); if (num11 > 0.01f) { float num12 = 0.93f + 0.07f * (float)Math.Sin(u * (MathF.PI * 2f) * 38f + Fbm(u * 30f, s * 2f, 30) * 3f); float num13 = 0.55f + 0.45f * Fbm(u * 16f + 2f, s * 16f, 16); float num14 = 1f - 0.45f * Smooth((s - 0.88f) / 0.08f); float b2 = 0.44f * num12 * num13 * num14; float b3 = 0.36f * num12 * num13 * num14; float b4 = 0.27f * num12 * num13 * num14; float t3 = Smooth((num11 - 0.2f) / 0.35f); float num15 = Bump(num11, 0.22f, 0.1f) * 0.7f; float num16 = Bump(s, 0.725f, 0.012f) * Smooth((num11 - 0.05f) / 0.3f) * 0.6f; r = Lerp(r, b2, t3) * (1f - num15) * (1f - num16); g = Lerp(g, b3, t3) * (1f - num15) * (1f - num16); b = Lerp(b, b4, t3) * (1f - num15) * (1f - num16); } } private static void StumpColor(float d, float ang, out float r, out float g, out float b) { float num = 0.06f * (float)Math.Sin(ang * 7f + 0.7f) + 0.04f * (float)Math.Sin(ang * 13f); float num2 = Fbm(d * 6f + 3f, ang * 2f, 12); if (d < 0.13f + 0.02f * num2) { r = 0.33f; g = 0.11f; b = 0.09f; } else if (d < 0.34f + 0.03f * num2) { float num3 = 0.85f + 0.15f * num2; r = 0.8f * num3; g = 0.74f * num3; b = 0.62f * num3; } else if (d < 0.86f + num) { float num4 = 0.6f + 0.6f * num2; r = 0.32f * num4; g = 0.05f * num4; b = 0.06f * num4; } else { SkinColor(0.02f, (ang / (MathF.PI * 2f) + 1f) % 1f, out r, out g, out b); } } public static float[] ComputeNormals(float[] p, int[] tris) { float[] array = new float[p.Length]; for (int i = 0; i < tris.Length; i += 3) { int num = tris[i] * 3; int num2 = tris[i + 1] * 3; int num3 = tris[i + 2] * 3; float num4 = p[num2] - p[num]; float num5 = p[num2 + 1] - p[num + 1]; float num6 = p[num2 + 2] - p[num + 2]; float num7 = p[num3] - p[num]; float num8 = p[num3 + 1] - p[num + 1]; float num9 = p[num3 + 2] - p[num + 2]; float num10 = num5 * num9 - num6 * num8; float num11 = num6 * num7 - num4 * num9; float num12 = num4 * num8 - num5 * num7; int[] array2 = new int[3] { num, num2, num3 }; foreach (int num13 in array2) { array[num13] += num10; array[num13 + 1] += num11; array[num13 + 2] += num12; } } Normalize(array); return array; } private static void Normalize(float[] n) { for (int i = 0; i < n.Length; i += 3) { float num = (float)Math.Sqrt(n[i] * n[i] + n[i + 1] * n[i + 1] + n[i + 2] * n[i + 2]); if (num < 1E-08f) { n[i + 2] = 1f; continue; } n[i] /= num; n[i + 1] /= num; n[i + 2] /= num; } } private static float Bump(float t, float c, float w) { float num = (t - c) / w; return (float)Math.Exp((0f - num) * num); } private static float Smooth(float t) { t = Math.Max(0f, Math.Min(1f, t)); return t * t * (3f - 2f * t); } private static float Ridge(float n, float c, float w) { return Bump(n, c, w); } private static float Lerp(float a, float b, float t) { return a + (b - a) * t; } private static float AngleDiff(float a, float b) { float num = (a - b) % (MathF.PI * 2f); if ((double)num > Math.PI) { num -= MathF.PI * 2f; } if ((double)num < -Math.PI) { num += MathF.PI * 2f; } return num; } private static byte ToByte(float v) { return (byte)Math.Max(0, Math.Min(255, (int)(v * 255f + 0.5f))); } private static float Fbm(float x, float y, int period) { float num = 0f; float num2 = 0.5f; float num3 = 0f; int num4 = period; for (int i = 0; i < 4; i++) { num += num2 * ValueNoise(x, y, num4); num3 += num2; x *= 2f; y *= 2f; num4 *= 2; num2 *= 0.5f; } return num / num3; } private static float ValueNoise(float x, float y, int period) { int num = (int)Math.Floor(x); int num2 = (int)Math.Floor(y); float num3 = x - (float)num; float num4 = y - (float)num2; num3 = num3 * num3 * (3f - 2f * num3); num4 = num4 * num4 * (3f - 2f * num4); float a = Hash(Mod(num, period), num2); float b = Hash(Mod(num + 1, period), num2); float a2 = Hash(Mod(num, period), num2 + 1); return Lerp(b: Lerp(a2, Hash(Mod(num + 1, period), num2 + 1), num3), a: Lerp(a, b, num3), t: num4); } private static int Mod(int a, int m) { return (a % m + m) % m; } private static float Hash(int x, int y) { int num = x * 374761393 + y * 668265263; int num2 = (num ^ (num >>> 13)) * 1274126177; return (float)(uint)((num2 ^ (num2 >>> 16)) & 0xFFFFFF) / 16777215f; } } public struct V3 { public float X; public float Y; public float Z; public static readonly V3 Zero = new V3(0f, 0f, 0f); public static readonly V3 Up = new V3(0f, 1f, 0f); public static readonly V3 Down = new V3(0f, -1f, 0f); public static readonly V3 Fwd = new V3(0f, 0f, 1f); public static readonly V3 Back = new V3(0f, 0f, -1f); public static readonly V3 Right = new V3(1f, 0f, 0f); public float Len => (float)Math.Sqrt(X * X + Y * Y + Z * Z); public V3 Norm { get { float len = Len; if (!(len > 1E-09f)) { return Up; } return this / len; } } public V3(float x, float y, float z) { X = x; Y = y; Z = z; } public static V3 operator +(V3 a, V3 b) { return new V3(a.X + b.X, a.Y + b.Y, a.Z + b.Z); } public static V3 operator -(V3 a, V3 b) { return new V3(a.X - b.X, a.Y - b.Y, a.Z - b.Z); } public static V3 operator -(V3 a) { return new V3(0f - a.X, 0f - a.Y, 0f - a.Z); } public static V3 operator *(V3 a, float k) { return new V3(a.X * k, a.Y * k, a.Z * k); } public static V3 operator *(float k, V3 a) { return new V3(a.X * k, a.Y * k, a.Z * k); } public static V3 operator /(V3 a, float k) { return new V3(a.X / k, a.Y / k, a.Z / k); } public static float Dot(V3 a, V3 b) { return a.X * b.X + a.Y * b.Y + a.Z * b.Z; } public static V3 Cross(V3 a, V3 b) { return new V3(a.Y * b.Z - a.Z * b.Y, a.Z * b.X - a.X * b.Z, a.X * b.Y - a.Y * b.X); } public static V3 Lerp(V3 a, V3 b, float t) { return a + (b - a) * t; } public static V3 Euler(V3 v, float ex, float ey, float ez) { float num = Cos(ez); float num2 = Sin(ez); float num3 = Cos(ex); float num4 = Sin(ex); float num5 = Cos(ey); float num6 = Sin(ey); V3 v2 = new V3(v.X * num - v.Y * num2, v.X * num2 + v.Y * num, v.Z); V3 v3 = new V3(v2.X, v2.Y * num3 - v2.Z * num4, v2.Y * num4 + v2.Z * num3); return new V3(v3.X * num5 + v3.Z * num6, v3.Y, (0f - v3.X) * num6 + v3.Z * num5); } public static V3 AxisAngle(V3 v, V3 axis, float deg) { float num = Cos(deg); float num2 = Sin(deg); return v * num + Cross(axis, v) * num2 + axis * (Dot(axis, v) * (1f - num)); } private static float Cos(float d) { return (float)Math.Cos((double)d * Math.PI / 180.0); } private static float Sin(float d) { return (float)Math.Sin((double)d * Math.PI / 180.0); } } public struct Xf { public V3 O; public V3 X; public V3 Y; public V3 Z; public V3 P(V3 p) { return O + X * p.X + Y * p.Y + Z * p.Z; } public V3 P(float x, float y, float z) { return O + X * x + Y * y + Z * z; } public V3 D(V3 d) { return X * d.X + Y * d.Y + Z * d.Z; } public static Xf At(V3 o) { return new Xf { O = o, X = V3.Right, Y = V3.Up, Z = V3.Fwd }; } public static Xf At(float x, float y, float z) { return At(new V3(x, y, z)); } public static Xf Rot(V3 o, float ex, float ey, float ez) { return new Xf { O = o, X = V3.Euler(V3.Right, ex, ey, ez), Y = V3.Euler(V3.Up, ex, ey, ez), Z = V3.Euler(V3.Fwd, ex, ey, ez) }; } public static Xf Look(V3 o, V3 fwd, V3 up) { V3 norm = fwd.Norm; V3 v = V3.Cross(up, norm); if (v.Len < 1E-05f) { v = V3.Cross(V3.Right, norm); } v = v.Norm; return new Xf { O = o, X = v, Y = V3.Cross(norm, v), Z = norm }; } } public sealed class MeshBuilder { private readonly List pos = new List(); private readonly List uv = new List(); private readonly List tris = new List(); public int Count => pos.Count / 3; public bool Empty => tris.Count == 0; public int Vertex(float x, float y, float z, float u, float v) { pos.Add(x); pos.Add(y); pos.Add(z); uv.Add(u); uv.Add(v); return Count - 1; } public int Vertex(V3 p, float u, float v) { return Vertex(p.X, p.Y, p.Z, u, v); } public void Tri(int a, int b, int c) { tris.Add(a); tris.Add(b); tris.Add(c); } public void Sheet(int cols, int rows, Func point, float u0, float u1, float v0, float v1) { for (int i = 0; i < 2; i++) { int count = Count; for (int j = 0; j <= rows; j++) { for (int k = 0; k <= cols; k++) { float num = (float)k / (float)cols; float num2 = (float)j / (float)rows; float[] array = point(num, num2); Vertex(array[0], array[1], array[2], u0 + (u1 - u0) * num, v0 + (v1 - v0) * num2); } } for (int l = 0; l < rows; l++) { for (int m = 0; m < cols; m++) { int num3 = count + l * (cols + 1) + m; int num4 = num3 + 1; int num5 = num3 + cols + 1; int num6 = num5 + 1; if (i == 0) { Tri(num3, num5, num4); Tri(num4, num5, num6); } else { Tri(num3, num4, num5); Tri(num4, num6, num5); } } } } } public void Grid(int cols, int rows, Func p, float uLen, float vLen, bool flip = false) { int count = Count; for (int i = 0; i <= rows; i++) { for (int j = 0; j <= cols; j++) { float num = (float)j / (float)cols; float num2 = (float)i / (float)rows; Vertex(p(num, num2), num * uLen, num2 * vLen); } } Quads(count, cols, rows, flip); } private void Quads(int start, int cols, int rows, bool flip) { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { int num = start + i * (cols + 1) + j; int num2 = num + 1; int num3 = num + cols + 1; int num4 = num3 + 1; if (!flip) { Tri(num, num3, num4); Tri(num, num4, num2); } else { Tri(num, num4, num3); Tri(num, num2, num4); } } } } public void Panel(int cols, int rows, Func p, float uLen, float vLen, V3 back, float thick) { Grid(cols, rows, p, uLen, vLen); Grid(cols, rows, (float a, float b) => p(a, b) + back * thick, uLen, vLen, flip: true); } public void Tube(IList pts, IList ra, IList rb, V3 upHint, int sides, float startCap = 1f, float endCap = 1f, Func mod = null, bool closedLoop = false, bool doubleSided = false, float uTiles = 1f, float vTiles = 1f) { int count = pts.Count; if (count < 2) { return; } V3[] array = new V3[count]; for (int i = 0; i < count; i++) { V3 v = (closedLoop ? pts[(i - 1 + count) % count] : pts[Math.Max(0, i - 1)]); V3 v2 = (closedLoop ? pts[(i + 1) % count] : pts[Math.Min(count - 1, i + 1)]); array[i] = (v2 - v).Norm; } V3[] array2 = new V3[count]; V3 v3 = upHint - array[0] * V3.Dot(upHint, array[0]); if (v3.Len < 0.0001f) { v3 = V3.Cross(array[0], V3.Right); if (v3.Len < 0.0001f) { v3 = V3.Cross(array[0], V3.Fwd); } } array2[0] = v3.Norm; for (int j = 1; j < count; j++) { V3 v4 = array2[j - 1] - array[j] * V3.Dot(array2[j - 1], array[j]); array2[j] = ((v4.Len < 1E-05f) ? array2[j - 1] : v4.Norm); } List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); if (!closedLoop && startCap > 0f) { for (int num = 4; num >= 1; num--) { double num2 = (double)num / 4.0 * Math.PI / 2.0; float num3 = (float)Math.Cos(num2); float num4 = (float)Math.Sin(num2) * Math.Min(ra[0], rb[0]) * startCap; list.Add(pts[0] - array[0] * num4); list2.Add(array[0]); list3.Add(array2[0]); list4.Add(ra[0] * num3); list5.Add(rb[0] * num3); list6.Add(0); } } for (int k = 0; k < count; k++) { list.Add(pts[k]); list2.Add(array[k]); list3.Add(array2[k]); list4.Add(ra[k]); list5.Add(rb[k]); list6.Add(k); } if (closedLoop) { list.Add(pts[0]); list2.Add(array[0]); list3.Add(array2[count - 1]); list4.Add(ra[0]); list5.Add(rb[0]); list6.Add(0); } if (!closedLoop && endCap > 0f) { for (int l = 1; l <= 4; l++) { double num5 = (double)l / 4.0 * Math.PI / 2.0; float num6 = (float)Math.Cos(num5); float num7 = (float)Math.Sin(num5) * Math.Min(ra[count - 1], rb[count - 1]) * endCap; list.Add(pts[count - 1] + array[count - 1] * num7); list2.Add(array[count - 1]); list3.Add(array2[count - 1]); list4.Add(ra[count - 1] * num6); list5.Add(rb[count - 1] * num6); list6.Add(count - 1); } } for (int m = 0; m < ((!doubleSided) ? 1 : 2); m++) { float num8 = ((m == 0) ? 1f : 0.93f); int count2 = Count; float num9 = 0f; for (int n = 0; n < list.Count; n++) { if (n > 0) { num9 += (list[n] - list[n - 1]).Len; } V3 v5 = V3.Cross(list3[n], list2[n]); float val = (float)(Math.PI * (double)(list4[n] + list5[n])); for (int num10 = 0; num10 <= sides; num10++) { float num11 = (float)num10 / (float)sides * (MathF.PI * 2f); float num12 = mod?.Invoke(list6[n], num11) ?? 1f; V3 p = list[n] + (list3[n] * ((float)Math.Cos(num11) * list4[n]) + v5 * ((float)Math.Sin(num11) * list5[n])) * (num12 * num8); Vertex(p, (float)num10 / (float)sides * Math.Max(0.05f, val) * uTiles, num9 * vTiles); } } Quads(count2, sides, list.Count - 1, m == 1); } } public void Tube(IList pts, IList r, V3 upHint, int sides, float startCap = 1f, float endCap = 1f, Func mod = null, float uTiles = 1f, float vTiles = 1f) { Tube(pts, r, r, upHint, sides, startCap, endCap, mod, closedLoop: false, doubleSided: false, uTiles, vTiles); } public void Spike(V3 from, V3 mid, V3 to, float r, int sides = 6, int rings = 6, float tip = 0.08f) { List list = new List(); List list2 = new List(); for (int i = 0; i <= rings; i++) { float num = (float)i / (float)rings; V3 a = V3.Lerp(from, mid, num); V3 b = V3.Lerp(mid, to, num); list.Add(V3.Lerp(a, b, num)); list2.Add(r * Math.Max(tip, 1f - num * num * 0.4f - num * 0.6f)); } V3 upHint = ((Math.Abs((to - from).Norm.Y) > 0.9f) ? V3.Fwd : V3.Up); Tube(list, list2, list2, upHint, sides, 0.6f, 0.4f); } public void Blob(Xf xf, float rx, float ry, float rz, int lon = 16, int lat = 10, float power = 2f, Func mod = null, float uTiles = 1f, float vTiles = 1f) { float e = 2f / power; float num = (float)(Math.PI * (double)(rx + rz)); Grid(lon, lat, delegate(float u, float v) { double num2 = (double)(u * 2f) * Math.PI; double num3 = ((double)v - 0.5) * Math.PI; V3 arg = new V3((float)(Math.Cos(num3) * Math.Cos(num2)), (float)Math.Sin(num3), (float)(Math.Cos(num3) * Math.Sin(num2))); float num4 = ((mod != null) ? mod(arg) : 1f); V3 p = new V3(Pow(arg.X, e) * rx, Pow(arg.Y, e) * ry, Pow(arg.Z, e) * rz) * num4; return xf.P(p); }, num * uTiles, (float)(Math.PI * (double)ry) * vTiles); } public void Ball(V3 c, float r, int lon = 12, int lat = 8) { Blob(Xf.At(c), r, r, r, lon, lat); } public void Torus(Xf xf, float R, float r, int segs = 24, int sides = 8, float rUp = -1f) { List list = new List(); List list2 = new List(); List list3 = new List(); for (int i = 0; i < segs; i++) { double num = (double)i / (double)segs * 2.0 * Math.PI; list.Add(xf.P((float)Math.Cos(num) * R, 0f, (float)Math.Sin(num) * R)); list2.Add((rUp > 0f) ? rUp : r); list3.Add(r); } Tube(list, list2, list3, xf.Y, sides, 0f, 0f, null, closedLoop: true); } private static float Pow(float c, float e) { return (float)Math.Sign(c) * (float)Math.Pow(Math.Abs(c), e); } public ModelMeshData Build() { ModelMeshData modelMeshData = new ModelMeshData { Positions = pos.ToArray(), Uvs = uv.ToArray(), Triangles = tris.ToArray() }; modelMeshData.Normals = FingerModel.ComputeNormals(modelMeshData.Positions, modelMeshData.Triangles); WeldNormals(modelMeshData); return modelMeshData; } private static void WeldNormals(ModelMeshData d) { Dictionary<(int, int, int), List> dictionary = new Dictionary<(int, int, int), List>(); int vertexCount = d.VertexCount; for (int i = 0; i < vertexCount; i++) { (int, int, int) key = ((int)Math.Round(d.Positions[i * 3] * 20000f), (int)Math.Round(d.Positions[i * 3 + 1] * 20000f), (int)Math.Round(d.Positions[i * 3 + 2] * 20000f)); if (!dictionary.TryGetValue(key, out var value)) { value = (dictionary[key] = new List(2)); } value.Add(i); } foreach (List value2 in dictionary.Values) { if (value2.Count < 2) { continue; } float num = 0f; float num2 = 0f; float num3 = 0f; foreach (int item in value2) { num += d.Normals[item * 3]; num2 += d.Normals[item * 3 + 1]; num3 += d.Normals[item * 3 + 2]; } float num4 = (float)Math.Sqrt(num * num + num2 * num2 + num3 * num3); if (num4 < 0.0001f) { continue; } num /= num4; num2 /= num4; num3 /= num4; foreach (int item2 in value2) { if (!(d.Normals[item2 * 3] * num + d.Normals[item2 * 3 + 1] * num2 + d.Normals[item2 * 3 + 2] * num3 < 0.5f)) { d.Normals[item2 * 3] = num; d.Normals[item2 * 3 + 1] = num2; d.Normals[item2 * 3 + 2] = num3; } } } } } public sealed class RigMat { public string Name; public float R; public float G; public float B; public float A = 1f; public float ER; public float EG; public float EB; public float Gloss = 0.25f; public string Tex = "plain"; public bool Unlit; } public sealed class RigPart { public string Name; public string Parent; public V3 Pos; public V3 Euler; public readonly Dictionary Geo = new Dictionary(); } public sealed class Rig { public readonly string Name; public readonly List Mats = new List(); public readonly List Parts = new List(); private readonly Dictionary byName = new Dictionary(); public RigPart this[string name] => byName[name]; public Rig(string name) { Name = name; } public int Mat(string name, float r, float g, float b, float er = 0f, float eg = 0f, float eb = 0f, string tex = "plain", float gloss = 0.25f) { Mats.Add(new RigMat { Name = name, R = r, G = g, B = b, ER = er, EG = eg, EB = eb, Tex = tex, Gloss = gloss }); return Mats.Count - 1; } public int Glow(string name, float r, float g, float b, float a) { Mats.Add(new RigMat { Name = name, R = r, G = g, B = b, A = a, Unlit = true }); return Mats.Count - 1; } public RigPart Part(string name, string parent, V3 pos, float ex = 0f, float ey = 0f, float ez = 0f) { RigPart rigPart = new RigPart { Name = name, Parent = parent, Pos = pos, Euler = new V3(ex, ey, ez) }; Parts.Add(rigPart); byName[name] = rigPart; return rigPart; } public bool Has(string name) { return byName.ContainsKey(name); } public MeshBuilder G(string part, int mat) { RigPart rigPart = byName[part]; if (!rigPart.Geo.TryGetValue(mat, out var value)) { value = (rigPart.Geo[mat] = new MeshBuilder()); } return value; } public Xf World(string part) { RigPart rigPart = byName[part]; Xf result = Xf.Rot(rigPart.Pos, rigPart.Euler.X, rigPart.Euler.Y, rigPart.Euler.Z); if (rigPart.Parent == null || !byName.ContainsKey(rigPart.Parent)) { return result; } Xf xf = World(rigPart.Parent); return new Xf { O = xf.P(result.O), X = xf.D(result.X), Y = xf.D(result.Y), Z = xf.D(result.Z) }; } } public static class TexGen { public const int Size = 128; public static byte[] Make(string kind) { int num = 128; byte[] array = new byte[num * num * 4]; for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float u = (float)j / (float)num; float v = (float)i / (float)num; Sample(kind, u, v, out var r, out var g, out var b); int num2 = (i * num + j) * 4; array[num2] = B(r); array[num2 + 1] = B(g); array[num2 + 2] = B(b); array[num2 + 3] = byte.MaxValue; } } return array; } private static void Sample(string kind, float u, float v, out float r, out float g, out float b) { switch (kind) { case "cloth": { float num = 0.86f + 0.07f * Tri(u * 64f + v * 64f) + 0.05f * Noise(u, v, 8, 1) + 0.03f * Noise(u, v, 32, 2); r = (g = (b = num)); break; } case "silk": { float num = 0.9f + 0.06f * Noise(u, v, 4, 3) + 0.04f * (float)Math.Sin((double)(u + Noise(u, v, 2, 4) * 0.3f) * Math.PI * 12.0); r = (g = (b = num)); break; } case "skin": { float num = (r = 0.93f + 0.04f * Noise(u, v, 8, 5) + 0.03f * Noise(u, v, 32, 6)); g = num * 0.985f; b = num * 0.975f; break; } case "hair": { float num = 0.78f + 0.16f * Noise(u, v, 64, 7, 2) + 0.08f * Noise(u, v, 16, 8, 2); r = (g = (b = num)); break; } case "fur": { float num = 0.72f + 0.2f * Noise(u, v, 48, 9, 3) + 0.08f * Noise(u, v, 12, 10); r = (g = (b = num)); break; } case "stripes": { float num10 = Smooth((float)Math.Sin((double)(v + 0.08f * Noise(u, v, 4, 11)) * Math.PI * 2.0 * 4.0) - 0.55f + 0.3f * Noise(u, v, 8, 12), 0.08f); float num11 = 0.8f + 0.2f * Noise(u, v, 48, 9, 3); float num = (0.14f + 0.86f * num10) * num11; r = (g = (b = num)); break; } case "scales": { float num5 = u * 12f; float num6 = v * 12f + (float)((int)(u * 12f) % 2) * 0.5f; float num7 = num5 - (float)Math.Floor(num5) - 0.5f; float num8 = num6 - (float)Math.Floor(num6) - 0.5f; float num9 = (float)Math.Sqrt(num7 * num7 + num8 * num8); float num = 0.7f + 0.3f * Smooth(0.5f - num9, 0.12f) + 0.05f * Noise(u, v, 16, 13); r = (g = (b = num)); break; } case "feather": { float num3 = Smooth(0.03f - Math.Abs(u * 4f % 1f - 0.5f), 0.02f); float num4 = 0.85f + 0.15f * (float)Math.Sin((double)(u * 4f % 1f + v * 3f) * Math.PI * 40.0); float num = Math.Min(1f, num4 * (0.9f + 0.1f * Noise(u, v, 8, 14)) + num3 * 0.2f); r = (g = (b = num)); break; } case "stone": { float num = (r = 0.7f + 0.18f * Noise(u, v, 4, 15) + 0.12f * Noise(u, v, 16, 16) + 0.06f * Noise(u, v, 64, 17)); g = num * 0.97f; b = num * 0.94f; break; } case "wood": { float num2 = (float)Math.Sin((double)(u * 6f + Noise(u, v, 4, 18) * 1.5f) * Math.PI * 2.0 * 3.0); float num = (r = 0.75f + 0.12f * num2 + 0.08f * Noise(u, v, 32, 19, 4)); g = num * 0.93f; b = num * 0.88f; break; } case "metal": { float num = 0.85f + 0.1f * Noise(u, v, 32, 20, 6) + 0.05f * Noise(u, v, 4, 21); r = (g = (b = num)); break; } default: r = (g = (b = 1f)); break; } } private static float Tri(float x) { return Math.Abs(x - (float)Math.Floor(x) - 0.5f) * 2f - 0.5f; } private static float Smooth(float d, float w) { return Math.Max(0f, Math.Min(1f, d / w + 0.5f)); } private static float Noise(float u, float v, int cells, int seed, int stretch = 1) { int num = Math.Max(1, cells / stretch); float num2 = u * (float)cells; float num3 = v * (float)num; int num4 = (int)Math.Floor(num2); int num5 = (int)Math.Floor(num3); float num6 = num2 - (float)num4; float num7 = num3 - (float)num5; num6 = num6 * num6 * (3f - 2f * num6); num7 = num7 * num7 * (3f - 2f * num7); float num8 = H(num4, num5, cells, num, seed); float num9 = H(num4 + 1, num5, cells, num, seed); float num10 = H(num4, num5 + 1, cells, num, seed); float num11 = H(num4 + 1, num5 + 1, cells, num, seed); return num8 + (num9 - num8) * num6 + (num10 + (num11 - num10) * num6 - (num8 + (num9 - num8) * num6)) * num7; } private static float H(int x, int y, int cu, int cv, int seed) { x = (x % cu + cu) % cu; y = (y % cv + cv) % cv; int num = x * 374761393 + y * 668265263 + seed * int.MaxValue; int num2 = (num ^ (num >>> 13)) * 1274126177; return (float)(uint)((num2 ^ (num2 >>> 16)) & 0xFFFF) / 32767.5f - 1f; } private static byte B(float v) { return (byte)Math.Max(0, Math.Min(255, (int)(v * 255f + 0.5f))); } } public static class RigCatalog { public static readonly Dictionary> All = new Dictionary> { ["gojo"] = CharacterRigs.Gojo, ["sukuna"] = CharacterRigs.Sukuna, ["megumi"] = CharacterRigs.Megumi, ["mahoraga"] = CharacterRigs.Mahoraga, ["dog_white"] = () => BeastRigs.Dog(white: true), ["dog_black"] = () => BeastRigs.Dog(white: false), ["nue"] = BeastRigs.Nue, ["toad"] = BeastRigs.Toad, ["elephant"] = BeastRigs.Elephant, ["serpent"] = BeastRigs.SerpentHead, ["ox"] = BeastRigs.Ox, ["tiger"] = BeastRigs.Tiger, ["deer"] = BeastRigs.Deer, ["rabbit"] = BeastRigs.Rabbit, ["shrine"] = ShrineRig.Build }; } public static class ShrineRig { public const float Height = 7.4f; public static Rig Build() { Rig r = new Rig("Malevolent Shrine"); int m = r.Mat("Stone", 0.17f, 0.13f, 0.12f, 0f, 0f, 0f, "stone"); int m2 = r.Mat("Wood", 0.1f, 0.05f, 0.045f, 0f, 0f, 0f, "wood"); int m3 = r.Mat("Lacquer", 0.5f, 0.04f, 0.035f, 0.04f, 0f, 0f, "wood", 0.55f); int m4 = r.Mat("Roof", 0.055f, 0.035f, 0.035f, 0f, 0f, 0f, "stone", 0.4f); int m5 = r.Mat("Bone", 0.84f, 0.79f, 0.67f, 0f, 0f, 0f, "stone", 0.3f); int m6 = r.Mat("Dark", 0.01f, 0f, 0f); int m7 = r.Mat("Lanterns", 0.9f, 0.15f, 0.08f, 0.8f, 0.1f, 0.03f, "silk"); r.Part("Shrine", null, V3.Zero); S(m).Blob(Xf.At(0f, 0.3f, 0f), 3.6f, 0.3f, 3.1f, 24, 8, 10f); S(m).Blob(Xf.At(0f, 0.8f, -0.2f), 3f, 0.2f, 2.5f, 24, 8, 10f); S(m).Blob(Xf.At(0f, 0.15f, 3.4f), 1.3f, 0.15f, 0.35f, 16, 6, 10f); S(m).Blob(Xf.At(0f, 0.45f, 3f), 1.3f, 0.15f, 0.3f, 16, 6, 10f); S(m3).Tube(new V3[2] { new V3(-3f, 1.01f, 2.31f), new V3(3f, 1.01f, 2.31f) }, new float[2] { 0.04f, 0.04f }, V3.Up, 8); S(m2).Blob(Xf.At(0f, 2.3f, -0.2f), 2.3f, 1.3f, 1.9f, 24, 10, 10f); float[] array = new float[2] { -2.1f, 2.1f }; foreach (float x in array) { float[] array2 = new float[2] { -1.9f, 1.5f }; foreach (float z in array2) { S(m3).Tube(new V3[3] { new V3(x, 1f, z), new V3(x, 2.4f, z), new V3(x, 3.75f, z) }, new float[3] { 0.19f, 0.18f, 0.19f }, V3.Fwd, 14, 0f, 0f); S(m).Blob(Xf.At(x, 1.07f, z), 0.27f, 0.08f, 0.27f, 14, 6, 4f); S(m3).Blob(Xf.At(x, 3.7f, z), 0.26f, 0.08f, 0.26f, 14, 6, 4f); } } S(m6).Blob(Xf.At(0f, 2.15f, 1.7f), 1.8f, 0.85f, 0.06f, 20, 10, 6f); array = new float[2] { 3.07f, 1.24f }; foreach (float y in array) { S(m3).Blob(Xf.At(0f, y, 1.76f), 2f, 0.11f, 0.1f, 20, 6, 8f); } for (int k = 0; k < 9; k++) { float num = -1.6f + (float)k * 0.4f; float num2 = ((k == 1 || k == 7) ? 1.6f : 1f); S(m5).Spike(new V3(num, 2.98f, 1.8f), new V3(num, 2.85f - 0.05f * num2, 1.83f), new V3(num + 0.03f, 2.98f - 0.42f * num2, 1.82f), 0.11f * num2, 8, 6, 0.06f); S(m5).Spike(new V3(num + 0.2f, 1.33f, 1.8f), new V3(num + 0.2f, 1.45f + 0.05f * num2, 1.83f), new V3(num + 0.17f, 1.33f + 0.36f * num2, 1.82f), 0.1f * num2, 8, 6, 0.06f); } Roof(S(m4), S(m3), 3.62f, -0.2f, 3.35f, 2.85f, 0.75f, 0.32f); S(m2).Blob(Xf.At(0f, 4.6f, -0.2f), 1.7f, 0.6f, 1.4f, 20, 8, 10f); S(m6).Blob(Xf.At(0f, 4.6f, 1.21f), 0.7f, 0.35f, 0.03f, 12, 6, 6f); Roof(S(m4), S(m3), 5.15f, -0.2f, 2.5f, 2.1f, 0.55f, 0.28f); Roof(S(m4), S(m3), 5.68f, -0.2f, 1.55f, 1.25f, 0.45f, 0.2f); S(m3).Tube(new V3[2] { new V3(-1.7f, 6.16f, -0.2f), new V3(1.7f, 6.16f, -0.2f) }, new float[2] { 0.09f, 0.09f }, V3.Up, 10); array = new float[2] { -1f, 1f }; foreach (float num3 in array) { List list = new List(); List list2 = new List(); V3 item = new V3(num3 * 1.1f, 6.05f, -0.2f); for (int l = 0; l <= 10; l++) { float num4 = (float)l / 10f; list.Add(item); list2.Add(Math.Max(0.02f, 0.24f * (1f - num4 * 0.92f))); item += new V3(num3 * (0.24f - 0.3f * num4), 0.15f + 0.07f * num4, 0.03f - 0.08f * num4 * num4); } S(m5).Tube(list, list2, list2, V3.Fwd, 12, 0.4f, 1f, (int ring, float th) => 1f + 0.04f * (float)Math.Sin((float)ring * 2.5f)); } Random random = new Random(20); for (int num5 = 0; num5 < 46; num5++) { float num6 = (float)(random.NextDouble() * Math.PI * 2.0); float num7 = 3.6f + (float)random.NextDouble() * 1.4f; V3 o = new V3((float)Math.Cos(num6) * num7, 0f, (float)Math.Sin(num6) * num7 * 0.9f - 0.2f); if (!(o.Z > 2.6f) || !(Math.Abs(o.X) < 1.6f)) { float num8 = 0.22f + (float)random.NextDouble() * 0.14f; o.Y = num8 * 0.85f + (float)random.NextDouble() * 0.25f; V3 norm = new V3(o.X, 0f, o.Z).Norm; float ey = (float)(Math.Atan2(norm.X, norm.Z) * 180.0 / Math.PI) + (float)(random.NextDouble() - 0.5) * 50f; Skull(S(m5), S(m6), Xf.Rot(o, (float)(random.NextDouble() - 0.5) * 30f, ey, (float)(random.NextDouble() - 0.5) * 30f), num8); } } array = new float[2] { -2.6f, 2.6f }; foreach (float x2 in array) { S(m2).Tube(new V3[2] { new V3(x2, 0.6f, 2.6f), new V3(x2, 1.75f, 2.6f) }, new float[2] { 0.05f, 0.05f }, V3.Fwd, 8); S(m7).Blob(Xf.At(x2, 1.98f, 2.6f), 0.2f, 0.26f, 0.2f, 14, 10, 2f, (V3 d) => 1f + 0.04f * (float)Math.Cos(d.Y * 30f)); S(m6).Blob(Xf.At(x2, 2.25f, 2.6f), 0.13f, 0.04f, 0.13f, 10, 6, 3f); S(m6).Blob(Xf.At(x2, 1.72f, 2.6f), 0.13f, 0.035f, 0.13f, 10, 6, 3f); } return r; MeshBuilder S(int mat) { return r.G("Shrine", mat); } } private static void Roof(MeshBuilder tiles, MeshBuilder trim, float y0, float zc, float w, float d, float rise, float curl) { Func func = delegate(float u, float v) { float num3 = (u - 0.5f) * 2f * w; float num4 = (v - 0.5f) * 2f * d; float num5 = Math.Max(Math.Abs(num3) / w, Math.Abs(num4) / d); float num6 = Math.Min(Math.Abs(num3) / w, Math.Abs(num4) / d); float y1 = y0 + rise * (1f - num5) * (1f - num5 * 0.35f) + curl * (float)Math.Pow(num5, 6.0) * (1f + 0.6f * num6 * num6); return new V3(num3, y1, zc + num4); }; tiles.Panel(24, 24, func, 6f, 6f, V3.Down, 0.12f); List list = new List(); List list2 = new List(); for (int num = 0; num < 64; num++) { float num2 = (float)num / 64f * 4f; float arg; float arg2; if (num2 < 1f) { arg = num2; arg2 = 0f; } else if (num2 < 2f) { arg = 1f; arg2 = num2 - 1f; } else if (num2 < 3f) { arg = 3f - num2; arg2 = 1f; } else { arg = 0f; arg2 = 4f - num2; } list.Add(func(arg, arg2) + V3.Down * 0.06f); list2.Add(0.07f); } trim.Tube(list, list2, list2, V3.Up, 6, 0f, 0f, null, closedLoop: true); } private static void Skull(MeshBuilder bone, MeshBuilder dark, Xf xf, float s) { bone.Blob(new Xf { O = xf.P(0f, 0.1f * s, -0.05f * s), X = xf.X, Y = xf.Y, Z = xf.Z }, 0.62f * s, 0.6f * s, 0.7f * s, 14); bone.Blob(new Xf { O = xf.P(0f, -0.2f * s, 0.25f * s), X = xf.X, Y = xf.Y, Z = xf.Z }, 0.42f * s, 0.3f * s, 0.36f * s, 12, 8); bone.Blob(new Xf { O = xf.P(0f, -0.48f * s, 0.25f * s), X = xf.X, Y = xf.Y, Z = xf.Z }, 0.32f * s, 0.12f * s, 0.3f * s, 10, 6); float[] array = new float[2] { -1f, 1f }; foreach (float num in array) { dark.Blob(new Xf { O = xf.P(num * 0.21f * s, 0f, 0.5f * s), X = xf.X, Y = xf.Y, Z = xf.Z }, 0.15f * s, 0.14f * s, 0.1f * s, 8, 6); } dark.Blob(new Xf { O = xf.P(0f, -0.2f * s, 0.6f * s), X = xf.X, Y = xf.Y, Z = xf.Z }, 0.06f * s, 0.09f * s, 0.05f * s, 6, 4); } } public static class TalismanModel { public const int TexSize = 256; public const float Width = 0.075f; public const float Length = 0.21f; public const float Thickness = 0.004f; public static ModelMeshData BuildMesh() { MeshBuilder meshBuilder = new MeshBuilder(); meshBuilder.Sheet(12, 36, delegate(float a, float b) { float num = (a - 0.5f) * 0.075f; float num2 = (b - 0.5f) * 0.21f; float num3 = 0.012f * (float)Math.Pow(2f * Math.Abs(b - 0.5f), 2.0); float num4 = 0.004f * (float)Math.Cos((double)(a - 0.5f) * Math.PI); float num5 = 0.0015f * (float)Math.Sin(b * 9f); return new float[3] { num, num3 + num4 + num5, num2 }; }, 0f, 1f, 0f, 1f); return meshBuilder.Build(); } public static byte[] BuildTexture() { int num = 256; byte[] array = new byte[num * num * 4]; Random random = new Random(31); float[] array2 = new float[110]; for (int i = 0; i < 22; i++) { bool num2 = i < 11; float num3 = (float)(i % 11) / 10f; float num4 = (num2 ? (0.06f + num3 * 0.26f) : (0.68f + num3 * 0.26f)); array2[i * 5] = 0.5f + (float)(random.NextDouble() - 0.5) * 0.24f; array2[i * 5 + 1] = num4; array2[i * 5 + 2] = 0.05f + (float)random.NextDouble() * 0.08f; array2[i * 5 + 3] = (new float[5] { 0f, 1.5708f, 0.5f, -0.5f, 0f })[random.Next(5)]; array2[i * 5 + 4] = 0.014f + (float)random.NextDouble() * 0.012f; } for (int j = 0; j < num; j++) { for (int k = 0; k < num; k++) { float num5 = ((float)k + 0.5f) / (float)num; float num6 = ((float)j + 0.5f) / (float)num; float num7 = num5; float num8 = num6 * 2.7999997f; float num9 = 0.04f * (float)Math.Sin(num5 * 160f + num6 * 7f) * (float)Math.Sin(num6 * 300f + num5 * 3f); float val = Math.Min(Math.Min(num5, 1f - num5) * 6f, Math.Min(num6, 1f - num6) * 18f); float num10 = 0.82f + 0.18f * Math.Min(1f, val); float num11 = (0.93f + num9) * num10; float num12 = (0.87f + num9) * num10; float num13 = (0.72f + num9) * num10; float val2 = 0f; float num14 = 0.5f; float num15 = 1.3999999f; float num16 = num7 - num14; float num17 = num8 - num15; float val3 = Ellipse(num16, num17, 0.22f, 0.18f); float val4 = Ellipse(num16, num17 + 0.17f, 0.085f, 0.15f); float val5 = Ellipse(num16, num17 + 0.06f, 0.16f, 0.13f); float val6 = Triangle(num16 + 0.13f, 0.1f - num17, 0.09f, 0.25f); float val7 = Triangle(num16 - 0.13f, 0.1f - num17, 0.09f, 0.25f); val3 = Math.Max(val3, val5); float num18 = Math.Max(Math.Max(val3, val4), Math.Max(val6, val7)); float val8 = Ellipse(num16 + 0.08f, num17 - 0.02f, 0.04f, 0.02f); float val9 = Ellipse(num16 - 0.08f, num17 - 0.02f, 0.04f, 0.02f); val2 = Math.Max(val2, num18 * (1f - Math.Max(val8, val9))); float num19 = Math.Abs((float)Math.Sqrt(num16 * num16 + num17 * num17) - 0.42f); val2 = Math.Max(val2, Smooth(0.035f - num19)); for (int l = 0; l < 22; l++) { float num20 = array2[l * 5]; float num21 = array2[l * 5 + 1] * 2.7999997f; float num22 = array2[l * 5 + 2]; float num23 = array2[l * 5 + 3]; float num24 = array2[l * 5 + 4]; float num25 = num7 - num20; float num26 = num8 - num21; float num27 = (float)Math.Cos(num23); float num28 = (float)Math.Sin(num23); float value = num25 * num27 + num26 * num28; float value2 = (0f - num25) * num28 + num26 * num27; if (!(Math.Abs(value) > num22)) { float num29 = 1f - Math.Abs(value) / num22 * 0.6f; val2 = Math.Max(val2, Smooth(num24 * num29 - Math.Abs(value2)) * 0.95f); } } float num30 = 0.04f + 0.03f * (float)Math.Sin(num5 * 40f + num6 * 25f); num11 = num11 * (1f - val2) + num30 * val2; num12 = num12 * (1f - val2) + num30 * val2; num13 = num13 * (1f - val2) + (num30 + 0.03f) * val2; float num31 = 2.5199997f; float num32 = Box(num7 - 0.5f, num8 - num31, 0.16f, 0.16f); float num33 = Box(num7 - 0.5f, num8 - num31, 0.1f, 0.1f) * 0.6f; float num34 = num32 * (1f - num33); num11 = num11 * (1f - num34) + 0.7f * num34; num12 = num12 * (1f - num34) + 0.08f * num34; num13 = num13 * (1f - num34) + 0.06f * num34; int num35 = (j * num + k) * 4; array[num35] = ToByte(num11); array[num35 + 1] = ToByte(num12); array[num35 + 2] = ToByte(num13); array[num35 + 3] = byte.MaxValue; } } return array; } private static float Smooth(float d) { return Math.Max(0f, Math.Min(1f, d * 60f + 0.5f)); } private static float Ellipse(float x, float y, float rx, float ry) { float num = (float)Math.Sqrt(x * x / (rx * rx) + y * y / (ry * ry)); return Math.Max(0f, Math.Min(1f, (1f - num) * 12f)); } private static float Triangle(float x, float y, float w, float h) { if (y > 0f || y < 0f - h) { return 0f; } float num = w * (1f + y / h); return Math.Max(0f, Math.Min(1f, (num - Math.Abs(x)) * 60f)); } private static float Box(float x, float y, float hw, float hh) { return Math.Max(0f, Math.Min(1f, Math.Min(hw - Math.Abs(x), hh - Math.Abs(y)) * 60f)); } private static byte ToByte(float v) { return (byte)Math.Max(0, Math.Min(255, (int)(v * 255f + 0.5f))); } } }