Decompiled source of Alien Hominid v1.2.4
plugins/AliemMod.dll
Decompiled a week 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 Aetherium.Items; using AliemMod.Components; using AliemMod.Components.Bundled; using AliemMod.Content; using AliemMod.Content.Achievements; using AliemMod.Content.Orbs; using AliemMod.Content.SkillDefs; using AliemMod.Content.Survivors; using AliemMod.Modules; using AliemMod.Modules.Characters; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EmotesAPI; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.GlobalSkills.LunarNeedle; using EntityStates.Treebot; using HG; using HG.BlendableTypes; using IL.RoR2; using IL.RoR2.Orbs; using JetBrains.Annotations; using KinematicCharacterController; using ModdedEntityStates.Aliem; using ModdedEntityStates.Aliem.AI; using Modules; using Modules.Achievements; using Modules.Survivors; using Mono.Cecil.Cil; using MonoMod.Cil; using On.RoR2; using On.RoR2.SurvivorMannequins; using R2API; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.SurvivorMannequins; using ShaderSwapper; using TILER2; using ThinkInvisible.TinkersSatchel; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AliemMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6c683a335b02d112b1642106febd0958ecc0c90e")] [assembly: AssemblyProduct("AliemMod")] [assembly: AssemblyTitle("AliemMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.TheTimeSweeper.Aliem", "Aliem", "1.2.3")] public class AliemPlugin : BaseUnityPlugin { public const string MODUID = "com.TheTimeSweeper.Aliem"; public const string MODNAME = "Aliem"; public const string MODVERSION = "1.2.3"; public const string DEV_PREFIX = "HABIBI"; public static AliemPlugin instance; public static ManualLogSource Log; private void Start() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[Initializing Aliem]"); instance = this; Log = ((BaseUnityPlugin)this).Logger; Config.MyConfig = ((BaseUnityPlugin)this).Config; DamageTypes.RegisterDamageTypes(); AliemConfig.ReadConfig(); if (AliemConfig.Debug.Value) { ((Component)this).gameObject.AddComponent<TestValueManager>(); } AliemAssets.Initialize(); Projectiles.Init(); States.Init(); Compat.Initialize(); Tokens.AddTokens(); Language.Init(); Language.PrintOutput("aliem.txt"); ItemDisplays.PopulateDisplays(); Buffs.RegisterBuffs(); Dots.RegisterDots(); new ContentPacks().Initialize(); new AliemSurvivor().Initialize(); new AliemPoolManager(((Component)this).transform); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[Initialized]"); } } public class TestValueManager : MonoBehaviour { private float _tim; private float _holdTime = 0.4f; public static float value1 = -60f; public static float value2 = 25f; private bool _testingEnabled => false; private void Update() { if (_testingEnabled && Input.GetKey((KeyCode)308)) { manageTestValue(ref value1, "pitch", (KeyCode)263, (KeyCode)260, 10f); manageTestValue(ref value2, "forwardSpeed", (KeyCode)264, (KeyCode)261, 1f); } } private void manageTestValue(ref float value, string valueName, KeyCode upKey, KeyCode downKey, float incrementAmount) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(upKey)) { value = setTestValue(value + incrementAmount, valueName); } if (Input.GetKeyDown(downKey)) { value = setTestValue(value - incrementAmount, valueName); } if (Input.GetKey(upKey) || Input.GetKey(downKey)) { float num = incrementAmount * (float)(Input.GetKey(upKey) ? 1 : (-1)); _tim += Time.deltaTime; if (_tim > _holdTime) { _tim = _holdTime - 0.02f; value = setTestValue(value + num, valueName); } } if (Input.GetKeyUp(upKey) || Input.GetKeyUp(downKey)) { _tim = 0f; } } private float setTestValue(float value, string print) { Helpers.LogWarning(print + ": " + value.ToString("0.000")); return value; } } internal static class Helpers { public const string agilePrefix = "<style=cIsUtility>Agile.</style> "; public static bool verbose; public static string DamageText(string text) { return "<style=cIsDamage>" + text + "</style>"; } public static string DamageValueText(float value) { return $"<style=cIsDamage>{value * 100f}% damage</style>"; } public static string DamageRangeText(float value1, float value2) { return $"<style=cIsDamage>{value1 * 100f}%-{value2 * 100f}% damage</style>"; } public static string UtilityText(string text) { return "<style=cIsUtility>" + text + "</style>"; } public static string RedText(string text) { return HealthText(text); } public static string HealthText(string text) { return "<style=cIsHealth>" + text + "</style>"; } internal static string KeywordText(string keyword, string sub) { return "<style=cKeywordName>" + keyword + "</style><style=cSub>" + sub + "</style>"; } public static string ScepterDescription(string desc) { return "\n<color=#d299ff>SCEPTER: " + desc + "</color>"; } public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } public static void LogVerbose(object message, bool chat = false) { if (AliemConfig.Debug.Value && verbose) { AliemPlugin.Log.LogMessage(message); if (chat) { Chat.AddMessage(message.ToString()); } } } public static void LogWarning(object message, bool chat = false) { if (AliemConfig.Debug.Value) { AliemPlugin.Log.LogWarning(message); if (chat) { Chat.AddMessage(message.ToString()); } } } public static List<TeamComponent> GatherEnemies(TeamIndex allyIndex, params TeamIndex[] ignore) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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) List<TeamComponent> list = new List<TeamComponent>(); bool flag = (int)FriendlyFireManager.friendlyFireMode > 0; IEnumerable<TeamIndex> enumerable = ((TeamIndex[])Enum.GetValues(typeof(TeamIndex))).Except(ignore); foreach (TeamIndex item in enumerable) { if (flag || allyIndex != item) { list.AddRange(TeamComponent.GetTeamMembers(item)); } } return list; } } public static class ArrayHelper { public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } } 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 int baseMaxStock = 1; public float baseRechargeInterval; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool resetCooldownTimerOnUse = false; public bool fullRestockOnAssign = true; public bool dontAllowPastMaxStocks = false; public bool beginSkillCooldownOnSkillEnd = false; public bool mustKeyPress = false; public bool isCombatSkill = true; public bool canceledFromSprinting = false; public bool cancelSprintingOnActivation = true; public bool forceSprintDuringState = false; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName, InterruptPriority interruptPriority, bool isCombatSkill, float baseRechargeInterval) { //IL_008d: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; this.interruptPriority = interruptPriority; this.isCombatSkill = isCombatSkill; this.baseRechargeInterval = baseRechargeInterval; } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } } } namespace Modules { public class MemeCompat { public static void init() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init); } private static void SurvivorCatalog_Init(orig_Init orig) { GameObject val = AliemAssets.LoadAsset<GameObject>("Aliem_Meme"); CustomEmotesAPI.ImportArmature(AliemSurvivor.instance.bodyPrefab, val, false, 0, true); orig.Invoke(); } } } namespace Modules.Survivors { public abstract class SurvivorBase : CharacterBase { public abstract string survivorTokenPrefix { get; } public abstract UnlockableDef characterUnlockableDef { get; } public virtual ConfigEntry<bool> characterEnabledConfig { get; } public virtual GameObject displayPrefab { get; set; } public override void InitializeCharacter() { if (characterEnabledConfig == null || characterEnabledConfig.Value) { InitializeUnlockables(); base.InitializeCharacter(); InitializeAI(); InitializeSurvivor(); } } protected override void InitializeCharacterBodyAndModel() { base.InitializeCharacterBodyAndModel(); InitializeDisplayPrefab(); } protected virtual void InitializeDisplayPrefab() { displayPrefab = Prefabs.CreateDisplayPrefab(bodyName + "Display", bodyPrefab, bodyInfo); } public virtual void InitializeUnlockables() { } public virtual void InitializeAI() { Prefabs.CreateGenericDoppelganger(bodyPrefab, bodyName + "MonsterMaster", "Merc"); } protected virtual void InitializeSurvivor() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, Color.grey, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) RegisterNewSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } public static void RegisterNewSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>(); val.bodyPrefab = bodyPrefab; val.displayPrefab = displayPrefab; val.primaryColor = charColor; val.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); val.displayNameToken = tokenPrefix + "NAME"; val.descriptionToken = tokenPrefix + "DESCRIPTION"; val.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; val.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; val.desiredSortPosition = sortPosition; val.unlockableDef = unlockableDef; Content.AddSurvivorDef(val); } protected virtual void AddCssPreviewSkill(int indexFromEditor, SkillFamily skillFamily, SkillDef skillDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>(); if (!Object.op_Implicit((Object)(object)component)) { Debug.LogError((object)"trying to add skillChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created a CharacterSelectSurvivorPreviewDisplayController on your Display prefab in editor"); return; } component.skillChangeResponses[indexFromEditor].triggerSkillFamily = skillFamily; component.skillChangeResponses[indexFromEditor].triggerSkill = skillDef; } protected virtual void AddCssPreviewSkin(int indexFromEditor, SkinDef skinDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>(); if (!Object.op_Implicit((Object)(object)component)) { Debug.LogError((object)"trying to add skinChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created a CharacterSelectSurvivorPreviewDisplayController on your Display prefab in editor"); } else { component.skinChangeResponses[indexFromEditor].triggerSkin = skinDef; } } protected virtual void FinalizeCSSPreviewDisplayController() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)displayPrefab)) { return; } CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent<CharacterSelectSurvivorPreviewDisplayController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } component.bodyPrefab = bodyPrefab; List<SkillChangeResponse> list = new List<SkillChangeResponse>(); for (int i = 0; i < component.skillChangeResponses.Length; i++) { if ((Object)(object)component.skillChangeResponses[i].triggerSkillFamily != (Object)null) { list.Add(component.skillChangeResponses[i]); } } component.skillChangeResponses = list.ToArray(); } } } namespace Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //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_000f: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool flag = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag2 = difficultyDef.nameToken == "INFERNO_NAME"; bool flag3 = (int)val >= 3 && (int)val <= 10; if (flag || flag2 || flag3) { ((BaseAchievement)this).Grant(); } } } } } namespace ModdedEntityStates { public abstract class BaseMeleeAttack : BaseSkillState, IStepSetter { public int swingIndex; protected string hitboxGroupName = "SwordGroup"; protected DamageType damageType = (DamageType)0; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartPercentTime = 0.2f; protected float attackEndPercentTime = 0.4f; protected float earlyExitPercentTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string playbackRateParam = "Slash.playbackRate"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1); protected DamageTypeCombo damageTypeCombo = DamageTypeCombo.GenericPrimary; public float duration = 1f; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; private GameObject swingEffectInstance; public override void OnEnter() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit(damageType); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxGroupName); attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration, 0.05f); } public override void OnExit() { if (inHitPause) { RemoveHitstop(); } if (Object.op_Implicit((Object)(object)swingEffectInstance)) { EntityState.Destroy((Object)(object)swingEffectInstance); } ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { Transform val = ((BaseState)this).FindModelChild(muzzleString); if (Object.op_Implicit((Object)(object)val)) { swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val); } } protected virtual void OnHitEnemyAuthority() { Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.deltaTime; if (hitPauseTimer <= 0f && inHitPause) { RemoveHitstop(); } if (!inHitPause) { stopwatch += Time.deltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(playbackRateParam, 0f); } } bool flag = stopwatch >= duration * attackStartPercentTime; bool flag2 = stopwatch >= duration * attackEndPercentTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { EnterAttack(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void RemoveHitstop() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0023: 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_0026: Unknown result type (might be due to invalid IL or missing references) if (stopwatch >= duration * earlyExitPercentTime) { return (InterruptPriority)0; } return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public class BaseMeleeAttackButEpic : BaseSkillState { public int swingIndex; protected string hitboxName = "Sword"; protected DamageType damageType = (DamageType)0; protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartTime = 0.2f; protected float attackEndTime = 0.4f; protected float baseEarlyExitTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected bool cancelled = false; protected bool keypress; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string hitstopAnimationParameter; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound; private float earlyExitTime; protected float duration; private bool hasFired; private float hitPauseTimer; private OverlapAttack attack; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; protected bool rolledCrit; public override void OnEnter() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; earlyExitTime = baseEarlyExitTime * duration; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; animator.SetBool("attacking", true); rolledCrit = ((BaseState)this).RollCrit(); HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName); } PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit(damageType); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = rolledCrit; attack.impactSound = impactSound; } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f); } public override void OnExit() { ((EntityState)this).OnExit(); animator.SetBool("attacking", false); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true); } protected virtual void OnHitEnemyAuthority() { OnHitEnemyAuthority(null); } protected virtual void OnHitEnemyAuthority(List<HurtBox> hits) { Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, hitstopAnimationParameter); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } protected virtual void FireAttack() { if (!hasFired) { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); if (((EntityState)this).isAuthority) { PlaySwingEffect(); ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null)) { OnHitEnemyAuthority(); } } protected virtual void SetNextState() { int num = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttackButEpic { swingIndex = num }); } public override void FixedUpdate() { //IL_0037: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.deltaTime; if (hitPauseTimer <= 0f && inHitPause) { ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } if (!inHitPause) { stopwatch += Time.deltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("Swing.playbackRate", 0f); } } bool flag = stopwatch >= duration * attackStartTime; bool flag2 = stopwatch >= duration * attackEndTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { OnFireAttackEnter(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } protected virtual void OnFireAttackEnter() { } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0013: 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) return (InterruptPriority)((!(((EntityState)this).fixedAge > earlyExitTime)) ? 1 : 0); } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } } public abstract class BaseTimedSkillState : BaseSkillState { protected float duration; protected float castStartTime; protected float castEndTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; public abstract float TimedBaseDuration { get; } public abstract float TimedBaseCastStartPercentTime { get; } public virtual float TimedBaseCastEndPercentTime => 1f; public override void OnEnter() { InitDurationValues(); ((BaseState)this).OnEnter(); } protected virtual void InitDurationValues() { duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; castStartTime = TimedBaseCastStartPercentTime * duration; castEndTime = TimedBaseCastEndPercentTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); bool flag = ((EntityState)this).fixedAge >= castStartTime; bool flag2 = ((EntityState)this).fixedAge >= castEndTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); if (!hasFired) { OnCastEnter(); hasFired = true; } } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { SetNextState(); } } protected virtual void SetNextState() { ((EntityState)this).outer.SetNextStateToMain(); } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; public override float TimedBaseCastEndPercentTime => 0.9f; protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; protected override void OnCastEnter() { } } public class WindDownState : BaseSkillState { public float windDownTime = 0.5f; private float _windDownTime; public WindDownState(float windDownTime_) { windDownTime = windDownTime_; } public override void OnEnter() { ((BaseState)this).OnEnter(); _windDownTime = windDownTime / ((BaseState)this).attackSpeedStat; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > _windDownTime) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } } namespace ModdedEntityStates.Aliem { public class AliemCharacterMain : GenericCharacterMain { public bool wasRiding = false; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); if (Input.GetKey((KeyCode)103)) { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); Helpers.LogWarning(modelAnimator.GetLayerWeight(modelAnimator.GetLayerIndex("Flinch"))); } if (wasRiding && ((EntityState)this).isAuthority) { GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, 1f, 1f, false); } } } public class ChargeBBGun : BaseChargingState { public override float BaseMaxChargeDuration => 3f; public virtual float MinDamageCoefficient => AliemConfig.M1_BBGunCharged_Damage_Min.Value; public virtual float MaxDamageCoefficient => AliemConfig.M1_BBGunCharged_Damage_Max.Value; protected override void StartNextState(float chargeCoefficient) { ((EntityState)this).outer.SetNextState((EntityState)(object)new FireBBGunCharged(GetChargedValue(MinDamageCoefficient, MaxDamageCoefficient)) { isOffHanded = base.isOffHanded }); } } public class FireBBGun : BaseSkillState, IOffHandable, IChannelingSkill { public float baseDamageCoefficient = AliemConfig.M1_BBGun_Damage.Value; public float maxSpread = AliemConfig.M1_BBGun_Spread.Value; public float spreadYawScale = AliemConfig.bbgunSpreadYaw.Value; public float baseFireInterval = AliemConfig.M1_BBGun_Interval.Value * 0.02f; public int bsPerFrame = AliemConfig.bbgunBaseBs.Value; private Ray _currentRay; private bool _currentCrit; private float _updateRayInterval = 0.2f; private Transform _muzzleTransform; private float _fireTim = 0f; private float _rayTim = 0f; private float _interval; public float range => AliemConfig.BBGunRange.Value; public string muzzleString => isOffHanded ? "BlasterMuzzle.R" : "BlasterMuzzle"; public bool isOffHanded { get; set; } public void StopChanneling() { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnEnter() { ((BaseState)this).OnEnter(); _muzzleTransform = ((BaseState)this).FindModelChild(muzzleString); _interval = baseFireInterval * (float)bsPerFrame / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("Gesture, Override", "ShootLoop", "ShootGun.playbackRate", _interval * 58.82f, 0f); ((EntityState)this).PlayAnimation(isOffHanded ? "RightArm, Over" : "LeftArm, Over", "ShootLoop"); ((EntityState)this).PlayAnimation(isOffHanded ? "LeftArm, Under" : "RightArm, Under", "ShootLoop"); } public override void FixedUpdate() { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); _rayTim -= Time.deltaTime; _fireTim -= Time.deltaTime; if (_rayTim <= 0f) { _rayTim += _updateRayInterval; onRayUpdate(); } int num = 0; while (_fireTim <= 0f) { num += bsPerFrame; _fireTim += _interval; } if (num > 0) { FireBs(num, ((Ray)(ref _currentRay)).direction); ((EntityState)this).characterBody.OnSkillActivated(((BaseSkillState)this).activatorSkillSlot); } } private void onRayUpdate() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) _currentRay = ((BaseState)this).GetAimRay(); _currentCrit = ((BaseState)this).RollCrit(); _interval = baseFireInterval * (float)bsPerFrame / ((EntityState)this).characterBody.attackSpeed; ((BaseState)this).StartAimMode(2f, false); } public override void OnExit() { ((EntityState)this).OnExit(); PlayAnimation(0.5f); } public void PlayAnimation(float duration) { ((EntityState)this).PlayAnimation("Gesture, Override", "ShootGun", "ShootGun.playbackRate", duration, 0f); ((EntityState)this).PlayAnimation(isOffHanded ? "RightArm, Over" : "LeftArm, Over", "ShootGun"); ((EntityState)this).PlayAnimation(isOffHanded ? "LeftArm, Under" : "RightArm, Under", "ShootGun"); } private ButtonState GetSkillButton() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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) return isOffHanded ? ((EntityState)this).inputBank.skill2 : ((EntityState)this).inputBank.skill1; } private void FireBs(int BCount, Vector3 aimVector) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Play_AliemBB", ((EntityState)this).gameObject); Vector3 up = Vector3.up; Vector3 val = Vector3.Cross(up, aimVector); int num = 0; for (int i = 0; i < BCount; i++) { float num2 = Random.Range(0f, maxSpread); float num3 = Random.Range(0f, 360f); Vector3 val2 = Quaternion.Euler(0f, 0f, num3) * (Quaternion.Euler(num2, 0f, 0f) * Vector3.forward); float y = val2.y; val2.y = 0f; float num4 = (Mathf.Atan2(val2.z, val2.x) * 57.29578f - 90f) * spreadYawScale; float num5 = Mathf.Atan2(y, ((Vector3)(ref val2)).magnitude) * 57.29578f; FireSingleB(Quaternion.AngleAxis(num4, up) * (Quaternion.AngleAxis(num5, val) * aimVector)); } } private void FireSingleB(Vector3 aimVector) { //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_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) Vector3 hitPoint; HurtBox val = BootlegCharacterRaycastSingle(((EntityState)this).gameObject, new Ray(((Ray)(ref _currentRay)).origin, aimVector), out hitPoint, range, BulletAttack.defaultStopperMask, (QueryTriggerInteraction)0); BBOrb bBOrb = (Object.op_Implicit((Object)(object)val) ? AliemPoolManager.instance.RentBBOrb() : AliemPoolManager.instance.RentBBOrbMissed()); bBOrb.targetPosition = hitPoint; bBOrb.speed = Random.Range(AliemConfig.bbgunMinSpeed.Value, AliemConfig.bbgunMaxSpeed.Value); bBOrb.attackOrigin = ((Ray)(ref _currentRay)).origin; bBOrb.damageValue = ((BaseState)this).damageStat * baseDamageCoefficient; bBOrb.attacker = ((EntityState)this).gameObject; bBOrb.isCrit = _currentCrit; ((Orb)bBOrb).origin = _muzzleTransform.position; ((Orb)bBOrb).target = val; bBOrb.damageTypeCombo = DamageTypeCombo.GenericPrimary; OrbManager.instance.AddOrb((Orb)(object)bBOrb); } private HurtBox BootlegCharacterRaycastSingle(GameObject bodyObject, Ray ray, out Vector3 hitPoint, float maxDistance, LayerMask layerMask, QueryTriggerInteraction queryTriggerInteraction) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) RaycastHit[] hits = Physics.SphereCastAll(ray, (float)AliemConfig.bbgunRadius.Value, maxDistance, LayerMask.op_Implicit(layerMask), queryTriggerInteraction); return CopyPasteCodeJustToAvoidOneGetComponent(bodyObject, ray, maxDistance, hits, out hitPoint); } private HurtBox CopyPasteCodeJustToAvoidOneGetComponent(GameObject bodyObject, Ray ray, float maxDistance, RaycastHit[] hits, out Vector3 hitPoint) { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00c0: Unknown result type (might be due to invalid IL or missing references) int num = -1; float num2 = float.PositiveInfinity; float num3 = 0f; HurtBox val = null; HurtBox result = null; for (int i = 0; i < hits.Length; i++) { float distance = ((RaycastHit)(ref hits[i])).distance; if (distance > num3) { num3 = distance; } if (!(distance < num2)) { continue; } val = ((Component)((RaycastHit)(ref hits[i])).collider).GetComponent<HurtBox>(); if (Object.op_Implicit((Object)(object)val)) { HealthComponent healthComponent = val.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { if (!FriendlyFireManager.ShouldDirectHitProceed(healthComponent, ((EntityState)this).teamComponent.teamIndex)) { continue; } num = i; result = val; if (distance == 0f) { hitPoint = ((Ray)(ref ray)).origin; return result; } } } num2 = distance; } if (num == -1) { maxDistance = ((num3 == 0f) ? maxDistance : num3); hitPoint = ((Ray)(ref ray)).origin + ((Ray)(ref ray)).direction * maxDistance; return null; } hitPoint = ((RaycastHit)(ref hits[num])).point; return result; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class FireBBGunCharged : RayGunFire { private float _chargedDamageCoefficient; private string _chargedShootSound = "Play_AliemBBCharged"; public override float BaseDuration => 0.5f; public override float BaseDamageCoefficient => _chargedDamageCoefficient; public override string soundString => _chargedShootSound; public override GameObject projectile => Projectiles.BBGunProjectilePrefabBig; public FireBBGunCharged() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) _chargedDamageCoefficient = AliemConfig.M1_BBGunCharged_Damage_Max.Value; damageTypeCombo = DamageTypeCombo.GenericSecondary; } public FireBBGunCharged(float dam_) { _chargedDamageCoefficient = dam_; } public override void PlayAnimation(float duration) { ((EntityState)this).PlayAnimation("Gesture, Override", "ShootGunBig", "ShootGun.playbackRate", duration * 3f, 0f); ((EntityState)this).PlayAnimation(base.isOffHanded ? "RightArm, Over" : "LeftArm, Over", "ShootGunBig"); ((EntityState)this).PlayAnimation(base.isOffHanded ? "LeftArm, Under" : "RightArm, Under", "ShootGunBig"); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class InputBBGun : MashAndHoldInputs { protected override EntityState newMashState { get { FireBBGun fireBBGun = new FireBBGun(); ((BaseSkillState)fireBBGun).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; return (EntityState)(object)fireBBGun; } } protected override EntityState newHoldState { get { ChargeBBGun chargeBBGun = new ChargeBBGun(); ((BaseSkillState)chargeBBGun).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; return (EntityState)(object)chargeBBGun; } } protected override InterruptPriority holdInterruptPriority => (InterruptPriority)1; } public class ChargedLunarNeedleFire : RayGunChargedFire { public override GameObject projectile => AliemAssets.LunarChargedProjectile; public override void OnEnter() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) damageTypeCombo = DamageTypeCombo.GenericSecondary; base.OnEnter(); EffectManager.SimpleMuzzleFlash(FireLunarNeedle.muzzleFlashEffectPrefab, ((EntityState)this).gameObject, "Head", false); Util.PlaySound("Play_item_lunar_use_utilityReplacement_end", ((EntityState)this).gameObject); } protected override void ModifyState() { base.ModifyState(); ((GenericProjectileBaseState)this).force = 0f; ((GenericProjectileBaseState)this).damageCoefficient = 0.05f; ((GenericProjectileBaseState)this).attackSoundString = FireLunarNeedle.fireSound; } } internal class ChargeRifle : BaseChargingState { public override float BaseMaxChargeDuration => 3f; public virtual int MinBullets => AliemConfig.M1_MachineGunCharged_Bullets_Min.Value; public virtual int MaxBullets => AliemConfig.M1_MachineGunCharged_Bullets_Max.Value; protected override void StartNextState(float chargeCoefficient) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ShootRifleCharged(Mathf.RoundToInt(GetChargedValue(MinBullets, MaxBullets))) { isOffHanded = base.isOffHanded }); } } public class InputRifle : MashAndHoldInputs { protected override EntityState newMashState => (EntityState)(object)new ShootRifleUncharged(); protected override EntityState newHoldState { get { ChargeRifle chargeRifle = new ChargeRifle(); ((BaseSkillState)chargeRifle).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; return (EntityState)(object)chargeRifle; } } } public class ShootRifleCharged : BaseShootBullet { private float _interval; private float _shootTimer; private int _shotsFired; private int _chargedBullets; private float _currentBloom; public override float damageCoefficient => AliemConfig.M1_MachineGunCharged_Damage.Value; public override float baseDuration => baseInterval * (float)bullets; public override float procCoefficient => 0.7f; public override float force => 200f; public override float recoil => 1f; public override float bloom => 0f; public override float range => 256f; public override float radius => 1.6f; public override float minSpread => 0f; public override float spread => AliemConfig.M1_MachineGunCharged_Spread.Value * ((EntityState)this).characterBody.spreadBloomAngle; public override LayerMask stopperMask => ((LayerIndex)(ref LayerIndex.world)).mask; public override GameObject tracerEffectPrefab => AliemAssets.rifleTracerBig; public override string muzzleString => base.isOffHanded ? "BlasterMuzzle.R" : "BlasterMuzzle"; public virtual float baseInterval => AliemConfig.M1_MachineGunCharged_Interval.Value; public new virtual int bullets => _chargedBullets; private float _bloomIncrement => 0.5f; public ShootRifleCharged() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) _chargedBullets = AliemConfig.M1_MachineGunCharged_Bullets_Max.Value; damageTypeCombo = DamageTypeCombo.GenericSecondary; } public ShootRifleCharged(int bullets) { _chargedBullets = bullets; } public override void OnEnter() { base.OnEnter(); _interval = baseInterval / ((BaseState)this).attackSpeedStat; } public override void FixedUpdate() { base.FixedUpdate(); _shootTimer -= Time.deltaTime; while (_shootTimer <= 0f && _shotsFired < bullets) { ((EntityState)this).characterBody.SetSpreadBloom(_currentBloom, false); _currentBloom += _bloomIncrement; Fire(); _shootTimer += _interval; _shotsFired++; } } protected override void ModifyBullet(BulletAttack bulletAttack) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) DamageAPI.AddModdedDamageType(bulletAttack, DamageTypes.FuckinChargedKillAchievementTracking); } protected override void playShootAnimation() { Util.PlaySound("Play_AliemRifleCharged", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("Gesture, Override", "ShootGunBig", "ShootGun.playbackRate", _interval * 5f, 0f); ((EntityState)this).PlayAnimation(base.isOffHanded ? "RightArm, Over" : "LeftArm, Over", "ShootGunBig"); ((EntityState)this).PlayAnimation(base.isOffHanded ? "LeftArm, Under" : "RightArm, Under", "ShootGunBig"); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class ShootRifleUncharged : BaseShootBullet { public override float damageCoefficient => AliemConfig.M1_MachineGun_Damage.Value; public override float baseDuration => AliemConfig.M1_MachineGun_Duration.Value; public override float force => 100f; public override float bloom => 0.5f; public override float range => 256f; public override float radius => 0.4f; public override float spread => 0f; public override FalloffModel falloff => (FalloffModel)(AliemConfig.M1_MachineGun_Falloff.Value ? 1 : 0); public override GameObject tracerEffectPrefab => AliemAssets.rifleTracer; public override void OnEnter() { base.OnEnter(); Fire(); } } public class AliemBurrow : BaseCharacterMain { private int inputButton = 2; public static float MaxBurrowTime = 1.4f; public SprintEffectController sprintEffectController; private float minBurrowTime = 0.1f; private ButtonState inputButtonState => (ButtonState)(inputButton switch { 1 => ((EntityState)this).inputBank.skill1, 3 => ((EntityState)this).inputBank.skill3, 4 => ((EntityState)this).inputBank.skill4, _ => ((EntityState)this).inputBank.skill2, }); public static event Action<int> onBurrowPopOutMultiHit; public AliemBurrow() { } public AliemBurrow(int inputButtonState) { inputButton = inputButtonState; } public override void OnEnter() { ((BaseCharacterMain)this).OnEnter(); ((EntityState)this).PlayCrossfade("FullBody, Override", "Burrow", 0.1f); Util.PlaySound(BurrowIn.burrowInSoundString, ((EntityState)this).gameObject); GameObject obj = ((EntityState)this).GetModelChildLocator().FindChildGameObject("Burrow"); if (obj != null) { obj.SetActive(true); } } public override void FixedUpdate() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) ((BaseCharacterMain)this).FixedUpdate(); ((EntityState)this).characterBody.isSprinting = true; ((BaseState)this).StartAimMode(2f, false); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.moveDirection = ((EntityState)this).inputBank.moveVector * 2.6f; } if (((EntityState)this).fixedAge > minBurrowTime && ((EntityState)this).isAuthority && (!inputButtonState.down || !((BaseState)this).isGrounded || ((EntityState)this).fixedAge > MaxBurrowTime)) { ((EntityState)this).outer.SetState((EntityState)(object)new AliemCharacterMain { wasRiding = true }); } } public override void OnExit() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_008e: 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_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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) ((BaseCharacterMain)this).OnExit(); GameObject val = ((EntityState)this).GetModelChildLocator().FindChildGameObject("Burrow"); if (val != null) { val.SetActive(false); } ((EntityState)this).PlayCrossfade("FullBody, Override", "UnBurrow", 0.1f); Util.PlaySound("Play_DigPopOut_AHI", ((EntityState)this).gameObject); EffectManager.SpawnEffect(AliemAssets.burrowPopOutEffect, new EffectData { origin = val.transform.position, rotation = Util.QuaternionSafeLookRotation(Vector3.up) }, false); if (((EntityState)this).isAuthority) { BlastAttack val2 = new BlastAttack { attacker = ((EntityState)this).gameObject, baseDamage = ((BaseState)this).damageStat * AliemConfig.M3_Burrow_PopOutDamage.Value, baseForce = 0f, bonusForce = Vector3.up * AliemConfig.M3_Burrow_PopOutForce.Value, crit = ((BaseState)this).RollCrit(), damageType = DamageTypeCombo.op_Implicit((DamageType)32), falloffModel = (FalloffModel)0, procCoefficient = 1f, radius = 4f, position = ((EntityState)this).transform.position, attackerFiltering = (AttackerFiltering)2, teamIndex = ((EntityState)this).teamComponent.teamIndex }; Result val3 = val2.Fire(); AliemBurrow.onBurrowPopOutMultiHit?.Invoke(val3.hitCount); } } } public class AliemLeapM2 : AliemLeap { protected override int inputButton => 2; } public class AliemLeapM3 : AliemLeap { protected override int inputButton => 3; } public class AliemLeap : GenericCharacterMain { private OverlapAttack overlapAttack; private bool hitSomething; private int hitSomethingFrames; private float previousAirControl; private BullseyeSearch bullseyeSearch; private List<HurtBox> overlapAttackHits = new List<HurtBox>(); protected virtual int inputButton => 2; private ButtonState inputButtonState => (ButtonState)(inputButton switch { 1 => ((EntityState)this).inputBank.skill1, 3 => ((EntityState)this).inputBank.skill3, 4 => ((EntityState)this).inputBank.skill4, _ => ((EntityState)this).inputBank.skill2, }); public static float DamageCoefficient => AliemConfig.M3_Leap_ImpactDamage.Value; public override void OnEnter() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Expected O, but got Unknown //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).OnEnter(); bullseyeSearch = new BullseyeSearch(); HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup hitboxGroup) => hitboxGroup.groupName == "Leap"); } overlapAttack = new OverlapAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), damage = DamageCoefficient * ((BaseState)this).damageStat, isCrit = ((BaseState)this).RollCrit(), hitBoxGroup = hitBoxGroup, hitEffectPrefab = AliemAssets.nemforcerImpactEffect, damageType = DamageTypeCombo.GenericUtility }; ((EntityState)this).GetModelAnimator().SetFloat("aimYawCycle", 0.5f); ((EntityState)this).GetModelAnimator().SetFloat("aimPitchCycle", 0.5f); previousAirControl = ((EntityState)this).characterMotor.airControl; ((EntityState)this).characterMotor.airControl = BaseLeap.airControl; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; if (((EntityState)this).isAuthority) { Vector3 val = ((Vector3)(ref direction)).normalized * BaseLeap.aimVelocity * ((BaseState)this).moveSpeedStat * (((EntityState)this).characterBody.isSprinting ? 1f : ((EntityState)this).characterBody.sprintingSpeedMultiplier); Vector3 val2 = Vector3.up * BaseLeap.upwardVelocity; Vector3 val3 = new Vector3(direction.x, 0f, direction.z); Vector3 val4 = ((Vector3)(ref val3)).normalized * BaseLeap.forwardVelocity; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity = val + val2 + val4; } CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); ((EntityState)this).PlayCrossfade("FullBody, Underride", "Dive", 0.1f); Util.PlaySound(BaseLeap.leapSoundString, ((EntityState)this).gameObject); ((EntityState)this).characterDirection.moveVector = direction; if (((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.onMovementHit += new MovementHitDelegate(OnMovementHit); } Util.PlaySound(BaseLeap.soundLoopStartEvent, ((EntityState)this).gameObject); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.diveBuff); } } private void OnMovementHit(ref MovementHitInfo movementHitInfo) { hitSomething = true; } public override void FixedUpdate() { //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_0055: 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_013e: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).FixedUpdate(); ((EntityState)this).characterBody.isSprinting = true; ((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterMotor.velocity; if (!((EntityState)this).isAuthority || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { return; } ((EntityState)this).characterMotor.moveDirection = ((EntityState)this).inputBank.moveVector; CharacterBody val = FireOverlap(); if (!Object.op_Implicit((Object)(object)val)) { val = FindBodyToRide(); } AliemRidingColliderHolderThatsIt aliemRidingColliderHolderThatsIt = default(AliemRidingColliderHolderThatsIt); if (Object.op_Implicit((Object)(object)val) && ((Component)val).TryGetComponent<AliemRidingColliderHolderThatsIt>(ref aliemRidingColliderHolderThatsIt) && (Object)(object)aliemRidingColliderHolderThatsIt.riddenCollider != (Object)null) { val = null; } if ((Object)(object)val != (Object)null && (inputButtonState.down || AliemConfig.M3_Leap_AlwaysRide.Value)) { ((EntityState)this).outer.SetNextState((EntityState)(object)new AliemRidingState { inputButton = inputButton, riddenBody = val }); return; } if (((BaseCharacterController)((EntityState)this).characterMotor).Motor.GroundingStatus.IsStableOnGround && !((BaseCharacterController)((EntityState)this).characterMotor).Motor.LastGroundingStatus.IsStableOnGround) { if (inputButtonState.down) { ((EntityState)this).outer.SetState((EntityState)(object)new AliemBurrow(inputButton)); } else { ((EntityState)this).outer.SetNextStateToMain(); } return; } if (hitSomething) { hitSomethingFrames++; } if (((EntityState)this).fixedAge >= BaseLeap.minimumDuration && hitSomethingFrames > 1) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void ProcessJump() { if (base.jumpInputReceived) { ((EntityState)this).outer.SetNextStateToMain(); } ((GenericCharacterMain)this).ProcessJump(); } private CharacterBody FindBodyToRide() { //IL_0009: 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_001e: 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_0066: 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) Ray val = default(Ray); ((Ray)(ref val))..ctor(((EntityState)this).characterBody.corePosition, Vector3.forward); RaycastHit val2 = default(RaycastHit); if (Util.CharacterSpherecast(((EntityState)this).gameObject, val, 1.51f, ref val2, 0f, ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, (QueryTriggerInteraction)0)) { HealthComponent healthComponent = ((Component)((RaycastHit)(ref val2)).collider).GetComponent<HurtBox>().healthComponent; if ((Object)(object)healthComponent != (Object)null && healthComponent.body.teamComponent.teamIndex == ((EntityState)this).teamComponent.teamIndex) { return healthComponent.body; } } return null; } private CharacterBody FireOverlap() { overlapAttackHits.Clear(); if (overlapAttack.Fire(overlapAttackHits) && overlapAttackHits.Count > 0) { return overlapAttackHits[0].healthComponent?.body; } return null; } public override void OnExit() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown Util.PlaySound(BaseLeap.soundLoopStopEvent, ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.onMovementHit -= new MovementHitDelegate(OnMovementHit); } ((EntityState)this).PlayAnimation("FullBody, Underride", "DiveRecover"); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2); ((EntityState)this).characterMotor.airControl = previousAirControl; if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.diveBuff); } ((GenericCharacterMain)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class AliemRidingChomp : BaseSkillState { public Collider riddenCollider; private float baseDuration = 0.3f; private float chompPercentTime = 1f; private float duration; private bool hasCasted; private bool hasHealed; public static float ChompDamageCoefficient => AliemConfig.M3_Chomp_Damage.Value; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayCrossfade("FullBody, Override", "RidingChomp", "Chomp.playbackRate", duration * 2f, 0.1f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge > duration * chompPercentTime && !hasCasted) { hasCasted = true; OnCastEnter(); } if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } protected void OnCastEnter() { //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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) Util.PlayAttackSpeedSound("Play_Chomp", ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); Transform transform = ((Component)((EntityState)this).GetComponent<AliemRidingColliderHolderThatsIt>().riddenCollider).transform; if ((Object)(object)transform == (Object)null) { transform = ((EntityState)this).transform; } if (((EntityState)this).isAuthority) { BlastAttack val = new BlastAttack { attacker = ((EntityState)this).gameObject, baseDamage = ((BaseState)this).damageStat * ChompDamageCoefficient, damageType = DamageTypeCombo.GenericUtility, crit = ((BaseState)this).RollCrit(), falloffModel = (FalloffModel)0, procCoefficient = 1f, radius = 2f, position = transform.position, attackerFiltering = (AttackerFiltering)2, teamIndex = ((EntityState)this).teamComponent.teamIndex }; if (AliemConfig.M3_Chomp_Slayer.Value) { ref DamageType damageType = ref val.damageType.damageType; damageType = (DamageType)((uint)damageType | 0x80000u); } DamageAPI.AddModdedDamageType(val, DamageTypes.Decapitating); val.Fire(); } FuckinHealInMultiplayerPlease(transform); } private void FuckinHealInMultiplayerPlease(Transform ridePoint) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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) hasHealed = true; if (NetworkServer.active) { float num = ((EntityState)this).characterBody.maxHealth - (AliemConfig.M3_Chomp_HealMissing.Value ? ((EntityState)this).healthComponent.health : 0f); num *= AliemConfig.M3_Chomp_Healing.Value; HealOrb val = new HealOrb(); ((Orb)val).origin = ridePoint.position; ((Orb)val).target = ((EntityState)this).characterBody.mainHurtBox; val.healValue = num; val.overrideDuration = 0.1f; OrbManager.instance.AddOrb((Orb)(object)val); } } public override void OnExit() { ((EntityState)this).OnExit(); EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Body").SetInterruptState((EntityState)(object)new EndRidingState(), (InterruptPriority)2); if (!hasHealed) { FuckinHealInMultiplayerPlease(((EntityState)this).transform); Helpers.LogWarning("you mother fucking fucker i caught you bitch", chat: true); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class AliemRidingState : BaseRidingState { public int inputButton; private GenericSkill _originalSkill; private GenericSkill inputGenericSkill { get { return (GenericSkill)(inputButton switch { 1 => ((EntityState)this).skillLocator.primary, 3 => ((EntityState)this).skillLocator.utility, 4 => ((EntityState)this).skillLocator.special, _ => ((EntityState)this).skillLocator.secondary, }); } set { switch (inputButton) { case 1: ((EntityState)this).skillLocator.primary = value; break; default: ((EntityState)this).skillLocator.secondary = value; break; case 3: ((EntityState)this).skillLocator.utility = value; break; case 4: ((EntityState)this).skillLocator.special = value; break; } } } public override void OnEnter() { base.OnEnter(); ((EntityState)this).PlayAnimation("FullBody, Underride", "RidingClimb", "RidincClimb.playbackRate", 0.4f, 0f); _originalSkill = inputGenericSkill; inputGenericSkill = ((EntityState)this).skillLocator.FindSkill("LOADOUT_SKILL_RIDING"); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.ridingBuff); } } public override void FixedUpdate() { base.FixedUpdate(); if (((EntityState)this).isAuthority && ((ButtonState)(ref ((EntityState)this).inputBank.jump)).justPressed) { ((EntityState)this).outer.SetState((EntityState)(object)new EndRidingState()); } } public override void OnExit() { base.OnExit(); if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.ridingBuff); } inputGenericSkill = _originalSkill; } } public class BaseRidingState : GenericCharacterMain { public CharacterBody riddenBody; public Collider riddenCollider; private GameObject _anchor; private Vector3 _initialPosition; private Vector3 _lastPosition; private Quaternion _lastRotation; private Transform _modelTransform; public override void OnEnter() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).OnEnter(); if (Object.op_Implicit((Object)(object)riddenBody) && NetworkServer.active) { riddenBody.AddBuff(Buffs.riddenBuff); } riddenCollider = findHighestHurtbox(); if ((Object)(object)riddenCollider == (Object)null) { ((EntityState)this).outer.SetNextStateToMain(); return; } ((EntityState)this).GetComponent<AliemRidingColliderHolderThatsIt>().riddenCollider = riddenCollider; Bounds bounds = riddenCollider.bounds; Vector3 center = ((Bounds)(ref bounds)).center; bounds = riddenCollider.bounds; center.y = ((Bounds)(ref bounds)).max.y; _anchor = new GameObject("aliemAnchor"); _anchor.transform.SetParent(((Component)riddenCollider).transform); _anchor.transform.position = center; if ((Object)(object)riddenBody.modelLocator != (Object)null && (Object)(object)riddenBody.modelLocator.modelTransform != (Object)null) { _anchor.transform.rotation = riddenBody.modelLocator.modelTransform.rotation; } else { _anchor.transform.rotation = ((Component)riddenBody).gameObject.transform.rotation; } if (AliemConfig.M3_Leap_RidingControl.Value && Object.op_Implicit((Object)(object)riddenBody) && Object.op_Implicit((Object)(object)riddenBody.master) && riddenBody.master.aiComponents.Length != 0 && Object.op_Implicit((Object)(object)riddenBody.master.aiComponents[0])) { riddenBody.master.aiComponents[0].stateMachine.SetNextState((EntityState)(object)new OverrideAICombat { overridor = ((EntityState)this).inputBank }); } ((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal; _modelTransform = ((EntityState)this).GetModelTransform(); _initialPosition = (Object.op_Implicit((Object)(object)_modelTransform) ? _modelTransform.position : ((EntityState)this).transform.position); _lastPosition = _initialPosition; _lastRotation = ((EntityState)this).transform.rotation; ((Behaviour)((EntityState)this).modelLocator).enabled = false; } private Collider findHighestHurtbox() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)riddenBody.hurtBoxGroup == (Object)null) { return null; } HurtBox[] hurtBoxes = riddenBody.hurtBoxGroup.hurtBoxes; HurtBox val = null; foreach (HurtBox val2 in hurtBoxes) { if (!((Object)(object)val2 == (Object)null)) { if ((Object)(object)val == (Object)null) { val = val2; } else if (((Component)val2).transform.position.y > ((Component)val).transform.position.y) { val = val2; } } } return (val != null) ? val.collider : null; } public override void Update() { ((GenericCharacterMain)this).Update(); if ((Object)(object)riddenCollider != (Object)null && (Object)(object)_anchor != (Object)null) { UpdateRidingPosition(); } } public override void FixedUpdate() { //IL_0041: 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_0067: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).FixedUpdate(); if (riddenBody.healthComponent.alive) { if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = Vector3.zero; if ((Object)(object)riddenCollider != (Object)null && (Object)(object)_anchor != (Object)null) { UpdateRidingPosition(fixedUpdate: true); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } else { ((EntityState)this).outer.SetNextStateToMain(); } } private void UpdateRidingPosition(bool fixedUpdate = false) { //IL_0002: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_006c: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b7: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(_initialPosition, _anchor.transform.position, ((EntityState)this).fixedAge * 3f); val = Vector3.Lerp(_lastPosition, val, 0.5f); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(val, true); if (Object.op_Implicit((Object)(object)_modelTransform)) { _modelTransform.position = val; Quaternion val2 = Quaternion.Lerp(_lastRotation, _anchor.transform.rotation, 0.1f); _modelTransform.rotation = val2; ((EntityState)this).characterDirection.forward = _anchor.transform.forward; _lastRotation = val2; } _lastPosition = val; } public override void OnExit() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown ((GenericCharacterMain)this).OnExit(); if (Object.op_Implicit((Object)(object)riddenBody) && NetworkServer.active) { riddenBody.RemoveBuff(Buffs.riddenBuff); } if (AliemConfig.M3_Leap_RidingControl.Value && Object.op_Implicit((Object)(object)riddenBody) && Object.op_Implicit((Object)(object)riddenBody.master) && riddenBody.master.aiComponents.Length != 0 && Object.op_Implicit((Object)(object)riddenBody.master.aiComponents[0])) { riddenBody.master.aiComponents[0].stateMachine.SetNextState((EntityState)new Combat()); } ((EntityState)this).GetComponent<AliemRidingColliderHolderThatsIt>().riddenCollider = null; ((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal; Object.Destroy((Object)(object)_anchor); ((EntityState)this).PlayAnimation("FullBody, Underride", "BufferEmpty"); ((Behaviour)((EntityState)this).modelLocator).enabled = true; } public override void OnSerialize(NetworkWriter writer) { ((EntityState)this).OnSerialize(writer); if (Object.op_Implicit((Object)(object)riddenBody)) { writer.Write(((Component)riddenBody).gameObject); } } public override void OnDeserialize(NetworkReader reader) { ((EntityState)this).OnDeserialize(reader); GameObject val = reader.ReadGameObject(); if (Object.op_Implicit((Object)(object)val)) { riddenBody = val.GetComponent<CharacterBody>(); } } } public class EndRidingState : BaseState { public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("FullBody, Underride", "BufferEmpty"); ((EntityState)this).outer.SetState((EntityState)(object)new AliemCharacterMain { wasRiding = true }); } } public class ChargeRayGun : BaseChargingState { public override float BaseMaxChargeDuration => 3f; public virtual float MinDamageCoefficient => AliemConfig.M1_RayGunCharged_Damage_Min.Value; public virtual float MaxDamageCoefficient => AliemConfig.M1_RayGunCharged_Damage_Max.Value; protected override void StartNextState(float chargeCoefficient) { string shootSound_ = ((chargeCoefficient >= 1f) ? "Play_RayGunBigClassic" : "Play_RayGunBigClassic"); ((EntityState)this).outer.SetNextState((EntityState)(object)new RayGunChargedFire(GetChargedValue(MinDamageCoefficient, MaxDamageCoefficient), shootSound_) { isOffHanded = base.isOffHanded }); } } public class CloseRangeKnife : BaseMeleeAttack { public override void OnEnter() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) hitboxGroupName = "Knife"; damageType = (DamageType)0; damageCoefficient = AliemConfig.M1_RayGun_Damage.Value * AliemConfig.M1_RayGun_CloseRangeKnife_Damage_Multiplier.Value; procCoefficient = 1f; pushForce = 300f; bonusForce = Vector3.zero; baseDuration = AliemConfig.M1_RayGun_CloseRangeKnife_Duration.Value; attackStartPercentTime = 0f; attackEndPercentTime = 0.5f; earlyExitPercentTime = 0.73f; hitStopDuration = 0.06f; attackRecoil = 0.5f; hitHopVelocity = 3f; swingSoundString = ""; hitSoundString = ""; muzzleString = "KnifeHitbox"; playbackRateParam = "ShootGun.playbackRate"; swingEffectPrefab = AliemAssets.knifeSwingEffect; hitEffectPrefab = AliemAssets.knifeImpactEffect; base.OnEnter(); } protected override void PlayAttackAnimation() { ((EntityState)this).PlayAnimation("Gesture, Override", "Knife", "ShootGun.playbackRate", duration, 0f); } } public class InputRayGun : MashAndHoldInputs { protected override EntityState initialMashState => (EntityState)(object)new RayGunFireUncharged(); protected override EntityState newMashState => (EntityState)(object)new RayGunFireUncharged(); protected override InterruptPriority mashInterruptPriority => (InterruptPriority)0; protected override EntityState newHoldState { get { ChargeRayGun chargeRayGun = new ChargeRayGun(); ((BaseSkillState)chargeRayGun).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; return (EntityState)(object)chargeRayGun; } } protected override InterruptPriority holdInterruptPriority => (InterruptPriority)0; protected override bool RepeatHoldState => false; } public class RayGunChargedFire : RayGunFire { private float _chargedDamageCoefficient; private string _chargedShootSound = "Play_RayGunBigClassic"; public override float BaseDuration => 0.5f; public override float BaseDamageCoefficient => _chargedDamageCoefficient; public override string soundString => _chargedShootSound; public override GameObject projectile => Projectiles.RayGunProjectilePrefabBig; public RayGunChargedFire() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) _chargedDamageCoefficient = AliemConfig.M1_RayGunCharged_Damage_Max.Value; damageTypeCombo = DamageTypeCombo.GenericSecondary; } public RayGunChargedFire(float dam_, string shootSound_) { _chargedDamageCoefficient = dam_; _chargedShootSound = shootSound_; } public override void PlayAnimation(float duration) { ((EntityState)this).PlayAnimation("Gesture, Override", "ShootGunBig", "ShootGun.playbackRate", duration * 3f, 0f); ((EntityState)this).PlayAnimation(base.isOffHanded ? "RightArm, Over" : "LeftArm, Over", "ShootGunBig"); ((EntityState)this).PlayAnimation(base.isOffHanded ? "LeftArm, Under" : "RightArm, Under", "ShootGunBig"); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class RayGunFire : GenericProjectileBaseState, IOffHandable { public static float ProjectilePitch = 0f; public static float ProjectileForce = 80f; public DamageTypeCombo damageTypeCombo = DamageTypeCombo.GenericPrimary; public static float RayGunDamageCoefficient => AliemConfig.M1_RayGun_Damage.Value; public virtual float BaseDuration => AliemConfig.M1_RayGun_Duration.Value; public virtual float BaseDelayDuration => 0f; public virtual float BaseDamageCoefficient => RayGunDamageCoefficient; public virtual string muzzleString => isOffHanded ? "BlasterMuzzle.R" : "BlasterMuzzle"; public virtual GameObject projectile => Projectiles.RayGunProjectilePrefab; public virtual string soundS