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 UrgotMod v1.0.3
UrgotMod.dll
Decompiled 10 months 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.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Captain.Weapon; using EntityStates.Commando.CommandoWeapon; using HG; using HG.BlendableTypes; using IL.RoR2; using KinematicCharacterController; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.ContentManagement; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Serialization; using UrgotMod; using UrgotMod.Controllers; using UrgotMod.Modules; using UrgotMod.Modules.Survivors; using UrgotMod.SkillStates; using UrgotMod.SkillStates.BaseStates; using UrgotMod.SkillStates.Emotes; using UrgotMod.SkillStates.Keystone; using UrgotMod.States; using UrgotMod.States.Emotes; [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("UrgotMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.3.0")] [assembly: AssemblyInformationalVersion("1.0.3")] [assembly: AssemblyProduct("UrgotMod")] [assembly: AssemblyTitle("UrgotMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.3.0")] [module: UnverifiableCode] public class FBDSkillOverrideController : MonoBehaviour { public SkillDef FBDSkillDef; public SkillDef NoMercySkillDef = new SkillDef { skillName = "URGOT_SPECIAL2_NAME", skillNameToken = "rahhhhhhhhhhhh", skillDescriptionToken = "you shoudnt see this actually", icon = Assets.mainAssetBundle.LoadAsset<Sprite>("urgot_rrecast"), activationState = new SerializableEntityStateType(typeof(NoMercy)), activationStateMachineName = "Body", baseMaxStock = 1, baseRechargeInterval = 0.5f, beginSkillCooldownOnSkillEnd = true, canceledFromSprinting = false, forceSprintDuringState = false, fullRestockOnAssign = true, interruptPriority = (InterruptPriority)2, resetCooldownTimerOnUse = false, isCombatSkill = true, mustKeyPress = false, cancelSprintingOnActivation = true, rechargeStock = 1, requiredStock = 1, stockToConsume = 1 }; private bool _canActivateNoMercy; private float _eTime; public bool mayExecute; private SkillLocator skillLocator; private GenericSkill specialSkill; private bool isOverridden; public bool canActivateNoMercy { get { return _canActivateNoMercy; } set { _canActivateNoMercy = value; UpdateSkillOverride(); } } public float eTime { get { if (!(_eTime < 5f) || !(_eTime > 0f)) { return 5f; } return _eTime; } set { _eTime = value; } } private void Start() { skillLocator = ((Component)this).GetComponent<SkillLocator>(); if ((Object)(object)skillLocator != (Object)null) { specialSkill = skillLocator.special; } } public void UpdateSkillOverride() { FBDSkillDef = Skills.skillDefs.Find((SkillDef SkillDef) => SkillDef.skillName == "URGOT_SPECIAL_NAME"); if (canActivateNoMercy && !isOverridden) { OverrideToNoMercy(); } else if (!canActivateNoMercy && isOverridden) { RestoreToFBD(); } } private void OverrideToNoMercy() { UrgotPlugin.Logger.LogMessage((object)"Hello?"); if ((Object)(object)specialSkill == (Object)null || (Object)(object)NoMercySkillDef == (Object)null) { UrgotPlugin.Logger.LogMessage((object)(((Object)(object)specialSkill == (Object)null) ? "Could not get special Skill" : "NoMercy skillDef is null")); } else if ((Object)(object)specialSkill.skillDef == (Object)(object)FBDSkillDef) { specialSkill.SetSkillOverride((object)this, NoMercySkillDef, (SkillOverridePriority)4); UrgotPlugin.Logger.LogMessage((object)"now what"); specialSkill.stock = 1; specialSkill.rechargeStopwatch = 0f; isOverridden = true; } else { UrgotPlugin.Logger.LogMessage((object)$"Special skillDef is not equal to {FBDSkillDef}"); } } private void RestoreToFBD() { if ((Object)(object)specialSkill == (Object)null || (Object)(object)FBDSkillDef == (Object)null) { UrgotPlugin.Logger.LogMessage((object)(((Object)(object)specialSkill == (Object)null) ? "Could not get special Skill" : "FBD skillDef is null")); return; } specialSkill.UnsetSkillOverride((object)this, NoMercySkillDef, (SkillOverridePriority)4); isOverridden = false; } public void SetNoMercyCondition(bool condition) { canActivateNoMercy = condition; } } internal enum UrgotCameraParams { DEFAULT, EMOTE } public enum AnimationLayer { Base, FullBody, Gesture } public static class AnimationLayerNames { private static readonly Dictionary<AnimationLayer, string> layerNames = new Dictionary<AnimationLayer, string> { { AnimationLayer.Base, "Base" }, { AnimationLayer.FullBody, "FullBody, Override" }, { AnimationLayer.Gesture, "Gesture, Override" } }; public static string GetLayerName(this AnimationLayer layer) { if (!layerNames.TryGetValue(layer, out var value)) { return layer.ToString(); } return value; } } 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 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 = true, bool slayer = false, bool poisonous = 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" }; } if (slayer) { keywordTokens = new string[1] { "KEYWORD_SLAYER" }; } } } namespace UrgotMod { 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("PlayVO", 1f); ((MonoBehaviour)this).Invoke("PlaySFX", 0.05f); } private void PlayVO() { if (Config.voiceLines.Value) { UrgotPlugin.Logger.LogMessage((object)"menus voiceline null check"); playID = Util.PlaySound("menu", ((Component)this).gameObject); } } private void PlaySFX() { playID2 = Util.PlaySound("menuSFX", ((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.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.DogWithWine.Urgot", "Urgot", "1.0.3")] public class UrgotPlugin : BaseUnityPlugin { public const string DEVELOPER_PREFIX = "URGOT"; public const string MODNAME = "Urgot"; public const string MODUID = "com.DogWithWine.Urgot"; public const string MODVERSION = "1.0.3"; public static UrgotPlugin instance; public static ModdedDamageType urgotDamage; internal List<SurvivorBase> Survivors = new List<SurvivorBase>(); internal static ManualLogSource Logger; private void Awake() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) Logger = ((BaseUnityPlugin)this).Logger; instance = this; try { urgotDamage = DamageAPI.ReserveDamageType(); Assets.Initialize(); Config.ReadConfig(); CameraParams.InitializeParams(); UrgotMod.Modules.States.RegisterStates(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); new Urgot().Initialize(); Logger.LogMessage((object)"ok ik this one is kinda uneccessary"); new ContentPacks().Initialize(); ContentManager.onContentPacksAssigned += LateSetup; Hook(); } catch (Exception ex) { Logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } 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 CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); PickupPickerController.FixedUpdateServer += new hook_FixedUpdateServer(PickupPickerController_FixedUpdateServer); } private void Run_OnServerSceneChanged(orig_OnServerSceneChanged orig, Run self, string sceneName) { orig.Invoke(self, sceneName); foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { CharacterBody body = instance.body.GetBody(); if (Object.op_Implicit((Object)(object)body.healthComponent)) { while (body.healthComponent.body.HasBuff(Buffs.executionTokenBuff)) { body.healthComponent.body.RemoveBuff(Buffs.executionTokenBuff); } } } } 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); } if (self.HasBuff(Buffs.lethalBuff)) { float num3 = self.GetBuffCount(Buffs.lethalBuff); self.attackSpeed += self.attackSpeed * (num3 * 0.1f); } if (self.HasBuff(Buffs.conquerorBuff)) { float num4 = self.GetBuffCount(Buffs.conquerorBuff); self.damage += num4 * (0.6f + num * 0.045f); } if (self.HasBuff(Buffs.movementSpeedBuff)) { self.moveSpeed += self.moveSpeed * (0.3f + num * 0.05f); } } } private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj) { } 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); } public void OnDestroy() { try { UnHooks(); } catch (Exception ex) { Logger.LogError((object)(ex.Message + " - " + ex.StackTrace)); } } 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats); PickupPickerController.FixedUpdateServer -= new hook_FixedUpdateServer(PickupPickerController_FixedUpdateServer); Run.OnServerSceneChanged -= new hook_OnServerSceneChanged(Run_OnServerSceneChanged); } } } namespace UrgotMod.States { public class UrgotMain : GenericCharacterMain { private ChildLocator childLocator; private Animator animator; public LocalUser localUser; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); childLocator = ((EntityState)this).GetModelChildLocator(); animator = ((EntityState)this).GetModelAnimator(); 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); } } } public override void FixedUpdate() { ((GenericCharacterMain)this).FixedUpdate(); } public override void OnExit() { ((GenericCharacterMain)this).OnExit(); } } } namespace UrgotMod.States.Emotes { public class Dance : BaseEmote { private GameObject hat; public override void OnEnter() { animString = "Dance"; duration = 2.042f; soundString = "dance"; base.OnEnter(); if (!Object.op_Implicit((Object)(object)hat)) { hat = Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>("hat")); } hat.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)hat)) { hat.transform.parent = ((Component)((BaseState)this).FindModelChild("AttachObj")).transform; hat.transform.position = ((Component)((BaseState)this).FindModelChild("AttachObj")).transform.position; hat.transform.localPosition = new Vector3(0.1517885f, 0.1841809f, -0.1253804f); hat.transform.localRotation = Quaternion.Euler(-176.593f, 85.119f, -9.799011f); } if (((EntityState)this).fixedAge >= 2.042f && !hat.activeSelf) { hat.SetActive(true); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)hat)) { EntityState.Destroy((Object)(object)hat.gameObject); } base.OnExit(); } } public class Joke : BaseEmote { private GameObject Joke1; public override void OnEnter() { animString = "Joke"; duration = 9.75f; soundString = "joke"; Util.PlaySound("jokeSFX", ((EntityState)this).gameObject); base.OnEnter(); if (!Object.op_Implicit((Object)(object)Joke1)) { Joke1 = Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>("Joke1")); } Joke1.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)Joke1)) { Joke1.transform.parent = ((Component)((BaseState)this).FindModelChild("AttachObj")).transform; Joke1.transform.position = ((Component)((BaseState)this).FindModelChild("AttachObj")).transform.position; Joke1.transform.localPosition = new Vector3(0.1517885f, 0.1841809f, -0.1253804f); Joke1.transform.localRotation = Quaternion.Euler(-176.593f, 85.119f, -9.799011f); } if (((EntityState)this).fixedAge >= 9.75f && !Joke1.activeSelf) { Joke1.SetActive(true); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)Joke1)) { EntityState.Destroy((Object)(object)Joke1.gameObject); } base.OnExit(); } } public class Laugh : BaseEmote { public override void OnEnter() { animString = "Laugh"; duration = 3.667f; soundString = "laugh"; base.OnEnter(); } } public class Taunt : BaseEmote { public override void OnEnter() { animString = "Taunt"; duration = 4.708f; soundString = "religion"; base.OnEnter(); } } } namespace UrgotMod.SkillStates { public class CorrosiveCharge : BaseSkillState { public static float damageCoefficient = Config.corrosiveChargeDamageCoefficient.Value; public static float procCoefficient = Config.corrosiveChargeProcCoefficient.Value; public static float baseDuration = 1f; public static float throwForce = 150f; private float duration; private float fireTime; private bool hasFired; private Animator animator; private GameObject projectilePrefab; public override void OnEnter() { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 1f; ((BaseState)this).StartAimMode(duration, false); animator = ((EntityState)this).GetModelAnimator(); projectilePrefab = Projectiles.corrosiveChargePrefab; ((EntityState)this).PlayCrossfade("Gesture, Override", "CorrosiveCharge_fwd", "CorrosiveCharge.PlaybackRate", duration, 0.05f); ProjectileController component = projectilePrefab.GetComponent<ProjectileController>(); ProjectileDamage component2 = projectilePrefab.GetComponent<ProjectileDamage>(); projectilePrefab.GetComponent<StickFuse>().playerTeamIndex = ((BaseState)this).GetTeam(); component2.damage = ((EntityState)this).characterBody.damage * Config.corrosiveChargeDamageCoefficient.Value; component2.force = throwForce; component.owner = ((EntityState)this).gameObject; component.procChainMask = default(ProcChainMask); Fire(); } public override void OnExit() { ((EntityState)this).OnExit(); } private void Fire() { if (!hasFired) { hasFired = true; Util.PlaySound("corrosiveCharge", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { FireCharge(); } } } private void FireCharge() { //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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); if ((Object)(object)projectilePrefab != (Object)null) { bool crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); ((BaseState)this).AddRecoil(-1f * FireTazer.recoilAmplitude, -1.5f * FireTazer.recoilAmplitude, -0.25f * FireTazer.recoilAmplitude, 0.25f * FireTazer.recoilAmplitude); if (Object.op_Implicit((Object)(object)FireTazer.muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MuzzleFlashes/MuzzleflashLoader"), ((EntityState)this).gameObject, "LowerBarrel", false); } FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = projectilePrefab; val.position = ((Ray)(ref aimRay)).origin; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.procChainMask = default(ProcChainMask); val.target = null; val.owner = ((Component)((EntityState)this).characterBody).gameObject; val.damage = ((EntityState)this).characterBody.damage * damageCoefficient; val.crit = crit; val.force = 80f; val.damageColorIndex = (DamageColorIndex)4; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((EntityState)this).outer.SetNextStateToMain(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class Disdain : BaseSkillState { public bool willTransition; private List<GameObject> previousTargets = new List<GameObject>(); private static float missBaseDuration = 0.667f; private static float baseDuration = 0.667f; private float missDuration; private float duration; private bool missed; protected Vector3 dashVelocity; public float dashSpeed { get; private set; } public override void OnEnter() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); UrgotPlugin.Logger.LogMessage((object)"DisdainOnEnter"); willTransition = false; missed = true; duration = baseDuration / ((BaseState)this).attackSpeedStat; missDuration = missBaseDuration / ((BaseState)this).attackSpeedStat; Vector3 velocity = ((EntityState)this).characterMotor.velocity; Ray aimRay = ((BaseState)this).GetAimRay(); dashVelocity = velocity + ((Ray)(ref aimRay)).direction * 40f; ((EntityState)this).characterDirection.forward = ((Vector3)(ref ((EntityState)this).characterMotor.velocity)).normalized; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.disableAirControlUntilCollision = true; ((EntityState)this).characterMotor.velocity = dashVelocity; ((EntityState)this).GetModelAnimator().SetBoolString("mayDash", true); ((EntityState)this).PlayCrossfade("FullBody, Override", "Disdain_Move_fwd", "Disdain.PlaybackRate", duration, 0.05f); } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterMotor.velocity = dashVelocity; ((EntityState)this).characterDirection.forward = dashVelocity; ((EntityState)this).characterBody.isSprinting = true; AttemptGrab(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void AttemptGrab() { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Expected O, but got Unknown //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0337: 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_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); BullseyeSearch val = new BullseyeSearch { teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = true, searchOrigin = ((EntityState)this).transform.position, searchDirection = ((Ray)(ref aimRay)).direction, sortMode = (SortMode)1, maxDistanceFilter = 6f, maxAngleFilter = 90f }; val.RefreshCandidates(); HurtBox val2 = val.GetResults().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.healthComponent) && Object.op_Implicit((Object)(object)val2.healthComponent.body) && val2.healthComponent.body.isElite && !val2.healthComponent.body.isBoss) { ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterBody.isSprinting = false; willTransition = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new DisdainGrab()); missed = false; return; } BullseyeSearch val3 = new BullseyeSearch { teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = false, searchOrigin = ((EntityState)this).transform.position, searchDirection = ((Ray)(ref aimRay)).direction, sortMode = (SortMode)1, maxDistanceFilter = 7f, maxAngleFilter = 180f }; val3.RefreshCandidates(); val3.FilterOutGameObject(((EntityState)this).gameObject); HurtBox val4 = val3.GetResults().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val4) && !previousTargets.Contains(((Component)val4).gameObject) && Object.op_Implicit((Object)(object)val4.healthComponent) && Object.op_Implicit((Object)(object)val4.healthComponent.body) && !val4.healthComponent.body.isElite) { Vector3 val5 = ((Component)val4).gameObject.transform.position - ((EntityState)this).gameObject.transform.position; float num = Vector3.SignedAngle(((Ray)(ref aimRay)).direction, val5, Vector3.up); Vector3 val6 = Vector3.Cross((num > 0f) ? (-((Ray)(ref aimRay)).direction) : ((Ray)(ref aimRay)).direction, Vector3.up); Vector3 normalized = ((Vector3)(ref val6)).normalized; UrgotPlugin.Logger.LogMessage((object)($"My Position:{((EntityState)this).gameObject.transform.position}, " + $"Enemy Position:{((Component)val4).gameObject.transform.position}, " + $"Facing Direction: {((Ray)(ref aimRay)).direction} " + "Is on the " + ((num > 0f) ? "right" : "left"))); DamageInfo val7 = new DamageInfo(); val7.damage = ((BaseState)this).damageStat * 2f; val7.force = Vector3.zero + normalized * 2000f; val7.procCoefficient = 1f; val7.crit = false; val7.inflictor = ((EntityState)this).gameObject; val7.position = ((EntityState)this).gameObject.transform.position; val7.damageColorIndex = (DamageColorIndex)0; val7.damageType = DamageTypeCombo.op_Implicit((DamageType)32); val7.procChainMask = default(ProcChainMask); val7.attacker = ((EntityState)this).gameObject; val4.healthComponent.TakeDamage(val7); val4.healthComponent.TakeDamageForce(val7, true, true); val4.healthComponent.body.AddBuff(Buffs.PermanentDebuff); val4.healthComponent.body.AddTimedBuff(Buffs.Poisoned, 60f); previousTargets.Add(((Component)val4).gameObject); } } public override void OnExit() { ((EntityState)this).OnExit(); UrgotPlugin.Logger.LogMessage((object)"DisdainOnExit"); ((EntityState)this).GetModelAnimator().SetBoolString("mayDash", false); if (missed) { ((EntityState)this).PlayCrossfade("FullBody, Override", "Disdain_Miss_fwd", "Disdain_Miss_fwd", missDuration, 0.05f); missed = false; } foreach (GameObject previousTarget in previousTargets) { UrgotPlugin.Logger.LogMessage((object)((previousTarget != null) ? ((Object)previousTarget).name : null)); } UrgotPlugin.Logger.LogMessage((object)previousTargets.Count); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class DisdainGrab : BaseSkillState { public static float slamDamageCoefficient = Config.disdainDamageCoefficient.Value; public static float slamProcCoefficient = 1f; protected Animator animator; private UrgotGrabController grabController; private static float baseDuration = 0.833f; private float duration; private float initialTime; private bool hasGrabbed; private bool hasTurned; private HurtBox saveHurtbox; public override void OnEnter() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); hasTurned = false; UrgotPlugin.Logger.LogMessage((object)"GrabOnEnter"); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayCrossfade("FullBody, Override", "Disdain_Grab_fwd", "DisdainGrab.PlaybackRate", baseDuration, 0.05f); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); ((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); } public override void Update() { ((EntityState)this).Update(); } public override void FixedUpdate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((EntityState)this).FixedUpdate(); if (!hasGrabbed) { AttemptGrab(); } if (((EntityState)this).fixedAge >= baseDuration / 2f && !hasTurned) { CharacterDirection characterDirection = ((EntityState)this).characterDirection; Ray aimRay = ((BaseState)this).GetAimRay(); characterDirection.forward = -((Ray)(ref aimRay)).direction; hasTurned = true; } if (((EntityState)this).fixedAge >= baseDuration && ((EntityState)this).isAuthority && hasGrabbed) { ((EntityState)this).outer.SetNextStateToMain(); } } public void AttemptGrab() { //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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: 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_01da: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)grabController)) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); BullseyeSearch val = new BullseyeSearch { teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = true, searchOrigin = ((EntityState)this).transform.position, searchDirection = ((Ray)(ref aimRay)).direction, sortMode = (SortMode)1, maxDistanceFilter = 8f, maxAngleFilter = 90f }; val.RefreshCandidates(); val.FilterOutGameObject(((EntityState)this).gameObject); HurtBox val2 = val.GetResults().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val2)) { UrgotPlugin.Logger.LogMessage((object)((Component)val2).gameObject); if (Object.op_Implicit((Object)(object)val2.healthComponent) && Object.op_Implicit((Object)(object)val2.healthComponent.body) && (val2.healthComponent.body.isElite || !val2.healthComponent.body.isBoss)) { grabController = ((Component)val2.healthComponent.body).gameObject.AddComponent<UrgotGrabController>(); grabController.pivotTransform = ((BaseState)this).FindModelChild("AttatchObj"); grabController.baseTransform = ((BaseState)this).FindModelChild("MidCon"); grabController.baseScale = ((EntityState)this).gameObject.transform.lossyScale; DamageInfo val3 = new DamageInfo(); val3.damage = ((BaseState)this).damageStat * slamDamageCoefficient; val3.procCoefficient = slamProcCoefficient; val3.crit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master); val3.attacker = ((EntityState)this).gameObject; val3.inflictor = ((EntityState)this).gameObject; val3.position = ((EntityState)this).gameObject.transform.position; val3.damageColorIndex = (DamageColorIndex)0; val3.damageType = DamageTypeCombo.op_Implicit((DamageType)32); val3.procChainMask = default(ProcChainMask); val2.healthComponent.TakeDamage(val3); val2.healthComponent.body.AddBuff(Buffs.Weak); hasGrabbed = true; saveHurtbox = val2; } if (NetworkServer.active && !((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility)) { ((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility); } } } public override void OnExit() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnExit(); UrgotPlugin.Logger.LogMessage((object)"GrabOnExit"); Util.PlaySound("disdain_slam", ((Component)saveHurtbox).gameObject); if (Object.op_Implicit((Object)(object)grabController)) { grabController.Release(); } ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2); if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility)) { ((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility); } ((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); hasTurned = false; } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class DisdainWindup : BaseSkillState { public float duration; private Animator animator; private float baseDuration = 0.5f; public override void OnEnter() { ((BaseState)this).OnEnter(); UrgotPlugin.Logger.LogMessage((object)"WindupOnEnter"); animator = ((EntityState)this).GetModelAnimator(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).healthComponent.AddBarrierAuthority(((EntityState)this).healthComponent.fullBarrier * 0.25f); Util.PlaySound("DisdainStart", ((EntityState)this).gameObject); Util.PlaySound("DisdainShield", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("FullBody, Override", "Disdain_Start_fwd", "Disdain.PlaybackRate", duration, 0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextState((EntityState)(object)new Disdain()); } } public override void OnExit() { ((EntityState)this).OnExit(); UrgotPlugin.Logger.LogMessage((object)"WindupOnExit"); } } public class UrgotDragController : MonoBehaviour { public float executionTime; public GameObject attacker; public bool authority; public Vector3 scaleReference; private HealthComponent healthComponentC; private CapsuleCollider capsuleCollider; private CharacterDirection direction; private ModelLocator modelLocator; private Transform modelTransform; private CharacterMotor motor; private Quaternion originalRotation; private SphereCollider sphereCollider; private Vector3 startPosition; private Vector3 currentPosition; private DamageInfo damageInfo; private ProjectileStickOnImpact ProjectileStickOnImpactC; private float scaleFractionx; private float scaleFractiony; private float scaleFractionz; private float deathTimer; private float elapsedTime; private void Awake() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) motor = ((Component)this).GetComponent<CharacterMotor>(); modelLocator = ((Component)this).GetComponent<ModelLocator>(); direction = ((Component)this).GetComponent<CharacterDirection>(); sphereCollider = ((Component)this).GetComponent<SphereCollider>(); capsuleCollider = ((Component)this).GetComponent<CapsuleCollider>(); healthComponentC = ((Component)this).GetComponent<HealthComponent>(); ProjectileStickOnImpactC = ((Component)this).GetComponent<ProjectileStickOnImpact>(); startPosition = ((Component)this).transform.position; currentPosition = startPosition; authority = false; 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 Start() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) executionTime = attacker.GetComponent<FBDSkillOverrideController>().eTime; scaleFractiony = ((Component)this).transform.lossyScale.y * 0.05f; scaleFractionx = ((Component)this).transform.lossyScale.x * 0.05f; scaleFractionz = ((Component)this).transform.lossyScale.z * 0.05f; executionTime *= 0.6f; deathTimer = executionTime; elapsedTime = 0f; scaleReference = new Vector3(5f, 0f, 0f); } public void Release() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) 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; } Object.Destroy((Object)(object)this); } private void FixedUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) if (attacker.GetComponent<FBDSkillOverrideController>().mayExecute) { Vector3 val = ((Component)this).transform.position; _ = Vector3.oneVector; if (Object.op_Implicit((Object)(object)attacker.transform)) { currentPosition = ((Component)this).transform.position; val = CalculateNextPos(elapsedTime, currentPosition); } else { UrgotPlugin.Logger.LogWarning((object)$"base transform ({attacker.transform}) is null"); Release(); } if (Object.op_Implicit((Object)(object)motor)) { motor.disableAirControlUntilCollision = true; motor.velocity = Vector3.zero; motor.rootMotion = Vector3.zero; ((BaseCharacterController)motor).Motor.SetPosition(val, true); } ((Component)this).transform.position = val; if (Object.op_Implicit((Object)(object)modelTransform)) { modelTransform.position = val; modelTransform.rotation = originalRotation; } deathTimer -= Time.fixedDeltaTime; Vector3 val2 = attacker.transform.position - ((Component)this).transform.position; if (((Vector3)(ref val2)).magnitude <= ((Vector3)(ref scaleReference)).magnitude || deathTimer <= 0f) { Execute(); return; } ManualLogSource logger = UrgotPlugin.Logger; val2 = attacker.transform.position - ((Component)this).transform.position; logger.LogMessage((object)$"remaining distance: {((Vector3)(ref val2)).magnitude}, scaleReference.magnitude {((Vector3)(ref scaleReference)).magnitude}"); } } private Vector3 CalculateNextPos(float elapsedTime, Vector3 cPos) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) float val = elapsedTime / (executionTime / Time.fixedDeltaTime); elapsedTime += Time.fixedDeltaTime; return Vector3.Lerp(cPos, attacker.transform.position, Math.Min(val, 1f)); } private void Execute() { MakeDmgInfo(healthComponentC.fullCombinedHealth); healthComponentC.TakeDamage(damageInfo); attacker.GetComponent<FBDSkillOverrideController>().canActivateNoMercy = false; } private void MakeDmgInfo(float h) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0025: 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_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_0092: Unknown result type (might be due to invalid IL or missing references) damageInfo = new DamageInfo(); damageInfo.damage = CheckForCoolestNumber(h); damageInfo.damageColorIndex = (DamageColorIndex)13; damageInfo.procCoefficient = 1f; damageInfo.crit = false; damageInfo.inflictor = ((Component)this).gameObject; damageInfo.position = ((Component)this).gameObject.transform.position; damageInfo.damageType = DamageTypeCombo.op_Implicit((DamageType)262144); damageInfo.procChainMask = default(ProcChainMask); damageInfo.attacker = attacker; } private float CheckForCoolestNumber(float h) { int num = 9999; while (h > (float)num) { num *= 10; num += 9; } return num; } } public class FBD : BaseSkillState { public static float damageCoefficient = Config.FBDDamageCoefficient.Value; public static float procCoefficient = Config.FBDProcCoefficient.Value; public static float baseDuration = 1.5f; private float duration; private float fireTime; private bool hasFired; private Animator animator; private GameObject projectilePrefab; public override void OnEnter() { //IL_00ed: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); hasFired = false; duration = baseDuration / ((BaseState)this).attackSpeedStat; fireTime = 1f; ((BaseState)this).StartAimMode(duration, false); animator = ((EntityState)this).GetModelAnimator(); projectilePrefab = Projectiles.drillPrefab; ((EntityState)this).PlayCrossfade("FullBody, Override", "FBD_Start_fwd", "FBDStart.PlaybackRate", duration, 0.05f); if (Config.voiceLines.Value) { Util.PlaySound("FBD", ((EntityState)this).gameObject); } Util.PlaySound("FBDLaunch", ((EntityState)this).gameObject); ProjectileController component = projectilePrefab.GetComponent<ProjectileController>(); ProjectileDamage component2 = projectilePrefab.GetComponent<ProjectileDamage>(); ExecutionHandler component3 = projectilePrefab.GetComponent<ExecutionHandler>(); component2.damage = ((EntityState)this).characterBody.damage * damageCoefficient; component2.force = 0f; component.owner = ((EntityState)this).gameObject; component.procChainMask = default(ProcChainMask); component3.attacker = ((EntityState)this).gameObject; component3.stack = ((EntityState)this).characterBody.GetBuffCount(Buffs.executionTokenBuff); component3.healthComponentC = ((EntityState)this).healthComponent; component3.refVector = ((BaseState)this).FindModelChild("MeaterA").position - ((BaseState)this).FindModelChild("MeaterB").position; } private void Fire() { if (((EntityState)this).isAuthority) { FireCharge(); } } private void FireCharge() { //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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); if ((Object)(object)projectilePrefab != (Object)null) { bool crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master); ((EntityState)this).characterBody.AddSpreadBloom(1.5f); ((BaseState)this).AddRecoil(-1f * FireTazer.recoilAmplitude, -1.5f * FireTazer.recoilAmplitude, -0.25f * FireTazer.recoilAmplitude, 0.25f * FireTazer.recoilAmplitude); if (Object.op_Implicit((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MuzzleFlashes/MuzzleflashBFG"))) { EffectManager.SimpleMuzzleFlash(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MuzzleFlashes/MuzzleflashBFG"), ((EntityState)this).gameObject, "MidCon", false); } FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = projectilePrefab; _ = ((BaseState)this).FindModelChild("MidCon").position; val.position = ((BaseState)this).FindModelChild("MidCon").position; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.procChainMask = default(ProcChainMask); val.target = null; val.owner = ((Component)((EntityState)this).characterBody).gameObject; val.damage = ((EntityState)this).characterBody.damage * damageCoefficient; val.crit = crit; val.force = 80f; val.damageColorIndex = (DamageColorIndex)0; FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= baseDuration / 3f && !hasFired) { Fire(); hasFired = true; } if (((EntityState)this).fixedAge >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class UrgotGrabController : MonoBehaviour { public Transform pivotTransform; public Transform baseTransform; public Vector3 baseScale; private CapsuleCollider capsuleCollider; private CharacterDirection direction; private ModelLocator modelLocator; private Transform modelTransform; private CharacterMotor motor; private Quaternion originalRotation; private SphereCollider sphereCollider; public void Release() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) 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; } Object.Destroy((Object)(object)this); } private void Awake() { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) 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_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_0025: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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) Vector3 val2; if (Object.op_Implicit((Object)(object)pivotTransform) && Object.op_Implicit((Object)(object)baseTransform)) { float num = Mathf.Max(((Component)this).gameObject.transform.lossyScale.y / baseScale.y, 1f); Vector3 val = pivotTransform.position - baseTransform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; val2 = pivotTransform.position + normalized * num; } else { val2 = ((Component)this).transform.position; } if (Object.op_Implicit((Object)(object)motor)) { motor.disableAirControlUntilCollision = true; motor.velocity = Vector3.zero; motor.rootMotion = Vector3.zero; ((BaseCharacterController)motor).Motor.SetPosition(val2, true); } if (Object.op_Implicit((Object)(object)pivotTransform) && Object.op_Implicit((Object)(object)baseTransform)) { ((Component)this).transform.position = val2; } else { Release(); } if (Object.op_Implicit((Object)(object)modelTransform)) { modelTransform.position = val2; modelTransform.rotation = pivotTransform.rotation; } } } internal class NoMercy : BaseSkillState { public float duration; private FBDSkillOverrideController fBDSkillOverrideControllerC; private readonly float baseDuration = 5f; private Animator animator; private float t = 1.5f; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; t = duration * 0.3f; UrgotPlugin.Logger.LogMessage((object)$"attackSpeedStat: {((BaseState)this).attackSpeedStat}, this.duration:{duration}"); fBDSkillOverrideControllerC = ((EntityState)this).gameObject.GetComponent<FBDSkillOverrideController>(); fBDSkillOverrideControllerC.eTime = duration; fBDSkillOverrideControllerC.mayExecute = true; animator = ((EntityState)this).GetModelAnimator(); ((EntityState)this).PlayAnimation("Gesture, Override", "FBD_execute"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration) { fBDSkillOverrideControllerC.canActivateNoMercy = false; fBDSkillOverrideControllerC.mayExecute = false; } t -= Time.fixedDeltaTime; if (t <= 0f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } } } namespace UrgotMod.SkillStates.Keystone { public class ElectrocuteHandler : MonoBehaviour { public CharacterBody attackerBody; public float electrocuteCD = 5f; public float stopwatch; private static readonly int maxElectrocuteStacks = 3; private CharacterBody body; private int electrocuteStacks; private bool fired; private HurtBox hurtBox; public void AddStack() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (GetStacks() < maxElectrocuteStacks && !fired) { body.AddTimedBuff(Buffs.electrocuteDebuff.buffIndex, 3f); GetStacks(); } } public int GetStacks() { electrocuteStacks = body.GetBuffCount(Buffs.electrocuteDebuff); return electrocuteStacks; } public void SetStacks(int num) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) body.SetBuffCount(Buffs.electrocuteDebuff.buffIndex, num); GetStacks(); } private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); hurtBox = body.mainHurtBox; AddStack(); } private void FireLightning() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00af: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown if (GetStacks() >= maxElectrocuteStacks) { SetStacks(0); fired = true; float num = Mathf.Floor(attackerBody.level / 4f); if (Object.op_Implicit((Object)(object)hurtBox)) { float num2 = 6f + num * 0.75f; OrbManager.instance.AddOrb((Orb)new SimpleLightningStrikeOrb { attacker = ((Component)attackerBody).gameObject, damageColorIndex = (DamageColorIndex)3, damageValue = attackerBody.damage * num2, isCrit = Util.CheckRoll(attackerBody.crit, attackerBody.master), procChainMask = default(ProcChainMask), procCoefficient = 1f, target = hurtBox }); } } } private void FixedUpdate() { if (!fired && NetworkServer.active) { FireLightning(); } if (stopwatch < electrocuteCD) { stopwatch += Time.fixedDeltaTime; } if (stopwatch >= electrocuteCD) { Object.Destroy((Object)(object)this); } } } public class KeyStoneHandler : NetworkBehaviour, IOnDamageDealtServerReceiver, IOnTakeDamageServerReceiver { public enum KeyStones { None = 0, Conqueror = 1, Lethal = 2, PhaseRush = 4, Electrocute = 8 } public float conquerorMaxStacks = 12f; [FormerlySerializedAs("Keystone")] public GenericSkill keyStone; public KeyStones keyStoneType; public float lethalMaxStacks = 6f; public float UptimeStopwatch; private CharacterBody body; private float conquerorUpTime = 4f; private HealthComponent healthComponent; private float lethalUpTime = 6f; private float MaxthrottleTime = 0.5f; private EntityStateMachine outer; private float throttleUpdateTime; protected bool isAuthority => Util.HasEffectiveAuthority(outer.networkIdentity); public void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); outer = ((Component)this).GetComponent<EntityStateMachine>(); healthComponent = ((Component)this).GetComponent<HealthComponent>(); GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; } private void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 if (damageReport != null && damageReport.victimBody != null && damageReport.attackerBody != null && (int)damageReport.victimTeamIndex != 1 && damageReport.attackerBody.GetBuffCount(Buffs.movementSpeedBuff) < 1 && damageReport.attackerBody.baseNameToken == "URGOT_NAME" && ((Component)damageReport.attackerBody).GetComponent<KeyStoneHandler>().keyStoneType == KeyStones.PhaseRush) { damageReport.attackerBody.AddTimedBuff(Buffs.movementSpeedBuff, 3f); } } public void OnDamageDealtServer(DamageReport damageReport) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) if (damageReport == null || !Object.op_Implicit((Object)(object)damageReport.victimBody) || !Object.op_Implicit((Object)(object)damageReport.attacker) || !(damageReport.attackerBody.baseNameToken == "URGOT_NAME") || !DamageAPI.HasModdedDamageType(damageReport.damageInfo, UrgotPlugin.urgotDamage)) { return; } UptimeStopwatch = 0f; if (keyStoneType == KeyStones.PhaseRush) { if (damageReport.victimBody.GetBuffCount(Buffs.phaseRushDebuff) < 3) { damageReport.victimBody.AddTimedBuff(Buffs.phaseRushDebuff, 4f); } if (damageReport.victimBody.GetBuffCount(Buffs.phaseRushDebuff) >= 3 && body.GetBuffCount(Buffs.movementSpeedBuff) < 1) { body.AddTimedBuff(Buffs.movementSpeedBuff, 3f); } } if (keyStoneType == KeyStones.Electrocute) { ElectrocuteHandler component = ((Component)damageReport.victimBody).gameObject.GetComponent<ElectrocuteHandler>(); if (!Object.op_Implicit((Object)(object)component)) { ((Component)damageReport.victimBody).gameObject.AddComponent<ElectrocuteHandler>().attackerBody = damageReport.attackerBody; } else { component.AddStack(); } } AddKeyStoneBuff(); if (keyStoneType == KeyStones.Conqueror && GetKeyStoneBuffCount() >= GetKeyStoneMaxStacks()) { float num = damageReport.damageDealt * 0.06f; healthComponent.Heal(num, default(ProcChainMask), true); } } public void OnTakeDamageServer(DamageReport damageReport) { } private void AddKeyStoneBuff() { if (GetKeyStoneBuffCount() < GetKeyStoneMaxStacks()) { if (keyStoneType == KeyStones.Conqueror) { body.AddBuff(Buffs.conquerorBuff); } if (keyStoneType == KeyStones.Lethal) { body.AddBuff(Buffs.lethalBuff); } } } private void AuthorityFixedUpdate() { } private void CheckKeyStone() { if (keyStone.skillNameToken == "URGOT_CONQUEROR_NAME") { keyStoneType = KeyStones.Conqueror; } if (keyStone.skillNameToken == "URGOT_LETHAL_NAME") { keyStoneType = KeyStones.Lethal; } if (keyStone.skillNameToken == "URGOT_PHASE_RUSH_NAME") { keyStoneType = KeyStones.PhaseRush; } if (keyStone.skillNameToken == "URGOT_ELECTROCUTE_NAME") { keyStoneType = KeyStones.Electrocute; } } private void FixedUpdate() { if (NetworkServer.active) { ServerFixedUpdate(); } if (isAuthority) { AuthorityFixedUpdate(); } } private float GetKeyStoneBuffCount() { if (keyStoneType == KeyStones.Conqueror) { return body.GetBuffCount(Buffs.conquerorBuff); } if (keyStoneType == KeyStones.Lethal) { return body.GetBuffCount(Buffs.lethalBuff); } return 0f; } private float GetKeyStoneMaxStacks() { if (keyStoneType == KeyStones.Conqueror) { return conquerorMaxStacks; } if (keyStoneType == KeyStones.Lethal) { return lethalMaxStacks; } return 6f; } private float GetKeyStoneUpTime() { if (keyStoneType == KeyStones.Conqueror) { return conquerorUpTime; } if (keyStoneType == KeyStones.Lethal) { return lethalUpTime; } return 5f; } private void RemoveKeyStoneBuff() { if (keyStoneType == KeyStones.Conqueror) { body.RemoveBuff(Buffs.conquerorBuff); } if (keyStoneType == KeyStones.Lethal) { body.RemoveBuff(Buffs.lethalBuff); } } private void ServerFixedUpdate() { if (UptimeStopwatch < GetKeyStoneUpTime()) { UptimeStopwatch += Time.fixedDeltaTime; } if (throttleUpdateTime < MaxthrottleTime) { throttleUpdateTime += Time.fixedDeltaTime; } if (throttleUpdateTime >= MaxthrottleTime && UptimeStopwatch > GetKeyStoneUpTime() && GetKeyStoneBuffCount() > 0f) { RemoveKeyStoneBuff(); throttleUpdateTime = 0f; } if (GetKeyStoneBuffCount() <= 0f) { UptimeStopwatch = 0f; } } private void Update() { CheckKeyStone(); } } } namespace UrgotMod.SkillStates.Emotes { public class BaseEmote : BaseState { public string soundString; public string animString; public float duration; public float animDuration; public bool normalizeModel; private uint activePlayID; private Animator animator; protected ChildLocator childLocator; private CameraParamsOverrideHandle handle; public LocalUser localUser; public override void OnEnter() { //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((EntityState)this).GetModelChildLocator(); localUser = LocalUserManager.readOnlyLocalUsersList[0]; ((EntityState)this).characterBody.hideCrosshair = true; if (Object.op_Implicit((Object)(object)((EntityState)this).GetAimAnimator())) { ((Behaviour)((EntityState)this).GetAimAnimator()).enabled = false; } animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 0f); animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 0f); if (animDuration == 0f && duration != 0f) { animDuration = duration; } if (duration > 0f) { ((EntityState)this).PlayAnimation("FullBody, Override", animString, "Emote.playbackRate", duration, 0f); } else { ((EntityState)this).PlayAnimation("FullBody, Override", animString, "Emote.playbackRate", animDuration, 0f); } if (Config.voiceLines.Value) { activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject); } if (normalizeModel && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator)) { ((EntityState)this).modelLocator.normalizeToFloor = true; } handle = CameraParams.OverrideUrgotCameraParams(((EntityState)this).cameraTargetParams, UrgotCameraParams.EMOTE); } public override void OnExit() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnExit(); ((EntityState)this).cameraTargetParams.RemoveParamsOverride(handle, 0.2f); if (Object.op_Implicit((Object)(object)((EntityState)this).GetAimAnimator())) { ((Behaviour)((EntityState)this).GetAimAnimator()).enabled = true; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 1f); animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 1f); } if (normalizeModel && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator)) { ((EntityState)this).modelLocator.normalizeToFloor = false; } ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); if (activePlayID != 0) { AkSoundEngine.StopPlayingID(activePlayID); } } public override void FixedUpdate() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0163: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); bool flag = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (!((EntityState)this).characterMotor.isGrounded) { flag = true; } if (((EntityState)this).characterMotor.velocity != Vector3.zero) { flag = true; } } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { if (((EntityState)this).inputBank.skill1.down) { flag = true; } if (((EntityState)this).inputBank.skill2.down) { flag = true; } if (((EntityState)this).inputBank.skill3.down) { flag = true; } if (((EntityState)this).inputBank.skill4.down) { flag = true; } if (((EntityState)this).inputBank.jump.down) { flag = true; } if (((EntityState)this).inputBank.moveVector != Vector3.zero) { flag = true; } } 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); return; } if (Input.GetKeyDown(Config.jokeKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Joke(), (InterruptPriority)0); return; } if (Input.GetKeyDown(Config.laughKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Laugh(), (InterruptPriority)0); return; } if (Input.GetKeyDown(Config.danceKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Dance(), (InterruptPriority)0); return; } } if (duration > 0f && ((EntityState)this).fixedAge >= duration) { flag = true; } if (flag) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } } } namespace UrgotMod.SkillStates.BaseStates { internal class Death : GenericCharacterDeath { public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)7; } public override void OnEnter() { ((GenericCharacterDeath)this).OnEnter(); Util.PlaySound("Death", ((EntityState)this).gameObject); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { modelAnimator.CrossFadeInFixedTime("Death", 0.1f); } } public override void OnExit() { ((GenericCharacterDeath)this).OnExit(); } } public class Purge : BaseSkillState { public static float damageCoefficient = Config.purgeDamageCoefficient.Value; public static float procCoefficientV = Config.purgeProcCoefficient.Value; public static float baseDuration = 0.2f; public static float force = 800f; public static float recoil = 1.1f; public static float range = 200f; public static GameObject tracerEffectPrefab = Assets.purgeTracer; private Animator animator; private float duration; private float fireTime; private float bulletStopWatch; private int bulletCount = 3; private bool hasFired; private bool hasHit; private string muzzleString; private Ray aimRay; private static float spreadBloomAngel = 0.3f; private void PlaySound() { Util.PlaySound("firing", ((EntityState)this).gameObject); } private void FireBullet(string targetMuzzle) { //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_0087: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("purge", ((EntityState)this).gameObject); ((Component)((EntityState)this).characterBody).GetComponent(typeof(CharacterBody)); EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, targetMuzzle, false); ((BaseState)this).AddRecoil(-0.4f * recoil, -0.8f * recoil, -0.3f * recoil, 0.3f * recoil); if (((EntityState)this).isAuthority) { new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle, damage = damageCoefficient * ((BaseState)this).damageStat, force = force, tracerEffectPrefab = tracerEffectPrefab, muzzleName = targetMuzzle, hitEffectPrefab = FirePistol2.hitEffectPrefab, isCrit = Util.CheckRoll(((BaseState)this).critStat, ((EntityState)this).characterBody.master), radius = 0.1f, smartCollision = true, trajectoryAimAssistMultiplier = 1f, damageType = DamageTypeCombo.GenericPrimary, hitCallback = new HitCallback(BulletHitCallback), procCoefficient = procCoefficientV, procChainMask = default(ProcChainMask) }.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(spreadBloomAngel); } private bool BulletHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); HealthComponent val = (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) ? hitInfo.hitHurtBox.healthComponent : null); if (Object.op_Implicit((Object)(object)val) && val.alive && hitInfo.hitHurtBox.teamIndex != ((EntityState)this).teamComponent.teamIndex) { hasHit = true; PointSoundManager.EmitSoundLocal(AkEventIdArg.op_Implicit(NetworkSoundEventCatalog.GetAkIdFromNetworkSoundEventIndex(Assets.bulletHitSoundEvent.index)), ((Component)hitInfo.hitHurtBox).transform.position); } return result; } public override void OnEnter() { //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_0043: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; aimRay = ((BaseState)this).GetAimRay(); animator = ((EntityState)this).GetModelAnimator(); animator.SetBool("attacking", true); ((BaseState)this).StartAimMode(aimRay, 3f, false); ((EntityState)this).GetComponent<EchoingFlamesComponent>().CheckAngle(((Ray)(ref aimRay)).direction, new Vector3(0f, 1f, 0f), new Vector3(1f, 0f, 0f)); if (animator.GetBool("isMoving") || !animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("Gesture, Override", "Fire", "Purge.playbackRate", duration, 0.05f); } else if (!animator.GetBool("isMoving") && animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("FullBody, Override", "Fire", "Purge.playbackRate", duration, 0.05f); } FireBullet("GunGrill"); } public override void OnExit() { ((EntityState)this).OnExit(); animator.SetBool("attacking", false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!(((EntityState)this).fixedAge < duration) && ((EntityState)this).isAuthority) { _ = ((BaseSkillState)this).activatorSkillSlot.stock; _ = 0; ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { } protected virtual void OnHitEnemyAuthority() { } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } } namespace UrgotMod.Modules { internal static class Assets { internal static Material commandoMat; internal static List<EffectDef> effectDefs = new List<EffectDef>(); internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard"); internal static AssetBundle mainAssetBundle; internal static GameObject purgeTracer; public static GameObject corrosiveCharge; internal static NetworkSoundEventDef bulletHitSoundEvent; internal static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); private const string assetbundleName = "urgotBundle"; private static string[] assetNames = new string[0]; public static Material CreateMaterial(string materialName, float emission, Color emissionColor, float normalStrength) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)commandoMat)) { commandoMat = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<CharacterModel>().baseRendererInfos[0].defaultMaterial; } Material val = Object.Instantiate<Material>(commandoMat); Material val2 = mainAssetBundle.LoadAsset<Material>(materialName); if (!Object.op_Implicit((Object)(object)val2)) { Debug.LogError((object)("Failed to load material: " + materialName + " - Check to see that the name in your Unity project matches the one in this code")); return commandoMat; } ((Object)val).name = materialName; val.SetColor("_Color", val2.GetColor("_Color")); val.SetTexture("_MainTex", val2.GetTexture("_MainTex")); val.SetColor("_EmColor", emissionColor); val.SetFloat("_EmPower", emission); val.SetTexture("_EmTex", val2.GetTexture("_EmissionMap")); val.SetFloat("_NormalStrength", normalStrength); return val2; } public static Material CreateMaterial(string materialName) { return CreateMaterial(materialName, 0f); } public static Material CreateMaterial(string materialName, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return CreateMaterial(materialName, emission, Color.white); } public static Material CreateMaterial(string materialName, float emission, Color emissionColor) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return CreateMaterial(materialName, emission, emissionColor, 0f); } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).material)) { ((Renderer)val).material.shader = hotpoo; } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).material)) { ((Renderer)val2).material.shader = hotpoo; } } } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.akId = AkSoundEngine.GetIDFromString(eventName); val.eventName = eventName; networkSoundEventDefs.Add(val); return val; } internal static void Initialize() { LoadAssetBundle(); UrgotPlugin.Logger.LogInfo((object)"LoadAssetbundle"); LoadSoundbank(); UrgotPlugin.Logger.LogInfo((object)"LoadSoundbank"); PopulateAssets(); UrgotPlugin.Logger.LogInfo((object)"PopulateAssets"); } internal static void LoadAssetBundle() { if ((Object)(object)mainAssetBundle == (Object)null) { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("UrgotMod.urgotBundle"); mainAssetBundle = AssetBundle.LoadFromStream(stream); } assetNames = mainAssetBundle.GetAllAssetNames(); } internal static Texture LoadCharacterIcon(string characterName) { return mainAssetBundle.LoadAsset<Texture>("urgot_square"); } internal static GameObject LoadCrosshair(string crosshairName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair") == (Object)null) { return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/StandardCrosshair"); } return LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/" + crosshairName + "Crosshair"); } internal static void LoadSoundbank() { using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("UrgotMod.urgotBank.bnk"); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } internal static void PopulateAssets() { if (!Object.op_Implicit((Object)(object)mainAssetBundle)) { Debug.LogError((object)"There is no AssetBundle to load assets from."); return; } purgeTracer = CreateTracer("TracerGoldGat", "PurgeTracer"); if (Object.op_Implicit((Object)(object)purgeTracer)) { purgeTracer.GetComponent<Tracer>().speed = 600f; purgeTracer.GetComponent<Tracer>().length = 75f; } bulletHitSoundEvent = CreateNetworkSoundEventDef("hit"); } internal static RendererInfo[] SetupRendererInfos(GameObject obj) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>(); RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[componentsInChildren.Length]; for (int i = 0; i < componentsInChildren.Length; i++) { array[i] = new RendererInfo { defaultMaterial = ((Renderer)componentsInChildren[i]).material, renderer = (Renderer)(object)componentsInChildren[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } private static void AddNewEffectDef(GameObject effectPrefab) { AddNewEffectDef(effectPrefab, ""); } private static void AddNewEffectDef(GameObject effectPrefab, string soundName) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown EffectDef val = new EffectDef(); val.prefab = effectPrefab; val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>(); val.prefabName = ((Object)effectPrefab).name; val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>(); val.spawnSoundEventName = soundName; effectDefs.Add(val); } private static GameObject CreateTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>())) { val.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>())) { val.AddComponent<VFXAttributes>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } val.GetComponent<Tracer>().speed = 250f; val.GetComponent<Tracer>().length = 50f; AddNewEffectDef(val); return val; } private static GameObject LoadEffect(string resourceName) { return LoadEffect(resourceName, "", parentToTransform: false); } private static GameObject LoadEffect(string resourceName, string soundName