Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of SettMod v4.9.2
SettMod.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.Commando; using EntityStates.Huntress; using EntityStates.LemurianBruiserMonster; using EntityStates.Mage; using EntityStates.Merc; using HG.BlendableTypes; using IL.RoR2; using KinematicCharacterController; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using Runes; using SettMod.Controllers; using SettMod.Modules; using SettMod.Modules.LeagueSkins; using SettMod.Modules.Survivors; using SettMod.SkillStates; using SettMod.SkillStates.BaseStates; using SettMod.SkillStates.Emotes; using SettMod.States; using SettMod.States.Emotes; using SettMod.UI; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; 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("SettMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("4.9.2.0")] [assembly: AssemblyInformationalVersion("4.9.2+59aee43943ba3bf3e1182912679284dbbac82f0d")] [assembly: AssemblyProduct("SettMod")] [assembly: AssemblyTitle("SettMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("4.9.2.0")] [module: UnverifiableCode] internal enum SettCameraParams { DEFAULT, EMOTE } internal class BodyInfo { internal string bodyName = ""; internal string bodyNameToken = ""; internal string subtitleNameToken = ""; internal string bodyNameToClone = "Commando"; internal Texture characterPortrait; internal GameObject crosshair; internal GameObject podPrefab; internal float maxHealth = 100f; internal float healthGrowth = 2f; internal float healthRegen; internal float regenGrowth; internal float shield; internal float shieldGrowth; internal float moveSpeed = 7f; internal float moveSpeedGrowth; internal float acceleration = 80f; internal float jumpPower = 15f; internal float jumpPowerGrowth; internal float damage = 12f; internal float damageGrowth; internal float attackSpeed = 1f; internal float attackSpeedGrowth; internal float armor; internal float armorGrowth; internal float crit = 1f; internal float critGrowth; internal int jumpCount = 1; internal Color bodyColor = Color.grey; internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f); internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f); internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f); internal Vector3 corePosition = new Vector3(0f, 1.5f, 0f); } internal class CustomRendererInfo { internal string childName; internal Material material; internal bool ignoreOverlays; } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = new string[0]; public Sprite skillIcon; public SerializableEntityStateType activationState; public InterruptPriority interruptPriority; public string activationStateMachineName; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool cancelSprintingOnActivation = true; public bool beginSkillCooldownOnSkillEnd; public bool fullRestockOnAssign = true; public bool resetCooldownTimerOnUse; public bool mustKeyPress; public SkillDefInfo() { } public SkillDefInfo(string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0060: 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_0071: Unknown result type (might be due to invalid IL or missing references) skillName = skillNameToken; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } } } namespace SettMod { public class MenuSound : MonoBehaviour { private uint playID; private uint playID2; private void OnDestroy() { if (playID != 0) { AkSoundEngine.StopPlayingID(playID); } if (playID2 != 0) { AkSoundEngine.StopPlayingID(playID2); } } private void OnEnable() { ((MonoBehaviour)this).Invoke("PlayEffect", 0.05f); } private void PlayEffect() { if (Config.voiceLines.Value) { playID = Util.PlaySound("SettMenuVO", ((Component)this).gameObject); } playID2 = Util.PlaySound("SettMenuSFX", ((Component)this).gameObject); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Lemonlust.Sett", "Sett", "4.9.2")] public class SettPlugin : BaseUnityPlugin { public const string developerPrefix = "SETT"; public const string MODNAME = "Sett"; public const string MODUID = "com.Lemonlust.Sett"; public const string MODVERSION = "4.9.2"; public static SettPlugin instance; public static ModdedDamageType settDamage; private GritGauge gritGauge; public void OnDestroy() { try { UnHooks(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)ex.ToString()); } } private void Awake() { //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) instance = this; try { settDamage = DamageAPI.ReserveDamageType(); Assets.Initialize(); Config.ReadConfig(); CameraParams.InitializeParams(); SettMod.Modules.States.RegisterStates(); NetworkingAPI.RegisterMessageType<SyncSettGrab>(); NetworkingAPI.RegisterMessageType<SyncSettRelease>(); NetworkingAPI.RegisterMessageType<SyncAddGrit>(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); new Sett().Initialize(); new ContentPacks().Initialize(); Hook(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)ex.ToString()); } } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self)) { float num = Mathf.Floor(self.level / 4f); if (self.HasBuff(Buffs.regenBuff)) { float num2 = self.GetBuffCount(Buffs.regenBuff); self.regen += num2 * (0.25f + num * 0.25f); } } } private void CreateGritGauge(HUD hud) { if (!Object.op_Implicit((Object)(object)gritGauge) && !((Object)(object)hud == (Object)null)) { gritGauge = ((Component)hud).GetComponentInChildren<GritGauge>(true); if (!Object.op_Implicit((Object)(object)gritGauge)) { gritGauge = GritGauge.Create(hud); } } } private void Hook() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); HUD.Awake += new hook_Awake(HUD_Awake); HUD.onHudTargetChangedGlobal += HUD_onHudTargetChangedGlobal; PickupPickerController.FixedUpdateServer += new hook_FixedUpdateServer(PickupPickerController_FixedUpdateServer); } private void HUD_Awake(orig_Awake orig, HUD self) { CreateGritGauge(self); orig.Invoke(self); } private void HUD_onHudTargetChangedGlobal(HUD obj) { if (Object.op_Implicit((Object)(object)obj) && Object.op_Implicit((Object)(object)obj.targetBodyObject) && Object.op_Implicit((Object)(object)gritGauge)) { GritComponent component = obj.targetBodyObject.GetComponent<GritComponent>(); if (Object.op_Implicit((Object)(object)component)) { ((Component)gritGauge).gameObject.SetActive(true); gritGauge.source = component; } else { ((Component)gritGauge).gameObject.SetActive(false); gritGauge.source = null; } } } private void PickupPickerController_FixedUpdateServer(orig_FixedUpdateServer orig, PickupPickerController self) { //IL_003e: 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_0053: Unknown result type (might be due to invalid IL or missing references) CharacterMaster currentParticipantMaster = self.networkUIPromptController.currentParticipantMaster; if (!Object.op_Implicit((Object)(object)currentParticipantMaster)) { return; } CharacterBody body = currentParticipantMaster.GetBody(); Interactor val = (Object.op_Implicit((Object)(object)body) ? ((Component)body).GetComponent<Interactor>() : null); if (Object.op_Implicit((Object)(object)body)) { Vector3 val2 = body.inputBank.aimOrigin - ((Component)self).transform.position; if (!((double)((Vector3)(ref val2)).sqrMagnitude > (Object.op_Implicit((Object)(object)val) ? Math.Pow(val.maxInteractionDistance + self.cutoffDistance, 2.0) : ((double)(self.cutoffDistance * self.cutoffDistance))))) { return; } } self.networkUIPromptController.SetParticipantMaster((CharacterMaster)null); } private void UnHooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats); HUD.Awake -= new hook_Awake(HUD_Awake); HUD.onHudTargetChangedGlobal -= HUD_onHudTargetChangedGlobal; PickupPickerController.FixedUpdateServer -= new hook_FixedUpdateServer(PickupPickerController_FixedUpdateServer); } } } namespace SettMod.UI { public class GritGauge : MonoBehaviour { public static readonly Color gritColor = new Color(0.96f, 0.74f, 0.22f, 1f); public static readonly Color trailColor = new Color(1f, 0.93f, 0.75f, 0.85f); public const float trailDelay = 0.4f; public const float trailSpeed = 0.8f; public const float spacing = 4f; public const float horizontalOffset = -2f; private Image fill; private Image trail; private TextMeshProUGUI currentText; private TextMeshProUGUI maxText; private RectTransform rect; private RectTransform templateContainer; private RectTransform container; private SpriteAsNumberManager numbers; private float trailValue; private float trailTimer; private int lastCurrent = -1; private int lastMax = -1; public GritComponent source { get; set; } public static GritGauge Create(HUD hud) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_01d4: 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_03c9: 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_034c: 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_036e: 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_0386: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)hud) || !Object.op_Implicit((Object)(object)hud.healthBar)) { return null; } HealthBar healthBar = hud.healthBar; Sprite sprite = (Object.op_Implicit((Object)(object)healthBar.style) ? healthBar.style.trailingOverHealthBarStyle.sprite : null); GameObject val = new GameObject("SettGritGaugeHolder"); val.SetActive(false); GameObject val2 = Object.Instantiate<GameObject>(((Component)healthBar).gameObject, val.transform, false); ((Object)val2).name = "SettGritBar"; HealthBar component = val2.GetComponent<HealthBar>(); RectTransform val3 = ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.barContainer)) ? component.barContainer : val2.GetComponent<RectTransform>()); TextMeshProUGUI val4 = (Object.op_Implicit((Object)(object)component) ? component.currentHealthText : null); TextMeshProUGUI val5 = (Object.op_Implicit((Object)(object)component) ? component.fullHealthText : null); SpriteAsNumberManager componentInChildren = val2.GetComponentInChildren<SpriteAsNumberManager>(true); if (Object.op_Implicit((Object)(object)component)) { string[] array = new string[3] { "criticallyHurtImage", "deadImage", "eliteBackdropRectTransform" }; foreach (string name in array) { FieldInfo field = typeof(HealthBar).GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); Component val6 = (Component)((field != null) ? /*isinst with value type is only supported in some contexts*/: null); if (Object.op_Implicit((Object)(object)val6)) { val6.gameObject.SetActive(false); } } Object.DestroyImmediate((Object)(object)component); } Transform[] componentsInChildren = val2.GetComponentsInChildren<Transform>(true); foreach (Transform val7 in componentsInChildren) { if (!((Object)(object)val7 == (Object)(object)val2.transform) && ((Object)val7).name == "SharedSufferingRoot") { ((Component)val7).gameObject.SetActive(false); } } if (Object.op_Implicit((Object)(object)val3)) { foreach (Transform item in (Transform)val3) { ((Component)item).gameObject.SetActive(false); } } if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Component)componentInChildren).gameObject.SetActive(true); TextMeshProUGUI[] array2 = (TextMeshProUGUI[])(object)new TextMeshProUGUI[2] { val4, val5 }; foreach (TextMeshProUGUI val8 in array2) { if (Object.op_Implicit((Object)(object)val8)) { ((Component)val8).gameObject.SetActive(false); } } array2 = val2.GetComponentsInChildren<TextMeshProUGUI>(true); foreach (TextMeshProUGUI val9 in array2) { if (((Object)val9).name == "Slash") { ((Component)val9).gameObject.SetActive(false); } } } else { TextMeshProUGUI[] array2 = (TextMeshProUGUI[])(object)new TextMeshProUGUI[2] { val4, val5 }; foreach (TextMeshProUGUI val10 in array2) { if (Object.op_Implicit((Object)(object)val10)) { ((Component)val10).gameObject.SetActive(true); ((Behaviour)val10).enabled = true; ((TMP_Text)val10).alpha = 1f; } } } RectTransform component2 = val2.GetComponent<RectTransform>(); val2.transform.SetParent(((Component)healthBar).transform, false); LayoutElement val11 = val2.GetComponent<LayoutElement>(); if (!Object.op_Implicit((Object)(object)val11)) { val11 = val2.AddComponent<LayoutElement>(); } val11.ignoreLayout = true; if (Object.op_Implicit((Object)(object)component2)) { component2.anchorMin = Vector2.zero; component2.anchorMax = Vector2.one; component2.pivot = new Vector2(0.5f, 0.5f); component2.offsetMin = Vector2.zero; component2.offsetMax = Vector2.zero; ((Transform)component2).localRotation = Quaternion.identity; ((Transform)component2).localScale = Vector3.one; } Object.Destroy((Object)(object)val); GritGauge gritGauge = val2.AddComponent<GritGauge>(); gritGauge.trail = CreateBar(val3, "GritTrail", sprite, trailColor); gritGauge.fill = CreateBar(val3, "GritFill", sprite, gritColor); gritGauge.currentText = val4; gritGauge.maxText = val5; gritGauge.rect = component2; gritGauge.templateContainer = healthBar.barContainer; gritGauge.container = val3; gritGauge.numbers = componentInChildren; val2.SetActive(false); return gritGauge; } private static Image CreateBar(RectTransform container, string name, Sprite sprite, Color color) { //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_0035: 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_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_006a: 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) GameObject val = new GameObject(name, new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform component = val.GetComponent<RectTransform>(); ((Transform)component).SetParent((Transform)(object)container, false); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; component.pivot = new Vector2(0f, 0.5f); Image component2 = val.GetComponent<Image>(); component2.sprite = sprite; component2.type = (Type)3; component2.fillMethod = (FillMethod)0; component2.fillOrigin = 0; component2.fillAmount = 0f; ((Graphic)component2).color = color; ((Graphic)component2).raycastTarget = false; return component2; } private static void SetFill(Image bar, float fraction) { if (Object.op_Implicit((Object)(object)bar)) { fraction = Mathf.Clamp01(fraction); bar.fillAmount = fraction; ((Behaviour)bar).enabled = fraction > 0.001f; } } private void LateUpdate() { //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_0057: 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_00b6: 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_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) if (Object.op_Implicit((Object)(object)rect)) { float num; if (!Object.op_Implicit((Object)(object)templateContainer)) { num = 0f; } else { Rect val = templateContainer.rect; num = ((Rect)(ref val)).height; } float num2 = num; if (num2 <= 0f) { num2 = 24f; } rect.anchoredPosition = new Vector2(-2f, 0f - (num2 + 4f)); if (Object.op_Implicit((Object)(object)templateContainer) && Object.op_Implicit((Object)(object)container) && (Object)(object)container != (Object)(object)rect) { container.anchorMin = templateContainer.anchorMin; container.anchorMax = templateContainer.anchorMax; container.pivot = templateContainer.pivot; container.anchoredPosition = templateContainer.anchoredPosition; container.sizeDelta = templateContainer.sizeDelta; } } } private void Update() { if (!Object.op_Implicit((Object)(object)source)) { return; } float currentGrit = source.GetCurrentGrit(); float maxGrit = source.GetMaxGrit(); float num = ((maxGrit > 0f) ? Mathf.Clamp01(currentGrit / maxGrit) : 0f); if (num >= trailValue) { trailValue = num; trailTimer = 0.4f; } else if (trailTimer > 0f) { trailTimer -= Time.deltaTime; } else { trailValue = Mathf.MoveTowards(trailValue, num, 0.8f * Time.deltaTime); } SetFill(fill, num); SetFill(trail, trailValue); int num2 = (int)currentGrit; int num3 = (int)maxGrit; if (Object.op_Implicit((Object)(object)numbers)) { if (num2 != lastCurrent || num3 != lastMax) { lastCurrent = num2; lastMax = num3; numbers.SetHitPointValues(num2, num3); } return; } if (Object.op_Implicit((Object)(object)currentText) && num2 != lastCurrent) { lastCurrent = num2; ((TMP_Text)currentText).text = num2.ToString(); } if (Object.op_Implicit((Object)(object)maxText) && num3 != lastMax) { lastMax = num3; ((TMP_Text)maxText).text = num3.ToString(); } } } } namespace SettMod.States { public class SettMain : GenericCharacterMain { public LocalUser localUser; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); localUser = LocalUserManager.readOnlyLocalUsersList[0]; } public override void Update() { //IL_0036: 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_00a2: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).Update(); if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded && !localUser.isUIFocused) { if (Input.GetKeyDown(Config.tauntKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Taunt(), (InterruptPriority)0); } else if (Input.GetKeyDown(Config.jokeKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Joke(), (InterruptPriority)0); } else if (Input.GetKeyDown(Config.laughKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Laugh(), (InterruptPriority)0); } else if (Input.GetKeyDown(Config.danceKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Dance(), (InterruptPriority)0); } } } } } namespace SettMod.States.Emotes { public class Dance : BaseEmote { public bool spam; public override void OnEnter() { if (spam) { animString = "DanceSpam"; } else { animString = "Dance"; } duration = float.MaxValue; base.OnEnter(); } } public class Joke : BaseEmote { private GameObject mom; public override void OnEnter() { animString = "Joke"; duration = 8.667f; soundString = "SettJoke"; base.OnEnter(); if (!Object.op_Implicit((Object)(object)mom)) { mom = Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>("momPortrait")); } mom.SetActive(false); } public override void FixedUpdate() { //IL_0051: 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_0099: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); if (Object.op_Implicit((Object)(object)mom)) { mom.transform.parent = ((Component)((BaseState)this).FindModelChild("L_Hand")).transform; mom.transform.position = ((Component)((BaseState)this).FindModelChild("L_Hand")).transform.position; mom.transform.localPosition = new Vector3(0.1517885f, 0.1841809f, -0.1253804f); mom.transform.localRotation = Quaternion.Euler(-176.593f, 85.119f, -9.799011f); } if (Object.op_Implicit((Object)(object)mom) && ((EntityState)this).fixedAge >= 2.3f && !mom.activeSelf) { mom.SetActive(true); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)mom)) { EntityState.Destroy((Object)(object)mom); } base.OnExit(); } } public class Laugh : BaseEmote { public override void OnEnter() { animString = "Laugh"; duration = 3.667f; soundString = "SettLaugh"; base.OnEnter(); } } public class Taunt : BaseEmote { public override void OnEnter() { animString = "Taunt"; duration = 6.417f; soundString = "SettTaunt"; base.OnEnter(); } } } namespace SettMod.SkillStates { public class Facebreaker : BaseSkillState { public static Vector3 CameraPosition = new Vector3(0f, -1.3f, -10f); public static float pullForce = Config.faceBreakerPullForce.Value; public static float pullRadius = Config.faceBreakerPullRadius.Value; public GameObject blastEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/SonicBoomEffect"); public float duration; public int maximumPullCount = int.MaxValue; public Transform pullOrigin; public AnimationCurve pullStrengthCurve; protected Animator animator; protected float baseDuration = 0.8f; protected float damageCoefficient = 6f; protected string hitboxName = "FaceBreaker"; protected NetworkSoundEventIndex impactSound; protected float startUp = 0.5f; protected float stopwatch; private OverlapAttack attack; private bool back; private Ray downRay; private bool front; private bool hasFired; private bool checkedQuickStart; private float attackTime; private float impactAnimDuration; private bool pulling; private List<CharacterBody> pullList = new List<CharacterBody>(); private Transform slamIndicatorInstance; public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (stopwatch >= startUp && !hasFired) { hasFired = true; if (Config.voiceLines.Value) { Util.PlaySound("SettEVO", ((EntityState)this).gameObject); } string text = ((front && back) ? "Facebreaker_Both" : ((back && !front) ? "Facebreaker_Back" : ((!front || back) ? "Facebreaker_Miss" : "Facebreaker_Front"))); ((EntityState)this).PlayCrossfade("Fullbody, Override", text, "FaceBreaker.playbackRate", impactAnimDuration, 0.05f); } if (stopwatch <= duration) { PullEnemies(Time.fixedDeltaTime); } if (!checkedQuickStart && pulling) { TryQuickStart(); } if (stopwatch >= attackTime && ((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null)) { OnHitEnemyAuthority(); } if (stopwatch >= duration && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public override void OnEnter() { //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) ((BaseState)this).OnEnter(); damageCoefficient = Config.faceBreakerDamageCoefficient.Value; ((EntityState)this).characterBody.SetAimTimer(2f); duration = baseDuration / ((BaseState)this).attackSpeedStat; startUp /= ((BaseState)this).attackSpeedStat; attackTime = duration * startUp; impactAnimDuration = duration; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((EntityState)this).PlayCrossfade("Fullbody, Override", "Facebreaker_Start", "FaceBreakerStartUp.playbackRate", startUp, 0.05f); HitBoxGroup hitBoxGroup = Array.Find(((Component)((EntityState)this).GetModelTransform()).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName); pullStrengthCurve = AnimationCurve.EaseInOut(0.1f, 0f, 1f, 1f); Util.PlaySound("SettESFX", ((EntityState)this).gameObject); impactSound = Assets.swordHitSoundEvent.index; attack = CreateAttack(hitBoxGroup); CreateIndicator(); } public override void OnExit() { if (Object.op_Implicit((Object)(object)slamIndicatorInstance)) { EntityState.Destroy((Object)(object)((Component)slamIndicatorInstance).gameObject); } ((EntityState)this).OnExit(); } public override void Update() { ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)slamIndicatorInstance)) { UpdateSlamIndicator(); } } protected OverlapAttack CreateAttack(HitBoxGroup hitBoxGroup) { //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_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_001e: 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_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_0036: 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_0054: 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_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) //IL_0075: 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_0088: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00a0: Expected O, but got Unknown OverlapAttack val = new OverlapAttack { damageType = DamageTypeCombo.op_Implicit((DamageType)40), attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), damage = damageCoefficient * ((BaseState)this).damageStat, procCoefficient = 1f, hitEffectPrefab = Assets.swordHitImpactEffect, forceVector = Vector3.zero, pushAwayForce = 0f, hitBoxGroup = hitBoxGroup, isCrit = ((BaseState)this).RollCrit(), impactSound = impactSound }; DamageAPI.AddModdedDamageType(val, SettPlugin.settDamage); return val; } protected virtual void OnHitEnemyAuthority() { Util.PlaySound("SettHitSFX", ((EntityState)this).gameObject); } private void TryQuickStart() { checkedQuickStart = true; if (!hasFired && pullList.Exists((CharacterBody body) => Object.op_Implicit((Object)(object)body))) { float num = startUp * 0.5f; startUp -= num; attackTime = Mathf.Max(0f, attackTime - num); duration -= num; if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("FaceBreakerStartUp.playbackRate", animator.GetFloat("FaceBreakerStartUp.playbackRate") * 2f); } } } private void AddToPullList(GameObject affectedObject) { CharacterBody component = affectedObject.GetComponent<CharacterBody>(); if (!pullList.Contains(component)) { pullList.Add(component); } } private void CreateIndicator() { //IL_0014: 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_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_0039: 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_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_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_008f: 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_009b: 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_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_00b4: 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_00cf: 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_00e6: 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_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_00f9: Expected O, but got Unknown GameObject areaIndicatorPrefab = HayMaker.GetAreaIndicatorPrefab(); if (Object.op_Implicit((Object)(object)areaIndicatorPrefab)) { Ray val = default(Ray); ((Ray)(ref val)).direction = Vector3.down; ((Ray)(ref val)).origin = ((EntityState)this).transform.position; downRay = val; slamIndicatorInstance = Object.Instantiate<GameObject>(areaIndicatorPrefab).transform; slamIndicatorInstance.localScale = Vector3.one * pullRadius; for (int i = 0; i <= 18; i++) { Vector3 val2 = ((EntityState)this).characterBody.footPosition + Random.insideUnitSphere * pullRadius; Vector3 val3 = ((EntityState)this).characterBody.footPosition - val2; Vector3 normalized = ((Vector3)(ref val3)).normalized; val2.y = ((EntityState)this).characterBody.footPosition.y; EffectManager.SpawnEffect(blastEffectPrefab, new EffectData { origin = val2, scale = 1f * pullRadius, rotation = Quaternion.LookRotation(normalized) }, false); } } } private void InitializePull() { //IL_0030: 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_006d: 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) if (pulling) { return; } pulling = true; Collider[] array = Physics.OverlapSphere(Object.op_Implicit((Object)(object)pullOrigin) ? pullOrigin.position : ((EntityState)this).transform.position, pullRadius); int i = 0; int num = 0; for (; i < array.Length; i++) { if (num >= maximumPullCount) { break; } HealthComponent component = ((Component)array[i]).GetComponent<HealthComponent>(); if (Object.op_Implicit((Object)(object)component)) { TeamComponent component2 = ((Component)component).GetComponent<TeamComponent>(); bool flag = false; if (Object.op_Implicit((Object)(object)component2)) { flag = component2.teamIndex == ((BaseState)this).GetTeam(); } if (!flag) { AddToPullList(((Component)component).gameObject); num++; } } } } private void PullEnemies(float deltaTime) { //IL_005d: 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_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_006d: 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_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_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_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_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_00ca: 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_00e2: 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_010c: 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_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_0166: 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_0173: 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) //IL_0140: 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) if (!pulling) { InitializePull(); } for (int i = 0; i < pullList.Count; i++) { CharacterBody val = pullList[i]; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.transform)) { continue; } Vector3 val2 = (Object.op_Implicit((Object)(object)pullOrigin) ? pullOrigin.position : ((EntityState)this).transform.position) - val.corePosition; float num = pullStrengthCurve.Evaluate(((Vector3)(ref val2)).magnitude / pullRadius); Vector3 val3 = ((Vector3)(ref val2)).normalized * num * deltaTime * pullForce; CharacterMotor component = ((Component)val).GetComponent<CharacterMotor>(); Vector3 forward = ((EntityState)this).characterDirection.forward; Vector3 normalized = ((Vector3)(ref forward)).normalized; Vector3 toEnemy = val.transform.position - (Object.op_Implicit((Object)(object)pullOrigin) ? pullOrigin.position : ((EntityState)this).transform.position); if (Object.op_Implicit((Object)(object)component)) { component.rootMotion += val3; if (component.useGravity) { component.rootMotion.y -= Physics.gravity.y * deltaTime * num; MarkSide(normalized, toEnemy); } } else { Rigidbody component2 = ((Component)val).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component2)) { component2.velocity += val3; MarkSide(normalized, toEnemy); } } } } private void MarkSide(Vector3 forward, Vector3 toEnemy) { //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) float num = Vector3.Dot(forward, toEnemy); if (num < 0f) { back = true; } else if (num >= 0f) { front = true; } } private void UpdateSlamIndicator() { //IL_0019: 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_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_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_0051: 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_0086: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)slamIndicatorInstance)) { float num = 250f; Ray val = default(Ray); ((Ray)(ref val)).direction = Vector3.down; ((Ray)(ref val)).origin = ((EntityState)this).transform.position; downRay = val; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(downRay, ref val2, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { ((Component)slamIndicatorInstance).transform.position = ((RaycastHit)(ref val2)).point; ((Component)slamIndicatorInstance).transform.up = ((RaycastHit)(ref val2)).normal; } } } } public class SettGoldAura : MonoBehaviour { private static Material auraMaterial; private static Texture2D softTexture; private static Texture2D rampTexture; public const float brightness = 1f; private Light auraLight; private float intensity; private float bodyHeight; private bool stopping; public static SettGoldAura Create(CharacterBody body, bool fullGrit) { //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_0026: 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) if (!Object.op_Implicit((Object)(object)body)) { return null; } GameObject val = new GameObject("SettGoldAura"); val.transform.SetParent(body.transform, false); val.transform.localPosition = body.transform.InverseTransformPoint(body.footPosition); SettGoldAura settGoldAura = val.AddComponent<SettGoldAura>(); settGoldAura.Setup(body, fullGrit); return settGoldAura; } public void SetIntensity(float value) { intensity = Mathf.Clamp(value, 0f, 2.5f); } public void Stop() { if (!stopping) { stopping = true; if (Object.op_Implicit((Object)(object)auraLight)) { ((Behaviour)auraLight).enabled = false; } ((Component)this).transform.SetParent((Transform)null, true); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Setup(CharacterBody body, bool fullGrit) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0045: 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_008d: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = ((Component)body).GetComponent<CapsuleCollider>(); bodyHeight = (Object.op_Implicit((Object)(object)component) ? component.height : 3f); GameObject val = new GameObject("AuraLight"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.up * (bodyHeight * 0.5f); auraLight = val.AddComponent<Light>(); auraLight.type = (LightType)2; auraLight.color = new Color(1f, 0.78f, 0.25f); auraLight.range = bodyHeight * (fullGrit ? 8f : 6f); auraLight.intensity = 0f; auraLight.shadows = (LightShadows)0; } private void Update() { if (!stopping) { float num = intensity; if (Object.op_Implicit((Object)(object)auraLight)) { float num2 = 0.75f + 0.5f * Mathf.PerlinNoise(Time.time * 14f, 0.37f); auraLight.intensity = 3f * num * num2; } } } internal static Material GetMaterial() { //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_0147: 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_00fc: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_0102: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)auraMaterial)) { return auraMaterial; } EnsureTextures(); Material val = null; GameObject val2 = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Treebot/SonicBoomEffect.prefab").WaitForCompletion(); if (Object.op_Implicit((Object)(object)val2)) { ParticleSystemRenderer[] componentsInChildren = val2.GetComponentsInChildren<ParticleSystemRenderer>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material sharedMaterial = ((Renderer)componentsInChildren[i]).sharedMaterial; if (Object.op_Implicit((Object)(object)sharedMaterial) && Object.op_Implicit((Object)(object)sharedMaterial.shader) && ((Object)sharedMaterial.shader).name.Contains("Cloud")) { val = new Material(sharedMaterial); break; } } } if (!Object.op_Implicit((Object)(object)val)) { Shader val3 = Shader.Find("Sprites/Default"); if (!Object.op_Implicit((Object)(object)val3)) { val3 = Shader.Find("Legacy Shaders/Particles/Additive"); } if (Object.op_Implicit((Object)(object)val3)) { val = new Material(val3); } } if (!Object.op_Implicit((Object)(object)val)) { Material val4 = LegacyResourcesAPI.Load<Material>("Materials/matVagrantEnergized"); val = (Object.op_Implicit((Object)(object)val4) ? new Material(val4) : new Material(Shader.Find("Standard"))); } val.mainTexture = (Texture)(object)softTexture; SetTexture(val, "_MainTex", (Texture)(object)softTexture); SetTexture(val, "_RemapTex", (Texture)(object)rampTexture); SetColor(val, "_TintColor", new Color(1f, 0.85f, 0.45f, 1f)); SetColor(val, "_Color", new Color(1f, 0.85f, 0.45f, 1f)); SetFloat(val, "_Boost", 2.5f); SetFloat(val, "_AlphaBoost", 1.5f); SetFloat(val, "_SrcBlend", 1f); SetFloat(val, "_DstBlend", 1f); SetFloat(val, "_InvFade", 0.5f); SetFloat(val, "_Cull", 0f); auraMaterial = val; return val; } private static void EnsureTextures() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //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_0144: 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_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_0178: 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_0198: 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_01a4: 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_01b3: 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_01e0: 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_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_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_00ab: 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) if (!Object.op_Implicit((Object)(object)softTexture)) { Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; 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.Sqrt(num * num + num2 * num2); float num4 = Mathf.Clamp01(1f - num3); num4 = num4 * num4 * (3f - 2f * num4); val.SetPixel(j, i, new Color(1f, 1f, 1f, num4)); } } val.Apply(); softTexture = val; } if (Object.op_Implicit((Object)(object)rampTexture)) { return; } Texture2D val2 = new Texture2D(256, 4, (TextureFormat)4, false); ((Texture)val2).wrapMode = (TextureWrapMode)1; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[5] { new GradientColorKey(new Color(0f, 0f, 0f), 0f), new GradientColorKey(new Color(0.9f, 0.35f, 0.02f), 0.3f), new GradientColorKey(new Color(1f, 0.72f, 0.15f), 0.6f), new GradientColorKey(new Color(1f, 0.95f, 0.65f), 0.85f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.3f), new GradientAlphaKey(1f, 1f) }); for (int k = 0; k < 256; k++) { Color val4 = val3.Evaluate((float)k / 255f); for (int l = 0; l < 4; l++) { val2.SetPixel(k, l, val4); } } val2.Apply(); rampTexture = val2; } private static void SetTexture(Material material, string property, Texture texture) { if (material.HasProperty(property)) { material.SetTexture(property, texture); } } private static void SetColor(Material material, string property, Color color) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (material.HasProperty(property)) { material.SetColor(property, color); } } private static void SetFloat(Material material, string property, float value) { if (material.HasProperty(property)) { material.SetFloat(property, value); } } } public class SettGrabController : MonoBehaviour { public Transform pivotTransform; public GameObject grabber; private EntityStateMachine grabberBodyMachine; private bool seenGrabberInShowStopper; private float age; private bool released; private CharacterBody body; private CapsuleCollider capsuleCollider; private CharacterDirection direction; private ModelLocator modelLocator; private Transform modelTransform; private CharacterMotor motor; private Quaternion originalRotation; private SphereCollider sphereCollider; public static SettGrabController Apply(GameObject grabber, GameObject target) { if (!Object.op_Implicit((Object)(object)grabber) || !Object.op_Implicit((Object)(object)target)) { return null; } Transform val = FindHand(grabber); if (!Object.op_Implicit((Object)(object)val)) { return null; } SettGrabController settGrabController = target.GetComponent<SettGrabController>(); if (!Object.op_Implicit((Object)(object)settGrabController)) { settGrabController = target.AddComponent<SettGrabController>(); } settGrabController.pivotTransform = val; settGrabController.grabber = grabber; settGrabController.grabberBodyMachine = EntityStateMachine.FindByCustomName(grabber, "Body"); if (NetworkServer.active) { CharacterBody component = grabber.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && !component.HasBuff(Buffs.HiddenInvincibility)) { component.AddBuff(Buffs.HiddenInvincibility); } } return settGrabController; } private static Transform FindHand(GameObject grabber) { ModelLocator component = grabber.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelTransform)) { return null; } ChildLocator component2 = ((Component)component.modelTransform).GetComponent<ChildLocator>(); if (!Object.op_Implicit((Object)(object)component2)) { return null; } return component2.FindChild("R_Hand"); } public void Release() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) if (!released) { released = true; if (Object.op_Implicit((Object)(object)modelLocator)) { ((Behaviour)modelLocator).enabled = true; } if (Object.op_Implicit((Object)(object)modelTransform)) { modelTransform.rotation = originalRotation; } if (Object.op_Implicit((Object)(object)direction)) { ((Behaviour)direction).enabled = true; } if (Object.op_Implicit((Object)(object)capsuleCollider)) { ((Collider)capsuleCollider).enabled = true; } if (Object.op_Implicit((Object)(object)sphereCollider)) { ((Collider)sphereCollider).enabled = true; } RemoveGrabInvincibility(grabber); Object.Destroy((Object)(object)this); } } private void OnDestroy() { RemoveGrabInvincibility(grabber); } public static void RemoveGrabInvincibility(GameObject grabber) { if (!NetworkServer.active || !Object.op_Implicit((Object)(object)grabber)) { return; } CharacterBody component = grabber.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { while (component.HasBuff(Buffs.HiddenInvincibility)) { component.RemoveBuff(Buffs.HiddenInvincibility); } } } private void Awake() { //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) body = ((Component)this).GetComponent<CharacterBody>(); motor = ((Component)this).GetComponent<CharacterMotor>(); direction = ((Component)this).GetComponent<CharacterDirection>(); modelLocator = ((Component)this).GetComponent<ModelLocator>(); capsuleCollider = ((Component)this).GetComponent<CapsuleCollider>(); sphereCollider = ((Component)this).GetComponent<SphereCollider>(); if (Object.op_Implicit((Object)(object)direction)) { ((Behaviour)direction).enabled = false; } if (Object.op_Implicit((Object)(object)capsuleCollider)) { ((Collider)capsuleCollider).enabled = false; } if (Object.op_Implicit((Object)(object)sphereCollider)) { ((Collider)sphereCollider).enabled = false; } if (Object.op_Implicit((Object)(object)modelLocator) && Object.op_Implicit((Object)(object)modelLocator.modelTransform)) { modelTransform = modelLocator.modelTransform; originalRotation = modelTransform.rotation; if (((Object)((Component)modelLocator).gameObject).name == "GreaterWispBody(Clone)") { modelLocator.dontReleaseModelOnDeath = true; modelLocator.dontDetatchFromParent = true; } ((Behaviour)modelLocator).enabled = false; } } private void FixedUpdate() { //IL_0105: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ee: Unknown result type (might be due to invalid IL or missing references) age += Time.fixedDeltaTime; if (!Object.op_Implicit((Object)(object)grabber)) { Release(); return; } if (Object.op_Implicit((Object)(object)grabberBodyMachine)) { bool num = grabberBodyMachine.state is ShowStopper; if (num) { seenGrabberInShowStopper = true; } if ((!num && seenGrabberInShowStopper) || (!seenGrabberInShowStopper && age > 1f)) { Release(); return; } } if (!Object.op_Implicit((Object)(object)pivotTransform)) { Release(); return; } if (Object.op_Implicit((Object)(object)motor) && Object.op_Implicit((Object)(object)body) && body.hasEffectiveAuthority) { motor.disableAirControlUntilCollision = true; motor.velocity = Vector3.zero; motor.rootMotion = Vector3.zero; ((BaseCharacterController)motor).Motor.SetPosition(pivotTransform.position, true); } ((Component)this).transform.position = pivotTransform.position; if (Object.op_Implicit((Object)(object)modelTransform)) { modelTransform.position = pivotTransform.position; modelTransform.rotation = pivotTransform.rotation; } } } public class SyncSettGrab : INetMessage, ISerializableObject { private NetworkInstanceId grabberId; private NetworkInstanceId targetId; public SyncSettGrab() { } public SyncSettGrab(NetworkInstanceId grabberId, NetworkInstanceId targetId) { //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) this.grabberId = grabberId; this.targetId = targetId; } public void Serialize(NetworkWriter writer) { //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) writer.Write(grabberId); writer.Write(targetId); } public void Deserialize(NetworkReader reader) { //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_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) grabberId = reader.ReadNetworkId(); targetId = reader.ReadNetworkId(); } public void OnReceived() { //IL_0001: 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) GameObject grabber = Util.FindNetworkObject(grabberId); GameObject target = Util.FindNetworkObject(targetId); SettGrabController.Apply(grabber, target); } } public class SyncSettRelease : INetMessage, ISerializableObject { private NetworkInstanceId targetId; public SyncSettRelease() { } public SyncSettRelease(NetworkInstanceId targetId) { //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) this.targetId = targetId; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(targetId); } public void Deserialize(NetworkReader reader) { //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) targetId = reader.ReadNetworkId(); } public void OnReceived() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(targetId); if (Object.op_Implicit((Object)(object)val)) { SettGrabController component = val.GetComponent<SettGrabController>(); if (Object.op_Implicit((Object)(object)component)) { component.Release(); } } } } public class SettGroundIndicator : MonoBehaviour { public const float rotationSpeed = 25f; public const float groundOffset = 0.3f; public const float ringSeparation = 0.1f; public const float brightness = 0.5f; public const int rings = 16; public const int segments = 48; public const float rebuildInterval = 0.05f; public const float probeHeight = 8f; public const float probeDepth = 30f; private static Texture2D markerTexture; private static Texture2D closingTexture; private Mesh markerMesh; private Mesh closingMesh; private Material markerMaterial; private Material closingMaterial; private Vector3[] baseVertices; private Vector3[] liftedVertices; private Vector2[] flatPositions; private Vector2[] markerUVs; private Vector2[] closingUVs; private float radius; private float closingFraction = 1f; private float intensity = 1f; private float spin; private float rebuildTimer; private Vector3 lastCenter; private bool hasGeometry; public static SettGroundIndicator Create(float radius) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) SettGroundIndicator settGroundIndicator = new GameObject("SettGroundIndicator").AddComponent<SettGroundIndicator>(); settGroundIndicator.radius = radius; settGroundIndicator.Setup(); return settGroundIndicator; } public void SetGround(Vector3 point, Vector3 normal) { //IL_0006: 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_004e: 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_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) ((Component)this).transform.rotation = Quaternion.identity; if (hasGeometry) { Vector3 val = point - lastCenter; if (!(((Vector3)(ref val)).sqrMagnitude > 0.0625f) && !(rebuildTimer <= 0f)) { return; } } ((Component)this).transform.position = point; lastCenter = point; rebuildTimer = 0.05f; RebuildGeometry(); } public void SetClosing(float fraction) { closingFraction = Mathf.Clamp01(fraction); } public void SetIntensity(float value) { intensity = Mathf.Max(0f, value); } private void Setup() { //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f1: 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_0105: 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) EnsureTextures(); Material material = SettGoldAura.GetMaterial(); markerMaterial = CreateMaterial(material, markerTexture, 3000); closingMaterial = CreateMaterial(material, closingTexture, 3001); int num = 769; baseVertices = (Vector3[])(object)new Vector3[num]; liftedVertices = (Vector3[])(object)new Vector3[num]; flatPositions = (Vector2[])(object)new Vector2[num]; markerUVs = (Vector2[])(object)new Vector2[num]; closingUVs = (Vector2[])(object)new Vector2[num]; Color[] array = (Color[])(object)new Color[num]; flatPositions[0] = Vector2.zero; array[0] = Color.white; for (int i = 1; i <= 16; i++) { float num2 = radius * (float)i / 16f; for (int j = 0; j < 48; j++) { float num3 = (float)j * MathF.PI * 2f / 48f; int num4 = VertexIndex(i, j); flatPositions[num4] = new Vector2(Mathf.Cos(num3), Mathf.Sin(num3)) * num2; array[num4] = Color.white; } } int[] triangles = BuildTriangles(); markerMesh = CreateMesh("SettGroundIndicatorMarker", baseVertices, array, triangles); closingMesh = CreateMesh("SettGroundIndicatorClosing", liftedVertices, array, triangles); CreateLayer("Marker", markerMesh, markerMaterial); CreateLayer("Closing", closingMesh, closingMaterial); } private static int VertexIndex(int ring, int segment) { return 1 + (ring - 1) * 48 + segment; } private static int[] BuildTriangles() { int num = 48; int[] array = new int[(num + 15 * num * 2) * 3]; int num2 = 0; for (int i = 0; i < num; i++) { int segment = (i + 1) % num; array[num2++] = 0; array[num2++] = VertexIndex(1, segment); array[num2++] = VertexIndex(1, i); } for (int j = 1; j < 16; j++) { for (int k = 0; k < num; k++) { int segment2 = (k + 1) % num; int num3 = VertexIndex(j, k); int num4 = VertexIndex(j, segment2); int num5 = VertexIndex(j + 1, k); int num6 = VertexIndex(j + 1, segment2); array[num2++] = num3; array[num2++] = num4; array[num2++] = num5; array[num2++] = num4; array[num2++] = num6; array[num2++] = num5; } } return array; } private static Mesh CreateMesh(string name, Vector3[] vertices, Color[] colors, int[] triangles) { //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_000c: 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_0019: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown Mesh val = new Mesh { name = name }; val.MarkDynamic(); val.vertices = vertices; val.colors = colors; val.uv = (Vector2[])(object)new Vector2[vertices.Length]; val.triangles = triangles; return val; } private void CreateLayer(string name, Mesh mesh, Material material) { //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_0018: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); val.AddComponent<MeshFilter>().sharedMesh = mesh; MeshRenderer obj = val.AddComponent<MeshRenderer>(); ((Renderer)obj).sharedMaterial = material; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; ((Renderer)obj).sortingOrder = material.renderQueue - 3000; } private void RebuildGeometry() { //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_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_0026: 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_0039: 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_005c: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009e: 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_00b5: 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_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) Vector3 position = ((Component)this).transform.position; RaycastHit val2 = default(RaycastHit); for (int i = 0; i < flatPositions.Length; i++) { Vector2 val = flatPositions[i]; float num = (Physics.Raycast(new Vector3(position.x + val.x, position.y + 8f, position.z + val.y), Vector3.down, ref val2, 30f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)) ? (((RaycastHit)(ref val2)).point.y - position.y) : 0f); baseVertices[i] = new Vector3(val.x, num + 0.3f, val.y); liftedVertices[i] = new Vector3(val.x, num + 0.3f + 0.1f, val.y); } markerMesh.vertices = baseVertices; markerMesh.RecalculateBounds(); closingMesh.vertices = liftedVertices; closingMesh.RecalculateBounds(); hasGeometry = true; } private void UpdateUVs() { //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_0099: 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_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_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_00e3: 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_0100: 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_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) float num = spin * (MathF.PI / 180f); float num2 = (0f - spin) * 2f * (MathF.PI / 180f); float num3 = 1f / (radius * 2f); float num4 = 1f / (radius * 2f * Mathf.Max(0.01f, closingFraction)); float num5 = Mathf.Cos(num); float num6 = Mathf.Sin(num); float num7 = Mathf.Cos(num2); float num8 = Mathf.Sin(num2); for (int i = 0; i < flatPositions.Length; i++) { Vector2 val = flatPositions[i]; markerUVs[i] = new Vector2(0.5f + (val.x * num5 - val.y * num6) * num3, 0.5f + (val.x * num6 + val.y * num5) * num3); closingUVs[i] = new Vector2(0.5f + (val.x * num7 - val.y * num8) * num4, 0.5f + (val.x * num8 + val.y * num7) * num4); } markerMesh.uv = markerUVs; closingMesh.uv = closingUVs; } private void Update() { rebuildTimer -= Time.deltaTime; spin = (spin + 25f * Time.deltaTime) % 360f; if (hasGeometry) { UpdateUVs(); } float num = 0.85f + 0.15f * Mathf.Sin(Time.time * 10f); Tint(markerMaterial, 0.8f * intensity * num * 0.5f); Tint(closingMaterial, (0.6f + 0.4f * (1f - closingFraction)) * intensity * 0.5f); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)markerMaterial)) { Object.Destroy((Object)(object)markerMaterial); } if (Object.op_Implicit((Object)(object)closingMaterial)) { Object.Destroy((Object)(object)closingMaterial); } if (Object.op_Implicit((Object)(object)markerMesh)) { Object.Destroy((Object)(object)markerMesh); } if (Object.op_Implicit((Object)(object)closingMesh)) { Object.Destroy((Object)(object)closingMesh); } } private static Material CreateMaterial(Material baseMaterial, Texture2D texture, int renderQueue) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown Material val = new Material(baseMaterial); val.renderQueue = renderQueue; if (val.HasProperty("_ZWrite")) { val.SetFloat("_ZWrite", 0f); } if (val.HasProperty("_Boost")) { val.SetFloat("_Boost", 1f); } if (val.HasProperty("_AlphaBoost")) { val.SetFloat("_AlphaBoost", 1f); } if (val.HasProperty("_Cull")) { val.SetFloat("_Cull", 0f); } val.mainTexture = (Texture)(object)texture; if (val.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)texture); } if (val.HasProperty("_Cloud1Tex")) { val.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.whiteTexture); } if (val.HasProperty("_Cloud2Tex")) { val.SetTexture("_Cloud2Tex", (Texture)(object)Texture2D.whiteTexture); } if (val.HasProperty("_InvFade")) { val.SetFloat("_InvFade", 30f); } return val; } private static void Tint(Material material, float alpha) { //IL_0038: 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) if (Object.op_Implicit((Object)(object)material)) { Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.8f, 0.35f, Mathf.Clamp01(alpha)); if (material.HasProperty("_TintColor")) { material.SetColor("_TintColor", val); } if (material.HasProperty("_Color")) { material.SetColor("_Color", val); } } } private static void EnsureTextures() { if (!Object.op_Implicit((Object)(object)markerTexture)) { markerTexture = BuildTexture(marker: true); } if (!Object.op_Implicit((Object)(object)closingTexture)) { closingTexture = BuildTexture(marker: false); } } private static float Band(float r, float inner, float outer, float softness) { float num = Mathf.Clamp01((r - inner) / softness); float num2 = Mathf.Clamp01((outer - r) / softness); return Mathf.Min(num, num2); } private static Texture2D BuildTexture(bool marker) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_01c3: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(256, 256, (TextureFormat)4, false); ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; for (int i = 0; i < 256; i++) { for (int j = 0; j < 256; j++) { float num = ((float)j + 0.5f) / 256f * 2f - 1f; float num2 = ((float)i + 0.5f) / 256f * 2f - 1f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num11; if (marker) { float num4 = ((Mathf.Abs(Mathf.Repeat(Mathf.Atan2(num2, num) * 57.29578f + 180f, 30f) - 15f) > 12.5f) ? 1f : 0f); float num5 = Band(num3, 0.93f, 0.995f, 0.015f); float num6 = Band(num3, 0.86f, 0.88f, 0.01f) * 0.6f; float num7 = Band(num3, 0.78f, 0.9f, 0.01f) * num4 * 0.8f; float num8 = Band(num3, 0.3f, 0.33f, 0.01f) * 0.7f; float num9 = Mathf.Clamp01((0.06f - num3) / 0.02f) * 0.8f; float num10 = ((num3 < 0.93f) ? Mathf.Lerp(0.04f, 0.2f, num3 / 0.93f) : 0f); num11 = Mathf.Max(num5, Mathf.Max(num6, Mathf.Max(num7, Mathf.Max(num8, Mathf.Max(num9, num10))))); } else { num11 = Band(num3, 0.9f, 0.99f, 0.03f); } val.SetPixel(j, i, new Color(1f, 1f, 1f, num11)); } } val.Apply(); return val; } } public class SettHandEnergy : MonoBehaviour { public const float sizeScale = 1f; public const float coreSize = 1.1f; public const float gatherRadius = 2.2f; private Transform hand; private ParticleSystem core; private ParticleSystem gather; private ParticleSystem burst; private float charge; private float fade = 1f; private bool released; private bool stopping; public static SettHandEnergy Create(Transform hand) { //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_001b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)hand)) { return null; } GameObject val = new GameObject("SettHandEnergy"); val.transform.position = hand.position; SettHandEnergy settHandEnergy = val.AddComponent<SettHandEnergy>(); settHandEnergy.hand = hand; settHandEnergy.Setup(); return settHandEnergy; } public void SetCharge(float value) { charge = Mathf.Clamp01(value); } public void Release(bool fullGrit) { if (!released) { released = true; if (Object.op_Implicit((Object)(object)burst)) { burst.Emit(fullGrit ? 70 : 45); } } } public void Stop() { if (!stopping) { stopping = true; if (Object.op_Implicit((Object)(object)core)) { core.Stop(true, (ParticleSystemStopBehavior)1); } if (Object.op_Implicit((Object)(object)gather)) { gather.Stop(true, (ParticleSystemStopBehavior)1); } Object.Destroy((Object)(object)((Component)this).gameObject, 0.6f); } } private void Setup() { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0077: 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_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_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_00e3: 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_010a: 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_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_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_01b8: 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_01d3: 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_01ff: 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_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_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) Material material = SettGoldAura.GetMaterial(); core = CreateSystem("Core", material, (ParticleSystemRenderMode)0, 120); MainModule main = core.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.08f, 0.16f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, MathF.PI * 2f); ((MainModule)(ref main)).startColor = new MinMaxGradient(Color.white, new Color(1f, 0.8f, 0.3f)); ShapeModule shape = core.shape; ((ShapeModule)(ref shape)).enabled = false; gather = CreateSystem("Gather", material, (ParticleSystemRenderMode)1, 300); float num = 0.22f; float num2 = 2.2f; MainModule main2 = gather.main; ((MainModule)(ref main2)).startLifetime = MinMaxCurve.op_Implicit(num); ((MainModule)(ref main2)).startSpeed = MinMaxCurve.op_Implicit((0f - num2) / num); ((MainModule)(ref main2)).startSize = new MinMaxCurve(0.08f, 0.16f); ((MainModule)(ref main2)).startColor = new MinMaxGradient(new Color(1f, 0.95f, 0.7f), new Color(1f, 0.7f, 0.2f)); ShapeModule shape2 = gather.shape; ((ShapeModule)(ref shape2)).enabled = true; ((ShapeModule)(ref shape2)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape2)).radius = num2; ((ShapeModule)(ref shape2)).radiusThickness = 0f; ParticleSystemRenderer component = ((Component)gather).GetComponent<ParticleSystemRenderer>(); component.lengthScale = 3f; component.velocityScale = 0.04f; burst = CreateSystem("Burst", material, (ParticleSystemRenderMode)1, 200); MainModule main3 = burst.main; ((MainModule)(ref main3)).loop = false; ((MainModule)(ref main3)).startLifetime = new MinMaxCurve(0.15f, 0.35f); ((MainModule)(ref main3)).startSpeed = new MinMaxCurve(12f, 28f); ((MainModule)(ref main3)).startSize = new MinMaxCurve(0.1f, 0.25f); ((MainModule)(ref main3)).startColor = new MinMaxGradient(Color.white, new Color(1f, 0.72f, 0.18f)); ((MainModule)(ref main3)).simulationSpace = (ParticleSystemSimulationSpace)1; ShapeModule shape3 = burst.shape; ((ShapeModule)(ref shape3)).enabled = true; ((ShapeModule)(ref shape3)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape3)).radius = 0.3f; ParticleSystemRenderer component2 = ((Component)burst).GetComponent<ParticleSystemRenderer>(); component2.lengthScale = 2.5f; component2.velocityScale = 0.03f; core.Play(); gather.Play(); } private ParticleSystem CreateSystem(string name, Material material, ParticleSystemRenderMode mode, int maxParticles) { //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_002e: 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) //IL_0072: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //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_00c2: 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_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_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_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_0127: 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) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); ParticleSystem val2 = val.AddComponent<ParticleSystem>(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).playOnAwake = false; ((MainModule)(ref main)).duration = 1f; ((MainModule)(ref main)).maxParticles = maxParticles; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(new Color(1f, 0.75f, 0.2f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.2f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); ParticleSystemRenderer component = val.GetComponent<ParticleSystemRenderer>(); component.renderMode = mode; ((Renderer)component).material = material; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; return val2; } private void LateUpdate() { //IL_0019: 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_00c0: 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_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_00ed: 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) if (Object.op_Implicit((Object)(object)hand)) { ((Component)this).transform.position = hand.position; } if (!stopping) { if (released) { fade = Mathf.Max(0f, fade - Time.deltaTime * 4f); } float num = charge * fade; float num2 = 1f + 0.12f * Mathf.Sin(Time.time * 30f); if (Object.op_Implicit((Object)(object)core)) { MainModule main = core.main; float num3 = 1.1f * (0.25f + 0.75f * num) * num2; ((MainModule)(ref main)).startSize = new MinMaxCurve(num3 * 0.8f, num3 * 1.2f); EmissionModule emission = core.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit((num > 0.01f) ? 90f : 0f); } if (Object.op_Implicit((Object)(object)gather)) { EmissionModule emission2 = gather.emission; ((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit(released ? 0f : (40f + 260f * charge)); } } } } public class HayMaker : BaseSkillState { public static Vector3 CameraPosition = new Vector3(1.8f, -2.4f, -8f); public static float hayMakerDamageCoefficient = Config.hayMakerDamageCoefficient.Value; public static float hayMakerGritBonus = Config.hayMakerGritBonus.Value; public static float hayMakerGritBonusPer4 = Config.hayMakerGritBonusPer4.Value; public static float hayMakerProcCoefficient = 1f; public GameObject blastEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Treebot/SonicBoomEffect.prefab").WaitForCompletion(); public float duration; protected Animator animator; protected float baseDuration = 1.51f; protected float EarlyExitTime = 1.2f; protected float startUp = 0.78f; protected float stopwatch; private float gritSnapShot; private bool hasFired; private float maxGritSnapShot; private static GameObject areaIndicatorPrefab; private Transform slamIndicatorInstance; private Transform chargeIndicatorInstance; private Material slamIndicatorMaterial; private Material chargeIndicatorMaterial; private TemporaryOverlay temporaryOverlay; private Material glowMaterial; private Light glowLight; private SettGoldAura aura; private SettHandEnergy handEnergy; private bool fullGrit; private float fireFlashTimer; public static readonly Color goldColor = new Color(1f, 0.72f, 0.18f); public static readonly Color brightGoldColor = new Color(1f, 0.85f, 0.4f); public const float hitRadius = 15f; public const float reachDistance = 13f; private const float fireFlashDuration = 0.35f; public override void FixedUpdate() { //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_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_004c: 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_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_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_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_0139: 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_013b: 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_014b: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; Ray aimRay = ((BaseState)this).GetAimRay(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && ((Ray)(ref aimRay)).direction != Vector3.zero) { ((EntityState)this).characterDirection.moveVector = ((Ray)(ref aimRay)).direction; } if (!Object.op_Implicit((Object)(object)slamIndicatorInstance)) { CreateIndicator(); } UpdateSlamIndicator(); if (stopwatch >= startUp && !hasFired) { hasFired = true; fireFlashTimer = 0.35f; if (Object.op_Implicit((Object)(object)handEnergy)) { handEnergy.Release(fullGrit); } if (Config.voiceLines.Value) { Util.PlaySound("SettWVO", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority) { Fire(); } for (int i = 0; i <= 25; i++) { float num = 45f; Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 10f, num, 1f, 1f, 0f, 0f); EffectManager.SpawnEffect(blastEffectPrefab, new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = 100f, rotation = Util.QuaternionSafeLookRotation(val) }, false); } } if (stopwatch >= EarlyExitTime && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public override void OnEnter() { //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) ((BaseState)this).OnEnter(); ((BaseState)this).StartAimMode(baseDuration, false); animator = ((EntityState)this).GetModelAnimator(); hasFired = false; duration = baseDuration; ((EntityState)this).characterMotor.velocity = Vector3.zero; GritComponent component = ((EntityState)this).GetComponent<GritComponent>(); float currentGrit = component.GetCurrentGrit(); float maxGrit = component.GetMaxGrit(); gritSnapShot = currentGrit; maxGritSnapShot = maxGrit; if (((EntityState)this).isAuthority) { ((EntityState)this).healthComponent.AddBarrierAuthority(currentGrit); component.AddGritAuthority(0f - currentGrit); } fullGrit = gritSnapShot >= maxGritSnapShot; if (fullGrit) { ((EntityState)this).PlayCrossfade("Fullbody, Override", "HayMaker2", "HayMaker.playbackRate", duration, 0.2f); } else { ((EntityState)this).PlayCrossfade("Fullbody, Override", "HayMaker", "HayMaker.playbackRate", duration, 0.2f); } Util.PlaySound("SettWSFX", ((EntityState)this).gameObject); CreateGoldGlow(); if (!Object.op_Implicit((Object)(object)slamIndicatorInstance)) { CreateIndicator(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)slamIndicatorInstance)) { EntityState.Destroy((Object)(object)((Component)slamIndicatorInstance).gameObject); } if (Object.op_Implicit((Object)(object)chargeIndicatorInstance)) { EntityState.Destroy((Object)(object)((Component)chargeIndicatorInstance).gameObject); } if (Object.op_Implicit((Object)(object)slamIndicatorMaterial)) { EntityState.Destroy((Object)(object)slamIndicatorMaterial); } if (Object.op_Implicit((Object)(object)chargeIndicatorMaterial)) { EntityState.Destroy((Object)(object)chargeIndicatorMaterial); } if (Object.op_Implicit((Object)(object)temporaryOverlay)) { EntityState.Destroy((Object)(object)temporaryOverlay); } if (Object.op_Implicit((Object)(object)glowMaterial)) { EntityState.Destroy((Object)(object)glowMaterial); } if (Object.op_Implicit((Object)(object)glowLight)) { EntityState.Destroy((Object)(object)((Component)glowLight).gameObject); } if (Object.op_Implicit((Object)(object)aura)) { aura.Stop(); } if (Object.op_Implicit((Object)(object)handEnergy)) { handEnergy.Stop(); } ((EntityState)this).OnExit(); } protected virtual void OnHitEnemyAuthority() { } private void Fire() { //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_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_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_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: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid